Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] @Synchronized causes error markers in Java editor with Eclipse 2024-09 (4.33.0) #3748

Open
janrieke opened this issue Sep 19, 2024 · 2 comments · May be fixed by #3749
Open

[BUG] @Synchronized causes error markers in Java editor with Eclipse 2024-09 (4.33.0) #3748

janrieke opened this issue Sep 19, 2024 · 2 comments · May be fixed by #3749

Comments

@janrieke
Copy link
Contributor

janrieke commented Sep 19, 2024

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:

package test;
import lombok.Synchronized;

public class ClassWithSynchronized {
	@Synchronized
	public void test() {
	}
}

and

package test;

public class UsingClass {
	private ClassWithSynchronized test;
}

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):

  • Lombok 1.18.34
  • eclipse 2024-09 (4.33.0) (uses bundled Java org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_21.0.4.v20240802-1551)
@Rawi01
Copy link
Collaborator

Rawi01 commented Sep 19, 2024

Fixed our tests a few hours ago was able to write a test case to reproduce it using your example 👍

Rawi01 added a commit to Rawi01/lombok that referenced this issue Sep 19, 2024
@janrieke
Copy link
Contributor Author

janrieke commented Sep 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants