docs: private static void addStubMethod(ClassWriter cw,
                                        String className,
                                        Set<String> classConstantFieldNames,
                                        Method method,
                                        Class<?>[] checkedExceptions, // d676434
                                        String idlName,
                                        boolean isRmiRemote,
                                        int rmicCompatible) throws EJBConfigurationException {
          GeneratorAdapter mg;
          String methodName = method.getName();
          String methodSignature = jdiMethodSignature(method); // d457086
          Class<?> declaringClass = method.getDeclaringClass();
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              Tr.debug(tc, INDENT + "adding method : " +
                           methodName + " " + methodSignature);
  
          // Determine the list of 'checked' exceptions, which will need to
          // be thrown in the Stub... and also perform validation.
          // Note that RemoteException is never a 'checked' exception, and
          // exceptions that are subclasses of other 'checked' exceptios
          // will be sorted to parent-last order, to avoid 'unreachable' code.
          Class<?>[] methodExceptions = method.getExceptionTypes();
  
          // If the interface extends Remote, the property is enabled to allow
          // remote exceptions, or any of the thrown exceptions are remote exceptions,
          // then allow remote exceptions to be thrown from the stub methods.
          boolean throwsRemoteEx = isRmiRemote || JITDeploy.ThrowRemoteFromEjb3Stub;
          if (!throwsRemoteEx) {
              for (Class<?> exClass : methodExceptions) {
                  if (RemoteException.class.isAssignableFrom(exClass)) {
                      throwsRemoteEx = true;
                      break;
                  }
              }
          }
  
          // Convert the return value, arguments, and exception classes to
          // ASM Type objects, and create the ASM Method object which will
          // be used to actually add the method and method code.
          Class<?>[] methodParameters = method.getParameterTypes();
          Class<?> returnClass = method.getReturnType();
          Type returnType = Type.getType(returnClass);
          Type[] argTypes = getTypes(methodParameters);
          Type[] exceptionTypes = getTypes(methodExceptions);
          Type[] checkedTypes = getTypes(checkedExceptions);
          Type declaringType = Type.getType(declaringClass);
          String declaringName = convertClassName(declaringClass.getName());
          final int numArgs = methodParameters.length;
  
          org.objectweb.asm.commons.Method m = new org.objectweb.asm.commons.Method(methodName, returnType, argTypes);
  
          // Create an ASM GeneratorAdapter object for the ASM Method, which
          // makes generating dynamic code much easier... as it keeps track
          // of the position of the arguements and local variables, etc.
          mg = new GeneratorAdapter(ACC_PUBLIC, m, null, exceptionTypes, cw);
  
          // -----------------------------------------------------------------------
          // Begin Method Code...
          // -----------------------------------------------------------------------
          mg.visitCode();
  
          // -----------------------------------------------------------------------
          // // If EJB 3 non-RMI method; add try/catch to map RemoteException
          // try
          // {
          // -----------------------------------------------------------------------
          Label map_remote_try_begin = new Label();
          if (!throwsRemoteEx) {
              mg.visitLabel(map_remote_try_begin);
          }
  
          // -----------------------------------------------------------------------
          // ServantObject servantObj;
          // -----------------------------------------------------------------------
          int servantObj = mg.newLocal(TYPE_CORBA_ServantObject);
  
          // -----------------------------------------------------------------------
          // do
          // {
          // -----------------------------------------------------------------------
          Label do_while_begin = new Label();
          mg.visitLabel(do_while_begin);
  
          // -----------------------------------------------------------------------
          //   while( !Util.isLocal(this) )
          //   {
          // -----------------------------------------------------------------------
          mg.loadThis();
          mg.visitMethodInsn(INVOKESTATIC, "javax/rmi/CORBA/Util", "isLocal",
                             "(Ljavax/rmi/CORBA/Stub;)Z");
          Label while_not_local_end = new Label();
          mg.visitJumpInsn(IFNE, while_not_local_end);
  
          // -----------------------------------------------------------------------
          //     org.omg.CORBA_2_3.portable.InputStream inputstream = null;
          // -----------------------------------------------------------------------
          Type inputStreamType = TYPE_CORBA_2_3_InputStream;
          int inputstream = mg.newLocal(inputStreamType);
          mg.visitInsn(ACONST_NULL);
          mg.storeLocal(inputstream);
  
          // -----------------------------------------------------------------------
          //     try
          //     {
          //       try
          //       {
          // -----------------------------------------------------------------------
          // only one label needed for both try begins
          Label not_local_try_begin = new Label();
          mg.visitLabel(not_local_try_begin);
  
          // -----------------------------------------------------------------------
          //         OutputStream outputstream = (OutputStream)_request("<idl name>", true);
          // -----------------------------------------------------------------------
          Type outputStreamType = TYPE_CORBA_2_3_OutputStream;
          int outputstream = mg.newLocal(outputStreamType);
          mg.loadThis();
          mg.push(idlName);
          mg.push(true);
          mg.visitMethodInsn(INVOKEVIRTUAL,
                             "org/omg/CORBA/portable/ObjectImpl",
                             "_request",
                             "(Ljava/lang/String;Z)Lorg/omg/CORBA/portable/OutputStream;");
          mg.checkCast(outputStreamType);
          mg.storeLocal(outputstream);
  
          // -----------------------------------------------------------------------
          //         outputstream.write_<primitive>( arg );
          //              or
          //         outputstream.write_value( arg, <class> );
          //              or
          //         Util.writeAny(outputstream, arg);
          //              or
          //         Util.writeRemoteObject(outputstream, arg);
          // -----------------------------------------------------------------------
          for (int i = 0; i < numArgs; i++) {
              JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_ARG_BEGIN + i); // d726162
              mg.loadLocal(outputstream);
              mg.loadArg(i);
              write_value(mg, className, classConstantFieldNames, // RTC111522
                          method, methodParameters[i], rmicCompatible); // d450525, PM46698
          }
  
          JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_DEFAULT); // d726162
  
          // -----------------------------------------------------------------------
          //         _invoke(outputstream);                     // void return value
          //              or
          //         inputstream = (InputStream)_invoke(outputstream)
          // -----------------------------------------------------------------------
          mg.loadThis();
          mg.loadLocal(outputstream);
          mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl", "_invoke",
                             "(Lorg/omg/CORBA/portable/OutputStream;)Lorg/omg/CORBA/portable/InputStream;");
          if (returnType == Type.VOID_TYPE) {
              mg.pop();
          } else {
              mg.checkCast(inputStreamType);
              mg.storeLocal(inputstream);
          }
  
          // -----------------------------------------------------------------------
          //         <return type> returnValue = inputstream.read_<primitive>();
          //              or
          //         <return type> returnValue = (<return type>)
          //                            inputstream.read_value(<return type>.class);
          //              or
          //         <return type> returnValue = (<return type>)
          //                           inputstream.read_Object(<return type>.class);
          //              or
          //         <return type> returnValue = (<return type>)
          //               inputstream.read_abstract_interface(<return type>.class);
          // -----------------------------------------------------------------------
          JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_RETURN); // d726162
          int returnValue = -1;
  
          if (returnType != Type.VOID_TYPE) {
              returnValue = mg.newLocal(returnType);
              mg.loadLocal(inputstream);
              read_value(mg, className, classConstantFieldNames, // RTC111522
                         method, returnClass, returnType, rmicCompatible); // d450525, PM46698
              mg.storeLocal(returnValue);
          }
  
          // -----------------------------------------------------------------------
          //         return - executing the finally first!
          // -----------------------------------------------------------------------
          Label not_local_finally_begin = new Label();
          mg.visitJumpInsn(JSR, not_local_finally_begin); // execute finally
  
          if (returnType != Type.VOID_TYPE) {
              mg.loadLocal(returnValue);
          }
          mg.returnValue();
  
          // -----------------------------------------------------------------------
          //       }
          // -----------------------------------------------------------------------
          Label not_local_inner_try_end = new Label();
          mg.visitLabel(not_local_inner_try_end);
  
          // -----------------------------------------------------------------------
          //       catch(ApplicationException appException)
          //       {
          // -----------------------------------------------------------------------
          JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_CATCH_BEGIN); // d726162
          Label catch_appException_label = not_local_inner_try_end;
          int appException = mg.newLocal(TYPE_CORBA_ApplicationException);
          mg.storeLocal(appException);
  
          // -----------------------------------------------------------------------
          //         inputstream = (org.omg.CORBA_2_3.portable.InputStream)
          //                                          appException.getInputStream();
          // -----------------------------------------------------------------------
          mg.loadLocal(appException);
          mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ApplicationException",
                             "getInputStream", "()Lorg/omg/CORBA/portable/InputStream;");
          if (inputStreamType != TYPE_CORBA_InputStream)
              mg.checkCast(inputStreamType);
          mg.storeLocal(inputstream);
  
          // -----------------------------------------------------------------------
          //         String exIdlName = inputstream.read_string();
          // -----------------------------------------------------------------------
          int exIdlName = mg.newLocal(TYPE_String);
          mg.loadLocal(inputstream);
          mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/InputStream",
                             "read_string", "()Ljava/lang/String;");
          mg.storeLocal(exIdlName);
  
          // -----------------------------------------------------------------------
          //         // For every checked exception (not a RemoteException
          //         if ( exIdlName.equals( <exception IDL> ) )
          //         {
          //           throw (<exception type>)in.read_value(<exception type>.class);
          //         }
          // -----------------------------------------------------------------------
  
          // The Java-to-IDL specification says that exception class names need to
          // be mangled.  Historically, we did not do this, so by default, we accept
          // both mangled and unmangled, but we look for unmangled first.    PM94096
          boolean rmicCompatibleExceptions = JITDeploy.isRMICCompatibleExceptions(rmicCompatible);
          Set<String> exceptionNamesIDLUsed = rmicCompatibleExceptions ? null : new HashSet<String>();
          for (int pass = rmicCompatibleExceptions ? 1 : 0; pass < 2; pass++) {
              boolean mangleComponents = pass == 1;
  
              for (int i = 0; i < checkedExceptions.length; ++i) {
                  String exceptionName = checkedExceptions[i].getName();
                  String exceptionNameIDL = getIdlExceptionName(exceptionName, mangleComponents); // PM94096
  
                  if (exceptionNamesIDLUsed == null || exceptionNamesIDLUsed.add(exceptionNameIDL)) {
                      JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_CATCH_BEGIN + 1 + i); // d726162
                      mg.loadLocal(exIdlName);
                      mg.visitLdcInsn(exceptionNameIDL);
                      mg.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals",
                                         "(Ljava/lang/Object;)Z");
                      Label if_equals_else = new Label();
                      mg.visitJumpInsn(IFEQ, if_equals_else);
  
                      mg.loadLocal(inputstream);
                      JITUtils.loadClassConstant(mg, className, classConstantFieldNames, checkedExceptions[i]); // d676434, RTC111522
                      mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA_2_3/portable/InputStream",
                                         "read_value", "(Ljava/lang/Class;)Ljava/io/Serializable;");
                      JITUtils.checkCast(mg, checkedTypes[i].getInternalName()); // d726162
                      mg.visitInsn(ATHROW);
                      mg.visitLabel(if_equals_else);
                  }
              }
          }
  
          JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_DEFAULT); // d726162
  
          // -----------------------------------------------------------------------
          //         throw new UnexpectedException(exIdlName);
          // -----------------------------------------------------------------------
          mg.visitTypeInsn(NEW, "java/rmi/UnexpectedException");
          mg.visitInsn(DUP);
          mg.loadLocal(exIdlName);
          mg.visitMethodInsn(INVOKESPECIAL, "java/rmi/UnexpectedException", "<init>",
                             "(Ljava/lang/String;)V");
          mg.visitInsn(ATHROW);
  
          // -----------------------------------------------------------------------
          //       }
          //       catch ( RemarshalException rex )
          //       {
          //       }
          // -----------------------------------------------------------------------
          Label catch_remarshalException_label = new Label();
          mg.visitLabel(catch_remarshalException_label);
          mg.visitInsn(POP);
          mg.visitJumpInsn(JSR, not_local_finally_begin); // execute finally
          mg.visitJumpInsn(GOTO, do_while_begin); // reiterate loop
  
          // -----------------------------------------------------------------------
          //     }
          // -----------------------------------------------------------------------
          Label not_local_outer_try_end = new Label();
          mg.visitLabel(not_local_outer_try_end);
  
          // -----------------------------------------------------------------------
          //     catch(SystemException systemexception)
          //     {
          //       throw Util.mapSystemException(systemexception);
          //     }
          // -----------------------------------------------------------------------
          Label catch_sysException_label = not_local_outer_try_end;
          int sysException = mg.newLocal(TYPE_CORBA_SystemException);
          mg.storeLocal(sysException);
          mg.loadLocal(sysException);
          mg.visitMethodInsn(INVOKESTATIC, "javax/rmi/CORBA/Util", "mapSystemException",
                             "(Lorg/omg/CORBA/SystemException;)Ljava/rmi/RemoteException;");
          mg.visitInsn(ATHROW);
  
          // -----------------------------------------------------------------------
          //     }
          // -----------------------------------------------------------------------
          Label not_local_outer_try_catch_end = new Label();
          mg.visitLabel(not_local_outer_try_catch_end);
  
          // -----------------------------------------------------------------------
          //     finally
          //     {
          // -----------------------------------------------------------------------
          // finally label - after caught exception
          Label not_local_finally_ex = not_local_outer_try_catch_end;
  
          int not_local_finally_th = mg.newLocal(TYPE_Throwable);
          mg.storeLocal(not_local_finally_th);
          mg.visitJumpInsn(JSR, not_local_finally_begin); // finally - jump/return to actual code
          mg.loadLocal(not_local_finally_th);
          mg.visitInsn(ATHROW); // finally - re-throw exception
  
          // finally label - after normal code flow
          mg.visitLabel(not_local_finally_begin);
  
          int not_local_finally_return = mg.newLocal(TYPE_Object);
          mg.storeLocal(not_local_finally_return);
  
          // -----------------------------------------------------------------------
          //       _releaseReply( inputstream );
          // -----------------------------------------------------------------------
          mg.loadThis();
          mg.loadLocal(inputstream);
          mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                             "_releaseReply", "(Lorg/omg/CORBA/portable/InputStream;)V");
  
          // -----------------------------------------------------------------------
          //     }                   // end of try / catch / finally
          // -----------------------------------------------------------------------
          // Return from finally, either to the return statement above for normal
          // code flow... or to the beginning of the finally above for the exception
          // path, to rethrow the exception.
          mg.ret(not_local_finally_return);
  
          // -----------------------------------------------------------------------
          //   }                     // end while( !Util.isLocal(this) )
          // -----------------------------------------------------------------------
          mg.visitLabel(while_not_local_end);
  
          // -----------------------------------------------------------------------
          //   servantObj = _servant_preinvoke(<idl name>, <method interface>.class);
          // -----------------------------------------------------------------------
          mg.loadThis();
          mg.push(idlName);
  
          JITUtils.loadClassConstant(mg, className, classConstantFieldNames, declaringClass); // d676434, RTC111522
  
          mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                             "_servant_preinvoke",
                             "(Ljava/lang/String;Ljava/lang/Class;)Lorg/omg/CORBA/portable/ServantObject;");
          mg.storeLocal(servantObj);
  
          // -----------------------------------------------------------------------
          // }
          // while(servantobject == null);
          // -----------------------------------------------------------------------
          mg.loadLocal(servantObj);
          mg.visitJumpInsn(IFNULL, do_while_begin);
  
          // -----------------------------------------------------------------------
          // try
          // {
          // -----------------------------------------------------------------------
          Label local_try_begin = new Label();
          mg.visitLabel(local_try_begin);
  
          // -----------------------------------------------------------------------
          //   At this point in the Stub, all of the 'mutable' parameters must be
          //   copied.  Prior to adding that copy code, build an array that
          //   corresponds to all of the parameters, which contains either a local
          //   variable index to hold that copy (for mutable parameters), or a -1,
          //   indicating there is no copy (for immutable parameters).
          // -----------------------------------------------------------------------
          int numMutableArgs = 0;
          int firstMutableArg = -1;
          int[] argCopy = null;
  
          if (numArgs > 0) {
              argCopy = new int[numArgs];
  
              for (int i = 0; i < numArgs; ++i) {
                  if (isMutable(methodParameters[i])) {
                      argCopy[i] = mg.newLocal(argTypes[i]);
                      ++numMutableArgs;
                      if (firstMutableArg == -1) {
                          firstMutableArg = i;
                      }
                  } else {
                      argCopy[i] = -1;
                  }
              }
          }
  
          // -----------------------------------------------------------------------
          //   // For a single mutable parameter, just copy that one object.
          //
          //   <arg type> argCopy = Util.copyObject( arg, _orb() );
          // -----------------------------------------------------------------------
          if (numMutableArgs == 1) {
              JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_ARG_BEGIN); // d726162
              mg.loadArg(firstMutableArg);
              mg.loadThis();
              mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                                 "_orb", "()Lorg/omg/CORBA/ORB;");
              mg.visitMethodInsn(INVOKESTATIC, "javax/rmi/CORBA/Util", "copyObject",
                                 "(Ljava/lang/Object;Lorg/omg/CORBA/ORB;)Ljava/lang/Object;");
              JITUtils.checkCast(mg, argTypes[firstMutableArg].getInternalName()); // d726162
              mg.storeLocal(argCopy[firstMutableArg]);
          }
  
          // -----------------------------------------------------------------------
          //   // For multiple mutable parameters, copy them all at once by passing
          //   // them all in an Object array.
          //
          //   Object argCopyarray[] = Util.copyObjects(new Object[] { args... }, _orb());
          // -----------------------------------------------------------------------
          else if (numMutableArgs > 1) {
              JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_ARG_BEGIN); // d726162
              mg.push(numMutableArgs);
              mg.visitTypeInsn(ANEWARRAY, "java/lang/Object");
  
              int argCopyArrayIndex = 0;
              for (int i = firstMutableArg; i < numArgs; ++i) {
                  if (argCopy[i] > -1) {
                      mg.visitInsn(DUP);
                      mg.push(argCopyArrayIndex++);
                      mg.loadArg(i);
                      mg.visitInsn(AASTORE);
                  }
              }
  
              mg.loadThis();
              mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                                 "_orb", "()Lorg/omg/CORBA/ORB;");
              mg.visitMethodInsn(INVOKESTATIC, "javax/rmi/CORBA/Util", "copyObjects",
                                 "([Ljava/lang/Object;Lorg/omg/CORBA/ORB;)[Ljava/lang/Object;");
              int argCopyArray = mg.newLocal(TYPE_Object_ARRAY);
              mg.storeLocal(argCopyArray);
  
              // -----------------------------------------------------------------------
              //   // And then pull the copy out of the array into a local variable
              //
              //   <arg type> argCopy<i> = (<arg type>)argCopyArray[<i>]; // for each arg
              // -----------------------------------------------------------------------
              argCopyArrayIndex = 0;
              for (int i = firstMutableArg; i < numArgs; ++i) {
                  if (argCopy[i] > -1) {
                      JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_ARG_BEGIN + i); // d726162
                      mg.loadLocal(argCopyArray);
                      mg.push(argCopyArrayIndex++);
                      mg.visitInsn(AALOAD);
                      JITUtils.checkCast(mg, argTypes[i].getInternalName()); // d726162
                      mg.storeLocal(argCopy[i]);
                  }
              }
          }
  
          JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_DEFAULT); // d726162
  
          // -----------------------------------------------------------------------
          //   Note that the parameters passed may be copies (if mutable) or
          //   may be the actual parameters (if immutable).
          //
          //   ((<interface>)servantObj.servant).<method>(argCopy<i>.....);
          //              or
          //   <return type> returnValue = ((<interface>)servantObj.servant).<method>(argCopy<i>.....);
          //   returnValue = (<return type>)Util.copyObject(returnValue, _orb());
          // -----------------------------------------------------------------------
          mg.loadLocal(servantObj);
          mg.visitFieldInsn(GETFIELD, "org/omg/CORBA/portable/ServantObject",
                            "servant", "Ljava/lang/Object;");
          JITUtils.checkCast(mg, declaringType.getInternalName()); // d726162
  
          for (int i = 0; i < numArgs; ++i) {
              if (argCopy[i] > -1)
                  mg.loadLocal(argCopy[i]); // mutable - the copy
              else
                  mg.loadArg(i); // immutable - real arg
          }
          mg.visitMethodInsn(INVOKEINTERFACE, declaringName,
                             methodName, m.getDescriptor());
  
          if (returnType != Type.VOID_TYPE) {
              JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_RETURN); // d726162
              returnValue = mg.newLocal(returnType);
              mg.storeLocal(returnValue);
  
              if (isMutable(returnClass)) {
                  mg.loadLocal(returnValue);
                  mg.loadThis();
                  mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                                     "_orb", "()Lorg/omg/CORBA/ORB;");
                  mg.visitMethodInsn(INVOKESTATIC, "javax/rmi/CORBA/Util", "copyObject",
                                     "(Ljava/lang/Object;Lorg/omg/CORBA/ORB;)Ljava/lang/Object;");
                  JITUtils.checkCast(mg, returnType.getInternalName()); // d726162
                  mg.storeLocal(returnValue);
              }
          }
  
          // -----------------------------------------------------------------------
          //   return - executing the finally first!
          // -----------------------------------------------------------------------
          Label local_finally_begin = new Label();
          mg.visitJumpInsn(JSR, local_finally_begin); // execute finally
  
          if (returnType != Type.VOID_TYPE) {
              mg.loadLocal(returnValue);
          }
          mg.returnValue();
  
          // -----------------------------------------------------------------------
          // }
          // -----------------------------------------------------------------------
          Label local_try_end = new Label();
          mg.visitLabel(local_try_end);
  
          // -----------------------------------------------------------------------
          // catch(Throwable ex)
          // {
          // -----------------------------------------------------------------------
          JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_CATCH_BEGIN); // d726162
          Label catch_throwable_label = local_try_end;
          int ex = mg.newLocal(TYPE_Throwable);
          mg.storeLocal(ex);
  
          // -----------------------------------------------------------------------
          //   Object exCopy = Util.copyObject(ex, _orb());
          // -----------------------------------------------------------------------
          int exCopy = mg.newLocal(TYPE_Object);
          mg.loadLocal(ex);
          mg.loadThis();
          mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                             "_orb", "()Lorg/omg/CORBA/ORB;");
          mg.visitMethodInsn(INVOKESTATIC, "javax/rmi/CORBA/Util", "copyObject",
                             "(Ljava/lang/Object;Lorg/omg/CORBA/ORB;)Ljava/lang/Object;");
          mg.storeLocal(exCopy);
  
          // -----------------------------------------------------------------------
          //   if ( exCopy instanceof <checked exception> )
          //     throw (<checed exception>)exCopy;
          //   else
          // -----------------------------------------------------------------------
          Label[] checked_else = new Label[checkedExceptions.length];
          for (int i = 0; i < checkedExceptions.length; ++i) {
              JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_CATCH_BEGIN + 1 + i); // d726162
              String checkedName = convertClassName(checkedExceptions[i].getName());
              mg.loadLocal(exCopy);
              mg.visitTypeInsn(INSTANCEOF, checkedName);
              checked_else[i] = new Label();
              mg.visitJumpInsn(IFEQ, checked_else[i]);
  
              mg.loadLocal(exCopy);
              mg.visitTypeInsn(CHECKCAST, checkedName);
              mg.visitInsn(ATHROW);
  
              mg.visitLabel(checked_else[i]);
          }
  
          JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_DEFAULT); // d726162
  
          // -----------------------------------------------------------------------
          //     throw Util.wrapException((Throwable)exCopy);
          // -----------------------------------------------------------------------
          mg.loadLocal(exCopy);
          mg.checkCast(TYPE_Throwable);
          mg.visitMethodInsn(INVOKESTATIC, "javax/rmi/CORBA/Util", "wrapException",
                             "(Ljava/lang/Throwable;)Ljava/rmi/RemoteException;");
          mg.visitInsn(ATHROW);
  
          // -----------------------------------------------------------------------
          // }
          // -----------------------------------------------------------------------
          Label local_try_catch_end = new Label();
          mg.visitLabel(local_try_catch_end);
  
          // -----------------------------------------------------------------------
          // finally
          // {
          // -----------------------------------------------------------------------
          // finally label - after caught exception
          Label local_finally_ex = local_try_catch_end;
  
          int local_finally_th = mg.newLocal(TYPE_Throwable);
          mg.storeLocal(local_finally_th);
          mg.visitJumpInsn(JSR, local_finally_begin); // finally - jump/return to actual code
          mg.loadLocal(local_finally_th);
          mg.visitInsn(ATHROW); // finally - re-throw exception
  
          // finally label - after normal code flow
          mg.visitLabel(local_finally_begin);
  
          int local_finally_return = mg.newLocal(TYPE_Object);
          mg.storeLocal(local_finally_return);
  
          // -----------------------------------------------------------------------
          //   _servant_postinvoke(servantObj);
          // -----------------------------------------------------------------------
          mg.loadThis();
          mg.loadLocal(servantObj);
          mg.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                             "_servant_postinvoke", "(Lorg/omg/CORBA/portable/ServantObject;)V");
  
          // -----------------------------------------------------------------------
          // }                   // end of try / catch / finally
          // -----------------------------------------------------------------------
          // Return from finally, either to the return statement above for normal
          // code flow... or to the beginning of the finally above for the exception
          // path, to rethrow the exception.
          mg.ret(local_finally_return);
  
          // -----------------------------------------------------------------------
          // // If EJB 3 non-RMI method; complete try/catch to map RemoteException
          // -----------------------------------------------------------------------
          Label map_remote_try_end = null;
          Label catch_tran_rollback_label = null;
          Label catch_remote_label = null;
          if (!throwsRemoteEx) {
              // -----------------------------------------------------------------------
              // }
              // -----------------------------------------------------------------------
              map_remote_try_end = new Label();
              mg.visitLabel(map_remote_try_end);
  
              // -----------------------------------------------------------------------
              // catch(TransactionRolledbackException trbex)
              // {
              //   throw new EJBTransactionRolledbackException(trbex);
              // }
              // -----------------------------------------------------------------------
              JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_CATCH_BEGIN + 100);
              catch_tran_rollback_label = map_remote_try_end;
              int trbex = mg.newLocal(JIT_Stub.TYPE_TransactionRolledbackException);
              mg.storeLocal(trbex);
  
              mg.visitTypeInsn(NEW, "javax/ejb/EJBTransactionRolledbackException");
              mg.visitInsn(DUP);
              mg.visitInsn(ACONST_NULL);
              mg.loadLocal(trbex);
              mg.visitMethodInsn(INVOKESPECIAL, "javax/ejb/EJBTransactionRolledbackException", "<init>", "(Ljava/lang/String;Ljava/lang/Exception;)V");
              mg.visitInsn(ATHROW);
  
              // -----------------------------------------------------------------------
              // catch(RemoteException rex)
              // {
              //   throw new EJBException(rex);
              // }
              // -----------------------------------------------------------------------
              JITUtils.setLineNumber(mg, JITUtils.LINE_NUMBER_CATCH_BEGIN + 101);
              catch_remote_label = new Label();
              mg.visitLabel(catch_remote_label);
              int rex = mg.newLocal(JIT_Stub.TYPE_RemoteException);
              mg.storeLocal(rex);
  
              mg.visitTypeInsn(NEW, "javax/ejb/EJBException");
              mg.visitInsn(DUP);
              mg.loadLocal(rex);
              mg.visitMethodInsn(INVOKESPECIAL, "javax/ejb/EJBException", "<init>", "(Ljava/lang/Exception;)V");
              mg.visitInsn(ATHROW);
          }
  
          // -----------------------------------------------------------------------
          // All Try-Catch-Finally definitions for above
          // -----------------------------------------------------------------------
  
          mg.visitTryCatchBlock(not_local_try_begin,
                                not_local_inner_try_end,
                                catch_appException_label,
                                "org/omg/CORBA/portable/ApplicationException");
          mg.visitTryCatchBlock(not_local_try_begin,
                                not_local_inner_try_end,
                                catch_remarshalException_label,
                                "org/omg/CORBA/portable/RemarshalException");
          mg.visitTryCatchBlock(not_local_try_begin,
                                not_local_outer_try_end,
                                catch_sysException_label,
                                "org/omg/CORBA/SystemException");
          mg.visitTryCatchBlock(not_local_try_begin,
                                not_local_outer_try_catch_end,
                                not_local_finally_ex,
                                null);
  
          mg.visitTryCatchBlock(local_try_begin,
                                local_try_end,
                                catch_throwable_label,
                                "java/lang/Throwable");
          mg.visitTryCatchBlock(local_try_begin,
                                local_try_catch_end,
                                local_finally_ex,
                                null);
  
          if (!throwsRemoteEx) {
              mg.visitTryCatchBlock(map_remote_try_begin,
                                    map_remote_try_end,
                                    catch_tran_rollback_label,
                                    "javax/transaction/TransactionRolledbackException");
              mg.visitTryCatchBlock(map_remote_try_begin,
                                    map_remote_try_end,
                                    catch_remote_label,
                                    "java/rmi/RemoteException");
          }
  
          // -----------------------------------------------------------------------
          // End Method Code...
          // -----------------------------------------------------------------------
          mg.endMethod(); // GeneratorAdapter accounts for visitMaxs(x,y)
          mg.visitEnd();
      }