Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.3
-
Component/s: None
-
Labels:None
-
Environment:GMaven 1.2
Groovy 1.7.1
-
Number of attachments :
Description
Try to joint-compile the following Groovy code:
class JointCompilation {
BigDecimal foo
}
Compilation of the generated Java stub fails with:
/testprj/target/generated-sources/groovy-stubs/JointCompilation.java:[20,8] cannot find symbol symbol : class BigDecimal location: class JointCompilation
Here is the generated Java stub:
import groovy.util.*; import java.lang.*; import groovy.lang.*; import java.util.*; import java.io.*; import java.net.*; public class JointCompilation extends java.lang.Object implements groovy.lang.GroovyObject { public JointCompilation () {} public groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;} public void setMetaClass(groovy.lang.MetaClass mc) { } public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments) { return null;} public java.lang.Object getProperty(java.lang.String property) { return null;} public void setProperty(java.lang.String property, java.lang.Object value) { } public BigDecimal getProp() { return (BigDecimal)null;} public void setProp(BigDecimal value) { } protected groovy.lang.MetaClass $getStaticMetaClass() { return (groovy.lang.MetaClass)null;} }
As you can see, an import for java.math.BigDecimal is missing. Strangely, I can't reproduce this bug with plain groovyc (although to my knowledge GMaven uses groovyc's stub generation by now).
same for BigInteger