groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: minor fixes for openjdk7 on CI
Date Mon, 23 Oct 2017 03:17:19 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X 468a24df3 -> 3ca502508


minor fixes for openjdk7 on CI


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/3ca50250
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/3ca50250
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/3ca50250

Branch: refs/heads/GROOVY_2_4_X
Commit: 3ca502508222d3fd79085fcb0d04bb0a0429e030
Parents: 468a24d
Author: paulk <paulk@asert.com.au>
Authored: Sat Oct 21 11:23:26 2017 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Mon Oct 23 13:16:53 2017 +1000

----------------------------------------------------------------------
 .../org/codehaus/groovy/reflection/CachedConstructor.java | 10 +++++-----
 .../runtime/m12n/ExtensionModuleHelperForTests.groovy     |  6 +++++-
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/3ca50250/src/main/org/codehaus/groovy/reflection/CachedConstructor.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/CachedConstructor.java b/src/main/org/codehaus/groovy/reflection/CachedConstructor.java
index 1d8f458..74d9b71 100644
--- a/src/main/org/codehaus/groovy/reflection/CachedConstructor.java
+++ b/src/main/org/codehaus/groovy/reflection/CachedConstructor.java
@@ -84,19 +84,19 @@ public class CachedConstructor extends ParameterTypes {
         } catch (InvocationTargetException e) {
             throw e.getCause() instanceof RuntimeException ? (RuntimeException)e.getCause()
: new InvokerInvocationException(e);
         } catch (IllegalArgumentException e) {
-            throw createExceptionText("failed to invoke constructor: ", constr, argumentArray,
e, false);
+            throw createException("failed to invoke constructor: ", constr, argumentArray,
e, false);
         } catch (IllegalAccessException e) {
-            throw createExceptionText("could not access constructor: ", constr, argumentArray,
e, false);
+            throw createException("could not access constructor: ", constr, argumentArray,
e, false);
         } catch (Exception e) {
             if (e instanceof RuntimeException)
                 throw (RuntimeException)e;
             else
-                throw createExceptionText("failed to invoke constructor: ", constr, argumentArray,
e, true);
+                throw createException("failed to invoke constructor: ", constr, argumentArray,
e, true);
         }
     }
 
-    private static GroovyRuntimeException createExceptionText(String init, Constructor constructor,
Object[] argumentArray, Throwable e, boolean setReason) {
-        throw new GroovyRuntimeException(
+    private static GroovyRuntimeException createException(String init, Constructor constructor,
Object[] argumentArray, Throwable e, boolean setReason) {
+        return new GroovyRuntimeException(
                 init
                         + constructor
                         + " with arguments: "

http://git-wip-us.apache.org/repos/asf/groovy/blob/3ca50250/src/test/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
b/src/test/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
index f60cc70..c821090 100644
--- a/src/test/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
+++ b/src/test/org/codehaus/groovy/runtime/m12n/ExtensionModuleHelperForTests.groovy
@@ -55,6 +55,10 @@ public class ExtensionModuleHelperForTests {
         }
 
         def ant = new AntBuilder()
+        def allowed = [
+                'Picked up JAVA_TOOL_OPTIONS: .*',
+                'Picked up _JAVA_OPTIONS: .*'
+        ]
         try {
             ant.with {
                 taskdef(name:'groovyc', classname:"org.codehaus.groovy.ant.Groovyc")
@@ -80,7 +84,7 @@ public class ExtensionModuleHelperForTests {
             String out = ant.project.properties.out
             String err = ant.project.properties.err
             baseDir.deleteDir()
-            if (err && err.trim() != 'Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8')
{
+            if (err && !allowed.any{ err.trim().matches(it) }) {
                 throw new RuntimeException("$err\nClasspath: ${cp.join('\n')}")
             } else if ( out.contains('FAILURES') || ! out.contains("OK")) {
                 throw new RuntimeException("$out\nClasspath: ${cp.join('\n')}")


Mime
View raw message