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/4f989414 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/4f989414 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/4f989414 Branch: refs/heads/GROOVY_2_4_X Commit: 4f989414ab61e18e6218165cbf650e2af02043d9 Parents: 25362dd 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:58:58 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/4f989414/src/main/groovy/grape/GrapeIvy.groovy ---------------------------------------------------------------------- diff --git a/src/main/groovy/grape/GrapeIvy.groovy b/src/main/groovy/grape/GrapeIvy.groovy index 10300c6..3e7e8e3 100644 --- a/src/main/groovy/grape/GrapeIvy.groovy +++ b/src/main/groovy/grape/GrapeIvy.groovy @@ -337,10 +337,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) } } }