docs: private static void addCommonTieMethods(ClassWriter cw,
                                              String tieClassName,
                                              String servantClassName,
                                              String servantDescriptor,
                                              boolean portableServer)
      {
          MethodVisitor mv;
          Label if_notnull_else, if_notnull_end;
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d576626
  
          // -----------------------------------------------------------------------
          // #if portableServer
          // public String[] _all_interfaces(POA poa, byte[] objectId) {
          // #else
          // public String[] _ids()
          // #endif
          // {
          //    return (String)[]) _type_ids.clone();
          // }
          // -----------------------------------------------------------------------
          if (portableServer) {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, INDENT + "adding method : _all_interfaces(Lorg/omg/PortableServer/POA;[B)[Ljava/lang/String;");
              mv = cw.visitMethod(ACC_PUBLIC, "_all_interfaces", "(Lorg/omg/PortableServer/POA;[B)[Ljava/lang/String;", null, null);
          } else {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, INDENT + "adding method : _ids ()[Ljava/lang/String;");
              mv = cw.visitMethod(ACC_PUBLIC, "_ids", "()[Ljava/lang/String;", null, null);
          }
          mv.visitCode();
          mv.visitFieldInsn(GETSTATIC, tieClassName, "_type_ids", "[Ljava/lang/String;");
          mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "clone", "()Ljava/lang/Object;"); // RTC67550
          mv.visitTypeInsn(CHECKCAST, "[Ljava/lang/String;"); // RTC67550
          mv.visitInsn(ARETURN);
          mv.visitMaxs(1, 1);
          mv.visitEnd();
  
          if (!portableServer) {
              // -----------------------------------------------------------------------
              // public void _set_delegate(Delegate delegate)
              // {
              //    super._set_delegate(delegate);
              //    if(delegate != null)
              //       orb = _orb();
              //    else
              //       orb = null;
              // }
              // -----------------------------------------------------------------------
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, INDENT + "adding method : _set_delegate (Lorg/omg/CORBA/portable/Delegate;)V");
  
              mv = cw.visitMethod(ACC_PUBLIC, "_set_delegate",
                                  "(Lorg/omg/CORBA/portable/Delegate;)V", null, null);
              mv.visitCode();
              mv.visitVarInsn(ALOAD, 0);
              mv.visitVarInsn(ALOAD, 1);
              mv.visitMethodInsn(INVOKESPECIAL, "org/omg/CORBA/portable/ObjectImpl",
                                 "_set_delegate", "(Lorg/omg/CORBA/portable/Delegate;)V");
              mv.visitVarInsn(ALOAD, 1);
              if_notnull_else = new Label();
              mv.visitJumpInsn(IFNULL, if_notnull_else);
              mv.visitVarInsn(ALOAD, 0);
              mv.visitVarInsn(ALOAD, 0);
              mv.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/portable/ObjectImpl",
                                 "_orb", "()Lorg/omg/CORBA/ORB;");
              mv.visitFieldInsn(PUTFIELD, tieClassName, "orb", "Lorg/omg/CORBA/ORB;");
              if_notnull_end = new Label();
              mv.visitJumpInsn(GOTO, if_notnull_end);
              mv.visitLabel(if_notnull_else);
              mv.visitVarInsn(ALOAD, 0);
              mv.visitInsn(ACONST_NULL);
              mv.visitFieldInsn(PUTFIELD, tieClassName, "orb", "Lorg/omg/CORBA/ORB;");
              mv.visitLabel(if_notnull_end);
              mv.visitInsn(RETURN);
              mv.visitMaxs(2, 2);
              mv.visitEnd();
          }
  
          // -----------------------------------------------------------------------
          // public void deactivate()
          // {
          // #if portableServer
          //    try {
          //      _poa().deactivate_object(_poa().servant_to_id(this));
          //    } catch (WrongPolicy e) {
          //    } catch (ObjectNotActive e) {
          //    } catch (ServantNotActive e) {
          //    }
          // #else
          //    if(orb != null)
          //    {
          //       orb.disconnect(this);
          //       _set_delegate(null);
          //    }
          // #endif
          // }
          // -----------------------------------------------------------------------
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, INDENT + "adding method : deactivate ()V");
  
          mv = cw.visitMethod(ACC_PUBLIC, "deactivate", "()V", null, null);
          mv.visitCode();
          if (portableServer) {
              Label try_begin = new Label();
              mv.visitLabel(try_begin);
  
              mv.visitVarInsn(ALOAD, 0);
              mv.visitMethodInsn(INVOKEVIRTUAL, tieClassName, "_poa", "()Lorg/omg/PortableServer/POA;");
              mv.visitVarInsn(ALOAD, 0);
              mv.visitMethodInsn(INVOKEVIRTUAL, tieClassName, "_poa", "()Lorg/omg/PortableServer/POA;");
              mv.visitVarInsn(ALOAD, 0);
              mv.visitMethodInsn(INVOKEVIRTUAL, "org/omg/PortableServer/POA", "servant_to_id", "(Lorg/omg/PortableServer/Servant;)[B");
              mv.visitMethodInsn(INVOKEVIRTUAL, "org/omg/PortableServer/POA", "deactivate_object", "([B)V");
              mv.visitInsn(RETURN);
  
              Label try_end = new Label();
              mv.visitLabel(try_end);
  
              Label catch_WrongPolicy_label = try_end;
              mv.visitInsn(POP);
              mv.visitInsn(RETURN);
  
              Label catch_ObjectNotActive_label = new Label();
              mv.visitLabel(catch_ObjectNotActive_label);
              mv.visitInsn(POP);
              mv.visitInsn(RETURN);
  
              Label catch_ServantNotActive_label = new Label();
              mv.visitLabel(catch_ServantNotActive_label);
              mv.visitInsn(POP);
              mv.visitInsn(RETURN);
  
              mv.visitTryCatchBlock(try_begin, try_end,
                                    catch_WrongPolicy_label,
                                    "org/omg/PortableServer/POAPackage/WrongPolicy");
              mv.visitTryCatchBlock(try_begin, try_end,
                                    catch_ObjectNotActive_label,
                                    "org/omg/PortableServer/POAPackage/ObjectNotActive");
              mv.visitTryCatchBlock(try_begin, try_end,
                                    catch_ServantNotActive_label,
                                    "org/omg/PortableServer/POAPackage/ServantNotActive");
          } else {
              mv.visitVarInsn(ALOAD, 0);
              mv.visitFieldInsn(GETFIELD, tieClassName, "orb", "Lorg/omg/CORBA/ORB;");
              if_notnull_end = new Label();
              mv.visitJumpInsn(IFNULL, if_notnull_end);
              mv.visitVarInsn(ALOAD, 0);
              mv.visitFieldInsn(GETFIELD, tieClassName, "orb", "Lorg/omg/CORBA/ORB;");
              mv.visitVarInsn(ALOAD, 0);
              mv.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/ORB", "disconnect",
                                 "(Lorg/omg/CORBA/Object;)V");
              mv.visitVarInsn(ALOAD, 0);
              mv.visitInsn(ACONST_NULL);
              mv.visitMethodInsn(INVOKEVIRTUAL, tieClassName, "_set_delegate",
                                 "(Lorg/omg/CORBA/portable/Delegate;)V");
              mv.visitLabel(if_notnull_end);
              mv.visitInsn(RETURN);
          }
          mv.visitMaxs(2, 1);
          mv.visitEnd();
  
          // -----------------------------------------------------------------------
          // public Remote getTarget()
          // {
          //    return target;
          // }
          // -----------------------------------------------------------------------
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, INDENT + "adding method : getTarget ()Ljava/rmi/Remote;");
  
          mv = cw.visitMethod(ACC_PUBLIC, "getTarget", "()Ljava/rmi/Remote;", null, null);
          mv.visitCode();
          mv.visitVarInsn(ALOAD, 0);
          mv.visitFieldInsn(GETFIELD, tieClassName, "target", servantDescriptor);
          mv.visitInsn(ARETURN);
          mv.visitMaxs(1, 1);
          mv.visitEnd();
  
          // -----------------------------------------------------------------------
          // public ORB orb()
          // {
          //    return _orb();
          // }
          // -----------------------------------------------------------------------
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, INDENT + "adding method : orb ()Lorg/omg/CORBA/ORB;");
  
          mv = cw.visitMethod(ACC_PUBLIC, "orb", "()Lorg/omg/CORBA/ORB;", null, null);
          mv.visitCode();
          mv.visitVarInsn(ALOAD, 0);
          mv.visitMethodInsn(INVOKEVIRTUAL, tieClassName, "_orb", "()Lorg/omg/CORBA/ORB;");
          mv.visitInsn(ARETURN);
          mv.visitMaxs(1, 1);
          mv.visitEnd();
  
          // -----------------------------------------------------------------------
          // public void orb(ORB orb)
          // {
          // #if portableServer
          //    try {
          //      ((org.omg.CORBA_2_3.ORB)orb).set_delegate(this);
          //    } catch (ClassCastException e) {
          //      throw new BAD_PARAM("POA Servant needs an org.omg.CORBA_2_3.ORB");
          //    }
          // #else
          //    orb.connect(this);
          // #endif
          // }
          // -----------------------------------------------------------------------
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, INDENT + "adding method : orb (Lorg/omg/CORBA/ORB;)V");
  
          mv = cw.visitMethod(ACC_PUBLIC, "orb", "(Lorg/omg/CORBA/ORB;)V", null, null);
          mv.visitCode();
          if (portableServer) {
              Label try_begin = new Label();
              mv.visitLabel(try_begin);
  
              mv.visitVarInsn(ALOAD, 1);
              mv.visitTypeInsn(CHECKCAST, "org/omg/CORBA_2_3/ORB");
              mv.visitVarInsn(ALOAD, 0);
              mv.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA_2_3/ORB", "set_delegate", "(Ljava/lang/Object;)V");
              mv.visitInsn(RETURN);
  
              Label try_end = new Label();
              mv.visitLabel(try_end);
  
              Label catch_ClassCastException_label = try_end;
              mv.visitInsn(POP);
              mv.visitTypeInsn(NEW, "org/omg/CORBA/BAD_PARAM");
              mv.visitInsn(DUP);
              mv.visitLdcInsn("POA Servant needs an org.omg.CORBA_2_3.ORB");
              mv.visitMethodInsn(INVOKESPECIAL, "org/omg/CORBA/BAD_PARAM", "<init>", "(Ljava/lang/String;)V");
              mv.visitInsn(ATHROW);
  
              mv.visitTryCatchBlock(try_begin, try_end,
                                    catch_ClassCastException_label,
                                    "java/lang/ClassCastException");
          } else {
              mv.visitVarInsn(ALOAD, 1);
              mv.visitVarInsn(ALOAD, 0);
              mv.visitMethodInsn(INVOKEVIRTUAL, "org/omg/CORBA/ORB", "connect", "(Lorg/omg/CORBA/Object;)V");
              mv.visitInsn(RETURN);
          }
          mv.visitMaxs(2, 2);
          mv.visitEnd();
  
          // -----------------------------------------------------------------------
          // public void setTarget(Remote remote)
          // {
          //    target = (EJSRemoteBMPBMPRaHome_a30a6d0b)remote;
          // }
          // -----------------------------------------------------------------------
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, INDENT + "adding method : setTarget (Ljava/rmi/Remote;)V");
  
          mv = cw.visitMethod(ACC_PUBLIC, "setTarget", "(Ljava/rmi/Remote;)V", null, null);
          mv.visitCode();
          mv.visitVarInsn(ALOAD, 0);
          mv.visitVarInsn(ALOAD, 1);
          mv.visitTypeInsn(CHECKCAST, servantClassName);
          mv.visitFieldInsn(PUTFIELD, tieClassName, "target", servantDescriptor);
          mv.visitInsn(RETURN);
          mv.visitMaxs(2, 2);
          mv.visitEnd();
  
          // -----------------------------------------------------------------------
          // public org.omg.CORBA.Object thisObject()
          // {
          // #if portableServer
          //    return _this_object();
          // #else
          //    return this;
          // #endif
          // }
          // -----------------------------------------------------------------------
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, INDENT + "adding method : orb (Lorg/omg/CORBA/ORB;)V");
  
          mv = cw.visitMethod(ACC_PUBLIC, "thisObject", "()Lorg/omg/CORBA/Object;", null, null);
          mv.visitCode();
          mv.visitVarInsn(ALOAD, 0);
          if (portableServer) {
              mv.visitMethodInsn(INVOKEVIRTUAL, tieClassName, "_this_object", "()Lorg/omg/CORBA/Object;");
          }
          mv.visitInsn(ARETURN);
          mv.visitMaxs(1, 1);
          mv.visitEnd();
  
      }