-
Bug
-
Resolution: Fixed
-
P3
-
6u22
-
b126
-
x86
-
windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2208057 | OpenJDK6 | James Holmlund | P3 | Resolved | Fixed | b23 |
FULL PRODUCT VERSION :
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Wersja 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
The bug appears when trying to create resource with filename '.' from annotation processor level. Folllowing line:
processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "foo", ".foo2", element)
throws Exception:
java.lang.IllegalArgumentException: relativeName is invalid
at com.sun.tools.javac.util.DefaultFileManager.getFileForOutput(DefaultFileManager.java:1050)
In spec it is said:
"A relative name is a non-null, non-empty sequence of path segments separated by '/'.; '.' or '..' are invalid path segments."
But in that case '.' at the begining of filename is not the segment. There is a difference between ".foo2" and "./foo2". The first one seems to be correct filename. But I cannot create it with DefaultFileManager. There is no way to create resource starting with '.' character.
REPRODUCIBILITY :
This bug can be reproduced always.
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Wersja 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
The bug appears when trying to create resource with filename '.' from annotation processor level. Folllowing line:
processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "foo", ".foo2", element)
throws Exception:
java.lang.IllegalArgumentException: relativeName is invalid
at com.sun.tools.javac.util.DefaultFileManager.getFileForOutput(DefaultFileManager.java:1050)
In spec it is said:
"A relative name is a non-null, non-empty sequence of path segments separated by '/'.; '.' or '..' are invalid path segments."
But in that case '.' at the begining of filename is not the segment. There is a difference between ".foo2" and "./foo2". The first one seems to be correct filename. But I cannot create it with DefaultFileManager. There is no way to create resource starting with '.' character.
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-2208057 DefaultFileManager incorrect
- Resolved
- relates to
-
JDK-6502392 Invalid relative names for Filer.createResource and Filer.getResource
- Closed