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

compiler allows hex literal to contain no hex digits

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: dkC59003 Date: 03/10/98


      javac (JDK1.1.4, JDK1.1.5, JDK1.1.6H) doesn't complain about
      illegal hexadecimal literal 0x and as result fails to pass
      the following JCK1.2 tests:

      lang/LEX/lex062/lex06213/lex06213.html

      Examples :
      ---------------------- lex06213.java --------------------------------
      import java.io.PrintStream;
      public class lex06213 {
      public static void main( String argv[] ) {
      System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
      }
      public static int run( String argv[], PrintStream out ) {
      long lng_var;
      lng_var = 0x; // compile-time error
      out.println("lng_var contains : " + lng_var);
      return 0/*STATUS_PASSED*/;
      }
      }
      -------------------------------------------------------------------------
      jdk1.1.6 :

      /export/ld22/java/konst/sqe/jck12/tests/lang/LEX/lex062/lex06293/lex06213 /export/ld14/java/dest/jdk1.1.6/solaris/bin/javac -d . lex06213.java
      /export/ld22/java/konst/sqe/jck12/tests/lang/LEX/lex062/lex06293/lex06213 /export/ld14/java/dest/jdk1.1.6/solaris/bin/java lex06213
      lng_var contains : 0
      /export/ld22/java/konst/sqe/jck12/tests/lang/LEX/lex062/lex06293/lex06213

      jdk1.2P :

      /export/ld22/java/konst/sqe/jck12/tests/lang/LEX/lex062/lex06293/lex06213 /export/ld14/java/dest/jdk1.2P/solaris/bin/javac -d . lex06213.java
      lex06213.java:12: Hexadecimal numbers must contain at least one hexadecimal digit.
      lng_var = 0x; // compile-time error
      ^
      1 error
      /export/ld22/java/konst/sqe/jck12/tests/lang/LEX/lex062/lex06293/lex06213



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

            tturnidgsunw Todd Turnidge (Inactive)
            dkhukhrosunw Dmitry Khukhro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: