Bug 277372 - [1.5][compiler] Signature attribute should not be generated with target jsr14
Summary: [1.5][compiler] Signature attribute should not be generated with target jsr14
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-21 14:46 EDT by Olivier Thomann CLA
Modified: 2009-08-25 21:16 EDT (History)
3 users (show)

See Also:
kent_johnson: review+
philippe_mulet: review+


Attachments
Proposed fix (1.79 KB, patch)
2009-05-21 14:48 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2009-05-21 14:46:29 EDT
When the target is jsr14, the resulting .class files are meant to be run on a 1.4 VM. So we don't need to provide the signature attribute.
Comment 1 Olivier Thomann CLA 2009-05-21 14:48:30 EDT
Created attachment 136699 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2009-05-21 14:59:55 EDT
Since SAT4J is using that mode, this change could be useful for them.
Comment 3 Olivier Thomann CLA 2009-05-21 15:00:18 EDT
Philippe and Kent, please review.
Comment 4 Philipe Mulet CLA 2009-05-21 15:34:01 EDT
+1
Comment 5 Olivier Thomann CLA 2009-05-21 15:49:24 EDT
Released for 3.5RC2.
Comment 6 Olivier Thomann CLA 2009-05-22 10:25:51 EDT
Verified for 3.5RC2 using I20090521-2000.
Comment 7 Nathan Summers CLA 2009-06-04 13:36:48 EDT
This change breaks the sat4j 2.1.0 build.  Here is the first error:

build:
     [echo] Compiling source code org.sat4j.pb/src/main/java using target jsr14
    [javac] Compiling 71 source files to sat4j-2.1.0/bin
    [javac] ----------
    [javac] 1. ERROR in sat4j-2.1.0/org.sat4j.pb/src/main/java/org/sat4j/pb/IPBSolver.java (at line 68)
    [javac]     IConstr addPseudoBoolean(IVecInt lits, IVec<BigInteger> coeffs,
    [javac]                                            ^^^^
    [javac] The type IVec is not generic; it cannot be parameterized with arguments <BigInteger>
    [javac] ----------
Comment 8 Olivier Thomann CLA 2009-06-04 13:46:40 EDT
This is because java/org/sat4j/pb/IPBSolver.java ends up being compiled against the binary version of IVec. It should only use the source types.
I can try to see what can be done to change the build of SAT4J.
Signature attributes must not end up being generated for the target jsr14.

This also means that the compiler used a generic signature even if the targeted version is 1.4. This looks like a bug.
Comment 9 Olivier Thomann CLA 2009-06-04 14:35:24 EDT
The jsr14 mode should only be used to "export" to a jar file.
Where is the ant script defined ?
Comment 11 Olivier Thomann CLA 2009-07-28 11:35:08 EDT
Could you please let me know what I need to load to reproduce the failure locally?
Thanks.
Comment 12 Nathan Summers CLA 2009-07-28 11:48:28 EDT
1. Download http://forge.ow2.org/project/download.php?group_id=228&file_id=12803
2. ant -Drelease=2.1.0 -lib /eclipse-ecj.jar p2
Comment 13 Olivier Thomann CLA 2009-07-28 12:04:34 EDT
The shape of the src jar doesn't match the build script.
Are you using the script from 

http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/sat4j/maven/tags/2_1_0_ECLIPSE/build.xml?rev=463&view=markup

with the src jar located in the download link in comment 12?
Comment 14 Nathan Summers CLA 2009-07-28 12:29:14 EDT
I take it back.  While I did look at that jar, it turns out that I actually compiled that source from an SVN export:

svn export svn://svn.forge.objectweb.org/svnroot/sat4j/maven/tags/2_1_0_ECLIPSE/ sat4j-2.1.0
Comment 15 Olivier Thomann CLA 2009-07-28 13:15:44 EDT
The problem seems to come from the output folder being added to the classpath before the source folder.
So when generated types are retrieved again, they are retrieved from 1.4 binaries types instead of being retrieve a 1.5 source type.
I'll try to remove the output folder from the classpath to see if this fixes the issue.
Comment 16 Olivier Thomann CLA 2009-08-25 21:15:27 EDT
This had a bad side effect on building multiple projects using the jsr14 target.
I'll revert the change to fix bug 286391.
Comment 17 Olivier Thomann CLA 2009-08-25 21:15:54 EDT
Closing as INVALID.
Comment 18 Olivier Thomann CLA 2009-08-25 21:16:12 EDT
Verified.