-
Enhancement
-
Resolution: Future Project
-
P4
-
None
-
1.0.2, 1.1, 1.1.3, 1.1.6, 1.1.8, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0, 1.4.2, 5.0, 6u26
-
generic, x86, sparc
-
generic, solaris_2.6, solaris_7, solaris_8, windows_95, windows_98, windows_nt, windows_2000, windows_7
class name to the file name that will contain the class. The absence of a
strategy to address this issue results in unresolveable bugs and
interoperability failure on all platforms.
The mapping needs to be specified, rather than a choice of the implementation, in order for implementations on the same platform to be interoperable.
Some examples of the problems that need to be solved by a platform-specific specfication of the class name to file name mapping:
(1) Win32 and liks platforms are not case sensitive, while Java
identifiers are.
(2) The unix limit on the total length of a filename is much
shorter than the limit on the length of a qualified Java identifier.
(3) Java identifiers include unicode characters; none of the target
file systems do.
A further problem arises because the tools we provide to produce jar files
may have to be aware of this mapping to undo it.
Here is a sample program which the available specifications do not
give enough information to tell a compiler how to behave:
frog$ cat -n T.java
1 /** doc for T */
2 public class T {
3 /** doc for id\u0ca0\u0ca1 */
4 public static class id\u0ca0\u0ca1 {
5 public void f() {}
6 }
7 /** doc for id\u0ca1\u0ca0 */
8 public static class id\u0ca1\u0ca0 {
9 public void g() {}
10 }
11 public static void main(String[] args) {
12 new id\u0ca0\u0ca1().f();
13 new id\u0ca1\u0ca0().g();
14 }
15 }
frog$
One suggestion would be to use a cryptographically strong hash function to
hash the class name to 256 bits and encode those bits to a filename that
is acceptable on all platforms.
neal.gafter@Eng 2001-03-05
- duplicates
-
JDK-4945544 Mapping from class name to file name for unicode characters
-
- Closed
-
-
JDK-1266364 Unicode escape in package name isn't processed properly
-
- Closed
-
-
JDK-4037490 Only one class file generated for sourcefiles whose names differ only in case
-
- Closed
-
-
JDK-4346857 javac should warn about case insensitive type conflicts
-
- Closed
-
-
JDK-4417544 Compiler reuses wrong file name on class file output
-
- Closed
-
-
JDK-4988649 Inner classes with identical names, but in different case, fails during runtime.
-
- Closed
-
-
JDK-7088636 error compiling java file with same class(different case) in a file
-
- Closed
-
-
JDK-4196252 switch for case-insensitive handling of java source files
-
- Closed
-
- relates to
-
JDK-4071299 Compilation spec needed: should state if private should imply final for a method
-
- Closed
-