JDK-4215103 : javac cannot find unicode named binary classes
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.2.0,1.2.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,solaris_2.6
  • CPU: generic,sparc
  • Submitted: 1999-02-25
  • Updated: 1999-02-27
  • Resolved: 1999-02-27
Related Reports
Duplicate :  
Duplicate :  
Description
% cat cm1.java
class cm1 {
}
//
class \u6f22\u5b57 {
}
% cat cm2.java
class cm2{
    public static void main(String args[]){
        new \u6f22\u5b57();
    }
}
% javac cm1.java
% rm cm1.java
% javac cm2.java
cm2.java:3: Class ?? not found.
        new \u6f22\u5b57();
            ^
1 error
% 

----------------------------------

Problem seems to be in:

    public void loadDefinition(ClassDeclaration c) {
...
	    Identifier nm = c.getName();
...
	    ClassFile binfile = pkg.getBinaryFile(nm.getName());


robert.field@Eng 1999-02-25

Comments
EVALUATION Javac simply passes the identifier text after processing Unicode escapes to the filesystem as the filename. If the character encoding used in the underlying OS cannot represent all of the characters in the string, the filename will be corrupted, or possibly the file creation will fail. We should be mangling such names to be plain ASCII in cases where the underlying filesystem cannot accept the entire Unicode character set. See 1266364. william.maddox@eng 1999-02-26 We have subsequently determined that 1266364 was spurious, however, the comments above stand. william.maddox@Eng 2000-01-05
26-02-1999