Community
Participate
Working Groups
I use ECJ to compile SAT4J from 1.5 source code to 1.4 bytecode. (I use the -source 1.5 and -target jsr14 parameters) I have two bundles: org.sat4j.core and org.sat4j.pb. The first bundle compiles fine and results in the org.sat4j.core.jar bundle. For the second one, I have hundreds of error of the form: The type XXX is not generic; it cannot be parameterized with arguments YYY I can understand that all information related to generic code in org.sat4j.core has been removed by the compiler, thus that error. However, I can compile that code without problem with ECJ 3.4.2. The source code of SAT4J is available at: svn://svn.forge.objectweb.org/svnroot/sat4j/maven The ant build file launches the compilation using ECJ and shows the problem.
The problem comes from the fact that the second compilation is using the .class files from the first one. Since the target is 1.4, there is no reason to preserve the Signature attributes. This is what has changed between 3.4.2 and 3.5. Could you please try to put the source files of the first project on the classpath of the second project before the binaries?
Kent, if I revert the change to remove the Signature attribute from the .class files I think this problem is gone. Do you see another way to solve it ? Daniel, did you try the suggestion in comment 1?
Olivier, I added jar files with the source code of my files in the classpath before the jars containing the class files. Unfortunately, it does not solve the problem.
Could you please provide the changes you made? I'd like to investigate this issue more deeply before putting back an attribute that should not be there with the 1.4 target.
(In reply to comment #3) > I added jar files with the source code of my files in the classpath before the > jars containing the class files. Did you add that jar as a sourcepath or as part of the classpath ?
I changed the classpath: Here is the way I define the classpath in my ant build script: <path id="somePath"> <pathelement location="${build}"/> <fileset dir="${lib}"> <include name="*src.jar"/> </fileset> <fileset dir="${lib}"> <include name="*.jar"/> <exclude name="*src.jar"/> </fileset> <fileset dir="${dist}/${release}"> <include name="*.jar"/> </fileset> <pathelement location="${java.home}/lib/javaws.jar"/> </path> Here is the full command line of the compiler: [javac] Using JDT compiler dropping /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/javaws.jar from path as it doesn't exist [javac] Compilation arguments: [javac] '-noExit' [javac] '-classpath' [javac] '/Users/leberre/MAVEN/bin:/Users/leberre/MAVEN/lib/commons-beanutils.jar:/Users/leberre/MAVEN/lib/commons-cli.jar:/Users/leberre/MAVEN/dist/2.1.1/org.sat4j.core-src.jar:/Users/leberre/MAVEN/dist/2.1.1/org.sat4j.core.jar:/usr/share/ant/lib/ant-launcher.jar:/Users/leberre/.ant/lib/ecj-3.5.jar:/usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-jai.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-swing.jar:/usr/share/ant/lib/ant-testutil.jar:/usr/share/ant/lib/ant-trax.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/junit-4.5.jar:/usr/share/ant/lib/xercesImpl.jar:/usr/share/ant/lib/xml-apis.jar:/Users/leberre/MAVEN/org.sat4j.pb/src/main/java' [javac] '-d' [javac] '/Users/leberre/MAVEN/bin' [javac] you can check that org.sat4j.core-src.jar appears right before org.sat4j.core.jar.
Created attachment 145589 [details] Proposed fix Ok, I think I should revert the change that removed the Signature attribute in case the target is lower or equals to 1.5. Daniel, could you please try this patch ?
Olivier, Could you attach a patched jar file of the compiler? I do not have a workspace with the JDT compiler yet :)
Fixed by reverting fix for bug 277372.
The fix works perfectly in ecj-M20090826-1100.jar.
Verified by reporter for 3.5.1RC2.
Verified.
Verified for 3.6M2 using build I20090914-1800