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

idlj can not compile wide character literal

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • other-libs
    • None
    • merlin
    • sparc
    • solaris_8
    • Not verified

      ********************************************************************************

      tuong.nguyen@eng 2000-10-24

      - Spec. reference:

        CORBA V 2.3.1 formal/99-10-07 , section 3.2.5.2

      - Problem description:

        When running the "idlj" command with the generated .idl file from the "rmic
        -idl ..." command, the idlj command returned errors if the .idl file contained
        wide character literal constant. Please see the output below for more details,
        also the *** NOTE: *** section below is my additional comments (not the output
        results).


      (tuongn@bonnelle) [5:54pm] JavaToIdlMapping [239] % cat Test1.java

      // CORBA v2.3 formal/99-10-07 - 3.2.5.2 Character literals

      import java.io.*;

      public class Test1 implements Serializable {
          public final static char CH1 = 'H';
      }
      (tuongn@bonnelle) [5:54pm] JavaToIdlMapping [240] % /usr/local/java/jdk1.4/solsparc/bin/rmic -idl Test1
      (tuongn@bonnelle) [5:56pm] JavaToIdlMapping [241] % cat Test1.idl
      /**
       * Test1.idl
       * Generated by rmic -idl. Do not edit
       * Tuesday, October 24, 2000 5:56:16 PM PDT
       */

      #include "orb.idl"

      #ifndef __Test1__
      #define __Test1__



          valuetype Test1 {
          
              const wchar CH1 = 72;
              factory create( );
          
          };

      #pragma ID Test1 "RMI:Test1:071DA8BE7F971128:25E563F0FD7E8CB3"


      #endif

      (tuongn@bonnelle) [5:56pm] JavaToIdlMapping [242] % vi Test1.idl

      *** NOTE: ***
      - vi Test1.idl file and changed the value 72 to L'H' (according to CORBA spec.
        section 3.2.5.2) then saved the file before running idlj command.
      - There is bug# 4375317 which reported the problem of "rmic -idl ..."
        incorrectly produced the const wchar value in the generated .idl file.
      - This bug filing is about idlj can not handle the wchar literal value.
      *************

      (tuongn@bonnelle) [6:09pm] JavaToIdlMapping [243] % cat Test1.idl
      /**
       * Test1.idl
       * Generated by rmic -idl. Do not edit
       * Tuesday, October 24, 2000 5:56:16 PM PDT
       */

      #include "orb.idl"

      #ifndef __Test1__
      #define __Test1__



          valuetype Test1 {
          
              const wchar CH1 = L'H';
              factory create( );
          
          };

      #pragma ID Test1 "RMI:Test1:071DA8BE7F971128:25E563F0FD7E8CB3"


      #endif

      (tuongn@bonnelle) [6:10pm] JavaToIdlMapping [244] % /usr/local/java/jdk1.4/solsparc/bin/idlj -i /usr/local/java/jdk1.4/solsparc/lib Test1.idl
      Test1.idl (line 16): L is an undeclared type.
              const wchar CH1 = L'H';
                                 ^
      Test1.idl (line 16): The type of the constant expression is long, but it should be wchar.
              const wchar CH1 = L'H';
                                 ^
      Test1.idl (line 16): Expected `;'; encountered `<character literal>'.
              const wchar CH1 = L'H';
                                 ^
      Test1.idl (line 16): Expected one of `private' `public' `init' `ValueBase' `typedef' `struct' `union' `enum' `const' `exception' `readonly' `attribute' `oneway' `float' `double' `long' `short' `unsigned' `char' `wchar' `boolean' `octet' `any' `string' `wstring' `<identifier>' `::' `void'; encountered `<character literal>'.
              const wchar CH1 = L'H';
                                 ^
      Test1.idl (line 17): Expected one of `typedef' `struct' `union' `enum' `const' `exception' `interface' `valuetype' `module'; encountered `factory'.
              factory create( );
              ^
      Test1.idl (line 19): Expected one of `typedef' `struct' `union' `enum' `const' `exception' `interface' `valuetype' `module'; encountered `}'.
          };
          ^
      (tuongn@bonnelle) [6:10pm] JavaToIdlMapping [245] %

      ********************************************************************************

      ###@###.### 2001-08-14

      - Fix verified ok
        1) with build: j2sdk-1_4_0-beta_refresh-bin-b75-solsparc-09_aug_2001
        2) with Test:
           tests/product/rmi-iiop/JavaToIdlMapping/ValueTypes/constants01/Test1.java

      ********************************************************************************

            eandersosunw Everett Anderson (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: