Bug 231260

Summary: Compiler compliance level 5.0 and String isEmpty();
Product: [Eclipse Project] JDT Reporter: Jean-Luc Geering <jgeering>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: david_audel, Mark.Swanson, njbartlett, Olivier_Thomann, remy.suen
Version: 3.3.2   
Target Milestone: 3.5 M4   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jean-Luc Geering CLA 2008-05-09 04:02:27 EDT
With the java compiler compliance level set to 5.0, Eclipse doesn't complain when I use java.lang.String.isEmpty(), which is only available in java 6.
Comment 1 Remy Suen CLA 2008-05-09 08:17:22 EDT
I don't think there is any way for the compiler to know that a method was added in Java 5 or Java 6.
Comment 2 Olivier Thomann CLA 2008-05-09 08:36:09 EDT
The compiler is using the libraries that you set up on the classpath.
So if you are setting the compliance to 1.5, you should use 1.5 libraries.

The @since information is not stored in the .class files, so there is no way for the compiler to retrieve this information from the binaries themselves.
Comment 3 Neil Bartlett CLA 2008-05-09 08:38:53 EDT
Like the -source flag in javac, the compiler compliance level dictates only which Java language features are used. It has no effect on available APIs.
Comment 4 Jerome Lanneluc CLA 2008-10-31 06:18:09 EDT
Closing as INVALID since the described problem is not a bug
Comment 5 Jerome Lanneluc CLA 2008-10-31 06:19:35 EDT
*** Bug 252220 has been marked as a duplicate of this bug. ***
Comment 6 David Audel CLA 2008-12-09 04:42:41 EST
Verified for 3.5M4