-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b03
-
generic
-
generic
-
Verified
SimpleJavaFileObject.toString() generates URI with some extra message
<testcase>
import java.io.File;
import java.net.URI;
import javax.tools.*;
import static javax.tools.StandardLocation.*;
import static javax.tools.JavaFileObject.Kind.*;
class JFO extends SimpleJavaFileObject {
public JFO(URI uri, Kind kind) {
super(uri,kind);
}
}
public class Foo {
public static void main(String... arg) throws Exception {
JavaCompilerTool javac = ToolProvider.getSystemJavaCompilerTool();
JavaFileManager jfm = javac.getStandardFileManager(null);
JavaFileObject jfo = jfm.getJavaFileForInput(CLASS_PATH,"Foo",SOURCE);
System.out.println("From JavaFileManager ->" + jfo.toString());
SimpleJavaFileObject sjfo = new JFO(jfo.toUri(), SOURCE);
System.out.println("From SimpleJavaFileObject ->" + sjfo.toString());
}
}
</testcase>
<output>
From JavaFileManager -> .\Foo.java
From SimpleJavaFileObject -> file:/Y:/MustangTestDev/tools/jsr199/JavaFileObject/JFOTest05/./Foo.java from JFO
</output>
1) In the output of SimpleJavaFileObject.toString() extra message 'from JFO' is not required.
2) There is inconsistency in the toString() message of JavaFileObject of StandardJavaFileManager and SimpleJavaFileObject.toString(). SimpleJavaFileObject generate more of URI.
<java-version>
bash-3.00$ java -version
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b88)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b88, mixed mode)
</java-vesrion>
<testcase>
import java.io.File;
import java.net.URI;
import javax.tools.*;
import static javax.tools.StandardLocation.*;
import static javax.tools.JavaFileObject.Kind.*;
class JFO extends SimpleJavaFileObject {
public JFO(URI uri, Kind kind) {
super(uri,kind);
}
}
public class Foo {
public static void main(String... arg) throws Exception {
JavaCompilerTool javac = ToolProvider.getSystemJavaCompilerTool();
JavaFileManager jfm = javac.getStandardFileManager(null);
JavaFileObject jfo = jfm.getJavaFileForInput(CLASS_PATH,"Foo",SOURCE);
System.out.println("From JavaFileManager ->" + jfo.toString());
SimpleJavaFileObject sjfo = new JFO(jfo.toUri(), SOURCE);
System.out.println("From SimpleJavaFileObject ->" + sjfo.toString());
}
}
</testcase>
<output>
From JavaFileManager -> .\Foo.java
From SimpleJavaFileObject -> file:/Y:/MustangTestDev/tools/jsr199/JavaFileObject/JFOTest05/./Foo.java from JFO
</output>
1) In the output of SimpleJavaFileObject.toString() extra message 'from JFO' is not required.
2) There is inconsistency in the toString() message of JavaFileObject of StandardJavaFileManager and SimpleJavaFileObject.toString(). SimpleJavaFileObject generate more of URI.
<java-version>
bash-3.00$ java -version
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b88)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b88, mixed mode)
</java-vesrion>
- relates to
-
JDK-6437349 JSR 199: JavaFileObject.isNameCompatible() will give true with some incompatible kinds
-
- Closed
-
-
JDK-6473901 fix file separator and other issues in javac's FileManager
-
- Closed
-