Skip to content

Commit

Permalink
Adapt to String#stripIndent of java 15
Browse files Browse the repository at this point in the history
`stripIndent` eclipses the `DefaultGroovyMethods` which is
already in the generic-whitelist.  Scripts already using this
method were breaking when the JVM was upstepped as it would choose
standard implementation over the one provided by groovy.
  • Loading branch information
Steven Aerts committed Sep 5, 2022
1 parent 4bd517d commit 6517737
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ method java.lang.String split java.lang.String
method java.lang.String split java.lang.String int
method java.lang.String startsWith java.lang.String
method java.lang.String startsWith java.lang.String int
method java.lang.String stripIndent
method java.lang.String substring int
method java.lang.String substring int int
method java.lang.String toCharArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ static void sanity(URL definition) throws Exception {
new MethodSignature(String.class, "isEmpty"),
// Does not exist until Java 15.
new MethodSignature(CharSequence.class, "isEmpty"),
// Overrides DefaultGroovyMethods.stripIndent(String) in Java 15+.
new MethodSignature(String.class, "stripIndent"),
// Override the corresponding RandomGenerator methods in Java 17+.
new MethodSignature(Random.class, "nextBoolean"),
new MethodSignature(Random.class, "nextBytes", byte[].class),
Expand Down

0 comments on commit 6517737

Please sign in to comment.