do not warn about default deprecated constructor for anonymous classes which use non-deprecated constructors

This commit is contained in:
anna
2012-02-21 10:37:22 +01:00
parent c1fc540869
commit 4a999d8fa2
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -150,6 +150,10 @@ public class DeprecationInspection extends BaseJavaLocalInspectionTool {
assert containingClass != null;
final PsiClass superClass = containingClass.getSuperClass();
if (hasDefaultDeprecatedConstructor(superClass)) {
if (superClass instanceof PsiAnonymousClass) {
final PsiExpressionList argumentList = ((PsiAnonymousClass)superClass).getArgumentList();
if (argumentList != null && argumentList.getExpressions().length > 0) return;
}
final PsiCodeBlock body = method.getBody();
if (body != null) {
final PsiStatement[] statements = body.getStatements();