@ -333,7 +333,12 @@ public class ClassTypeResolver extends JavaParserVisitorAdapter {
|
|||||||
if (isMemberVisibleFromClass(typeToSearch.getType(), field.getModifiers(), accessingClass)) {
|
if (isMemberVisibleFromClass(typeToSearch.getType(), field.getModifiers(), accessingClass)) {
|
||||||
return typeToSearch.resolveTypeDefinition(field.getGenericType());
|
return typeToSearch.resolveTypeDefinition(field.getGenericType());
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException e) { /* swallow */ }
|
} catch (final NoSuchFieldException ignored) {
|
||||||
|
// swallow
|
||||||
|
} catch (final NoClassDefFoundError e) {
|
||||||
|
// TODO : report a missing class once we start doing that...
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// transform the type into it's supertype
|
// transform the type into it's supertype
|
||||||
typeToSearch = typeToSearch.resolveTypeDefinition(typeToSearch.getType().getGenericSuperclass());
|
typeToSearch = typeToSearch.resolveTypeDefinition(typeToSearch.getType().getGenericSuperclass());
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
package net.sourceforge.pmd.typeresolution;
|
package net.sourceforge.pmd.typeresolution;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertSame;
|
import static org.junit.Assert.assertSame;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user