diff options
Diffstat (limited to 'plugins/IntentionPowerPak')
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() { |