GROOVY-7833: exception in phase 'conversion' (also ignore blank lines - closes 
#329)


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

Branch: refs/heads/master
Commit: 38439af6688f55b041a00a24a590a87df4fcea36
Parents: 7b68c84
Author: paulk <pa...@asert.com.au>
Authored: Fri Jun 3 14:57:45 2016 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Fri Jun 3 14:57:45 2016 +1000

----------------------------------------------------------------------
 src/main/groovy/grape/GrapeIvy.groovy | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/38439af6/src/main/groovy/grape/GrapeIvy.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrapeIvy.groovy 
b/src/main/groovy/grape/GrapeIvy.groovy
index dc62ceb..3702c13 100644
--- a/src/main/groovy/grape/GrapeIvy.groovy
+++ b/src/main/groovy/grape/GrapeIvy.groovy
@@ -338,10 +338,11 @@ class GrapeIvy implements GrapeEngine {
     }
 
     void processRunners(InputStream is, String name, ClassLoader loader) {
-        is.text.readLines().each {
-            def line = it.trim()
-            if (!line.startsWith("#")) {
-                GroovySystem.RUNNER_REGISTRY[name] = 
loader.loadClass(line).newInstance()
+        is.text.readLines()*.trim().findAll{ !it.isEmpty() && it[0] != '#' 
}.each {
+            try {
+                GroovySystem.RUNNER_REGISTRY[name] = 
loader.loadClass(it).newInstance()
+            } catch (Exception ex) {
+                throw new IllegalStateException("Error registering runner 
class '" + it + "'", ex)
             }
         }
     }

Reply via email to