summaryrefslogtreecommitdiff
path: root/plugins/IntentionPowerPak
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2013-02-08 15:14:04 -0800
committerJean-Baptiste Queru <jbq@google.com>2013-02-08 15:14:04 -0800
commit9edc8f6b58f71ec510ba36b838f115718d9a174d (patch)
tree06f6df92024fa534ff27e1c0b5fc8b2002848093 /plugins/IntentionPowerPak
parentb56ea2a18f232d79481e778085fd64e8ae486fc3 (diff)
downloadidea-9edc8f6b58f71ec510ba36b838f115718d9a174d.tar.gz
Snapshot of commit 84dc01e773388c2c72a1fc437f313dd5747e7809
from branch master of git://git.jetbrains.org/idea/community.git
Diffstat (limited to 'plugins/IntentionPowerPak')
-rw-r--r--plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java4
-rw-r--r--plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/ParenthesesUtils.java3
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/SimplePrecedence.java11
-rw-r--r--plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/parenthesis/UnnecessaryParenthesesIntentionTest.java1
4 files changed, 15 insertions, 4 deletions
diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java
index 767d3481bb93..cdde20ef83e6 100644
--- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java
+++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/modifiers/ModifierIntention.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2013 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.
@@ -94,7 +94,7 @@ abstract class ModifierIntention extends Intention implements LowPriorityAction
final String name = FileUtil.getNameWithoutExtension(javaFile.getName());
final String className = aClass.getName();
if (name.equals(className)) {
- MultiMap.emptyInstance();
+ return MultiMap.emptyInstance();
}
final MultiMap<PsiElement, String> conflicts = new MultiMap();
conflicts.putValue(aClass, IntentionPowerPackBundle.message(
diff --git a/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/ParenthesesUtils.java b/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/ParenthesesUtils.java
index 67b5f539a39d..b4d97f52687d 100644
--- a/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/ParenthesesUtils.java
+++ b/plugins/IntentionPowerPak/src/com/siyeh/ipp/psiutils/ParenthesesUtils.java
@@ -455,8 +455,7 @@ public class ParenthesesUtils {
return true;
}
}
- return false;
}
- return parentPrecedence != childPrecedence;
+ return parentPrecedence < childPrecedence;
}
}
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/SimplePrecedence.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/SimplePrecedence.java
new file mode 100644
index 000000000000..c2bfc6529b8a
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/parentheses/SimplePrecedence.java
@@ -0,0 +1,11 @@
+package com.siyeh.ipp.parentheses;
+class Inversion {
+ public void context(boolean a, boolean b, boolean c) {
+ if ((!a || <caret>!b) && !c) {
+ System.out.println(1);
+ }
+ else {
+ System.out.println(0);
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/parenthesis/UnnecessaryParenthesesIntentionTest.java b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/parenthesis/UnnecessaryParenthesesIntentionTest.java
index 77bc9e5abede..720442fc883d 100644
--- a/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/parenthesis/UnnecessaryParenthesesIntentionTest.java
+++ b/plugins/IntentionPowerPak/testSrc/com/siyeh/ipp/parenthesis/UnnecessaryParenthesesIntentionTest.java
@@ -17,6 +17,7 @@ public class UnnecessaryParenthesesIntentionTest extends IPPTestCase {
public void testNotCommutative2() { doTest(); }
public void testArrayInitializer() { doTest(); }
public void testArrayAccessExpression() { doTest(); }
+ public void testSimplePrecedence() { assertIntentionNotAvailable(); }
@Override
protected String getRelativePath() {