code: public Class<?> findLoadedOrDefineClass(ClassLoader classLoader, String className, byte[] classbytes)
      {
          Class<?> klass = findLoadedClass(classLoader, className);
          if (klass == null)
          {
              try
              {
                  klass = defineClass(classLoader, className, classbytes);
              } catch (LinkageError ex)
              {
                  klass = findLoadedClass(classLoader, className);
                  if (klass == null)
                  {
                      throw ex;
                  }
              }
          }
  
          return klass;
      }
docs: Return {@link ClassLoader#defineClass} with a PermissionCollection containing AllPermission.
  This method searches for a class and returns it. If it's not found, it's defined.
  
  @param classLoader the class loader
  @param className the class name
  @param classbytes the class bytes
  @return the class
  @throws LinkageError if a class is defined twice within the given class loader
  @throws ClassFormatError if the bytes passed in are invalid