-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Draft
moebarni
wants to merge
24
commits into
develop
Choose a base branch
from
1266-feature-investigate-varargs-cg
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add support for var-args method calls with @PolymorphicSignature causing unmatched method signatures #1333
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
cde2e34
added MethodHandle test cases
moebarni 732834e
added preanalysis in AbstractCallGraphAlgorithm constructor; added ch…
moebarni fa59d4a
updated test cases
moebarni 4436c41
added VarHandle test
moebarni f24ff9a
bad "solution" for RTA
moebarni eed2df1
Merge branch 'develop' into 1266-feature-investigate-varargs-cg
moebarni ece4faa
wrapper approach (failed to detect new MethodHandle instance)
moebarni 9c20cf2
extended collectInstantiatedClassesInMethod (only for method/varHandl…
moebarni 9eb4cb8
with comments and separated version
moebarni 5a95bdf
cleaned
moebarni 3aeebd4
Merge branch 'develop' into 1266-feature-investigate-varargs-cg
moebarni 1646566
deleted sout, comment, first test
moebarni d2a4f11
changed method name; deleted test case for example1; deleted unnecess…
moebarni 1d450b4
deleted sout; added diffParamTest + superClassTest
moebarni 2348c11
Merge branch 'develop' into 1266-feature-investigate-varargs-cg
moebarni 07de6b4
fixed format
moebarni 706fc81
changed preanalysis data structure to Table
moebarni bc8763d
formatting
moebarni 2988813
Merge branch 'develop' into 1266-feature-investigate-varargs-cg
moebarni 19397b2
deleted duplicate getDeclClassType-method; add methodName-subtype pai…
moebarni 5a00c10
updated methodName-subType pairs
moebarni 5261278
rollback collectInstantiatedClassesInMethod
moebarni ba19f9b
fmt
moebarni a8aa9d6
structural changes (getMethodsWithPolymorphicAnnotation)
moebarni 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
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
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
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
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
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
Binary file added
BIN
+1.07 KB
...ph/src/test/resources/callgraph/Polymorphic/binary/e1/MethodHandleDiffParamExample1.class
Binary file not shown.
Binary file added
BIN
+1.03 KB
...graph/src/test/resources/callgraph/Polymorphic/binary/e2/MethodHandleInvokeExample2.class
Binary file not shown.
Binary file added
BIN
+861 Bytes
...p.callgraph/src/test/resources/callgraph/Polymorphic/binary/e3/VarHandleGetExample3.class
Binary file not shown.
Binary file added
BIN
+967 Bytes
.../test/resources/callgraph/Polymorphic/binary/e4/MethodHandleSuperClassExample4$Base.class
Binary file not shown.
Binary file added
BIN
+381 Bytes
...st/resources/callgraph/Polymorphic/binary/e4/MethodHandleSuperClassExample4$Derived.class
Binary file not shown.
Binary file added
BIN
+1.18 KB
...h/src/test/resources/callgraph/Polymorphic/binary/e4/MethodHandleSuperClassExample4.class
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
...lgraph/src/test/resources/callgraph/Polymorphic/source/MethodHandleDiffParamExample1.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package e1; | ||
|
|
||
| import java.lang.invoke.MethodHandle; | ||
| import java.lang.invoke.MethodHandles; | ||
| import java.lang.invoke.MethodType; | ||
|
|
||
| public class MethodHandleDiffParamExample1 { | ||
| public static void main(String[] args) throws Throwable { | ||
| MethodHandle handle = MethodHandles.lookup() | ||
| .findVirtual( | ||
| String.class, | ||
| "indexOf", | ||
| MethodType.methodType(int.class, String.class, int.class) | ||
| ); | ||
|
|
||
| handle.invoke("HelloWorld", "lo", 3); | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
...callgraph/src/test/resources/callgraph/Polymorphic/source/MethodHandleInvokeExample2.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package e2; | ||
|
|
||
| import java.lang.invoke.MethodHandle; | ||
| import java.lang.invoke.MethodHandles; | ||
| import java.lang.invoke.MethodType; | ||
|
|
||
| public class MethodHandleInvokeExample2 { | ||
| public static void main(String[] args) throws Throwable { | ||
| MethodHandle handle = MethodHandles.lookup() | ||
| .findVirtual(String.class, "substring", MethodType.methodType(String.class, int.class, int.class)); | ||
|
|
||
| handle.invoke("HelloWorld", 0, 5); | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
...graph/src/test/resources/callgraph/Polymorphic/source/MethodHandleSuperClassExample4.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package e4; | ||
|
|
||
| import java.lang.invoke.MethodHandle; | ||
| import java.lang.invoke.MethodHandles; | ||
| import java.lang.invoke.MethodType; | ||
|
|
||
| public class MethodHandleSuperClassExample4 { | ||
| static class Base { | ||
| protected void method1(String dummy) { | ||
| System.out.println("Method1: " + dummy); | ||
| } | ||
| } | ||
|
|
||
| static class Derived extends Base {} | ||
|
|
||
| public static void main(String[] args) throws Throwable { | ||
| MethodHandle handle = MethodHandles.lookup() | ||
| .findVirtual(Base.class, "method1", MethodType.methodType(void.class, String.class)); | ||
|
|
||
| handle.invoke(new Derived(), "SubClass!"); | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
sootup.callgraph/src/test/resources/callgraph/Polymorphic/source/VarHandleGetExample3.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package e3; | ||
|
|
||
| import java.lang.invoke.MethodHandles; | ||
| import java.lang.invoke.VarHandle; | ||
|
|
||
| public class VarHandleGetExample3 { | ||
| static int value = 42; | ||
|
|
||
| public static void main(String[] args) throws Throwable { | ||
| VarHandle handle = MethodHandles.lookup() | ||
| .findStaticVarHandle(VarHandleGetExample3.class, "value", int.class); | ||
|
|
||
| handle.get(); | ||
| } | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.