United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6437349 JSR 199: JavaFileObject.isNameCompatible() will give true with some incompatible kinds
JDK-6437349 : JSR 199: JavaFileObject.isNameCompatible() will give true with some incompatible kinds

Details
Type:
Bug
Submit Date:
2006-06-12
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
tools
OS:
generic
Sub-Component:
javac
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

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.
                                     
2006-06-12



Hardware and Software, Engineered to Work Together