diff --git a/src/main/java/de/thetaphi/forbiddenapis/Checker.java b/src/main/java/de/thetaphi/forbiddenapis/Checker.java
index cb90abc5..83b200e4 100644
--- a/src/main/java/de/thetaphi/forbiddenapis/Checker.java
+++ b/src/main/java/de/thetaphi/forbiddenapis/Checker.java
@@ -444,8 +444,11 @@ boolean checkType(Type type) {
while (type != null) {
switch (type.getSort()) {
case Type.OBJECT:
- // don't check superclasses (TODO: investigate):
- return checkClassUse(type.getInternalName());
+ if (checkClassUse(type.getInternalName())) {
+ return true;
+ }
+ final ClassSignatureLookup c = lookupRelatedClass(type.getInternalName());
+ return (c != null && checkClassDefinition(c.superName, c.interfaces));
case Type.ARRAY:
type = type.getElementType();
break;
diff --git a/src/test/antunit/Java5ClassReferences.class b/src/test/antunit/Java5ClassReferences.class
index 8ecd75b7..9a254cfd 100644
Binary files a/src/test/antunit/Java5ClassReferences.class and b/src/test/antunit/Java5ClassReferences.class differ
diff --git a/src/test/antunit/Java5ClassReferences.java b/src/test/antunit/Java5ClassReferences.java
index de93421a..c2db010b 100644
--- a/src/test/antunit/Java5ClassReferences.java
+++ b/src/test/antunit/Java5ClassReferences.java
@@ -17,6 +17,8 @@
/* The binary class file is packaged together with the source distribution.
*/
+import java.util.*;
+
class Java5ClassReferences {
static Integer[][] test() {
Integer.class.getName();
@@ -28,4 +30,9 @@ static Integer[][] test() {
private Integer field1;
private final Integer[] field2 = null;
+
+ // we forbid the superclass or interface, but concrete instance is used:
+ public List> list1;
+ public ArrayList> list2;
+ public HashSet> set1;
}
diff --git a/src/test/antunit/TestClassReferences.xml b/src/test/antunit/TestClassReferences.xml
index 7b82ef8e..92d5fd5b 100644
--- a/src/test/antunit/TestClassReferences.xml
+++ b/src/test/antunit/TestClassReferences.xml
@@ -21,10 +21,13 @@
java.lang.Integer @ Forbidden class reference!
+ java.util.List @ Forbidden class reference!
+ java.util.AbstractCollection @ Forbidden class reference!
+ java.util.AbstractSet @ Forbidden class reference!
-
+
\ No newline at end of file