Skip to content

Conversation

@weih-kahoot
Copy link

java.lang.NullPointerException
at org.codehaus.groovy.util.ListHashMap.get(ListHashMap.java:120)
at org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData(NodeMetaDataHandler.java:44)

java.lang.NullPointerException
	at org.codehaus.groovy.util.ListHashMap.get(ListHashMap.java:120)
	at org.codehaus.groovy.ast.NodeMetaDataHandler.getNodeMetaData(NodeMetaDataHandler.java:44)
@weih-kahoot
Copy link
Author

weih-kahoot commented Apr 27, 2023

I've seen this NPE occurred for quite a few times, and it's weird the fix is not backported to 4.0.x release branch.
Kindly let me know if the PR can be accepted, :)

@eric-milles
Copy link
Member

Is the request just to cherry-pick a commint from master? If so, can you create a JIRA ticket with a quick description so there is tracking for the next Groovy 4 release? Then I can handle the git ops.

@paulk-asert
Copy link
Contributor

paulk-asert commented May 16, 2023

After the proposed change, the code will still be prone to a NPE if called with a null 'key'.
What about using the following as the replacement for the condition in question:

Objects.equals(key, listKeys[i])

@weih-kahoot
Copy link
Author

@eric-milles sure, I've created ticket https://issues.apache.org/jira/browse/GROOVY-11063

@asfgit asfgit closed this in 62097da May 17, 2023
@weih-kahoot weih-kahoot deleted the backport_npe_to_4_0_x branch May 18, 2023 03:09
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.

3 participants