-
-
Notifications
You must be signed in to change notification settings - Fork 111
Add support for var-args method calls with @PolymorphicSignature causing unmatched method signatures #1333
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
base: develop
Are you sure you want to change the base?
Conversation
…eck method (which ignores parameter and return types)
# Conflicts: # sootup.callgraph/src/test/java/sootup/callgraph/CallGraphTestBase.java
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1333 +/- ##
=============================================
+ Coverage 71.47% 71.56% +0.08%
Complexity 19 19
=============================================
Files 443 443
Lines 18468 18514 +46
Branches 2954 2960 +6
=============================================
+ Hits 13200 13249 +49
+ Misses 4156 4154 -2
+ Partials 1112 1111 -1
🚀 New features to boost your workflow:
|
…eType); undo wrapper
sootup.callgraph/src/test/java/sootup/callgraph/CallGraphTestBase.java
Outdated
Show resolved
Hide resolved
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
| .flatMap( | ||
| value -> { | ||
| // ClassType as returnType | ||
| if (value instanceof AbstractInvokeExpr && value.getType() instanceof ClassType) { | ||
| return Stream.of((ClassType) value.getType()); | ||
| // new-expression | ||
| } else if (value instanceof JNewExpr) { | ||
| return Stream.of(((JNewExpr) value).getType()); | ||
| } | ||
| return Stream.empty(); | ||
| }) |
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.
we are only checking for new expressions. Method calls are not considered because first you do not check if they are constructor and second because if you would check for constructors you would consider supertypes as instaniated if the constructor contains a super() call.
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.
Rollback applied. New approach required to treat java.lang.invoke.MethodHandle (with its package-private constructor) as instantiated during RTA analysis.
sootup.callgraph/src/main/java/sootup/callgraph/RapidTypeAnalysisAlgorithm.java
Outdated
Show resolved
Hide resolved
| if (targetMethodSignature.getDeclClassType().equals(polymorphicMethodSigs.getDeclClassType()) | ||
| && targetMethodSignature.getName().equals(polymorphicMethodSigs.getName())) { |
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.
two cases are not covered which me might have to investigate.
- different parameters,
- subclasses of classes that contain these methods
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.
Created tests.
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.
No subclasses of java.lang.invoke.MethodHandle/VarHandle possible, both classes have package-private constructors and all their implementations are package-private.
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.
can you access the annotation outside of the package?
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.
No: 'java.lang.invoke.MethodHandle.PolymorphicSignature' is not public in 'java.lang.invoke.MethodHandle'. Cannot be accessed from outside package
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
...up.callgraph/src/test/resources/callgraph/Polymorphic/source/MethodHandleInvokeExample1.java
Outdated
Show resolved
Hide resolved
sootup.callgraph/src/main/java/sootup/callgraph/AbstractCallGraphAlgorithm.java
Outdated
Show resolved
Hide resolved
…ary if; added break
|
fixes also #78 |
issue: #1266