-
Notifications
You must be signed in to change notification settings - Fork 337
Initial handling of constructor diamond operators #1464
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
Merged
+426
−29
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
a1e4bb8
WIP
msridhar 22fb655
test case
msridhar e86b344
tweak test
msridhar 81f952c
better tests
msridhar 03ce931
WIP
msridhar dfba3e5
docs
msridhar fdf01ee
WIP
msridhar 4446516
simplify
msridhar dc3a227
more
msridhar 471701d
simplify
msridhar aea98ae
simplify
msridhar 0e2df18
reuse helper method
msridhar e607850
bug fix
msridhar d1636f7
fix nested constructors
msridhar c6c1e9a
fix diagnostic message
msridhar 68ad56d
simplify
msridhar 02d32b6
small fix
msridhar ec32f89
another fix
msridhar bae860f
Merge branch 'master' into issue-1451
msridhar e1d8386
Merge branch 'master' into issue-1451
msridhar 89bb268
failing test
msridhar 36ac60c
test fix
msridhar 65fc519
tweaks
msridhar 2454efd
docs
msridhar df8f89e
add issue links
msridhar 82e633e
remove unnecessary code
msridhar 319f453
more coderabbit comments
msridhar 1374e89
Merge branch 'master' into issue-1451
msridhar 4babffe
test of Void without @Nullable
msridhar 78501f2
extract helper to check for raw types and use for NewClassTrees
msridhar 2c50426
add tracking issue
msridhar 95ee81d
add another link to issue
msridhar 39898d7
tweak comment
msridhar bfd95f7
get rid of withPathToSubtree
msridhar d50bf7b
WIP
msridhar bc76012
fixes
msridhar 2883e5a
add case and TODO for ConditionalExpressionTree
msridhar e321bbc
Merge branch 'master' into issue-1451
msridhar dc9d2dc
try throwing
msridhar 829490a
don't throw, but track in an issue
msridhar caa54dd
add javadoc
msridhar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
docs
- Loading branch information
commit dfba3e5aa2fd8481b48f8d16146b95ede32653c6
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: uber/NullAway
Length of output: 7770
🏁 Script executed:
Repository: uber/NullAway
Length of output: 39
🏁 Script executed:
Repository: uber/NullAway
Length of output: 1324
🏁 Script executed:
Repository: uber/NullAway
Length of output: 218
🏁 Script executed:
Repository: uber/NullAway
Length of output: 1493
🏁 Script executed:
Repository: uber/NullAway
Length of output: 4962
🏁 Script executed:
Repository: uber/NullAway
Length of output: 690
🏁 Script executed:
Repository: uber/NullAway
Length of output: 39
🏁 Script executed:
Repository: uber/NullAway
Length of output: 1358
🏁 Script executed:
Repository: uber/NullAway
Length of output: 39
🏁 Script executed:
Repository: uber/NullAway
Length of output: 436
🏁 Script executed:
Repository: uber/NullAway
Length of output: 925
🏁 Script executed:
Repository: uber/NullAway
Length of output: 639
🏁 Script executed:
Repository: uber/NullAway
Length of output: 542
🏁 Script executed:
Repository: uber/NullAway
Length of output: 39
🏁 Script executed:
Repository: uber/NullAway
Length of output: 1665
🏁 Script executed:
Repository: uber/NullAway
Length of output: 59
🏁 Script executed:
Repository: uber/NullAway
Length of output: 1860
Add null guard for
parentCtorSymbolto prevent potential NPE.ASTHelpers.getSymbol(parentConstructorCall)can return null. The codebase pattern shows null checks forgetSymbol()results onMemberSelectTree(line 522) andAssignmentTree(line 502). IfparentCtorSymbolis null,TypeSubstitutionUtils.memberType()at line 606 will dereferencesym.typeand throw an NPE.🛡️ Proposed null guard
if (parent instanceof NewClassTree parentConstructorCall) { // get the type returned by the parent constructor call Type parentClassType = getTreeType(parentConstructorCall, state.withPath(parentPath)); if (parentClassType != null) { Symbol parentCtorSymbol = ASTHelpers.getSymbol(parentConstructorCall); + if (parentCtorSymbol == null) { + return null; + } // get the proper type for the constructor, as a member of the type returned by the // constructor Type parentCtorType =🤖 Prompt for AI Agents