-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3312 from Rawi01/extensionmethod-nonstatic
Ignore non-static/non-public extension methods
- Loading branch information
Showing
4 changed files
with
47 additions
and
1 deletion.
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
12 changes: 12 additions & 0 deletions
12
test/transform/resource/after-delombok/ExtensionMethodNonStatic.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,12 @@ | ||
class ExtensionMethodNonStatic { | ||
public void test() { | ||
String s = "test"; | ||
s.startsWith(""); | ||
} | ||
|
||
static class Extensions { | ||
public boolean startsWith(String s, String prefix) { | ||
return s.startsWith(prefix); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
test/transform/resource/after-ecj/ExtensionMethodNonStatic.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,18 @@ | ||
import lombok.experimental.ExtensionMethod; | ||
@ExtensionMethod({ExtensionMethodNonStatic.Extensions.class}) class ExtensionMethodNonStatic { | ||
static class Extensions { | ||
Extensions() { | ||
super(); | ||
} | ||
public boolean startsWith(String s, String prefix) { | ||
return s.startsWith(prefix); | ||
} | ||
} | ||
ExtensionMethodNonStatic() { | ||
super(); | ||
} | ||
public void test() { | ||
String s = "test"; | ||
s.startsWith(""); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
test/transform/resource/before/ExtensionMethodNonStatic.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,15 @@ | ||
import lombok.experimental.ExtensionMethod; | ||
|
||
@ExtensionMethod({ExtensionMethodNonStatic.Extensions.class}) | ||
class ExtensionMethodNonStatic { | ||
public void test() { | ||
String s = "test"; | ||
s.startsWith(""); | ||
} | ||
|
||
static class Extensions { | ||
public boolean startsWith(String s, String prefix) { | ||
return s.startsWith(prefix); | ||
} | ||
} | ||
} |