Issue #1566: partial fix of ReturnCount violations
This commit is contained in:
parent
f981e58454
commit
98a3157200
|
|
@ -260,6 +260,7 @@ public class IllegalInstantiationCheck
|
|||
* @return value of illegal instatiated type
|
||||
*/
|
||||
private String checkImportStatements(String className) {
|
||||
String illegalType = null;
|
||||
// import statements
|
||||
for (FullIdent importLineText : imports) {
|
||||
final String importArg = importLineText.getText();
|
||||
|
|
@ -270,17 +271,19 @@ public class IllegalInstantiationCheck
|
|||
// assume that illegalInsts only contain existing classes
|
||||
// or else we might create a false alarm here
|
||||
if (illegalClasses.contains(fqClass)) {
|
||||
return fqClass;
|
||||
illegalType = fqClass;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (CommonUtils.baseClassname(importArg).equals(className)
|
||||
&& illegalClasses.contains(importArg)) {
|
||||
return importArg;
|
||||
illegalType = importArg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return illegalType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue