docs: static byte[] generateClassBytes(String homeClassName,
                                       Class<?> remoteHomeInterface,
                                       Class<?> localHomeInterface,
                                       Class<?> ejbClass,
                                       Class<?> pkeyClass,
                                       HashMap<String, String> initMethods,
                                       String beanName,
                                       int beanType)
                      throws EJBConfigurationException
      {
          Method[] methods = null;
          HashMap<String, Method> homeMethods = new HashMap<String, Method>(); // d490485
  
          String internalClassName = convertClassName(homeClassName);
          String internalRemoteHomeInterfaceName = (remoteHomeInterface == null)
                          ? null : convertClassName(remoteHomeInterface.getName());
          String internalLocalHomeInterfaceName = (localHomeInterface == null)
                          ? null : convertClassName(localHomeInterface.getName());
          String internalEJBClassName = convertClassName(ejbClass.getName());
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.entry(tc, "generateEJBHomeImplBytes");
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          {
              Tr.debug(tc, INDENT + "className = " + internalClassName);
              Tr.debug(tc, INDENT + "remote    = " + internalRemoteHomeInterfaceName);
              Tr.debug(tc, INDENT + "local     = " + internalLocalHomeInterfaceName);
              Tr.debug(tc, INDENT + "ejb       = " + internalEJBClassName);
          }
  
          ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); //F743-11995
  
          // Define the Class object
          cw.visit(V1_2, ACC_PUBLIC + ACC_SUPER,
                   internalClassName,
                   null,
                   "com/ibm/ejs/container/EJSHome",
                   null);
  
          // Define the source code file and debug settings
          String sourceFileName = homeClassName.substring(homeClassName.lastIndexOf(".") + 1) + ".java";
          cw.visitSource(sourceFileName, null);
  
          // Add the public no parameter local object (wrapper) constructor
          addEJBHomeImplCtor(cw);
  
          // Add the public home methods (i.e. create) from the remote home interface
          if (remoteHomeInterface != null)
          {
              methods = remoteHomeInterface.getMethods();
              for (int i = 0; i < methods.length; ++i)
              {
                  Method method = methods[i];
                  String methodName = method.getName();
  
                  Class<?> declaringClass = method.getDeclaringClass();
                  if (declaringClass.equals(EJBHome.class))
                  {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                          Tr.debug(tc, INDENT + "skipping      : " +
                                       declaringClass.getName() + "." + methodName);
                  }
                  else
                  {
                      switch (beanType)
                      {
                          case InternalConstants.TYPE_STATELESS_SESSION:
                              if (methodName.equals("create") &&
                                  method.getReturnType() != Void.TYPE)
                              {
                                  addEJBHomeStatelessMethod(cw, method, false);
                              }
                              else
                              {
                                  // Log the error and throw meaningful exception. d457128.2
                                  Tr.error(tc, "JIT_INVALID_SL_HOME_METHOD_CNTR5022E",
                                           new Object[] { beanName,
                                                         remoteHomeInterface.getName(),
                                                         methodName });
                                  throw new EJBConfigurationException("EJB stateless session home interface " +
                                                                      remoteHomeInterface.getName() +
                                                                      " must have only one method, and it must be " +
                                                                      "create() : " + beanName + " : " + methodName);
                              }
                              break;
  
                          case InternalConstants.TYPE_STATEFUL_SESSION:
                              if (methodName.startsWith("create") &&
                                  method.getReturnType() != Void.TYPE)
                              {
                                  addEJBHomeCreateMethod(cw, method, initMethods, internalEJBClassName, beanName, false);
                              }
                              else
                              {
                                  // Log the error and throw meaningful exception. d457128.2
                                  Tr.error(tc, "JIT_INVALID_SF_HOME_METHOD_CNTR5023E",
                                           new Object[] { beanName,
                                                         remoteHomeInterface.getName(),
                                                         methodName });
                                  throw new EJBConfigurationException("EJB stateful session home interface " +
                                                                      remoteHomeInterface.getName() +
                                                                      " must define only create methods : " +
                                                                      beanName + " : " + methodName);
                              }
                              break;
  
                          case InternalConstants.TYPE_BEAN_MANAGED_ENTITY:
                              if (methodName.startsWith("create"))
                              {
                                  addBMPEJBHomeCreateMethod(cw, method, ejbClass, pkeyClass,
                                                            internalEJBClassName,
                                                            beanName, false);
                              }
                              else if (methodName.equals("findByPrimaryKey"))
                              {
                                  addBMPEJBHomeFindByPrimaryKeyMethod(cw, method, ejbClass, pkeyClass,
                                                                      internalEJBClassName,
                                                                      beanName, false);
                              }
                              else if (methodName.startsWith("find"))
                              {
                                  addBMPEJBHomeFindMethod(cw, method, ejbClass, pkeyClass,
                                                          internalEJBClassName,
                                                          beanName, false);
                              }
                              else if (methodName.startsWith("remove"))
                              {
                                  // Log the error and throw meaningful exception. d457128.2
                                  Tr.error(tc, "JIT_INVALID_BMP_HOME_METHOD_CNTR5024E",
                                           new Object[] { beanName,
                                                         remoteHomeInterface.getName(),
                                                         methodName });
                                  throw new EJBConfigurationException("EJB entity bean home interface " +
                                                                      remoteHomeInterface.getName() + " must not " +
                                                                      "define a method that starts with remove : " +
                                                                      beanName + " : " + methodName);
                              }
                              else
                              {
                                  addBMPEJBHomeHomeMethod(cw, method, ejbClass,
                                                          internalEJBClassName,
                                                          beanName);
                                  // Save this 'home method' signature, to insure the same
                                  // 'home method' is not added again for the local home
                                  // interface (below).                              d490485
                                  homeMethods.put(methodKey(method), method);
                              }
                              break;
  
                          default:
                              // This is an APAR condition... and should never really happen.
                              // Really, this is here to make it obvious that a change is
                              // needed here when a new bean type (like CMP) is added
                              // in the future, so a Tr.error is not needed.      d457128.2
                              throw new ContainerEJBException("EJBContainer internal error: " +
                                                              "Bean Type not supported: " + beanType);
                      }
                  }
              }
          }
  
          // Add the public home methods (i.e. create) from the local home interface
          if (localHomeInterface != null)
          {
              methods = localHomeInterface.getMethods();
              for (int i = 0; i < methods.length; ++i)
              {
                  Method method = methods[i];
                  String methodName = method.getName();
  
                  Class<?> declaringClass = method.getDeclaringClass();
                  if (declaringClass.equals(EJBLocalHome.class))
                  {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                          Tr.debug(tc, INDENT + "skipping      : " +
                                       declaringClass.getName() + "." + methodName);
                  }
                  else
                  {
                      switch (beanType)
                      {
                          case InternalConstants.TYPE_STATELESS_SESSION:
                              if (methodName.equals("create") &&
                                  method.getReturnType() != Void.TYPE)
                              {
                                  addEJBHomeStatelessMethod(cw, method, true);
                              }
                              else
                              {
                                  // Log the error and throw meaningful exception. d457128.2
                                  Tr.error(tc, "JIT_INVALID_SL_HOME_METHOD_CNTR5022E",
                                           new Object[] { beanName,
                                                         localHomeInterface.getName(),
                                                         methodName });
                                  throw new EJBConfigurationException("EJB stateless session home interface " +
                                                                      localHomeInterface.getName() +
                                                                      " must have only one method, and it must be " +
                                                                      "create() : " + beanName + " : " + methodName);
                              }
                              break;
  
                          case InternalConstants.TYPE_STATEFUL_SESSION:
                              if (methodName.startsWith("create") &&
                                  method.getReturnType() != Void.TYPE)
                              {
                                  addEJBHomeCreateMethod(cw, method, initMethods, internalEJBClassName, beanName, true);
                              }
                              else
                              {
                                  // Log the error and throw meaningful exception. d457128.2
                                  Tr.error(tc, "JIT_INVALID_SF_HOME_METHOD_CNTR5023E",
                                           new Object[] { beanName,
                                                         localHomeInterface.getName(),
                                                         methodName });
                                  throw new EJBConfigurationException("EJB stateful session home interface " +
                                                                      localHomeInterface.getName() +
                                                                      " must define only create methods : " +
                                                                      beanName + " : " + methodName);
                              }
                              break;
  
                          case InternalConstants.TYPE_BEAN_MANAGED_ENTITY:
                              if (methodName.startsWith("create"))
                              {
                                  addBMPEJBHomeCreateMethod(cw, method, ejbClass, pkeyClass,
                                                            internalEJBClassName,
                                                            beanName, true);
                              }
                              else if (methodName.equals("findByPrimaryKey"))
                              {
                                  addBMPEJBHomeFindByPrimaryKeyMethod(cw, method, ejbClass, pkeyClass,
                                                                      internalEJBClassName,
                                                                      beanName, true);
                              }
                              else if (methodName.startsWith("find"))
                              {
                                  addBMPEJBHomeFindMethod(cw, method, ejbClass, pkeyClass,
                                                          internalEJBClassName,
                                                          beanName, true);
                              }
                              else if (methodName.startsWith("remove"))
                              {
                                  // Log the error and throw meaningful exception. d457128.2
                                  Tr.error(tc, "JIT_INVALID_BMP_HOME_METHOD_CNTR5024E",
                                           new Object[] { beanName,
                                                         localHomeInterface.getName(),
                                                         methodName });
                                  throw new EJBConfigurationException("EJB entity bean home interface " +
                                                                      localHomeInterface.getName() + " must not " +
                                                                      "define a method that starts with remove : " +
                                                                      beanName + " : " + methodName);
                              }
                              else
                              {
                                  // If the 'home method' has not already been added for
                                  // the remote home interface, then add it now.     d490485
                                  String methodSig = methodKey(method);
                                  if (homeMethods.containsKey(methodSig))
                                  {
                                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                                          Tr.debug(tc, INDENT + "skipping      : " + methodSig +
                                                       " : home method already added for remote interface");
                                  }
                                  else
                                  {
                                      addBMPEJBHomeHomeMethod(cw, method, ejbClass,
                                                              internalEJBClassName,
                                                              beanName);
                                  }
                              }
                              break;
  
                          default:
                              // This is an APAR condition... and should never really happen.
                              // Really, this is here to make it obvious that a change is
                              // needed here when a new bean type (like CMP) is added
                              // in the future, so a Tr.error is not needed.      d457128.2
                              throw new ContainerEJBException("EJBContainer internal error: " +
                                                              "Bean Type not supported: " + beanType);
                      }
                  }
              }
          }
  
          cw.visitEnd();
  
          byte[] classBytes = cw.toByteArray();
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              writeToClassFile(internalClassName, classBytes);
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.exit(tc, "generateEJBHomeImplBytes: " + classBytes.length + " bytes");
  
          return classBytes;
      }