IDEA-79048 (False positive 'collection queried but never updated' report)

This commit is contained in:
Bas Leijdekkers
2011-12-21 15:20:18 +01:00
parent c1052a3736
commit 8fdcb6e59b
2 changed files with 14 additions and 3 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2010 Dave Griffith, Bas Leijdekkers
* Copyright 2003-2011 Dave Griffith, Bas Leijdekkers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -73,10 +73,10 @@ class VariableAssignedVisitor extends JavaRecursiveElementVisitor {
if (assigned) {
return;
}
super.visitPrefixExpression(prefixExpression);
if (!checkUnaryExpressions) {
return;
}
super.visitPrefixExpression(prefixExpression);
final IElementType tokenType = prefixExpression.getOperationTokenType();
if (!tokenType.equals(JavaTokenType.PLUSPLUS) &&
!tokenType.equals(JavaTokenType.MINUSMINUS)) {
@@ -94,10 +94,10 @@ class VariableAssignedVisitor extends JavaRecursiveElementVisitor {
if (assigned) {
return;
}
super.visitPostfixExpression(postfixExpression);
if (!checkUnaryExpressions) {
return;
}
super.visitPostfixExpression(postfixExpression);
final IElementType tokenType = postfixExpression.getOperationTokenType();
if (!tokenType.equals(JavaTokenType.PLUSPLUS) &&
!tokenType.equals(JavaTokenType.MINUSMINUS)) {
@@ -166,4 +166,15 @@ public class MismatchedCollectionQueryUpdate {
for (final String value : ourValues) {}
}
}
private void updateAttachmentWarning(final String message) {
final List<String> includedAttachments;
if (message instanceof Object &&
!(includedAttachments = boo()).isEmpty()) {
if (includedAttachments.size() == 1) {
}
}
}
List<String> boo() {return null;}
}