JDK-6437349 : JSR 199: JavaFileObject.isNameCompatible() will give true with some incompatible kinds
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-12
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b03Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
JavaFileObject.isNameCompatible() will give true with some incompatible kinds
<testcase>
import java.util.Arrays;
import javax.tools.*;
import static javax.tools.StandardLocation.*;
import static javax.tools.JavaFileObject.Kind.*;
public class Foo {
    public static void main(String[] args) throws Exception {
        JavaCompilerTool javac = ToolProvider.getSystemJavaCompilerTool();
         JavaFileManager jfm = javac.getStandardFileManager(null);
        JavaFileObject jfo = jfm.getJavaFileForInput(CLASS_PATH, "Foo", SOURCE);
        System.out.println(jfo.isNameCompatible("Foo.java",OTHER));
    }
}
</testcase>

<output>
true
</output>

<java-version>
bash-3.00$ java -version
java version "1.6.0-beta2"
Java(TM) SE Runtime Environment (build 1.6.0-beta2-b86)
Java HotSpot(TM) Client VM (build 1.6.0-beta2-b86, mixed mode)
</java-version>
Failing case: javac/api/JavaFileObject/JFOTest03

Comments
EVALUATION A minor bug.
12-06-2006