Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4307912

Filesystem silently translates illegal characters, causing compiler failure

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_7

      Description



      Name: laC46010 Date: 01/28/2000



      The class name and package name containing Unicode Escape are incorrectly
      reflected on solaris file-system.

      The test pkgs00704 is valid compile positive test (see source and log below).
      This test fails on all JDK versions by different reasons.
      It is compiled succesfully on all JDK versions solaris but the two classes with
      the same name belonging to different packages (pkgs00704\u00e8 and
      pkgs00704\u00e9)are placed to the same directory on JDK 1.2 and later.
      As the result one of correspoding class-files rewrite another.
      On JDK 1.02 and 1.1* these classes are placed to the different directory
      but the execution fails.
      Note that if this test is compiled and executed on win32 then it passes.

      The test name00203 is valid compile positive test (see source and log below).
      This test fails on all JDK versions by different reasons.
      It is compiled succesfully on all JDK versions solaris but the two classes with
      the different names (name00203\u00e8 and name00203\u00e9) are placed to the same
      class-file on JDK 1.2 and later. As the result one of correspoding class-files
      rewrite another. The name of class-file is name002003?.class where character
      code of ? is 0x3f.
      On JDK 1.02 and 1.1* these classes are placed to the different class-files
      but the execution fails.
      Note that if this test is compiled and executed on win32 then it passes.

      Source pkgs00704
      -------------------------pkgs00704a/pkgs00704a.java--------------------------
      package javasoft.sqe.tests.lang.pkgs007.pkgs00704\u00e8;
      public class pkgs00704a {
        public static int get() {
           return 8;
        }
      }
      -------------------------------pkgs00704a.java-------------------------------
      package javasoft.sqe.tests.lang.pkgs007.pkgs00704\u00e9;
      public class pkgs00704a {
        public static int get() {
             return 4;
        }
      }
      -------------------------------pkgs00704.java--------------------------------
      public static int run(String argv[],PrintStream out) {
         if(javasoft.sqe.tests.lang.pkgs007.pkgs00704\u00e8.pkgs00704a.get()!=8) {
             out.println("pkgs00704a.get() != 8 ");
             return 2/*STATUS_FAILED*/;
         }
         if(javasoft.sqe.tests.lang.pkgs007.pkgs00704\u00e9.pkgs00704a.get()!=4) {
             out.println("pkgs00704a.get() != 4 ");
             return 2/*STATUS_FAILED*/;
         }
         return 0/*STATUS_PASSED*/;
      }
      -----------------------------------------------------------------------------
      log on JDK 1.3 solaris
      _________________________________________________________________________
      javac -d . pkgs00704a.java pkgs00704a/pkgs00704a.java pkgs00704.java

      java -cp . javasoft.sqe.tests.lang.pkgs007.pkgs00704.pkgs00704

      Exception in thread "main" java.lang.NoClassDefFoundError:
      javasoft/sqe/tests/lang/pkgs007/pkgs00704?/pkgs00704a (wrong name:
      javasoft/sqe/tests/lang/pkgs007/pkgs00704?/pkgs00704a)
              at java.lang.ClassLoader.defineClass0(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:453)
              at
      java.security.SecureClassLoader.defineClass(SecureClassLoader.java:101)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:59)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:291)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:290)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
              at
      javasoft.sqe.tests.lang.pkgs007.pkgs00704.pkgs00704.run(pkgs00704.java:17)
              at
      javasoft.sqe.tests.lang.pkgs007.pkgs00704.pkgs00704.main(pkgs00704.java:10)
      _________________________________________________________________________

      log on JDK 1.1 solaris
      _________________________________________________________________________
      javac -d . pkgs00704a.java pkgs00704a/pkgs00704a.java pkgs00704.java

      export CLASSPATH=.:/export/ld25/java/dest/jdk1.1/solaris/lib/classes.zip

      java javasoft.sqe.tests.lang.pkgs007.pkgs00704.pkgs00704

      java.lang.NoClassDefFoundError:
      javasoft/sqe/tests/lang/pkgs007/pkgs00704è/pkgs00704a
              at
              at
      javasoft.sqe.tests.lang.pkgs007.pkgs00704.pkgs00704.main(pkgs00704.java:10)
      _________________________________________________________________________



      Source name00203
      -------------------------------name00203.java--------------------------------
      class name00203\u00e9 {
          static int i = 4;
      }
      class name00203\u00e8 {
          static int i = 8;
      }
      public class name00203 {
          public static int run(String argv[],PrintStream out) {
             if(name00203\u00e9.i != 4) {
                 out.println("name00203\u00e9.i != 4");
                 return 2/*STATUS_FAILED*/;
             }
             if(name00203\u00e8.i != 8) {
                 out.println("name00203\u00e8.i != 8");
                 return 2/*STATUS_FAILED*/;
             }
             return 0/*STATUS_PASSED*/;
          }
      }
      -----------------------------------------------------------------------------
      log on JDK 1.3 solaris
      _________________________________________________________________________
      javac -d . name00203.java

      java -cp . javasoft.sqe.tests.lang.name002.name00203.name00203

      Exception in thread "main" java.lang.NoClassDefFoundError:
      javasoft/sqe/tests/lang/name002/name00203/name00203? (wrong name:
      javasoft/sqe/tests/lang/name002/name00203/name00203?)
              at java.lang.ClassLoader.defineClass0(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:453)
              at
      java.security.SecureClassLoader.defineClass(SecureClassLoader.java:101)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:59)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:291)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:290)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
              at
      javasoft.sqe.tests.lang.name002.name00203.name00203.run(name00203.java:22)
              at
      javasoft.sqe.tests.lang.name002.name00203.name00203.main(name00203.java:19)
      _________________________________________________________________________

      log on JDK 1.1 solaris
      _________________________________________________________________________
      javac -d . name00203.java

      export CLASSPATH=.:/export/ld25/java/dest/jdk1.1/solaris/lib/classes.zip

      java javasoft.sqe.tests.lang.name002.name00203.name00203

      java.lang.NoClassDefFoundError:
      javasoft/sqe/tests/lang/name002/name00203/name00203é
              at
              at
      javasoft.sqe.tests.lang.name002.name00203.name00203.main(name00203.java:19)
      _________________________________________________________________________

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mr Mark Reinhold
                Reporter:
                leosunw Leo Leo (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: