Skip to content
Permalink
Browse files

[JENKINS-46088] Verify removal of double transform of cast expression

  • Loading branch information...
abayer committed Aug 9, 2017
1 parent ea5ce36 commit dfca3826cefa326d40e4b40b214ac86406833eab
@@ -47,7 +47,7 @@
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>groovy-sandbox</artifactId>
<version>1.13</version>
<version>1.14-20170809.195528-1</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy</groupId>
@@ -848,4 +848,11 @@ public static void assertRejected(Whitelist whitelist, String expectedSignature,
// control: trying to call an existing method that's not safe
assertRejected(new GenericWhitelist(), "method java.lang.Class getClassLoader", "[].class.classLoader");
}

@Issue("JENKINS-46088")
@Test
public void matcherTypeAssignment() throws Exception {
assertEvaluate(new GenericWhitelist(), "goodbye world", "def text = 'hello world'; java.util.regex.Matcher matcher = text =~ 'hello (.+)'; matcher ? \"goodbye ${matcher[0][1]}\" : 'fail'");
}

}

0 comments on commit dfca382

Please sign in to comment.
You can’t perform that action at this time.