eclipse-jdt / eclipse-jdt/eclipse.jdt.core

Eclipse unable to reference class ending with "$" in its name?

Open
#2,441 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

I am working on a Spring Boot/Maven app that make use of generated metamodel class under target/generated-sources/annotations/. When testing this problem I also created classes manually.

When I have a class ending with "$", for example "VodMetadata$" that is under target/generated-sources/annotations// or another source folder I created, eclipse is unable to resolve it. However if I have other classes such as "VodMetada", "VodMetadata1", "VodMetadata_" under same package eclipse has no problem resolving them.

If "VodMetadata$" is placed under "src/main/java" it is resolved. If it has a unique package name it also have no problem. This problem only seem to occur when it is under a separate source folder but has the same package/path as a package in "src/main/java". I can't change the package because the class will be generated by a library.

The app can be compiled and run without any problem. IntelliJ does not have this problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.