JDK-4077321 : Accents not supported in inner classes
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.1.3
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-09-08
  • Updated: 2000-03-02
  • Resolved: 2000-03-02
Related Reports
Relates :  
Description

Name: rlT66838			Date: 09/08/97


I've defined a class with an accent in its name.
It compiles well, and creates the .class file 
with the correct name, but when I try to use it 
from another class, an error is thrown at runtime:

java.lang.NoClassDefFoundError: DocTextoEditar$L��nAImprimir
        at DocTextoEditar$Dibujante.run(DocTextoEditar.java:230)

If I change the name to the class, all goes well.

I wasn't using any particular local, so I think it should be the en_US.
My keyboard is a standard Spanish Windows 95 keyboard. Accents and '��'
work well with all programs, even with java programs. The problem was:
    - I wrote a program, some of the identifiers (class names, method
names, fields...) were in Spanish.
    - Everything worked well, until I created a new (inner) class that
had a '��' (i acute) in its name. It was the first class with an accent
in its name (but not the firs identifier, I've created a lot of fields
and methods with accents). The file compiled without any error, but when
I tried to use the class (in another file), the java runtime told me
that there wasn't such a class.

    I send you a piece of code (and the .class files generated with
javac) that produces the following error:
-----
D:\Datos\Ricardo\temp>java I��
873644852710
java.lang.NoClassDefFoundError: I��$E��
        at I+��.<init>(I+��.java:7)
        at I+��.main(I+��.java:5)

D:\Datos\Ricardo\temp>java -version
java version "1.1.3"

D:\Datos\Ricardo\ms>chcp
Tabla de c��digos activa: 850
-----
I'm using the JDK 1.1.3 on a Windows 95 machine.

Hope this helps.

class I�� {
    E�� e�� = new E��();
    public static void main(String[] args) {
        System.out.println(System.currentTimeMillis());
        E�� ee��= new I��().e��;
    };
    I��(){System.out.println(""+System.currentTimeMillis()+e��);}
    class E�� {
        E�� () { System.out.println(System.currentTimeMillis()); }
    };
};


======================================================================

Comments
EVALUATION The problem is almost certainly in the mapping of class names to file names. william.maddox@Eng 1998-01-14 I am able to reproduce similar behaviour using jdk1.1.3. The compiler is correctly generating the name of the inner class using the UTF-8 encoding. There appearently is a problem with the VM not beling able to locate the desired file. It appears that the manifestation of the bug changed slightly but is none-the-less still present. In jdk1.3rc1-S, the compiler continues to correctly generate the name of the inner class in UTF-8 encoding ("\00ED") and the default VM properly runs the test. $ sh $ /usr/local/java/jdk1.1.3/solaris/bin/javac I.java $ /usr/local/java/jdk1.1.3/solaris/bin/java `cat i` 948510650911 java.lang.NoClassDefFoundError: I��$E�� at I����.<init>(I.java:7) at I����.main(I.java:5) $ rm *.class $ /usr/local/java/jdk1.1.8/solaris/bin/javac I.java $ /usr/local/java/jdk1.1.8/solaris/bin/java `cat i` Error loading class I��: Wrong name $ rm *.class $ /usr/local/java/jdk1.2/solaris/bin/javac I.java $ /usr/local/java/jdk1.2/solaris/bin/java `cat i` Exception in thread "main" java.lang.NoClassDefFoundError: I $ rm *.class $ /usr/local/java/jdk1.3/solaris/bin/javac I.java $ /usr/local/java/jdk1.3/solaris/bin/java `cat i` 948510822086 948510822096 948510822098I��$E��@fef3d See the evaluation in bug 1266364 for more details regarding international character sets. iris.garcia@eng 2000-01-21 Name: ab88733 Date: 03/02/2000 This bug is being closed because the new javac compiler does not exhibit this behavior. No work on the old javac compiler is planned. The new javac compiler is shipping with the 1.3 release of J2SE. The old compiler is provided in 1.3 for backwards compatibility; it will be withdrawn in a future release of J2SE. ======================================================================
11-06-2004

WORK AROUND Name: rlT66838 Date: 09/08/97 If I change the name to the class, all goes well. ======================================================================
11-06-2004