Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fixing Java field access #1862

wants to merge 1 commit into from

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Nov 21, 2024

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).

It also contains some adjustments to the import system, more specifically when the importedSymbols field is populated. This might have implications for other languages and if wanted I can extract this into a separate PR.

@oxisto
Copy link
Member Author

oxisto commented Nov 21, 2024

Blocked by #1586

@oxisto oxisto added the blocked Blocked by an external factor label Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 88.52459% with 7 lines in your changes missing coverage. Please review.

Project coverage is 76.30%. Comparing base (d2c7f28) to head (c7f72a6).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...in/de/fraunhofer/aisec/cpg/passes/JavaExtraPass.kt 68.75% 0 Missing and 5 partials ⚠️
...n/de/fraunhofer/aisec/cpg/passes/ImportResolver.kt 83.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...n/de/fraunhofer/aisec/cpg/passes/SymbolResolver.kt 87.89% <100.00%> (-0.32%) ⬇️
...lin/de/fraunhofer/aisec/cpg/passes/TypeResolver.kt 95.74% <100.00%> (+0.18%) ⬆️
...s/kotlin/de/fraunhofer/aisec/cpg/test/TestUtils.kt 71.87% <ø> (+0.29%) ⬆️
...ofer/aisec/cpg/frontends/java/ExpressionHandler.kt 77.80% <100.00%> (+5.36%) ⬆️
...r/aisec/cpg/frontends/java/JavaLanguageFrontend.kt 68.12% <100.00%> (-3.94%) ⬇️
...n/de/fraunhofer/aisec/cpg/passes/ImportResolver.kt 89.41% <83.33%> (-0.13%) ⬇️
...in/de/fraunhofer/aisec/cpg/passes/JavaExtraPass.kt 68.75% <68.75%> (ø)

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oxisto oxisto removed the blocked Blocked by an external factor label Nov 28, 2024
@oxisto oxisto marked this pull request as ready for review November 28, 2024 14:05
@oxisto oxisto added the java Related to Java language parsing label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Related to Java language parsing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant