-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find references to fields via getters/setters (#1561)
Signed-off-by: Snjezana Peco <[email protected]>
- Loading branch information
Showing
5 changed files
with
188 additions
and
32 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
43 changes: 43 additions & 0 deletions
43
org.eclipse.jdt.ls.tests/projects/eclipse/hello/src/org/ref/Apple.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,43 @@ | ||
package org.ref; | ||
|
||
public class Apple { | ||
private String name; | ||
|
||
public Apple(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public static <T> AppleBuilder<T> builder() { | ||
return new AppleBuilder<T>(); | ||
} | ||
|
||
public static class AppleBuilder<T> { | ||
private String name; | ||
|
||
private AppleBuilder() { | ||
} | ||
|
||
public AppleBuilder<T> name(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return "AppleBuilder(name = " + name + ")"; | ||
} | ||
|
||
public Apple build() { | ||
return new Apple(name); | ||
} | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
org.eclipse.jdt.ls.tests/projects/eclipse/hello/src/org/ref/Test.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 @@ | ||
package org.ref; | ||
|
||
public class Test { | ||
public static void main(String[] args) { | ||
Apple apple = Apple.builder().name("Hello World!").build(); | ||
System.out.println(apple.getName()); | ||
} | ||
|
||
} |
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