-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fixing Java field access #1862
Fixing Java field access #1862
Conversation
Blocked by #1586 |
c781e33
to
faaa036
Compare
4c7279c
to
952f56c
Compare
952f56c
to
5f75416
Compare
5f75416
to
c7f72a6
Compare
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.
I fail to understand most of the changes since the old code is hard to understand and the new code requires in-depth knowledge and understanding of the java parser and frontend which I do not have. However, I have some nits which should already be resolved and may support subsequent more detailed reviews.
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt
Outdated
Show resolved
Hide resolved
cpg-language-java/src/test/kotlin/de/fraunhofer/aisec/cpg/enhancements/calls/SuperCallTest.kt
Outdated
Show resolved
Hide resolved
cpg-language-java/src/test/kotlin/de/fraunhofer/aisec/cpg/enhancements/calls/SuperCallTest.kt
Outdated
Show resolved
Hide resolved
cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/ExpressionHandler.kt
Show resolved
Hide resolved
cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/ExpressionHandler.kt
Outdated
Show resolved
Hide resolved
cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/java/ExpressionHandler.kt
Outdated
Show resolved
Hide resolved
cpg-language-java/src/main/kotlin/de/fraunhofer/aisec/cpg/passes/JavaExtraPass.kt
Show resolved
Hide resolved
c7f72a6
to
592b8ce
Compare
Agreed. I will extract the remaining changes that are not Java-specific to extra PRs (#1908 and #1909) |
d4cd2a8
to
0494bdb
Compare
0494bdb
to
6cba546
Compare
…t of candidates This adds a new function `Language.bestViableReferenceCandidate` which takes the old implementation as a default behaviour.
6cba546
to
358acbb
Compare
Please re-check, I addressed the issues. |
* Provide a function for languages to influence reference resolution out of candidates This adds a new function `Language.bestViableReferenceCandidate` which takes the old implementation as a default behaviour. * Fixing Java field access * Better solution for reference candidate * Addressed code review * Simplified
This PR consists of a major overhaul of Java reference and member expression parsing. It removes a LOT of old weird legacy code that was full of weird things.
It also introduces a new Java-specific pass, that takes care of deciding when a member access is actually static or not. This might be something that we could decide to adapt for other/all languages (maybe also tied to the discussion in #1863).