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

-falltie option broke when file has multiple interfaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • other-libs
    • None
    • beta
    • unknown
    • solaris_1
    • Not verified

        I found what the problem is with idlj. It turns out it was
        not the recent changes. They are changes to
                                                                               
                /com/sun/tools/corba/se/idl/toJavaPortable/InterfaceGen.java
                                                                               
                                                                               
        -------------------------
                                                                               
        The last time it was changed was:
                                                                               
                                                                               
        501 toJavaPortable> sccs prt InterfaceGen.java
                                                                               
        SCCS/s.InterfaceGen.java:
                                                                               
        D 1.10 00/12/21 11:13:12 hemanth 18 17 00015/00000/00833
        Fixed a bug for fallTie option
                                                                               
        -------------------------
                                                                               
        Looking at the change I see:
                                                                               
                                                                               
        505 toJavaPortable> sccs diffs InterfaceGen.java
                                                                               
        ------- InterfaceGen.java -------
        2c2
        < * %W% %E%
        ---
        > * @(#)InterfaceGen.java 1.10 00/12/21
        21c21
        < * %W% %E%
        ---
        > * @(#)InterfaceGen.java 1.10 00/12/21
        506 toJavaPortable> sccs diffs -r 1.9 InterfaceGen.java
                                                                               
        ------- InterfaceGen.java -------
        2c2
        < * %W% %E%
        ---
        > * @(#)InterfaceGen.java 1.10 00/12/21
        21c21
        < * %W% %E%
        ---
        > * @(#)InterfaceGen.java 1.10 00/12/21
        96a97,111
        >
        > // _REVISIT_, Whenever there is time restructure the code to
        > // encapsulate stub and skeleton generation.
        >
        > // If the option is -fallTie then generate the Tie class first
        > // and then generate the ImplBase class to make the generation
        > // complete for the Hierarchy.
        > Arguments theArguments = (Arguments)Compile.compiler.arguments;
        > if( (theArguments.TIEServer == true )
        > &&(theArguments.emit == theArguments.All ) )
        > {
        > theArguments.TIEServer = false;
        > // Generate the ImplBase class
        > generateSkeleton ();
        > }
                                                                                        
                                                                                        
        -------------------------
                                                                                        
        The line:
                                                                                        
                            theArguments.TIEServer = false;
                                                                                        
        turns off the TIEServer argumment so generateSkeleton will behave
        differently. However, if the file contains multiple interface then
        the remaining interfaces which still need to be processed will not
        have tie classes generated.
                                                                                        
        So why did this not turn up in any tests sooner?
                                                                                        
        My hcks.idl test has multiple interfaces. And it does use a Tie class
        in the test. However, it only uses a tie from one of the interfaces
        in the file. It turns out that the interface was always the first one
        in the file until my putback today. I added one more interface above
        it. I noticed that it generated a Tie class for the new interface but
        not for the rest.
                                                                                
        So I changed InterfaceGen.java to say:
                                                                               
                          theArguments.TIEServer = false;
                          // Generate the ImplBase class
                          generateSkeleton ();
                          // Revert in case file contains multiple interfaces
                          theArguments.TIEServer = true;
                                                                               
        Now all interfaces in the idl file have tie classes generated.
                                                                               
        I am going to submit a bug on this. Then I need someone to review my
        changes so I can put them back. The Q also changes since this bug
        breaks the build:
                                                                               
        0. Harold
        1. Everett
        2. Ram
        3. Harold
                                                                               
        Cheers,
        Harold
                                                                               
        ps: SQE should add tests to make sure that an IDL file
        with multiple interfaces all have Tie classes generated.
                                                                               
                                                                                       

              hcarr Harold Carr
              hcarr Harold Carr
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: