Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0-beta-3, 1.8.7
-
Component/s: SQL processing
-
Labels:None
-
Number of attachments :
Description
When executing the code:
#! /usr/bin/env groovy import groovy.sql.DataSet import groovy.sql.Sql @Grab ( 'org.xerial:sqlite-jdbc:3.7.2' ) @GrabConfig ( systemClassLoader = true ) def database final words = [ ] try { database = Sql.newInstance ( 'jdbc:sqlite:database.db' , 'org.sqlite.JDBC' ) final wordsTable = new DataSet ( database , 'words' ) ( 0 ..< 4 ).each { i -> words << wordsTable.findAll ( { j , item -> item.id == j }.curry ( i ) ).firstRow ( ).word } } finally { database?.close ( ) } println words.join ( '' )
the result is the error:
Caught: groovy.lang.GroovyRuntimeException: Could not find the ClassNode for MetaClass: groovy.lang.MetaClassImpl@6c1826dc[class org.codehaus.groovy.runtime.CurriedClosure]
groovy.lang.GroovyRuntimeException: Could not find the ClassNode for MetaClass: groovy.lang.MetaClassImpl@6c1826dc[class org.codehaus.groovy.runtime.CurriedClosure]
which doesn't really tell the programmer anything useful about the executed code they wrote.
Issue Links
- is related to
-
GROOVY-5376
Incomprehensible Error Message Passing Partial Evaluated Lambda Function
-
So, I was going to propose the current error message changes as per the example below. Assume you have some closure where the source is not available:
which currently reports the following error:
I propose it would become: