-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARJAVA-1873 Find method when using method references as initialize…
…r of variable (#1029) * SONARJAVA-1873 Find method when using method references as initializer of variable * Refactor in order to keep responsability separated between resolve and typeAndRefSolver * Complete unit test to validate correct references
- Loading branch information
Showing
4 changed files
with
72 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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 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
9 changes: 9 additions & 0 deletions
9
java-frontend/src/test/files/sym/MethodReferencesVariableInitializers.java
This file contains 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,9 @@ | ||
import java.util.function.Function; | ||
|
||
class A { | ||
private final Runnable invalidator = this::invalidate; | ||
private final Function<String, Object> myFunc = A::foo; | ||
|
||
private void invalidate() { } | ||
private static Object foo(String s) { return null; } | ||
} |
This file contains 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