Bug 231260 - Compiler compliance level 5.0 and String isEmpty();
Summary: Compiler compliance level 5.0 and String isEmpty();
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 252220 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-09 04:02 EDT by Jean-Luc Geering CLA
Modified: 2008-12-09 04:42 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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