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#3370] Support Helper in method
- Loading branch information
Showing
9 changed files
with
55 additions
and
4 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
2 changes: 1 addition & 1 deletion
2
...sform/resource/after-delombok/Helper.java → ...delombok/HelperInInitializationBlock.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,4 +1,4 @@ | ||
class HelperTest { | ||
public class HelperInInitializationBlock { | ||
{ | ||
final int z = 5; | ||
if (Boolean.TRUE) { | ||
|
13 changes: 13 additions & 0 deletions
13
test/transform/resource/after-delombok/HelperInMethod.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,13 @@ | ||
public class HelperInMethod { | ||
int someMethod(int arg1) { | ||
int localVar = 5; | ||
|
||
class Helpers { | ||
int helperMethod(int arg) { | ||
return arg + localVar; | ||
} | ||
} | ||
final Helpers $Helpers = new Helpers(); | ||
return $Helpers.helperMethod(10); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import lombok.experimental.Helper; | ||
public class HelperInMethod { | ||
public HelperInMethod() { | ||
super(); | ||
} | ||
int someMethod(int arg1) { | ||
int localVar = 5; | ||
@Helper class Helpers { | ||
Helpers() { | ||
super(); | ||
} | ||
int helperMethod(int arg) { | ||
return (arg + localVar); | ||
} | ||
} | ||
final Helpers $Helpers = new Helpers(); | ||
return $Helpers.helperMethod(10); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
test/transform/resource/before/Helper.java → ...e/before/HelperInInitializationBlock.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
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,16 @@ | ||
import lombok.experimental.Helper; | ||
|
||
public class HelperInMethod { | ||
int someMethod(int arg1) { | ||
int localVar = 5; | ||
|
||
@Helper | ||
class Helpers { | ||
int helperMethod(int arg) { | ||
return arg + localVar; | ||
} | ||
} | ||
|
||
return helperMethod(10); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.