Skip to content

Conversation

@kilink
Copy link

@kilink kilink commented Sep 17, 2025

Use Optional.ofNullable to avoid throwing an NPE when a class file can't be read.

visitClassFile is annotated with @Nullable, and reading the code I can see that it returns null if it's unable to parse the class file. We ran into this issue when running tests on JDK 25. I guess it's indicative that Java 25 class files can't be parsed, but the intent of the code is to log a warning and proceed as far as I can tell.

Use Optional.ofNullable to avoid throwing an NPE when a class file can't be read.

Signed-off-by: Patrick Strawderman <[email protected]>
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