protected void loadClassDependencies(Class aClass) throws ClassNotFoundException {
    String name = aClass.getName();
    if (myVisited.add(aClass)) {
      try {
        for (Method method : aClass.getDeclaredMethods()) {
          loadTypeDependencies(method.getGenericReturnType());
          for (Type type : method.getGenericExceptionTypes()) {
            loadTypeDependencies(type);
          }
          for (Type type : method.getGenericParameterTypes()) {
            loadTypeDependencies(type);
          }
          for (Annotation[] annotations : method.getParameterAnnotations()) {
            loadAnnotationAttributes(annotations);
          }
        }
        for (Constructor method : aClass.getDeclaredConstructors()) {
          for (Type type : method.getGenericExceptionTypes()) {
            loadTypeDependencies(type);
          }
          for (Type type : method.getGenericParameterTypes()) {
            loadTypeDependencies(type);
          }
          for (Annotation[] annotations : method.getParameterAnnotations()) {
            loadAnnotationAttributes(annotations);
          }
        }

        for (Field field : aClass.getDeclaredFields()) {
          loadTypeDependencies(field.getGenericType());
          loadAnnotationAttributes(field.getDeclaredAnnotations());
        }

        Type superclass = aClass.getGenericSuperclass();
        if (superclass != null) {
          loadClassDependencies(aClass);
        }

        for (Type intf : aClass.getGenericInterfaces()) {
          loadTypeDependencies(intf);
        }

        loadAnnotationAttributes(aClass.getAnnotations());
        Package aPackage = aClass.getPackage();
        if (aPackage != null) {
          loadAnnotationAttributes(aPackage.getAnnotations());
        }
      }
      catch (Error e) {
        myVisited.remove(aClass);
        //noinspection InstanceofCatchParameter
        if (e instanceof LinkageError) {
          throw new ClassNotFoundException(name, e);
        }
        throw e;
      }
      catch (RuntimeException e) {
        myVisited.remove(aClass);
        //noinspection InstanceofCatchParameter
        if (e instanceof TypeNotPresentException) {
          throw new ClassNotFoundException(name, e);
        }
        throw e;
      }
    }
  }
protected void loadClassDependencies(Class aClass)