Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed Apr 6, 2022
1 parent 28e377f commit bd435b0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ protected TypePool.Resolution doCache(String name, TypePool.Resolution resolutio
protected TypePool.Resolution doResolve(String name) {
TypePool.Resolution resolution = cacheProvider.find(name);
if (resolution == null) {
// calling super.doDescribe that will locate the class bytes and parse them unlike
// doDescribe in this class that returns a lazy resolution without parsing the class bytes
resolution = cacheProvider.register(name, super.doDescribe(name));
}
return resolution;
Expand Down Expand Up @@ -419,10 +421,11 @@ public Generic getSuperClass() {
String superName = superClassDescription.getTypeName();
Class<?> superClass = findLoadedClass(classLoader, superName);
if (superClass != null) {
// here we use raw type and loose generic info
// we don't expect to have matchers that would use the generic info
superClassDescription = newTypeDescription(superClass).asGenericType();
}
}
// using raw type
cachedSuperClass = superClassDescription;
}
return cachedSuperClass;
Expand All @@ -436,12 +439,13 @@ public TypeList.Generic getInterfaces() {
TypeList.Generic interfaces = delegate().getInterfaces();
ClassLoader classLoader = classLoaderRef.get();
if (canUseFindLoadedClass() && classLoader != null && !interfaces.isEmpty()) {
// here we use raw types and loose generic info
// we don't expect to have matchers that would use the generic info
List<TypeDescription> result = new ArrayList<>();
for (Generic interfaceDescription : interfaces) {
String interfaceName = interfaceDescription.getTypeName();
Class<?> interfaceClass = findLoadedClass(classLoader, interfaceName);
if (interfaceClass != null) {
// using raw type
result.add(newTypeDescription(interfaceClass));
} else {
result.add(interfaceDescription.asErasure());
Expand Down

0 comments on commit bd435b0

Please sign in to comment.