Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.8.2
-
Fix Version/s: 1.8.5, 2.0-beta-2, 1.7.11
-
Component/s: class generator, Stub generator / Joint compiler
-
Labels:None
-
Environment:Hide{noformat}
amonakhov@marvin:~$ uname -a
Linux marvin 2.6.39-1-amd64 #1 SMP Tue May 24 14:34:19 UTC 2011 x86_64 GNU/Linux
amonakhov@marvin:~$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
amonakhov@marvin:~$ ant -version
Apache Ant(TM) version 1.8.2 compiled on September 22 2011
{noformat}Show{noformat} amonakhov@marvin :~$ uname -a Linux marvin 2.6.39-1-amd64 #1 SMP Tue May 24 14:34:19 UTC 2011 x86_64 GNU/Linux amonakhov@marvin :~$ java -version java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) amonakhov@marvin :~$ ant -version Apache Ant(TM) version 1.8.2 compiled on September 22 2011 {noformat}
-
Number of attachments :
Description
When compiling via Ant Groovyc task, the compiler generates erroneous Java from the two following files:
B.groovy
class B {
Map<String, Map<String, Integer[]>> columnsMap = [:]
}
C.java
public class C { public void f(B b) { System.out.println(b.getColumnsMap()); } }
Ant compilation results in many lines with the same error (full log attached):
[groovyc] /tmp/groovy-generated-2531065055182916850-java-source/B.java:16: ';' expected
[groovyc] public java.util.Map<java.lang.String, java.util.Map<java.lang.String, [Ljava.lang.Integer;>> getColumnsMap() { return (java.util.Map<java.lang.String, java.util.Map<java.lang.String, [Ljava.lang.Integer;>>)null;}
Notes:
- if C.java is excluded from build, everything compiles fines.
- Eclipse plug-in compiles code fine too.
And if it's needed, the Ant task:
<target name="compile2" depends="check_java_version,prepare_libs">
<mkdir dir="temp_src/classes"/>
<path id="groovy.class.path">
<fileset dir="${lib.dir}/groovy" includes="*.jar"/>
</path>
<taskdef name="groovyc"
classname="org.codehaus.groovy.ant.Groovyc"
classpathref="groovy.class.path" />
<groovyc srcdir="temp_src"
destdir="temp_src/classes"
listfiles="yes"
stacktrace="yes"
verbose="yes">
<classpath refid="arms.class.path"/>
<javac source="1.6" target="1.6"/>
</groovyc>
</target>
Paul, didn't we fix this recently?