You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In Lombok 1.18.6 and earlier, the error message produced by the @NonNull annotation was "${fieldName} is marked @NonNull but is null" (previous), but was recently changed to "${fieldName} is marked non-null but is null" (current).
To Reproduce
Steps to reproduce the behavior, preferably in the form of the smallest java source file you can make that will show the problem when compiled with javac -cp lombok.jar ExampleFile.java or as sole java file in a fresh new eclipse project.
import lombok.NonNull;
public class ExampleFile {
public static void example(@NonNull String field) {
}
public static void main(String[] args) {
try {
example(null);
} catch (NullPointerException e) {
if (!e.getMessage().equals("field is marked @NonNull but is null")) {
throw new AssertionError("Lombok exception message changed");
}
}
}
}
Expected behavior
I expect the exception message to be stable across releases unless called out as a (Improbable) Breaking Change in the release notes.
Version info (please complete the following information):
Lombok version: 1.18.8
Platform: javac 1.8.0_202
Additional context
This causes unit tests that assert the exception message content to fail.
The text was updated successfully, but these errors were encountered:
Pff, not sure it's a good idea to test the content of exception traces, but, touché I guess.
This might be a first, but, discussed it with @rspilker and we'll retroactively update the changelog.
For some context for the change: Turns out not every annotation that marks a parameter as 'null not allowed' is specifically called @NonNull which is why we slightly changed the message.
I'm afraid we can't retroactively change lombok.jar on maven and such (and therefore won't change it on our site either; let's not introduce 2 binarily different lombok jars both tagged with the same stable release version number).
But it will be in changelogs in lombok.jars released from today onwards.
Describe the bug
In Lombok 1.18.6 and earlier, the error message produced by the
@NonNull
annotation was "${fieldName} is marked@NonNull
but is null" (previous), but was recently changed to "${fieldName} is marked non-null but is null" (current).To Reproduce
Steps to reproduce the behavior, preferably in the form of the smallest java source file you can make that will show the problem when compiled with
javac -cp lombok.jar ExampleFile.java
or as sole java file in a fresh new eclipse project.Expected behavior
I expect the exception message to be stable across releases unless called out as a (Improbable) Breaking Change in the release notes.
Version info (please complete the following information):
Additional context
This causes unit tests that assert the exception message content to fail.
The text was updated successfully, but these errors were encountered: