#1296 PMD UnusedPrivateMethod invalid detection of 'private void method(int,boolean,Integer...)'

This commit is contained in:
Andreas Dangel committed 2015-01-17 22:42:58 +01:00
1 parent 9d96d974de
commit 6b69174e24
3 files changed
+9

No files matched your search

@@ -10,6 +10,7 @@ import java.util.Map;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.ASTAllocationExpression;
import net.sourceforge.pmd.lang.java.ast.ASTArgumentList;
import net.sourceforge.pmd.lang.java.ast.ASTBooleanLiteral;
import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceBodyDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceType;
@@ -323,6 +324,8 @@ public class ClassScope extends AbstractJavaScope {
type = new SimpleTypedNameDeclaration("int", literal.getType());
} else if (literal.isLongLiteral()) {
type = new SimpleTypedNameDeclaration("long", literal.getType());
} else if (literal.jjtGetNumChildren() == 1 && literal.jjtGetChild(0) instanceof ASTBooleanLiteral) {
type = new SimpleTypedNameDeclaration("boolean", Boolean.TYPE);
}
} else if (child instanceof ASTAllocationExpression && child.jjtGetChild(0) instanceof ASTClassOrInterfaceType) {
ASTClassOrInterfaceType classInterface = (ASTClassOrInterfaceType)child.jjtGetChild(0);
@@ -1401,6 +1401,11 @@ public class UnusedPrivateMethod {
deleteAllAssetsWithExceptions(galleryId, false, exceptionList);
}
public void deleteAllAssetsWithExceptions(int galleryId, Integer... exceptionList) throws MediaServiceException
{
deleteAllAssetsWithExceptions(galleryId, true, exceptionList);
}
private void deleteAllAssetsWithExceptions(int galleryId, boolean purge, Integer... exceptionList) throws MediaServiceException
{
}
+1
View File
@@ -10,5 +10,6 @@
**Bugfixes:**
* [#1296](https://sourceforge.net/p/pmd/bugs/1296/): PMD UnusedPrivateMethod invalid detection of 'private void method(int,boolean,Integer...)'
* [#1298](https://sourceforge.net/p/pmd/bugs/1298/): Member variable int type with value 0xff000000 causes processing error
* [#1299](https://sourceforge.net/p/pmd/bugs/1299/): MethodReturnsInternalArray false positive