Bug 171466

Summary: JavaCore.getDefaultOptions returns incorrect compiler compliance level
Product: [Eclipse Project] JDT Reporter: Kathy Chan <kathy>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: szhou
Version: 3.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Kathy Chan CLA 2007-01-23 16:51:33 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:10:16 EST

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