Bug 171467 - JavaCore.getDefaultOptions returns incorrect compiler compliance level
Summary: JavaCore.getDefaultOptions returns incorrect compiler compliance level
Status: CLOSED DUPLICATE of bug 171465
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-23 16:51 EST by Kathy Chan CLA
Modified: 2007-01-23 17:17 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Chan CLA 2007-01-23 16:51:54 EST
Driver:  Eclipse 3.2.1

If I start the workbench with JDK 1.5 and create a Java project, the default JDK compliance level as shown by the UI is 1.5.  When I run the code snippet:

IJavaProject javaProject;
projectJdkComplianceLevel = javaProject.getOption ("org.eclipse.jdt.core.compiler.compliance", false);
defaultJdkComplianceLevel = (String)JavaCore.getDefaultOptions().get("org.eclipse.jdt.core.compiler.compliance");

Here's what I got:

projectJdkcomplianceLevel = null (as expected since it's not set for project) 
defaultJdkComplianceLevel = 1.4 (expected 1.5)

If I "enable project specific setting" and explicitely set compliance level to Java 5.0,

projectJdkcomplianceLevel = 1.5 (as expected) 
defaultJdkComplianceLevel = 1.4 (expected 1.5)

If I run the workbench with JDK 1.4, defaultJdkcomplianceLevel is 1.4 as expected.

Would it be possible to have this problem addressed for Eclipse 3.2.2?
Comment 1 Olivier Thomann CLA 2007-01-23 17:09:56 EST

*** This bug has been marked as a duplicate of bug 171465 ***
Comment 2 Kathy Chan CLA 2007-01-23 17:17:38 EST
Closing defect.  Not sure why multiple defects were opened.