forked from projectlombok/lombok
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fixes projectlombok#3240] Resolve delegate target class to find impl…
…emented methods
- Loading branch information
Showing
3 changed files
with
66 additions
and
10 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
43 changes: 43 additions & 0 deletions
43
test/transform/resource/after-delombok/DelegateInNestedClass.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 @@ | ||
class DelegateInNestedClass { | ||
void localClass() { | ||
|
||
class LocalClass { | ||
private final java.lang.Runnable field = null; | ||
|
||
@java.lang.SuppressWarnings("all") | ||
public void run() { | ||
this.field.run(); | ||
} | ||
} | ||
} | ||
|
||
void anonymousClass() { | ||
Runnable r = new Runnable() { | ||
private final java.lang.Runnable field = null; | ||
@java.lang.SuppressWarnings("all") | ||
public void run() { | ||
this.field.run(); | ||
} | ||
}; | ||
} | ||
|
||
|
||
class InnerClass { | ||
private final java.lang.Runnable field = null; | ||
|
||
@java.lang.SuppressWarnings("all") | ||
public void run() { | ||
this.field.run(); | ||
} | ||
} | ||
|
||
|
||
static class StaticClass { | ||
private final java.lang.Runnable field = null; | ||
|
||
@java.lang.SuppressWarnings("all") | ||
public void run() { | ||
this.field.run(); | ||
} | ||
} | ||
} |
21 changes: 13 additions & 8 deletions
21
...resource/before/DelegateOnLocalClass.java → ...esource/before/DelegateInNestedClass.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 |
---|---|---|
@@ -1,19 +1,24 @@ | ||
//platform !eclipse: Requires a 'full' eclipse with intialized workspace, and we don't (yet) have that set up properly in the test run. | ||
//skip compare content | ||
//ignore: crashed javac with NPE, should be enabled when that bug is fixed | ||
import lombok.experimental.Delegate; | ||
import lombok.Getter; | ||
|
||
interface DelegateOnLocalClass { | ||
void test1() { | ||
class DelegateOnStatic { | ||
class DelegateInNestedClass { | ||
void localClass() { | ||
class LocalClass { | ||
@Delegate private final java.lang.Runnable field = null; | ||
} | ||
} | ||
|
||
void test2() { | ||
void anonymousClass() { | ||
Runnable r = new Runnable() { | ||
@Delegate private final java.lang.Runnable field = null; | ||
} | ||
}; | ||
} | ||
|
||
class InnerClass { | ||
@Delegate private final java.lang.Runnable field = null; | ||
} | ||
|
||
static class StaticClass { | ||
@Delegate private final java.lang.Runnable field = null; | ||
} | ||
} |