code: @Override
      public byte[] transform(ClassLoader loader,
                              String className,
                              Class<?> classBeingRedefined,
                              ProtectionDomain protectionDomain,
                              byte[] classfileBuffer) throws IllegalClassFormatException {
          byte[] transformedBytes = providerClassTransformer.transform(loader, className, classBeingRedefined, protectionDomain, classfileBuffer);
  
          try {
              // Capture bytecode to disk if capturing is enabled and if a transformation has occurred.
              // The transform() method contract states a return value of null indicates no transformation.
              // We check the returned byte array just in case the JPA Implementation violates that contract.
              if (captureEnabled && transformedBytes != null) {
                  File saveFile = new File(captureRootDir, className.replace('.', '/') + ".class");
                  File targetDir = saveFile.getParentFile();
  
                  if (mkdirs(targetDir)) {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "Capturing enhanced Entity Class bytecode to " + saveFile.getAbsolutePath());
                      }
  
                      writeCapturedEnhancedBytecode(saveFile, transformedBytes);
                  } else {
                      // Couldn't create the target directory
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "Failed to create capture directory " + targetDir.getAbsolutePath());
                      }
                  }
              }
          } catch (Throwable t) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Caught unexpected Exception while capturing " + className + ".", t);
              }
          }
  
          return transformedBytes;
      }
docs: /*
  (non-Javadoc)
  
  @see javax.persistence.spi.ClassTransformer#transform(java.lang.ClassLoader, java.lang.String, java.lang.Class, java.security.ProtectionDomain, byte[])