docs: @SuppressWarnings("Duplicates")
      @Override
      public void visitBeanDefinitionEnd() {
          if (classWriter == null) {
              throw new IllegalStateException("At least one called to visitBeanDefinitionConstructor(..) is required");
          }
  
          String[] interfaceInternalNames = new String[interfaceTypes.size()];
          Iterator<Class> j = interfaceTypes.iterator();
          for (int i = 0; i < interfaceInternalNames.length; i++) {
              interfaceInternalNames[i] = Type.getInternalName(j.next());
          }
          classWriter.visit(V1_8, ACC_SYNTHETIC,
                  beanDefinitionInternalName,
                  generateBeanDefSig(providedType.getInternalName()),
                  isSuperFactory ? TYPE_ABSTRACT_BEAN_DEFINITION.getInternalName() : superType.getInternalName(),
                  interfaceInternalNames);
  
          if (buildMethodVisitor == null) {
              throw new IllegalStateException("At least one call to visitBeanDefinitionConstructor() is required");
          }
  
          finalizeInjectMethod();
          finalizeBuildMethod();
          finalizeAnnotationMetadata();
          finalizeTypeArguments();
  
          if (preprocessMethods) {
              GeneratorAdapter requiresMethodProcessing = startPublicMethod(classWriter, "requiresMethodProcessing", boolean.class.getName());
              requiresMethodProcessing.push(true);
              requiresMethodProcessing.visitInsn(IRETURN);
              requiresMethodProcessing.visitMaxs(1, 1);
              requiresMethodProcessing.visitEnd();
          }
  
          constructorVisitor.visitInsn(RETURN);
          constructorVisitor.visitMaxs(DEFAULT_MAX_STACK, 1);
          if (buildMethodVisitor != null) {
              buildMethodVisitor.visitInsn(ARETURN);
              buildMethodVisitor.visitMaxs(DEFAULT_MAX_STACK, buildMethodLocalCount);
          }
          if (injectMethodVisitor != null) {
              injectMethodVisitor.visitMaxs(DEFAULT_MAX_STACK, injectMethodLocalCount);
          }
          if (postConstructMethodVisitor != null) {
              postConstructMethodVisitor.visitVarInsn(ALOAD, postConstructInstanceIndex);
              postConstructMethodVisitor.visitInsn(ARETURN);
              postConstructMethodVisitor.visitMaxs(DEFAULT_MAX_STACK, postConstructMethodLocalCount);
          }
          if (preDestroyMethodVisitor != null) {
              preDestroyMethodVisitor.visitVarInsn(ALOAD, preDestroyInstanceIndex);
              preDestroyMethodVisitor.visitInsn(ARETURN);
              preDestroyMethodVisitor.visitMaxs(DEFAULT_MAX_STACK, preDestroyMethodLocalCount);
          }
  
          for (GeneratorAdapter method : loadTypeMethods.values()) {
              method.visitMaxs(3, 1);
              method.visitEnd();
          }
          classWriter.visitEnd();
          this.beanFinalized = true;
      }