c;
}
'''
}
diff --git a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterWrapTest.java b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterWrapTest.java
index d59ef95a4621..4482dd7985ae 100644
--- a/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterWrapTest.java
+++ b/java/java-tests/testSrc/com/intellij/psi/formatter/java/JavaFormatterWrapTest.java
@@ -15,11 +15,14 @@
*/
package com.intellij.psi.formatter.java;
+import com.intellij.idea.Bombed;
import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
+import java.util.Calendar;
+
/**
* Is intended to hold specific java formatting tests for 'wrapping' settings.
*
@@ -242,6 +245,7 @@ public class JavaFormatterWrapTest extends AbstractJavaFormatterTest {
);
}
+ @Bombed(user = "Roman Shevchenko", year = 2014, month = Calendar.MARCH, day = 14)
public void testWrapMethodAnnotationBeforeParams() {
// Inspired by IDEA-59536
getSettings().getRootSettings().RIGHT_MARGIN = 90;
@@ -251,8 +255,7 @@ public class JavaFormatterWrapTest extends AbstractJavaFormatterTest {
doClassTest(
"@SuppressWarnings({\"SomeInspectionIWantToIgnore\"}) public void doSomething(int x, int y) {}",
"@SuppressWarnings({\"SomeInspectionIWantToIgnore\"})\n" +
- "public void doSomething(int x, int y) {" +
- "\n}"
+ "public void doSomething(int x, int y) {\n}"
);
}
@@ -399,4 +402,34 @@ public class JavaFormatterWrapTest extends AbstractJavaFormatterTest {
doMethodTest(before, after);
}
+
+ public void testFieldAnnotationWithoutModifier() {
+ doClassTest("@NotNull String myFoo = null;", "@NotNull\nString myFoo = null;");
+ }
+
+ public void testTypeAnnotationsInModifierList() {
+ getSettings().getRootSettings().FORMATTER_TAGS_ENABLED = true;
+
+ String prefix =
+ "import java.lang.annotation.*;\n\n" +
+ "//@formatter:off\n" +
+ "@interface A { }\n" +
+ "@Target({ElementType.TYPE_USE}) @interface TA { int value() default 0; }\n" +
+ "//@formatter:on\n\n";
+
+ doTextTest(
+ prefix + "interface C {\n" +
+ " @TA(0)String m();\n" +
+ " @A @TA(1) @TA(2)String m();\n" +
+ " @A public @TA String m();\n" +
+ "}",
+
+ prefix + "interface C {\n" +
+ " @TA(0) String m();\n\n" +
+ " @A\n" +
+ " @TA(1) @TA(2) String m();\n\n" +
+ " @A\n" +
+ " public @TA String m();\n" +
+ "}");
+ }
}
diff --git a/java/java-tests/testSrc/com/intellij/refactoring/WrapReturnValueTest.java b/java/java-tests/testSrc/com/intellij/refactoring/WrapReturnValueTest.java
index 1b0d7f1072fd..01c5907754f1 100644
--- a/java/java-tests/testSrc/com/intellij/refactoring/WrapReturnValueTest.java
+++ b/java/java-tests/testSrc/com/intellij/refactoring/WrapReturnValueTest.java
@@ -13,11 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-/*
- * User: anna
- * Date: 20-Aug-2008
- */
package com.intellij.refactoring;
import com.intellij.openapi.vfs.VirtualFile;
@@ -30,7 +25,10 @@ import com.intellij.JavaTestUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
-public class WrapReturnValueTest extends MultiFileTestCase{
+/**
+ * @author anna
+ */
+public class WrapReturnValueTest extends MultiFileTestCase {
@Override
protected String getTestDataPath() {
return JavaTestUtil.getJavaTestDataPath();
@@ -42,39 +40,43 @@ public class WrapReturnValueTest extends MultiFileTestCase{
return "/refactoring/wrapReturnValue/";
}
- private void doTest(final boolean existing) throws Exception {
+ public void testSimple() { doTest(false); }
+ public void testGenerics() { doTest(false); }
+ public void testInconsistentWrapper() { doTest(true, "Existing class does not have getter for selected field"); }
+ public void testWrapper() { doTest(true); }
+ public void testStrip() { doTest(true); }
+ public void testNoConstructor() { doTest(true, "Existing class does not have appropriate constructor"); }
+ public void testInnerClass() { doTest(false, null, true); }
+ public void testHierarchy() { doTest(false, null, true); }
+ public void testAnonymous() { doTest(true, null, false); }
+ public void testWrongFieldAssignment() { doTest(true, "Existing class does not have appropriate constructor", false); }
+ public void testWrongFieldType() { doTest(true, "Existing class does not have appropriate constructor", false); }
+ public void testStaticMethodInnerClass() { doTest(false, null, true); }
+ public void testRawReturnType() { doTest(true, "Existing class does not have appropriate constructor"); }
+ public void testReturnInsideLambda() { doTest(false, null, true); }
+ public void testTypeAnnotations() { doTest(false); }
+
+ private void doTest(final boolean existing) {
doTest(existing, null);
}
- private void doTest(final boolean existing, @NonNls String exceptionMessage) throws Exception {
+ private void doTest(final boolean existing, @NonNls String exceptionMessage) {
doTest(existing, exceptionMessage, false);
}
- private void doTest(final boolean existing, String exceptionMessage, final boolean createInnerClass) throws Exception {
+ private void doTest(final boolean existing, String exceptionMessage, final boolean createInnerClass) {
try {
doTest(new PerformAction() {
@Override
- public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
+ public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) {
PsiClass aClass = myJavaFacade.findClass("Test", GlobalSearchScope.projectScope(getProject()));
-
assertNotNull("Class Test not found", aClass);
-
- final PsiMethod method = aClass.findMethodsByName("foo", false)[0];
-
-
-
- @NonNls final String wrapperClassName = "Wrapper";
-
- final PsiClass wrapperClass = myJavaFacade.findClass(wrapperClassName, GlobalSearchScope.projectScope(getProject()));
-
+ PsiMethod method = aClass.findMethodsByName("foo", false)[0];
+ String wrapperClassName = "Wrapper";
+ PsiClass wrapperClass = myJavaFacade.findClass(wrapperClassName, GlobalSearchScope.projectScope(getProject()));
assertTrue(!existing || wrapperClass != null);
- final PsiField delegateField = existing ? wrapperClass.findFieldByName("myField", false) : null;
- WrapReturnValueProcessor processor = new WrapReturnValueProcessor(wrapperClassName, "",
- null, method, existing, createInnerClass,
- delegateField);
- processor.run();
- /*LocalFileSystem.getInstance().refresh(false);
- FileDocumentManager.getInstance().saveAllDocuments();*/
+ PsiField delegateField = existing ? wrapperClass.findFieldByName("myField", false) : null;
+ new WrapReturnValueProcessor(wrapperClassName, "", null, method, existing, createInnerClass, delegateField).run();
}
});
}
@@ -89,61 +91,4 @@ public class WrapReturnValueTest extends MultiFileTestCase{
fail("Conflict was not found");
}
}
-
- public void testSimple() throws Exception {
- doTest(false);
- }
-
- public void testGenerics() throws Exception {
- doTest(false);
- }
-
- public void testInconsistentWrapper() throws Exception {
- doTest(true, "Existing class does not have getter for selected field");
- }
-
- public void testWrapper() throws Exception {
- doTest(true);
- }
-
- public void testStrip() throws Exception {
- doTest(true);
- }
-
- public void testNoConstructor() throws Exception {
- doTest(true, "Existing class does not have appropriate constructor");
- }
-
- public void testInnerClass() throws Exception {
- doTest(false, null, true);
- }
-
- public void testHierarchy() throws Exception {
- doTest(false, null, true);
- }
-
- public void testAnonymous() throws Exception {
- doTest(true, null, false);
- }
-
- public void testWrongFieldAssignment() throws Exception {
- doTest(true, "Existing class does not have appropriate constructor", false);
- }
-
- public void testWrongFieldType() throws Exception {
- doTest(true, "Existing class does not have appropriate constructor", false);
- }
-
- public void testStaticMethodInnerClass() throws Exception {
- doTest(false, null, true);
- }
-
- public void testRawReturnType() throws Exception {
- doTest(true, "Existing class does not have appropriate constructor");
- }
-
- public void testReturnInsideLambda() throws Exception {
- doTest(false, null, true);
- }
-
}
\ No newline at end of file
diff --git a/lib/ecj-4.2.1.jar b/lib/ecj-4.2.1.jar
deleted file mode 100644
index 8323c71b02df..000000000000
Binary files a/lib/ecj-4.2.1.jar and /dev/null differ
diff --git a/lib/ecj-4.3.2.jar b/lib/ecj-4.3.2.jar
new file mode 100644
index 000000000000..fd4c47a47e9e
Binary files /dev/null and b/lib/ecj-4.3.2.jar differ
diff --git a/lib/required_for_dist.txt b/lib/required_for_dist.txt
index 2172a82609da..9e98e00da837 100644
--- a/lib/required_for_dist.txt
+++ b/lib/required_for_dist.txt
@@ -12,7 +12,7 @@ httpcore-4.3.1.jar
httpclient-4.3.2.jar
fluent-hc-4.3.2.jar
httpmime-4.3.2.jar
-ecj-4.2.1.jar
+ecj-4.3.2.jar
groovy-all-2.2.1.jar
gson-2.2.4.jar
guava-14.0.1.jar
diff --git a/lib/src/ecjsrc-4.2.1.jar b/lib/src/ecjsrc-4.2.1.jar
deleted file mode 100644
index d16f20f55d93..000000000000
Binary files a/lib/src/ecjsrc-4.2.1.jar and /dev/null differ
diff --git a/lib/src/ecjsrc-4.3.2.jar b/lib/src/ecjsrc-4.3.2.jar
new file mode 100644
index 000000000000..5d54db8bb843
Binary files /dev/null and b/lib/src/ecjsrc-4.3.2.jar differ
diff --git a/platform/lang-api/src/com/intellij/formatting/Wrap.java b/platform/lang-api/src/com/intellij/formatting/Wrap.java
index c8eaca99f366..1dc14ac3fe5e 100644
--- a/platform/lang-api/src/com/intellij/formatting/Wrap.java
+++ b/platform/lang-api/src/com/intellij/formatting/Wrap.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -22,7 +22,6 @@ package com.intellij.formatting;
*
* @see com.intellij.formatting.Block#getWrap()
*/
-
public abstract class Wrap {
/**
* Converts a low-priority wrap setting to a regular wrap setting.
@@ -32,29 +31,20 @@ public abstract class Wrap {
private static WrapFactory myFactory;
- /**
- * @deprecated use {@link WrapType#ALWAYS} instead
- */
- @Deprecated
+ /** @deprecated use {@link WrapType#ALWAYS} (to remove in IDEA 14) */
+ @SuppressWarnings({"UnusedDeclaration"})
public static WrapType ALWAYS = WrapType.ALWAYS;
- /**
- * @deprecated use {@link WrapType#NORMAL} instead
- */
- @Deprecated
+ /** @deprecated use {@link WrapType#NORMAL} (to remove in IDEA 14) */
+ @SuppressWarnings({"UnusedDeclaration"})
public static WrapType NORMAL = WrapType.NORMAL;
- /**
- * @deprecated use {@link WrapType#NONE} instead
- */
- @Deprecated
+ /** @deprecated use {@link WrapType#NONE} (to remove in IDEA 14) */
+ @SuppressWarnings({"UnusedDeclaration"})
public static WrapType NONE = WrapType.NONE;
- /**
- * @deprecated use {@link WrapType#CHOP_DOWN_IF_LONG} instead
- */
+ /** @deprecated use {@link WrapType#CHOP_DOWN_IF_LONG} (to remove in IDEA 14) */
@SuppressWarnings({"UnusedDeclaration"})
- @Deprecated
public static WrapType CHOP_DOWN_IF_LONG = WrapType.CHOP_DOWN_IF_LONG;
static void setFactory(WrapFactory factory) {
@@ -82,7 +72,7 @@ public abstract class Wrap {
*
* Example:
*
- * |
+ * |
* foo(123, 4|56
* |
* | <- right margin
@@ -121,10 +111,9 @@ public abstract class Wrap {
* @param wrapFirstElement if true, the first element in a sequence of elements of the same type
* is also wrapped.
* @return the wrap setting instance.
- * @see #ignoreParentWraps()
+ * @see #ignoreParentWraps()
*/
public static Wrap createChildWrap(final Wrap parentWrap, final WrapType wrapType, final boolean wrapFirstElement) {
- return myFactory.createChildWrap(parentWrap, wrapType, wrapFirstElement);
+ return myFactory.createChildWrap(parentWrap, wrapType, wrapFirstElement);
}
-
}
diff --git a/platform/lang-api/src/com/intellij/formatting/WrapFactory.java b/platform/lang-api/src/com/intellij/formatting/WrapFactory.java
index 57c25a73673e..ff5026025a45 100644
--- a/platform/lang-api/src/com/intellij/formatting/WrapFactory.java
+++ b/platform/lang-api/src/com/intellij/formatting/WrapFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -19,7 +19,7 @@ package com.intellij.formatting;
* Internal interface for creating wrap setting instances.
*/
interface WrapFactory {
- public Wrap createWrap(WrapType type, boolean wrapFirstElement);
+ Wrap createWrap(WrapType type, boolean wrapFirstElement);
- public Wrap createChildWrap(final Wrap parentWrap, final WrapType wrapType, final boolean wrapFirstElement);
+ Wrap createChildWrap(Wrap parentWrap, WrapType wrapType, boolean wrapFirstElement);
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java
index f77589143856..1729dc94b93c 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java
@@ -18,31 +18,15 @@ package com.intellij.openapi.keymap.impl;
public class ShortcutRestrictions {
public static final ShortcutRestrictions NO_RESTRICTIONS = new ShortcutRestrictions(true, true, true, true);
- private final boolean myAllowMouseShortcut;
- private final boolean myAllowMouseDoubleClick;
- private final boolean myAllowKeyboardShortcut;
- private final boolean myAllowAbbreviation;
+ public final boolean allowMouseShortcut;
+ public final boolean allowMouseDoubleClick;
+ public final boolean allowKeyboardShortcut;
+ public final boolean allowAbbreviation;
public ShortcutRestrictions(boolean allowMouseShortcut, boolean allowMouseDoubleClick, boolean allowKeyboardShortcut, boolean allowAbbreviation) {
- myAllowMouseShortcut = allowMouseShortcut;
- myAllowMouseDoubleClick = allowMouseDoubleClick;
- myAllowKeyboardShortcut = allowKeyboardShortcut;
- myAllowAbbreviation = allowAbbreviation;
- }
-
- public boolean allowMouseShortcut() {
- return myAllowMouseShortcut;
- }
-
- public boolean allowMouseDoubleClick() {
- return myAllowMouseDoubleClick;
- }
-
- public boolean allowKeyboardShortcut() {
- return myAllowKeyboardShortcut;
- }
-
- public boolean allowAbbreviation() {
- return myAllowAbbreviation;
+ this.allowMouseShortcut = allowMouseShortcut;
+ this.allowMouseDoubleClick = allowMouseDoubleClick;
+ this.allowKeyboardShortcut = allowKeyboardShortcut;
+ this.allowAbbreviation = allowAbbreviation;
}
}
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java
index 03881edc628b..7756d8b401dd 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java
@@ -961,7 +961,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
final ShortcutRestrictions restrictions = ActionShortcutRestrictions.getForActionId(actionId);
- if (restrictions.allowKeyboardShortcut()) {
+ if (restrictions.allowKeyboardShortcut) {
group.add(new DumbAwareAction("Add Keyboard Shortcut") {
@Override
public void actionPerformed(AnActionEvent e) {
@@ -978,7 +978,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
});
}
- if (restrictions.allowMouseShortcut()) {
+ if (restrictions.allowMouseShortcut) {
group.add(new DumbAwareAction("Add Mouse Shortcut") {
@Override
public void actionPerformed(AnActionEvent e) {
@@ -994,7 +994,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi
});
}
- if (Registry.is("actionSystem.enableAbbreviations") && restrictions.allowAbbreviation()) {
+ if (Registry.is("actionSystem.enableAbbreviations") && restrictions.allowAbbreviation) {
group.add(new DumbAwareAction("Add Abbreviation") {
@Override
public void actionPerformed(AnActionEvent e) {
diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java
index 4a137f7b013c..92db22ea1f48 100644
--- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java
+++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/MouseShortcutDialog.java
@@ -101,7 +101,7 @@ class MouseShortcutDialog extends DialogWrapper{
myModifiers=-1;
}
- myRbDoubleClick.setEnabled(restrictions.allowMouseDoubleClick());
+ myRbDoubleClick.setEnabled(restrictions.allowMouseDoubleClick);
updatePreviewAndConflicts();