Closed janrieke closed 1 month ago
Fixed our tests a few hours ago was able to write a test case to reproduce it using your example :+1:
As a workaround you can try adding @EqualsAndHashCode
to the referenced class to get rid of the error markers. You can remove @EqualsAndHashCode
when you are finished editing a source file that references the problematic class, because the compilation still works.
Describe the bug Since the update to Eclipse 2024-09 (4.33.0), classes that contain one or more
@Synchronized
annotations cause "CLASSNAME cannot be resolved to a type" errors in other classes that reference these classes.Note that these errors only appear when the source file is actually opened in a Java editor. They neither show up in the Outline nor the Package Explorer. It seems they are just pseudo errors, because the compilation produces a valid class file and actually loading and executing the compiled classes also works.
Removing the
@Synchronized
makes the error disappear. Putting some other lombok annotations like@Builder
or@EqualsAndHashCode
on the (referenced) class also removes the error, while other annotations like@Getter
or@ToString
do not affect the error.There is no error in the Eclipse logs when this problem is present.
To Reproduce Create a new Eclipse project with just these two files:
and
When opening
UsingClass
in the Java editor, you'll see an error marker at line 4 with the error message "ClassWithSynchronized cannot be resolved to a type".Expected behavior No error markers present in referencing classes.
Version info (please complete the following information):
org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_21.0.4.v20240802-1551
)