Bug 206483 - [compiler][1.7] 1.7 VMs cannot read .class files generated with target 1.7
Summary: [compiler][1.7] 1.7 VMs cannot read .class files generated with target 1.7
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-16 11:55 EDT by Olivier Thomann CLA
Modified: 2007-10-29 13:02 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix (1.13 KB, patch)
2007-10-16 12:00 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix (3.05 KB, patch)
2007-10-16 12:49 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 2007-10-16 11:55:51 EDT
Since for now the 1.7 VMs cannot read the .class files generated with a target 1.7, we should change the target 1.7 (or 7.0) to generate the same class file major/minor version as 1.6 (50.0 instead of 51.0).
Once the 1.7 VMs will be able to consume .class file with version 51.0, we should revert this change.
Comment 1 Olivier Thomann CLA 2007-10-16 12:00:55 EDT
Created attachment 80466 [details]
Proposed fix

Philippe, please review.
Comment 2 Philipe Mulet CLA 2007-10-16 12:37:42 EDT
I'd prefer changing the classfile generation to dump 50.0 instead of 51.0 when target is set to 1.7. This would keep the compiler ability to distinguish between 1.6 and 1.7 generation.
Comment 3 Philipe Mulet CLA 2007-10-16 12:38:29 EDT
pls also create a separate bug to remember to remove the hack once 1.7 VMs do behave correctly (i.e. consume 51.0 classfiles).
Comment 4 Olivier Thomann CLA 2007-10-16 12:49:19 EDT
Created attachment 80474 [details]
Proposed fix

Dump 50.0 instead of 51.0.
The version change is considered only when the bytes are actually written.
Comment 5 Olivier Thomann CLA 2007-10-16 12:51:23 EDT
I opened bug 206498 to revert this change once 51.0 is supported.
Comment 6 Olivier Thomann CLA 2007-10-16 12:51:45 EDT
Released for 3.4M3.
Comment 7 Jerome Lanneluc CLA 2007-10-29 13:02:22 EDT
Verified for 3.4M3 using I20071029-0010