Skip to content

Conversation

liampace
Copy link
Contributor

@liampace liampace commented Sep 18, 2025

Initially discovered on PR #3945, some unit tests unexpectedly started to fail due to the deprecation of AccessLevel.MODULE. This PR attempts to fix these tests and any others along the way. Right now, the failing tests for the various @Log annotations new access level feature are passing locally. I'm still searching for if any other annotations are unexpectedly failing tests.

@liampace
Copy link
Contributor Author

liampace commented Sep 18, 2025

I noticed when building the tests using javac6 locally, the EqualsAndHashCodeOfAndExcludeError.java message test was failing. I was wondering if this is an actual bug or if the tests were simply not updated:

Terminal Output:

[junit] ***** EqualsAndHashCodeOfAndExcludeError.java *****
    [junit] [EqualsAndHashCodeOfAndExcludeError.java] Expected message '2:60 You must use constant literals in lombok annotations; they cannot be references to (static) fields.' but got message '2 ERROR You must use constant literals in lombok annotations; they cannot be references to (static) fields.'
    [junit] **** Expected ******
    [junit] 2:60 You must use constant literals in lombok annotations; they cannot be references to (static) fields.
    [junit] 7:160 You must use constant literals in lombok annotations; they cannot be references to (static) fields.
    [junit] ****  Actual  ******
    [junit] 2 ERROR You must use constant literals in lombok annotations; they cannot be references to (static) fields.
    [junit] 7 ERROR You must use constant literals in lombok annotations; they cannot be references to (static) fields.
    [junit] ****  Actual File  ******
    [junit]    1 // Generated by delombok at Thu Sep 18 16:50:01 EDT 2025
    [junit]    2 // skip-compare-contents
    [junit]    3 final class EqualsAndHashCodeErrorOf {
    [junit]    4        int x;
    [junit]    5 }
    [junit]    6
    [junit]    7 final class EqualsAndHashCodeErrorExclude {
    [junit]    8        int x;
    [junit]    9 }
    [junit]   10
    [junit]   11 class Const {
    [junit]   12        static final String A = "A";
    [junit]   13 }
    [junit]   14
    [junit] *******************

@liampace
Copy link
Contributor Author

liampace commented Sep 19, 2025

It seems that the CI checks here are happy now. Let me know if there is anything I may have missed and I'll get it fixed asap.

Copy link
Collaborator

@Rawi01 Rawi01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the tests 👍

  • Please add yourself to the AUTHORS file
  • Instead of adding @SuppressWarnings everywhere it is also possible to add a .messages file for a test. Our test system compares the generated messages with this file and the test passes if the content matches. Using these files would lead to a smaller and simpler PR but your approach is fine too, just want to let you know for your next PR :)

@Rawi01 Rawi01 merged commit da5e18d into projectlombok:master Sep 25, 2025
60 checks passed
@liampace liampace deleted the fix-tests branch September 25, 2025 17:00
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 this pull request may close these issues.

2 participants