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

rmic generates bad code for local optimization of void return type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.4.0
    • 1.4.0
    • other-libs
    • None
    • beta3
    • generic
    • generic

      (from Sanjeev's email)

      It looks like there is a bug in the local stub code which causes
      a NullPointerException when doing same-VM invocations across
      classloaders:

      The stub code looks like:

          public void initLogging(Properties arg0) throws RemoteException {
              if (!Util.isLocal(this)) {
                  try {
                      org.omg.CORBA_2_3.portable.InputStream in = null;
                      try {
                          org.omg.CORBA_2_3.portable.OutputStream out =
                              (org.omg.CORBA_2_3.portable.OutputStream)
                              _request("initLogging", true);
                          out.write_value(arg0,Properties.class);
                          _invoke(out);
                      } catch (ApplicationException ex) {
                          in = (org.omg.CORBA_2_3.portable.InputStream)
      ex.getInputStream();
                          String id = in.read_string();
                          throw new UnexpectedException(id);
                      } catch (RemarshalException ex) {
                          initLogging(arg0);
                      } finally {
                          _releaseReply(in);
                      }
                  } catch (SystemException ex) {
                      throw Util.mapSystemException(ex);
                  }
              } else {
                  ServantObject so = _servant_preinvoke("initLogging",TxBean.class);
                  if (so == null) {
                      initLogging(arg0);
                  }
                  try {
                      Properties arg0Copy = (Properties) Util.copyObject(arg0,_orb());
                      ((TxBean)so.servant).initLogging(arg0Copy);
                  } catch (Throwable ex) {
                      Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
                      throw Util.wrapException(exCopy);
                  } finally {
                      _servant_postinvoke(so);
                  }
              }
          }


      Note that if so is null, it calls initLogging, then it must return,
      rather than going on. This bug happens only for methods returning void.
      If initLogging returned anything, the code would be:
      "return initLogging(arg0);"

      For now I have turned off the local optimization in the
      RI build being tested by the SQE/CTS teams because some tests broke.
      I'll enable it next week after doing another CORBA integration
      with the fix for the above bug.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: