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

idlj generates server classes with variables that clash with parameter names

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • other-libs
    • merlin
    • generic
    • generic
    • Not verified



        Name: krC82822 Date: 01/29/2001


        29 Jan 2001, eval1127@eng -- reproducible with 1.3.0 and merlin beta 49.
        ----------------
        java version "1.3.0"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
        Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

        and

        java version "1.4.0-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b49)


        The 'idlj' tool supplied with Java 2 SDK 1.3.0 for Windows generates server
        code with variables having names that sometimes clash with the names of
        parameters.

        Using the following IDL (Demo.idl) as an example:

            interface Demo {
                long demo(in long method);
            };

        If we invoke the following command to generate Java source:

            idlj -fall Demo.idl

        And then the following command to compile the generated Java source:

            javac *.java

        We obtain the following compiler error output:

            _DemoImplBase.java:37: method is already defined in _invoke
        (java.lang.String,org
        .omg.CORBA.portable.InputStream,org.omg.CORBA.portable.ResponseHandler)
                     int method = in.read_long ();
                         ^
            1 error

        This is because idlj generates a local variable named 'method' whose name
        clashes with the name of the parameter named 'method'.

        Many other bug reports (e.g., 4149897, 4118046, 4149581, 4149834, 4149807)
        mention a similar problem with the older 'idltojava' compiler, and the
          Evaluation section claims that the problem has been fixed in Java SDK 1.3. The
        names that clash may have changed, but the problem remains!
        (Review ID: 109854)
        ======================================================================

              kcavanauorcl Ken Cavanaugh (Inactive)
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: