From 173fb106d4862559b78b0151bb2a93494d359184 Mon Sep 17 00:00:00 2001 From: Kirill Kalishev Date: Tue, 24 Nov 2009 16:12:58 +0300 Subject: [PATCH 01/26] macros: keycode input if unicode characters --- .../intellij/ide/actionMacro/ActionMacro.java | 78 +++++++++--- .../ide/actionMacro/ActionMacroManager.java | 4 +- .../openapi/ui/playback/PlaybackRunner.java | 6 +- .../commands/AlphaNumericTypeCommand.java | 5 +- .../playback/commands/KeyCodeTypeCommand.java | 112 ++++++++++++++++++ .../playback/commands/KeyShortcutCommand.java | 4 +- .../ui/playback/commands/KeyStokeMap.java | 36 ++++-- .../ui/playback/commands/TypeCommand.java | 27 ++++- 8 files changed, 233 insertions(+), 39 deletions(-) create mode 100644 platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java index 55175993432b..63a7ecc80c07 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java @@ -20,14 +20,14 @@ import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.actionSystem.EditorActionManager; import com.intellij.openapi.editor.actionSystem.TypedAction; -import com.intellij.openapi.util.InvalidDataException; -import com.intellij.openapi.util.JDOMExternalizable; -import com.intellij.openapi.util.WriteExternalException; -import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.ui.playback.commands.KeyCodeTypeCommand; +import com.intellij.openapi.ui.playback.commands.TypeCommand; +import com.intellij.openapi.util.*; import org.jdom.Element; import org.jetbrains.annotations.NonNls; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; @@ -50,6 +50,8 @@ public class ActionMacro implements JDOMExternalizable { @NonNls private static final String ATTRIBUTE_TEXT = "text"; @NonNls + private static final String ATTRIBUTE_KEY_CODES = "text-keycode"; + @NonNls private static final String ELEMENT_ACTION = "action"; @NonNls private static final String ATTRIBUTE_ID = "id"; @@ -80,7 +82,8 @@ public class ActionMacro implements JDOMExternalizable { for (Iterator iterator = actions.iterator(); iterator.hasNext();) { Element action = (Element)iterator.next(); if (ELEMENT_TYPING.equals(action.getName())) { - myActions.add(new TypedDescriptor(action.getAttributeValue(ATTRIBUTE_TEXT))); + Pair, List> codes = parseKeyCodes(action.getAttributeValue(ATTRIBUTE_KEY_CODES)); + myActions.add(new TypedDescriptor(action.getAttributeValue(ATTRIBUTE_TEXT), codes.getFirst(), codes.getSecond())); } else if (ELEMENT_ACTION.equals(action.getName())) { myActions.add(new IdActionDescriptor(action.getAttributeValue(ATTRIBUTE_ID))); @@ -90,6 +93,14 @@ public class ActionMacro implements JDOMExternalizable { } } + private Pair, List> parseKeyCodes(String keyCodesText) { + return KeyCodeTypeCommand.parseKeyCodes(keyCodesText); + } + + public String unparseKeyCodes(Pair, List> keyCodes) { + return KeyCodeTypeCommand.unparseKeyCodes(keyCodes); + } + public void writeExternal(Element macro) throws WriteExternalException { macro.setAttribute(ATTRIBUTE_NAME, myName); final ActionDescriptor[] actions = getActions(); @@ -98,8 +109,10 @@ public class ActionMacro implements JDOMExternalizable { Element actionNode = null; if (action instanceof TypedDescriptor) { actionNode = new Element(ELEMENT_TYPING); - final String t = ((TypedDescriptor)action).getText(); + TypedDescriptor typedDescriptor = (TypedDescriptor)action; + final String t = typedDescriptor.getText(); actionNode.setAttribute(ATTRIBUTE_TEXT, JDOMUtil.escapeText(t)); + actionNode.setAttribute(ATTRIBUTE_KEY_CODES, unparseKeyCodes(new Pair, List>(typedDescriptor.getKeyCodes(), typedDescriptor.getKeyModifiers()))); } else if (action instanceof IdActionDescriptor) { actionNode = new Element(ELEMENT_ACTION); @@ -161,13 +174,13 @@ public class ActionMacro implements JDOMExternalizable { myActions.add(new ShortcutActionDesciption(text)); } - public void appendKeytyped(char c) { + public void appendKeytyped(char c, int keyCode, int modifiers) { ActionDescriptor lastAction = myActions.size() > 0 ? myActions.get(myActions.size() - 1) : null; if (lastAction instanceof TypedDescriptor) { - ((TypedDescriptor)lastAction).addChar(c); + ((TypedDescriptor)lastAction).addChar(c, keyCode, modifiers); } else { - myActions.add(new TypedDescriptor(c)); + myActions.add(new TypedDescriptor(c, keyCode, modifiers)); } } @@ -184,18 +197,30 @@ public class ActionMacro implements JDOMExternalizable { } public static class TypedDescriptor implements ActionDescriptor { + private String myText; - public TypedDescriptor(String text) { + private List myKeyCodes = new ArrayList(); + private List myModifiers = new ArrayList(); + + public TypedDescriptor(String text, List keyCodes, List modifiers) { myText = text; + myKeyCodes.addAll(keyCodes); + myModifiers.addAll(modifiers); + + assert myKeyCodes.size() == myModifiers.size(); } - public TypedDescriptor(char c) { + public TypedDescriptor(char c, int keyCode, int modifiers) { myText = String.valueOf(c); + myKeyCodes.add(keyCode); + myModifiers.add(modifiers); } - public void addChar(char c) { + public void addChar(char c, int keyCode, int modifier) { myText = myText + c; + myKeyCodes.add(keyCode); + myModifiers.add(modifier); } public String getText() { @@ -203,7 +228,7 @@ public class ActionMacro implements JDOMExternalizable { } public Object clone() { - return new TypedDescriptor(myText); + return new TypedDescriptor(myText, myKeyCodes, myModifiers); } public boolean equals(Object o) { @@ -217,8 +242,23 @@ public class ActionMacro implements JDOMExternalizable { } public void generateTo(StringBuffer script) { - script.append(myText); - script.append("\n"); + if (TypeCommand.containsUnicode(myText)) { + script.append(KeyCodeTypeCommand.PREFIX).append(" "); + + for (int i = 0; i < myKeyCodes.size(); i++) { + Integer each = myKeyCodes.get(i); + script.append(each.toString()); + script.append(KeyCodeTypeCommand.MODIFIER_DELIMITER); + script.append(myModifiers.get(i)); + if (i < myKeyCodes.size() - 1) { + script.append(KeyCodeTypeCommand.CODE_DELIMITER); + } + } + script.append(" ").append(myText).append("\n"); + } else { + script.append(myText); + script.append("\n"); + } } public String toString() { @@ -233,6 +273,14 @@ public class ActionMacro implements JDOMExternalizable { typedAction.actionPerformed(editor, chars[i], context); } } + + public List getKeyCodes() { + return myKeyCodes; + } + + public List getKeyModifiers() { + return myModifiers; + } } public static class ShortcutActionDesciption implements ActionDescriptor { diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java index b32bea00fd66..4e8812500227 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java @@ -360,8 +360,8 @@ public class ActionMacroManager implements ExportableApplicationComponent, Named && e.getKeyCode() != KeyEvent.VK_META && e.getKeyCode() != KeyEvent.VK_SHIFT; - if (e.getID() == KeyEvent.KEY_TYPED && plainType && !isEnter) { - myRecordingMacro.appendKeytyped(e.getKeyChar()); + if (e.getID() == KeyEvent.KEY_PRESSED && plainType && !isEnter) { + myRecordingMacro.appendKeytyped(e.getKeyChar(), e.getKeyCode(), e.getModifiers()); } else if (e.getID() == KeyEvent.KEY_PRESSED && noModifierKeyIsPressed && (!plainType || isEnter)) { final boolean waiting = IdeEventQueue.getInstance().getKeyEventDispatcher().isWaitingForSecondKeyStroke(); if (!e.equals(myLastActionInputEvent) && !waiting) { diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java index 0027308deb4e..d04b434ad180 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/PlaybackRunner.java @@ -126,6 +126,10 @@ public class PlaybackRunner { return new EmptyCommand(line); } + if (actualString.startsWith(KeyCodeTypeCommand.PREFIX)) { + return new KeyCodeTypeCommand(string, line); + } + if (actualString.startsWith(DelayCommand.PREFIX)) { return new DelayCommand(string, line); } @@ -229,7 +233,7 @@ public class PlaybackRunner { } }); - new PlaybackRunner("%[comma]", new StatusCallback() { + new PlaybackRunner("%type", new StatusCallback() { public void error(String text, int currentLine) { System.out.println("Error: " + currentLine + " " + text); } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java index c0a034f9a1c2..be95759e4fa8 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java @@ -28,7 +28,10 @@ public class AlphaNumericTypeCommand extends TypeCommand { } public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { - final String text = getText(); + return type(robot, getText()); + } + + protected ActionCallback type(Robot robot, String text) { for (int i = 0; i < text.length(); i++) { final char each = text.charAt(i); if ('\\' == each && i + 1 < text.length()) { diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java new file mode 100644 index 000000000000..6b13ea242580 --- /dev/null +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java @@ -0,0 +1,112 @@ +/* + * Copyright 2000-2009 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.openapi.ui.playback.commands; + +import com.intellij.openapi.ui.playback.PlaybackRunner; +import com.intellij.openapi.util.ActionCallback; +import com.intellij.openapi.util.Pair; + +import java.awt.*; +import java.awt.List; +import java.util.*; + +public class KeyCodeTypeCommand extends AlphaNumericTypeCommand { + + public static final String PREFIX = CMD_PREFIX + "type"; + public static final String CODE_DELIMITER = ";"; + public static final String MODIFIER_DELIMITER = ":"; + + public KeyCodeTypeCommand(String text, int line) { + super(text, line); + } + + @Override + public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + String text = getText().substring(PREFIX.length()).trim(); + + int textDelim = text.indexOf(" "); + + String codes; + if (textDelim >= 0) { + codes = text.substring(0, textDelim); + } else { + codes = text; + } + + String unicode; + if (codes.length() + 1 < text.length()) { + unicode = text.substring(textDelim + 1); + } else { + unicode = ""; + } + + + String[] pairs = codes.split(CODE_DELIMITER); + for (String eachPair : pairs) { + try { + String[] splits = eachPair.split(MODIFIER_DELIMITER); + Integer code = Integer.valueOf(splits[0]); + Integer modifier = Integer.valueOf(splits[1]); + type(robot, code.intValue(), modifier.intValue()); + } + catch (NumberFormatException e) { + dumpError(cb, "Invalid code: " + eachPair); + return new ActionCallback.Rejected(); + } + } + + + return new ActionCallback.Done(); + } + + public static Pair, java.util.List> parseKeyCodes(String keyCodesText) { + ArrayList codes = new ArrayList(); + ArrayList modifiers = new ArrayList(); + + if (keyCodesText != null) { + String[] pairs = keyCodesText.split(CODE_DELIMITER); + for (String each : pairs) { + String[] strings = each.split(MODIFIER_DELIMITER); + if (strings.length == 2) { + codes.add(Integer.valueOf(strings[0])); + codes.add(Integer.valueOf(strings[1])); + } + } + } + + return new Pair, java.util.List>(codes, modifiers); + } + + public static String unparseKeyCodes(Pair, java.util.List> pairs) { + StringBuffer result = new StringBuffer(); + + java.util.List codes = pairs.getFirst(); + java.util.List modifiers = pairs.getSecond(); + + for (int i = 0; i < codes.size(); i++) { + Integer each = codes.get(i); + result.append(each.toString()); + result.append(MODIFIER_DELIMITER); + result.append(modifiers.get(i)); + if (i < codes.size() - 1) { + result.append(CODE_DELIMITER); + } + } + + return result.toString(); + } + +} diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java index cfca38ba76b5..c5bd853b1588 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyShortcutCommand.java @@ -23,7 +23,7 @@ import java.awt.*; public class KeyShortcutCommand extends TypeCommand { public static String PREFIX = CMD_PREFIX + "["; - public static String POSTFIX = CMD_PREFIX + "]"; + public static String POSTFIX = "]"; public KeyShortcutCommand(String text, int line) { super(text, line); @@ -31,7 +31,7 @@ public class KeyShortcutCommand extends TypeCommand { public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { final String one = getText().substring(PREFIX.length()); - if (!one.endsWith("]")) { + if (!one.endsWith(POSTFIX)) { dumpError(cb, "Expected " + "]"); return new ActionCallback.Rejected(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyStokeMap.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyStokeMap.java index f3831b55973c..3ef546a7d14e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyStokeMap.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyStokeMap.java @@ -22,7 +22,6 @@ import javax.swing.*; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.util.HashMap; -import java.util.Locale; import java.util.Map; public class KeyStokeMap { @@ -32,11 +31,17 @@ public class KeyStokeMap { private Map myMap; public KeyStroke get(char c) { - if (myMap == null) { - myMap = generateKeyStrokeMappings(); - } + Character mappedChar = new Character(c); - return myMap.get(new Character(c)); + if (getMap().containsKey(mappedChar)) { + return getMap().get(mappedChar); + } else { + return KeyStroke.getKeyStroke(c); + } + } + + public boolean containsChar(char c) { + return getMap().containsKey(c); } public KeyStroke get(String strokeText) { @@ -136,13 +141,13 @@ public class KeyStokeMap { map.put(new Character((char)entry[0]), stroke); } - // If the locale is not en_US/GB, provide only a very basic map and - // rely on key_typed events instead - Locale locale = Locale.getDefault(); - if (!Locale.US.equals(locale) && !Locale.UK.equals(locale)) { - LOG.debug("Not US: " + locale); - return map; - } + //// If the locale is not en_US/GB, provide only a very basic map and + //// rely on key_typed events instead + //Locale locale = Locale.getDefault(); + //if (!Locale.US.equals(locale) && !Locale.UK.equals(locale)) { + // LOG.debug("Not US: " + locale); + // return map; + //} // Basic symbol/punctuation mappings for (int i = 0; i < mappings.length; i++) { @@ -175,4 +180,11 @@ public class KeyStokeMap { return map; } + private Map getMap() { + if (myMap == null) { + myMap = generateKeyStrokeMappings(); + } + + return myMap; + } } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/TypeCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/TypeCommand.java index a4f1d864a8c7..02530d93fec4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/TypeCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/TypeCommand.java @@ -24,7 +24,7 @@ import java.awt.event.KeyEvent; public abstract class TypeCommand extends AbstractCommand { - private KeyStokeMap myMap = new KeyStokeMap(); + private static KeyStokeMap ourMap = new KeyStokeMap(); public TypeCommand(String text, int line) { super(text, line); @@ -56,9 +56,16 @@ public abstract class TypeCommand extends AbstractCommand { robot.keyPress(KeyEvent.VK_META); } - robot.keyPress(keyStroke.getKeyCode()); - robot.delay(Registry.intValue("actionSystem.playback.autodelay")); - robot.keyRelease(keyStroke.getKeyCode()); + if (keyStroke.getKeyCode() > 0) { + robot.keyPress(keyStroke.getKeyCode()); + robot.delay(Registry.intValue("actionSystem.playback.autodelay")); + robot.keyRelease(keyStroke.getKeyCode()); + } else { + robot.keyPress(keyStroke.getKeyChar()); + robot.delay(Registry.intValue("actionSystem.playback.autodelay")); + robot.keyRelease(keyStroke.getKeyChar()); + } + if (shift) { robot.keyRelease(KeyEvent.VK_SHIFT); @@ -78,10 +85,18 @@ public abstract class TypeCommand extends AbstractCommand { } protected KeyStroke get(char c) { - return myMap.get(c); + return ourMap.get(c); } protected KeyStroke getFromShortcut(String sc) { - return myMap.get(sc); + return ourMap.get(sc); + } + + public static boolean containsUnicode(String s) { + for (int i = 0; i < s.length(); i++) { + if (!ourMap.containsChar(s.charAt(i))) return true; + } + + return false; } } \ No newline at end of file From 246b6267c238b92875cbb9531f2e4a4d6c1431e9 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 25 Nov 2009 14:25:57 +0300 Subject: [PATCH 02/26] NPE fix: FileEditor seem to be provided from the console view's editor. Obviously it doesn't have VirtualFile associated --- .../src/com/intellij/ide/impl/StructureViewWrapperImpl.java | 6 +++++- .../openapi/fileEditor/impl/text/TextEditorProvider.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java index 87545027c1ad..85c681072efe 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java @@ -25,6 +25,7 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.fileEditor.FileEditor; +import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; @@ -41,6 +42,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.HierarchyEvent; import java.awt.event.HierarchyListener; +import java.util.Arrays; /** * @author Eugene Belyaev @@ -100,7 +102,9 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl final DataContext dataContext = DataManager.getInstance().getDataContext(owner); final FileEditor fileEditor = PlatformDataKeys.FILE_EDITOR.getData(dataContext); if (fileEditor != null) { - setFileEditor(fileEditor); + if (Arrays.asList(FileEditorManager.getInstance(myProject).getSelectedEditors()).contains(fileEditor)) { + setFileEditor(fileEditor); + } } else { setModule(LangDataKeys.MODULE_CONTEXT.getData(dataContext)); diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorProvider.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorProvider.java index 2488277f5912..467666f31177 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorProvider.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorProvider.java @@ -239,6 +239,8 @@ public class TextEditorProvider implements FileEditorProvider, DumbAware { public StructureViewBuilder getStructureViewBuilder() { VirtualFile file = FileDocumentManager.getInstance().getFile(myEditor.getDocument()); + if (file == null) return null; + final Project project = myEditor.getProject(); LOG.assertTrue(project != null); return StructureViewBuilder.PROVIDER.getStructureViewBuilder(file.getFileType(), file, project); From ac7d7872eef7019bdf7b4b8fddc22d7104519e68 Mon Sep 17 00:00:00 2001 From: Maas van den Berg Date: Wed, 25 Nov 2009 14:31:29 +0300 Subject: [PATCH 03/26] IDEADEV-41572 --- .../openapi/roots/ui/configuration/ContentEntryTreeEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java index 0a60e65c042a..85f89a22200e 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/ContentEntryTreeEditor.java @@ -180,7 +180,7 @@ public abstract class ContentEntryTreeEditor { public void select(VirtualFile file) { if (myFileSystemTree != null) { - myFileSystemTree.select(file); + myFileSystemTree.select(file, null); } } From c317da06f1c838445b85747dd8846d4faab46a8a Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 25 Nov 2009 13:48:56 +0300 Subject: [PATCH 04/26] do not need parenthesis for associative operations (IDEADEV-41569); move to java-tests --- .../tree/java/ReplaceExpressionUtil.java | 4 +- .../AndAndSubexpression.after.java | 6 + .../AndAndSubexpression.java | 5 + .../AnonymousClass.after.java | 10 + .../introduceVariable/AnonymousClass.java | 10 + .../AnonymousClass1.after.java | 9 + .../introduceVariable/AnonymousClass1.java | 8 + .../AnonymousClass2.after.java | 13 + .../introduceVariable/AnonymousClass2.java | 13 + .../ConflictingField.after.java | 8 + .../introduceVariable/ConflictingField.java | 8 + .../ConflictingFieldInExpression.after.java | 8 + .../ConflictingFieldInExpression.java | 8 + .../ConflictingFieldInOuterClass.after.java | 9 + .../ConflictingFieldInOuterClass.java | 8 + .../DuplicateGenericExpressions.after.java | 12 + .../DuplicateGenericExpressions.java | 11 + .../introduceVariable/IDEADEV13369.after.java | 9 + .../introduceVariable/IDEADEV13369.java | 8 + .../introduceVariable/IDEADEV3678.after.java | 9 + .../introduceVariable/IDEADEV3678.java | 7 + .../introduceVariable/InsideElse.after.java | 12 + .../introduceVariable/InsideElse.java | 9 + .../introduceVariable/InsideFor.after.java | 8 + .../introduceVariable/InsideFor.java | 6 + .../introduceVariable/InsideIf.after.java | 10 + .../introduceVariable/InsideIf.java | 8 + .../introduceVariable/InsideWhile.after.java | 9 + .../introduceVariable/InsideWhile.java | 7 + .../introduceVariable/MethodCall.after.java | 11 + .../introduceVariable/MethodCall.java | 10 + .../MethodCallInSwitch.after.java | 12 + .../introduceVariable/MethodCallInSwitch.java | 11 + .../NonExpression.after.java | 7 + .../introduceVariable/NonExpression.java | 6 + .../NonExpressionPriorityFailure.after.java | 6 + .../NonExpressionPriorityFailure.java | 6 + .../introduceVariable/Parenthized.after.java | 6 + .../introduceVariable/Parenthized.java | 5 + .../ParenthizedOccurence.after.java | 14 ++ .../ParenthizedOccurence.java | 13 + .../introduceVariable/ReplaceAll.after.java | 8 + .../introduceVariable/ReplaceAll.java | 7 + ...ReturnStatementWithoutSemicolon.after.java | 6 + .../ReturnStatementWithoutSemicolon.java | 5 + .../introduceVariable/SCR10412.after.java | 6 + .../introduceVariable/SCR10412.java | 5 + .../introduceVariable/SCR18295.after.java | 9 + .../introduceVariable/SCR18295.java | 8 + .../introduceVariable/SCR18295a.after.java | 8 + .../introduceVariable/SCR18295a.java | 8 + .../introduceVariable/SCR22718.after.java | 8 + .../introduceVariable/SCR22718.java | 7 + .../introduceVariable/SCR26075.after.java | 15 ++ .../introduceVariable/SCR26075.java | 14 ++ .../introduceVariable/SCR40281.after.java | 13 + .../introduceVariable/SCR40281.java | 13 + .../introduceVariable/Scr16910.after.java | 9 + .../introduceVariable/Scr16910.java | 7 + .../SimpleExpression.after.java | 5 + .../introduceVariable/SimpleExpression.java | 5 + .../SkipSemicolon.after.java | 6 + .../introduceVariable/SkipSemicolon.java | 5 + .../StaticConflictingField.after.java | 9 + .../StaticConflictingField.java | 9 + .../introduceVariable/StaticImport.after.java | 7 + .../introduceVariable/StaticImport.java | 7 + .../introduceVariable/SubLiteral.after.java | 6 + .../introduceVariable/SubLiteral.java | 5 + .../introduceVariable/SubLiteral1.after.java | 6 + .../introduceVariable/SubLiteral1.java | 5 + .../SubLiteralFromExpression.after.java | 7 + .../SubLiteralFromExpression.java | 6 + .../SubPrimitiveLiteral.after.java | 6 + .../SubPrimitiveLiteral.java | 5 + .../ThisQualifier.after.java | 12 + .../introduceVariable/ThisQualifier.java | 11 + .../TypeAnnotations.after.java | 13 + .../introduceVariable/TypeAnnotations.java | 13 + .../WithIfBranches.after.java | 22 ++ .../introduceVariable/WithIfBranches.java | 21 ++ .../genericTypeWithInner/after/test/A.java | 6 + .../after/test/Client.java | 9 + .../genericTypeWithInner/after/test/List.java | 4 + .../genericTypeWithInner/before/test/A.java | 6 + .../before/test/Client.java | 9 + .../before/test/List.java | 4 + .../genericTypeWithInner1/after/test/A.java | 6 + .../after/test/Client.java | 7 + .../after/test/List.java | 4 + .../genericTypeWithInner1/after/test/X.java | 5 + .../genericTypeWithInner1/before/test/A.java | 6 + .../before/test/Client.java | 7 + .../before/test/List.java | 4 + .../genericTypeWithInner1/before/test/X.java | 5 + .../after/Client.java | 7 + .../after/PairProvider.java | 7 + .../after/util/Pair.java | 13 + .../before/Client.java | 5 + .../before/PairProvider.java | 7 + .../before/util/Pair.java | 13 + .../after/Client.java | 5 + .../genericWithTwoParameters2/after/Pair.java | 10 + .../after/PairProvider.java | 5 + .../before/Client.java | 5 + .../before/Pair.java | 10 + .../before/PairProvider.java | 5 + .../samePackageRef/after/pack1/A.java | 7 + .../samePackageRef/after/pack1/B.java | 4 + .../samePackageRef/before/pack1/A.java | 7 + .../samePackageRef/before/pack1/B.java | 4 + .../IntroduceVariableMultifileTest.java | 95 ++++++++ .../refactoring/IntroduceVariableSuite.java | 17 ++ .../refactoring/IntroduceVariableTest.java | 227 ++++++++++++++++++ .../MockIntroduceVariableHandler.java | 87 +++++++ .../testSrc/com/intellij/refactoring/Run.java | 14 ++ 116 files changed, 1340 insertions(+), 2 deletions(-) create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ConflictingField.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ConflictingField.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideElse.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideElse.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideFor.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideFor.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideIf.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideIf.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideWhile.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/InsideWhile.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/MethodCall.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/MethodCall.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/NonExpression.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/NonExpression.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/Parenthized.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/Parenthized.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR10412.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR10412.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR18295.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR18295.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR18295a.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR18295a.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR22718.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR22718.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR26075.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR26075.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR40281.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SCR40281.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/Scr16910.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/Scr16910.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/StaticImport.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/StaticImport.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubLiteral.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubLiteral.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.after.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/A.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/List.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/A.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/List.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/A.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/List.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/X.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/A.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/List.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/X.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/PairProvider.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/util/Pair.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/PairProvider.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/util/Pair.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Pair.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/PairProvider.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Client.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Pair.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/PairProvider.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/A.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/B.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/A.java create mode 100644 java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/B.java create mode 100644 java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableMultifileTest.java create mode 100644 java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableSuite.java create mode 100644 java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java create mode 100644 java/java-tests/testSrc/com/intellij/refactoring/MockIntroduceVariableHandler.java create mode 100644 java/java-tests/testSrc/com/intellij/refactoring/Run.java diff --git a/java/java-impl/src/com/intellij/psi/impl/source/tree/java/ReplaceExpressionUtil.java b/java/java-impl/src/com/intellij/psi/impl/source/tree/java/ReplaceExpressionUtil.java index 1ec313c9661b..b18e8b8f0e1a 100644 --- a/java/java-impl/src/com/intellij/psi/impl/source/tree/java/ReplaceExpressionUtil.java +++ b/java/java-impl/src/com/intellij/psi/impl/source/tree/java/ReplaceExpressionUtil.java @@ -48,7 +48,7 @@ public class ReplaceExpressionUtil implements Constants { else if (i == BINARY_EXPRESSION) { if (priority < parentPriority) return true; final IElementType opType = ((PsiBinaryExpression)SourceTreeToPsiMap.treeElementToPsi(oldParent)).getOperationSign().getTokenType(); - return ((CompositeElement)oldParent).getChildRole(oldExpr) == ChildRole.LOPERAND ? false : opType != PLUS && opType != ASTERISK; + return ((CompositeElement)oldParent).getChildRole(oldExpr) == ChildRole.LOPERAND ? false : opType != PLUS && opType != ASTERISK && opType != ANDAND; } else if (i == INSTANCE_OF_EXPRESSION) { return priority < parentPriority; @@ -158,4 +158,4 @@ public class ReplaceExpressionUtil implements Constants { return -1; } } -} \ No newline at end of file +} diff --git a/java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.after.java b/java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.after.java new file mode 100644 index 000000000000..29b3ed570261 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.after.java @@ -0,0 +1,6 @@ +class A { + public void test(boolean a, boolean b) { + final boolean ab = a && b; + if (true && ab); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.java b/java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.java new file mode 100644 index 000000000000..25a0dc2101db --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AndAndSubexpression.java @@ -0,0 +1,5 @@ +class A { + public void test(boolean a, boolean b) { + if (true && a && b); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.after.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.after.java new file mode 100644 index 000000000000..b45ea8f2fa7e --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.after.java @@ -0,0 +1,10 @@ +class Test { + public void method() { + final int temp = 1 + 2; + Runnable r = new Runnable() { + public void run() { + int i = temp; + } + }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.java new file mode 100644 index 000000000000..3e0b89e0903b --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass.java @@ -0,0 +1,10 @@ +class Test { + public void method() { + 1 + 2 + Runnable r = new Runnable() { + public void run() { + int i = 1 + 2; + } + }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.after.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.after.java new file mode 100644 index 000000000000..4270d7d2388b --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.after.java @@ -0,0 +1,9 @@ +class A { + static { + Runnable runnable = new Runnable() { + public void run() { + } + }; + System.out.println(runnable); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.java new file mode 100644 index 000000000000..56a55d4cfe3c --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass1.java @@ -0,0 +1,8 @@ +class A { + static { + System.out.println(new Runnable() { + public void run() { + } + }); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.after.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.after.java new file mode 100644 index 000000000000..bbda64c5fffd --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.after.java @@ -0,0 +1,13 @@ +public class TestClass { + void x() { + new Exception() { + int doSomething() { return 1; } + void a() { + int j = doSomething(); + } + void b() { + doSomething(); + } + }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.java b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.java new file mode 100644 index 000000000000..fcf7a0583bdf --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/AnonymousClass2.java @@ -0,0 +1,13 @@ +public class TestClass { + void x() { + new Exception() { + int doSomething() { return 1; } + void a() { + doSomething(); + } + void b() { + doSomething(); + } + }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ConflictingField.after.java b/java/java-tests/testData/refactoring/introduceVariable/ConflictingField.after.java new file mode 100644 index 000000000000..2358335bde7e --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ConflictingField.after.java @@ -0,0 +1,8 @@ +class A { + private int name; + public void method() { + System.out.println(name); + String name = "xyz"; + System.out.println(this.name); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ConflictingField.java b/java/java-tests/testData/refactoring/introduceVariable/ConflictingField.java new file mode 100644 index 000000000000..5aa0f41e0eef --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ConflictingField.java @@ -0,0 +1,8 @@ +class A { + private int name; + public void method() { + System.out.println(name); + "xyz" + System.out.println(name); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.after.java b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.after.java new file mode 100644 index 000000000000..9689d3d386ec --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.after.java @@ -0,0 +1,8 @@ +class A { + private int name; + public void method() { + System.out.println(name); + int name = this.name; + System.out.println(this.name); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.java b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.java new file mode 100644 index 000000000000..1c7808c8fcfa --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInExpression.java @@ -0,0 +1,8 @@ +class A { + private int name; + public void method() { + System.out.println(name); + name + System.out.println(name); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.after.java b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.after.java new file mode 100644 index 000000000000..39a6ba8a4b03 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.after.java @@ -0,0 +1,9 @@ +public class Test4 { + String text = "Hello world!"; + private class Q { + void foo() { + final String text = Test4.this.text; + System.out.println("text = " + text); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.java b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.java new file mode 100644 index 000000000000..0a964fc09862 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ConflictingFieldInOuterClass.java @@ -0,0 +1,8 @@ +public class Test4 { + String text = "Hello world!"; + private class Q { + void foo() { + System.out.println("text = " + text); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.after.java b/java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.after.java new file mode 100644 index 000000000000..bfa2e7e81f14 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.after.java @@ -0,0 +1,12 @@ +class Foo2 { + Foo2 getList() { + return null; + } + + { + Foo2 f = new Foo2(); + Foo2 temp = f.getList(); + Object a = temp; + Object b = temp; + } +} diff --git a/java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.java b/java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.java new file mode 100644 index 000000000000..658790b01a2f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/DuplicateGenericExpressions.java @@ -0,0 +1,11 @@ +class Foo2 { + Foo2 getList() { + return null; + } + + { + Foo2 f = new Foo2(); + Object a = f.getList(); + Object b = f.getList(); + } +} diff --git a/java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.after.java b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.after.java new file mode 100644 index 000000000000..f67f7fed67f2 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.after.java @@ -0,0 +1,9 @@ +class Tester { + void method() { + final int[] ints = {1}; + f(ints); + } + + private void f(int[] ints) { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.java b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.java new file mode 100644 index 000000000000..87e627b1371e --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV13369.java @@ -0,0 +1,8 @@ +class Tester { + void method() { + f(new int[]{1}); + } + + private void f(int[] ints) { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.after.java b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.after.java new file mode 100644 index 000000000000..90ebb5eb6eed --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.after.java @@ -0,0 +1,9 @@ +class Bar { + void bar(Object[] components) { + for (int i = 0; i < components.length; ++i) { + final Object component = components[i]; + if (component != null) + addChildren(component); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.java b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.java new file mode 100644 index 000000000000..76dd5eeb8d1c --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/IDEADEV3678.java @@ -0,0 +1,7 @@ +class Bar { + void bar(Object[] components) { + for (int i = 0; i < components.length; ++i) + if (components[i] != null) + addChildren(components[i]); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideElse.after.java b/java/java-tests/testData/refactoring/introduceVariable/InsideElse.after.java new file mode 100644 index 000000000000..28c549ca8a70 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideElse.after.java @@ -0,0 +1,12 @@ +public class C { + { + Object o = getO(); + String s; + if (o == null) + s = ""; + else { + String s1 = o.toString(); + s = s1; + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideElse.java b/java/java-tests/testData/refactoring/introduceVariable/InsideElse.java new file mode 100644 index 000000000000..6a11196a164a --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideElse.java @@ -0,0 +1,9 @@ +public class C { + { + Object o = getO(); + String s; + if (o == null) + s = ""; + else s = o.toString(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideFor.after.java b/java/java-tests/testData/refactoring/introduceVariable/InsideFor.after.java new file mode 100644 index 000000000000..f86f92db3548 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideFor.after.java @@ -0,0 +1,8 @@ +class Test { + public void method() { + for(int i = 0; i < 100; i++) { + int temp = i * 2; + sum += temp; + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideFor.java b/java/java-tests/testData/refactoring/introduceVariable/InsideFor.java new file mode 100644 index 000000000000..b87dffcf42f0 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideFor.java @@ -0,0 +1,6 @@ +class Test { + public void method() { + for(int i = 0; i < 100; i++) + sum += i * 2; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideIf.after.java b/java/java-tests/testData/refactoring/introduceVariable/InsideIf.after.java new file mode 100644 index 000000000000..f6f70ca941c6 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideIf.after.java @@ -0,0 +1,10 @@ +public class C { + { + Object o = getO(); + String s = ""; + if (o != null) { + String s1 = o.toString(); + s += s1; + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideIf.java b/java/java-tests/testData/refactoring/introduceVariable/InsideIf.java new file mode 100644 index 000000000000..ada25c89cfc4 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideIf.java @@ -0,0 +1,8 @@ +public class C { + { + Object o = getO(); + String s = ""; + if (o != null) + s += o.toString(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideWhile.after.java b/java/java-tests/testData/refactoring/introduceVariable/InsideWhile.after.java new file mode 100644 index 000000000000..8e069bb08e72 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideWhile.after.java @@ -0,0 +1,9 @@ +class Test { + public void method() { + int i = 0; + while(i < 100) { + int temp = i++ * 2; + sum += temp; + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/InsideWhile.java b/java/java-tests/testData/refactoring/introduceVariable/InsideWhile.java new file mode 100644 index 000000000000..86bfd935e92a --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/InsideWhile.java @@ -0,0 +1,7 @@ +class Test { + public void method() { + int i = 0; + while(i < 100) + sum += i++ * 2; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/MethodCall.after.java b/java/java-tests/testData/refactoring/introduceVariable/MethodCall.after.java new file mode 100644 index 000000000000..b961f2152ef8 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/MethodCall.after.java @@ -0,0 +1,11 @@ +class A { + Object getObject() { + return null; + } + + void method() { + final Object temp = getObject(); + Object o = temp; + return temp.hashCode(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/MethodCall.java b/java/java-tests/testData/refactoring/introduceVariable/MethodCall.java new file mode 100644 index 000000000000..446740a3327c --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/MethodCall.java @@ -0,0 +1,10 @@ +class A { + Object getObject() { + return null; + } + + void method() { + Object o = getObject(); + return getObject().hashCode(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.after.java b/java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.after.java new file mode 100644 index 000000000000..4cfd67ddd070 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.after.java @@ -0,0 +1,12 @@ +class A { + int getContentElementType() { + return 0; + } + + void method() { + final int i = getContentElementType(); + switch (i) { + default: throw new IllegalArgumentException("Wrong content type: " + i); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.java b/java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.java new file mode 100644 index 000000000000..5826ad932958 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/MethodCallInSwitch.java @@ -0,0 +1,11 @@ +class A { + int getContentElementType() { + return 0; + } + + void method() { + switch (getContentElementType()) { + default: throw new IllegalArgumentException("Wrong content type: " + getContentElementType()); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/NonExpression.after.java b/java/java-tests/testData/refactoring/introduceVariable/NonExpression.after.java new file mode 100644 index 000000000000..50e5ae9a714f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/NonExpression.after.java @@ -0,0 +1,7 @@ +class A { + public void test() { + int a = 0; int b = 0; int c = 0; + final int sum = b + c; + int d = a + sum; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/NonExpression.java b/java/java-tests/testData/refactoring/introduceVariable/NonExpression.java new file mode 100644 index 000000000000..8207e65aeebe --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/NonExpression.java @@ -0,0 +1,6 @@ +class A { + public void test() { + int a = 0; int b = 0; int c = 0; + int d = a + b + c; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.after.java b/java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.after.java new file mode 100644 index 000000000000..b00f97d57182 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.after.java @@ -0,0 +1,6 @@ +class A { + public void test() { + int a = 0; int b = 0; int c = 0; + int d = a - b + c; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.java b/java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.java new file mode 100644 index 000000000000..b00f97d57182 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/NonExpressionPriorityFailure.java @@ -0,0 +1,6 @@ +class A { + public void test() { + int a = 0; int b = 0; int c = 0; + int d = a - b + c; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/Parenthized.after.java b/java/java-tests/testData/refactoring/introduceVariable/Parenthized.after.java new file mode 100644 index 000000000000..ace70278d812 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/Parenthized.after.java @@ -0,0 +1,6 @@ +class A { + void method() { + int temp = 1 + 2; + int k = temp; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/Parenthized.java b/java/java-tests/testData/refactoring/introduceVariable/Parenthized.java new file mode 100644 index 000000000000..6d69851f85b1 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/Parenthized.java @@ -0,0 +1,5 @@ +class A { + void method() { + int k = (1 + 2); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.after.java b/java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.after.java new file mode 100644 index 000000000000..36fab6b61ae2 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.after.java @@ -0,0 +1,14 @@ +import java.util.*; + +public class Introduce { + private static List _list = new ArrayList(); + + public static void main(String[] args) { + final boolean empty = _list.isEmpty(); + final boolean invisible = (!empty); + final boolean visible = empty; + + if("".equals(_list.get(0)) || empty) { + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.java b/java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.java new file mode 100644 index 000000000000..7e018f5b28b6 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ParenthizedOccurence.java @@ -0,0 +1,13 @@ +import java.util.*; + +public class Introduce { + private static List _list = new ArrayList(); + + public static void main(String[] args) { + final boolean invisible = (!_list.isEmpty()); + final boolean visible = (_list.isEmpty()); + + if("".equals(_list.get(0)) || _list.isEmpty()) { + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.after.java b/java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.after.java new file mode 100644 index 000000000000..46d7bc0bf4c1 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.after.java @@ -0,0 +1,8 @@ +class Test { + int method(String p1, int p2) { + final String s = p1 + p2; + int i = s; + for(int l = i; l <= s; l++) + sum += s; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.java b/java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.java new file mode 100644 index 000000000000..62f5650f1289 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ReplaceAll.java @@ -0,0 +1,7 @@ +class Test { + int method(String p1, int p2) { + int i = p1 + p2; + for(int l = i; l <= p1 + p2; l++) + sum += p1 + p2; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.after.java b/java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.after.java new file mode 100644 index 000000000000..8059fe699c69 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.after.java @@ -0,0 +1,6 @@ +class Test { + public String bla() { + final String b = String.format("foo.bar.%s", ""); + return b + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.java b/java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.java new file mode 100644 index 000000000000..79effe05a436 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ReturnStatementWithoutSemicolon.java @@ -0,0 +1,5 @@ +class Test { + public String bla() { + return String.format("foo.bar.%s", "") + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR10412.after.java b/java/java-tests/testData/refactoring/introduceVariable/SCR10412.after.java new file mode 100644 index 000000000000..b1c1edc9c5ef --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR10412.after.java @@ -0,0 +1,6 @@ +class Test { + { + String[] newVar = {"a", "b"}; + String[] s = newVar; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR10412.java b/java/java-tests/testData/refactoring/introduceVariable/SCR10412.java new file mode 100644 index 000000000000..0a4769de226f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR10412.java @@ -0,0 +1,5 @@ +class Test { + { + String[] s = { "a", "b" }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR18295.after.java b/java/java-tests/testData/refactoring/introduceVariable/SCR18295.after.java new file mode 100644 index 000000000000..9d0e6789ec41 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR18295.after.java @@ -0,0 +1,9 @@ +public class Thing { + + private String it; + + private void dumb() { + String it = this.it; + it.length(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR18295.java b/java/java-tests/testData/refactoring/introduceVariable/SCR18295.java new file mode 100644 index 000000000000..a483505c774b --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR18295.java @@ -0,0 +1,8 @@ +public class Thing { + + private String it; + + private void dumb() { + it.length(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR18295a.after.java b/java/java-tests/testData/refactoring/introduceVariable/SCR18295a.after.java new file mode 100644 index 000000000000..f06bc92f479d --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR18295a.after.java @@ -0,0 +1,8 @@ +public class Thing { + + private String it; + + private void dumb() { + String it = this.it; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR18295a.java b/java/java-tests/testData/refactoring/introduceVariable/SCR18295a.java new file mode 100644 index 000000000000..1ae9841b9337 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR18295a.java @@ -0,0 +1,8 @@ +public class Thing { + + private String it; + + private void dumb() { + it + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR22718.after.java b/java/java-tests/testData/refactoring/introduceVariable/SCR22718.after.java new file mode 100644 index 000000000000..c4928fc91619 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR22718.after.java @@ -0,0 +1,8 @@ +class Test { + Object object; + void foo() { + final Object object = this.object; + Object o = object; // object is selected + Object p = object; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR22718.java b/java/java-tests/testData/refactoring/introduceVariable/SCR22718.java new file mode 100644 index 000000000000..264e03725b0b --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR22718.java @@ -0,0 +1,7 @@ +class Test { + Object object; + void foo() { + Object o = object; // object is selected + Object p = object; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR26075.after.java b/java/java-tests/testData/refactoring/introduceVariable/SCR26075.after.java new file mode 100644 index 000000000000..c93d770a0820 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR26075.after.java @@ -0,0 +1,15 @@ +class C { + String f () { + return null; + } + + C getParent() {return null;} + + void test () { + C c = new C(); + String wrong = c.f(); + while (wrong != null) { + c = c.getParent(); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR26075.java b/java/java-tests/testData/refactoring/introduceVariable/SCR26075.java new file mode 100644 index 000000000000..9644126505c9 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR26075.java @@ -0,0 +1,14 @@ +class C { + String f () { + return null; + } + + C getParent() {return null;} + + void test () { + C c = new C(); + while (c.f() != null) { + c = c.getParent(); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR40281.after.java b/java/java-tests/testData/refactoring/introduceVariable/SCR40281.after.java new file mode 100644 index 000000000000..b1f17e1c4e57 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR40281.after.java @@ -0,0 +1,13 @@ +class Set {} + +class Map { + class Entry { + } + Set> entries () { return null; } +} + +class C { + void foo (Map s) { + Set.Entry> temp = s.entries(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SCR40281.java b/java/java-tests/testData/refactoring/introduceVariable/SCR40281.java new file mode 100644 index 000000000000..768986f8f6a5 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SCR40281.java @@ -0,0 +1,13 @@ +class Set {} + +class Map { + class Entry { + } + Set> entries () { return null; } +} + +class C { + void foo (Map s) { + s.entries(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/Scr16910.after.java b/java/java-tests/testData/refactoring/introduceVariable/Scr16910.after.java new file mode 100644 index 000000000000..8a3007aa47db --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/Scr16910.after.java @@ -0,0 +1,9 @@ +class C { + { + String s = "Text"; + if (()) { + final int i = s.length(); + System.out.println("Whatever" + i); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/Scr16910.java b/java/java-tests/testData/refactoring/introduceVariable/Scr16910.java new file mode 100644 index 000000000000..def02b5c176c --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/Scr16910.java @@ -0,0 +1,7 @@ +class C { + { + String s = "Text"; + if (()) + System.out.println("Whatever" + s.length()); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.after.java b/java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.after.java new file mode 100644 index 000000000000..3098b65b74e1 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.after.java @@ -0,0 +1,5 @@ +public class Test { + public void method() { + int i = 1 + 2; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.java b/java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.java new file mode 100644 index 000000000000..75e12d379c61 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SimpleExpression.java @@ -0,0 +1,5 @@ +public class Test { + public void method() { + 1 + 2 + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.after.java b/java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.after.java new file mode 100644 index 000000000000..877ba1ce7333 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.after.java @@ -0,0 +1,6 @@ +class Test { + void foo() { + int mi5 = 0; + int i = mi5; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.java b/java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.java new file mode 100644 index 000000000000..d80ce364e001 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SkipSemicolon.java @@ -0,0 +1,5 @@ +class Test { + void foo() { + int i = 0; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.after.java b/java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.after.java new file mode 100644 index 000000000000..91a13f207da6 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.after.java @@ -0,0 +1,9 @@ +class XYZ { + static int name; + + void method() { + System.out.println(name); + int name = 27; + System.out.println(XYZ.name); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.java b/java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.java new file mode 100644 index 000000000000..88b2ab132f51 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/StaticConflictingField.java @@ -0,0 +1,9 @@ +class XYZ { + static int name; + + void method() { + System.out.println(name); + 27 + System.out.println(name); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/StaticImport.after.java b/java/java-tests/testData/refactoring/introduceVariable/StaticImport.after.java new file mode 100644 index 000000000000..390e99f1ad07 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/StaticImport.after.java @@ -0,0 +1,7 @@ +import static java.lang.Integer.*; + +class A { + public void test() { + final int i = MAX_VALUE; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/StaticImport.java b/java/java-tests/testData/refactoring/introduceVariable/StaticImport.java new file mode 100644 index 000000000000..5397bf4da363 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/StaticImport.java @@ -0,0 +1,7 @@ +import static java.lang.Integer.*; + +class A { + public void test() { + MAX_VALUE; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubLiteral.after.java b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral.after.java new file mode 100644 index 000000000000..df0efa21aa14 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral.after.java @@ -0,0 +1,6 @@ +class A { + public void test() { + String str = "ss"; + String s = "s" + str + "s"; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubLiteral.java b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral.java new file mode 100644 index 000000000000..350afec78e37 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral.java @@ -0,0 +1,5 @@ +class A { + public void test() { + String s = "ssss"; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.after.java b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.after.java new file mode 100644 index 000000000000..aea109f68e03 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.after.java @@ -0,0 +1,6 @@ +class A { + public void test() { + String str = "ss"; + String s = str; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.java b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.java new file mode 100644 index 000000000000..bb6061bb2947 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubLiteral1.java @@ -0,0 +1,5 @@ +class A { + public void test() { + String s = "ss"; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.after.java b/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.after.java new file mode 100644 index 000000000000..3b4350b1b4c4 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.after.java @@ -0,0 +1,7 @@ +class A { + public void test() { + int i = 0; + String str = i + "sss"; + String s = str + "s"; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.java b/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.java new file mode 100644 index 000000000000..0c4aa3d44dfe --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubLiteralFromExpression.java @@ -0,0 +1,6 @@ +class A { + public void test() { + int i = 0; + String s = i + "ssss"; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.after.java b/java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.after.java new file mode 100644 index 000000000000..63c604c9c62e --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.after.java @@ -0,0 +1,6 @@ +class A { + public void test() { + boolean str = true; + String s = "ss" + str; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.java b/java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.java new file mode 100644 index 000000000000..e11ca29fd0d5 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/SubPrimitiveLiteral.java @@ -0,0 +1,5 @@ +class A { + public void test() { + String s = "sstrue"; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.after.java b/java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.after.java new file mode 100644 index 000000000000..b25eddd07e46 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.after.java @@ -0,0 +1,12 @@ +public class Test9 { + protected int count; +} + +class Test10 extends Test9 { + private class Test10i { + void test() { + final int count = Test10.this.count; + System.out.println(count); + } + } +} diff --git a/java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.java b/java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.java new file mode 100644 index 000000000000..eb8ee046beb1 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/ThisQualifier.java @@ -0,0 +1,11 @@ +public class Test9 { + protected int count; +} + +class Test10 extends Test9 { + private class Test10i { + void test() { + System.out.println(count); + } + } +} diff --git a/java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.after.java b/java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.after.java new file mode 100644 index 000000000000..13598a7525ca --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.after.java @@ -0,0 +1,13 @@ +import java.lang.annotation.*; + +@Target({ElementType.TYPE_USE/*, ElementType.TYPE*/}) +@interface TA { + +} + +class C { + void foo () { + @TA C y = null; + @TA C y1 = y; + } +} diff --git a/java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.java b/java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.java new file mode 100644 index 000000000000..bba9d94fa887 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/TypeAnnotations.java @@ -0,0 +1,13 @@ +import java.lang.annotation.*; + +@Target({ElementType.TYPE_USE/*, ElementType.TYPE*/}) +@interface TA { + +} + +class C { + void foo () { + @TA C y = null; + y; + } +} diff --git a/java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.after.java b/java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.after.java new file mode 100644 index 000000000000..ba57de19feab --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.after.java @@ -0,0 +1,22 @@ +class A { + private class Inner { + public void innerMethod() { + new Runnable() { + public void run() { + if (true) { + if (true) { + int i = 0; + int temp = i * i; + if (i == 0) { + System.out.println("" + temp); + } else { + System.out.println("" + temp); + i = temp; + } + } + } + } + }.run(); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.java b/java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.java new file mode 100644 index 000000000000..6b0d6904b44b --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/WithIfBranches.java @@ -0,0 +1,21 @@ +class A { + private class Inner { + public void innerMethod() { + new Runnable() { + public void run() { + if (true) { + if (true) { + int i = 0; + if (i == 0) { + System.out.println("" + i * i); + } else { + System.out.println("" + i * i); + i = i * i; + } + } + } + } + }.run(); + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/A.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/A.java new file mode 100644 index 000000000000..0243bf8ad740 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/A.java @@ -0,0 +1,6 @@ +package test; + +public class A { + public static class B { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/Client.java new file mode 100644 index 000000000000..e7effa4cfd05 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/Client.java @@ -0,0 +1,9 @@ +package test; + +public class Client { + public static List getList() { return null; } + + public static void method() { + final List l = getList(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/List.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/List.java new file mode 100644 index 000000000000..554f3a07f85f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/after/test/List.java @@ -0,0 +1,4 @@ +package test; + +public class List { +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/A.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/A.java new file mode 100644 index 000000000000..0243bf8ad740 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/A.java @@ -0,0 +1,6 @@ +package test; + +public class A { + public static class B { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/Client.java new file mode 100644 index 000000000000..c6531ff5543e --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/Client.java @@ -0,0 +1,9 @@ +package test; + +public class Client { + public static List getList() { return null; } + + public static void method() { + getList() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/List.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/List.java new file mode 100644 index 000000000000..554f3a07f85f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner/before/test/List.java @@ -0,0 +1,4 @@ +package test; + +public class List { +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/A.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/A.java new file mode 100644 index 000000000000..0243bf8ad740 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/A.java @@ -0,0 +1,6 @@ +package test; + +public class A { + public static class B { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/Client.java new file mode 100644 index 000000000000..8d82a0aafbaf --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/Client.java @@ -0,0 +1,7 @@ +package test; + +public class Client { + public static void method() { + final List l = X.getList(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/List.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/List.java new file mode 100644 index 000000000000..554f3a07f85f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/List.java @@ -0,0 +1,4 @@ +package test; + +public class List { +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/X.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/X.java new file mode 100644 index 000000000000..3b7bf52b10e6 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/after/test/X.java @@ -0,0 +1,5 @@ +package test; + +public class X { + public static List getList() { return null; } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/A.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/A.java new file mode 100644 index 000000000000..0243bf8ad740 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/A.java @@ -0,0 +1,6 @@ +package test; + +public class A { + public static class B { + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/Client.java new file mode 100644 index 000000000000..a5df1000ba9e --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/Client.java @@ -0,0 +1,7 @@ +package test; + +public class Client { + public static void method() { + X.getList() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/List.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/List.java new file mode 100644 index 000000000000..554f3a07f85f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/List.java @@ -0,0 +1,4 @@ +package test; + +public class List { +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/X.java b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/X.java new file mode 100644 index 000000000000..3b7bf52b10e6 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericTypeWithInner1/before/test/X.java @@ -0,0 +1,5 @@ +package test; + +public class X { + public static List getList() { return null; } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/Client.java new file mode 100644 index 000000000000..38d94b3a880b --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/Client.java @@ -0,0 +1,7 @@ +import util.Pair; + +class Client { + void method() { + Pair> p = PairProvider.getPair(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/PairProvider.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/PairProvider.java new file mode 100644 index 000000000000..5b6d9ab0d515 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/PairProvider.java @@ -0,0 +1,7 @@ +import util.Pair; + +class PairProvider { + public static Pair> getPair() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/util/Pair.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/util/Pair.java new file mode 100644 index 000000000000..7c095c55a11d --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/after/util/Pair.java @@ -0,0 +1,13 @@ +package util; + +class Pair { + public Pair(L l, R r) { + + } + public L getL() { + return null; + } + public R getR() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/Client.java new file mode 100644 index 000000000000..fa5369d87f58 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/Client.java @@ -0,0 +1,5 @@ +class Client { + void method() { + PairProvider.getPair() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/PairProvider.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/PairProvider.java new file mode 100644 index 000000000000..5b6d9ab0d515 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/PairProvider.java @@ -0,0 +1,7 @@ +import util.Pair; + +class PairProvider { + public static Pair> getPair() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/util/Pair.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/util/Pair.java new file mode 100644 index 000000000000..7c095c55a11d --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters/before/util/Pair.java @@ -0,0 +1,13 @@ +package util; + +class Pair { + public Pair(L l, R r) { + + } + public L getL() { + return null; + } + public R getR() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Client.java new file mode 100644 index 000000000000..543df406c970 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Client.java @@ -0,0 +1,5 @@ +class Client { + void method() { + Pair> p = new PairProvider().getPair(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Pair.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Pair.java new file mode 100644 index 000000000000..e5ba61c07ff0 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/Pair.java @@ -0,0 +1,10 @@ +class Pair { + public Pair(L l, R r) { + } + public L getL() { + return null; + } + public R getR() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/PairProvider.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/PairProvider.java new file mode 100644 index 000000000000..7eed25a9e9b3 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/after/PairProvider.java @@ -0,0 +1,5 @@ +class PairProvider { + public Pair> getPair() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Client.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Client.java new file mode 100644 index 000000000000..881c465e288f --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Client.java @@ -0,0 +1,5 @@ +class Client { + void method() { + new PairProvider().getPair() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Pair.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Pair.java new file mode 100644 index 000000000000..e5ba61c07ff0 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/Pair.java @@ -0,0 +1,10 @@ +class Pair { + public Pair(L l, R r) { + } + public L getL() { + return null; + } + public R getR() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/PairProvider.java b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/PairProvider.java new file mode 100644 index 000000000000..7eed25a9e9b3 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/genericWithTwoParameters2/before/PairProvider.java @@ -0,0 +1,5 @@ +class PairProvider { + public Pair> getPair() { + return null; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/A.java b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/A.java new file mode 100644 index 000000000000..096f73a5a65e --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/A.java @@ -0,0 +1,7 @@ +package pack1; + +public class A { + void method() { + B b = new B(); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/B.java b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/B.java new file mode 100644 index 000000000000..8799ce102090 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/after/pack1/B.java @@ -0,0 +1,4 @@ +package pack1; + +class B { +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/A.java b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/A.java new file mode 100644 index 000000000000..6298fd6c2b15 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/A.java @@ -0,0 +1,7 @@ +package pack1; + +public class A { + void method() { + new B() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/B.java b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/B.java new file mode 100644 index 000000000000..8799ce102090 --- /dev/null +++ b/java/java-tests/testData/refactoring/introduceVariable/samePackageRef/before/pack1/B.java @@ -0,0 +1,4 @@ +package pack1; + +class B { +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableMultifileTest.java b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableMultifileTest.java new file mode 100644 index 000000000000..6b90f6b2ca96 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableMultifileTest.java @@ -0,0 +1,95 @@ +package com.intellij.refactoring; + +import com.intellij.JavaTestUtil; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.JavaPsiFacade; +import com.intellij.psi.PsiClass; +import com.intellij.psi.PsiFile; +import com.intellij.refactoring.introduceVariable.IntroduceVariableBase; + +/** + * @author dsl + */ +public class IntroduceVariableMultifileTest extends MultiFileTestCase { + protected void setUp() throws Exception { + super.setUp(); + LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + } + + protected String getTestRoot() { + return "/refactoring/introduceVariable/"; + } + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + public void testSamePackageRef() throws Exception { + doTest( + createAction("pack1.A", + new MockIntroduceVariableHandler("b", false, false, false, "pack1.B") + ) + ); + } + + public void testGenericTypeWithInner() throws Exception { + doTest( + createAction("test.Client", + new MockIntroduceVariableHandler("l", false, true, true, "test.List") + ) + ); + } + + public void testGenericTypeWithInner1() throws Exception { + doTest( + createAction("test.Client", + new MockIntroduceVariableHandler("l", false, true, true, "test.List") + ) + ); + } + + public void testGenericWithTwoParameters() throws Exception { + doTest( + createAction("Client", + new MockIntroduceVariableHandler("p", false, false, true, + "util.Pair>") + ) + ); + } + + public void testGenericWithTwoParameters2() throws Exception { + doTest( + createAction("Client", + new MockIntroduceVariableHandler("p", false, false, true, + "Pair>") + ) + ); + } + + + public void testDummy() { + + } + + PerformAction createAction(final String className, final IntroduceVariableBase testMe) { + return new PerformAction() { + public void performAction(VirtualFile vroot, VirtualFile rootAfter) { + final JavaPsiFacade psiManager = getJavaFacade(); + final PsiClass aClass = psiManager.findClass(className); + assertTrue(aClass != null); + final PsiFile containingFile = aClass.getContainingFile(); + final VirtualFile virtualFile = containingFile.getVirtualFile(); + assertTrue(virtualFile != null); + final Editor editor = createEditor(virtualFile); + setupCursorAndSelection(editor); + testMe.invoke(myProject, editor, containingFile, null); + FileDocumentManager.getInstance().saveAllDocuments(); + } + }; + } +} diff --git a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableSuite.java b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableSuite.java new file mode 100644 index 000000000000..b84f95e95cd7 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableSuite.java @@ -0,0 +1,17 @@ +package com.intellij.refactoring; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * @author dsl + */ +public class IntroduceVariableSuite extends TestCase { + public static Test suite() { + final TestSuite suite = new TestSuite(); + suite.addTestSuite(IntroduceVariableTest.class); + suite.addTestSuite(IntroduceVariableMultifileTest.class); + return suite; + } +} diff --git a/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java new file mode 100644 index 000000000000..3e0793b9351b --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java @@ -0,0 +1,227 @@ +package com.intellij.refactoring; + +import com.intellij.JavaTestUtil; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.projectRoots.impl.JavaSdkImpl; +import com.intellij.openapi.roots.LanguageLevelProjectExtension; +import com.intellij.pom.java.LanguageLevel; +import com.intellij.psi.PsiElement; +import com.intellij.refactoring.introduceVariable.IntroduceVariableBase; +import com.intellij.refactoring.introduceVariable.IntroduceVariableSettings; +import com.intellij.testFramework.LightCodeInsightTestCase; +import com.intellij.util.containers.MultiMap; +import org.jetbrains.annotations.NonNls; + +import java.util.Collection; + +/** + * @author dsl + */ +public class IntroduceVariableTest extends LightCodeInsightTestCase { + + @Override + protected String getTestDataPath() { + return JavaTestUtil.getJavaTestDataPath(); + } + + public void testSimpleExpression() throws Exception { + doTest(new MockIntroduceVariableHandler("i", false, false, true, "int")); + } + + public void testInsideFor() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", false, false, true, "int")); + } + + public void testReplaceAll() throws Exception { + doTest(new MockIntroduceVariableHandler("s", true, true, true, "java.lang.String")); + } + + public void testIDEADEV3678() throws Exception { + doTest(new MockIntroduceVariableHandler("component", true, true, true, "java.lang.Object")); + } + + public void testIDEADEV13369() throws Exception { + doTest(new MockIntroduceVariableHandler("ints", true, true, true, "int[]")); + } + + public void testAnonymousClass() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", true, false, true, "int")); + } + + public void testAnonymousClass1() throws Exception { + doTest(new MockIntroduceVariableHandler("runnable", false, false, false, "java.lang.Runnable")); + } + + public void testAnonymousClass2() throws Exception { + doTest(new MockIntroduceVariableHandler("j", true, false, false, "int")); + } + + public void testParenthized() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", true, false, false, "int")); + } + + public void testMethodCall() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", true, true, true, "java.lang.Object")); + } + + public void testMethodCallInSwitch() throws Exception { + doTest(new MockIntroduceVariableHandler("i", true, true, true, "int")); + } + + public void testParenthizedOccurence() throws Exception { + doTest(new MockIntroduceVariableHandler("empty", true, true, true, "boolean")); + } + + public void testConflictingField() throws Exception { + doTest(new MockIntroduceVariableHandler("name", true, false, true, "java.lang.String")); + } + + public void testConflictingFieldInExpression() throws Exception { + doTest(new MockIntroduceVariableHandler("name", false, false, true, "int")); + } + + public void testStaticConflictingField() throws Exception { + doTest(new MockIntroduceVariableHandler("name", false, false, true, "int")); + } + + public void testScr16910() throws Exception { + doTest(new MockIntroduceVariableHandler("i", true, true, false, "int")); + } + + public void testSCR18295() throws Exception { + doTest(new MockIntroduceVariableHandler("it", true, false, false, "java.lang.String")); + } + + public void testSCR18295a() throws Exception { + doTest(new MockIntroduceVariableHandler("it", false, false, false, "java.lang.String")); + } + + public void testSCR10412() throws Exception { + doTest(new MockIntroduceVariableHandler("newVar", false, false, false, "java.lang.String[]")); + } + + public void testSCR22718() throws Exception { + doTest(new MockIntroduceVariableHandler("object", true, true, false, "java.lang.Object")); + } + + public void testSCR26075() throws Exception { + doTest(new MockIntroduceVariableHandler("wrong", false, false, false, "java.lang.String") { + protected void assertValidationResult(boolean validationResult) { + assertFalse(validationResult); + } + + protected boolean reportConflicts(MultiMap conflicts, final Project project, IntroduceVariableSettings dialog) { + assertEquals(2, conflicts.size()); + Collection conflictsMessages = conflicts.values(); + assertTrue(conflictsMessages.contains("Introducing variable may break code logic.")); + assertTrue(conflictsMessages.contains("Local variable c is modified in loop body.")); + return false; + } + }); + } + + public void testConflictingFieldInOuterClass() throws Exception { + doTest(new MockIntroduceVariableHandler("text", true, true, false, "java.lang.String")); + } + + public void testSkipSemicolon() throws Exception { + doTest(new MockIntroduceVariableHandler("mi5", false, false, false, "int")); + } + + public void testInsideIf() throws Exception { + doTest(new MockIntroduceVariableHandler("s1", false, false, false, "java.lang.String")); + } + + public void testInsideElse() throws Exception { + doTest(new MockIntroduceVariableHandler("s1", false, false, false, "java.lang.String")); + } + + public void testInsideWhile() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", false, false, false, "int")); + } + + public void testSCR40281() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", false, false, false, "Set.Entry>")); + } + + public void testWithIfBranches() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", true, false, false, "int")); + } + + public void testDuplicateGenericExpressions() throws Exception { + doTest(new MockIntroduceVariableHandler("temp", true, false, false, "Foo2")); + } + + public void testStaticImport() throws Exception { + doTest(new MockIntroduceVariableHandler("i", true, true, false, "int")); + } + + public void testThisQualifier() throws Exception { + doTest(new MockIntroduceVariableHandler("count", true, true, false, "int")); + } + + public void testSubLiteral() throws Exception { + doTest(new MockIntroduceVariableHandler("str", false, false, false, "java.lang.String")); + } + + public void testSubLiteral1() throws Exception { + doTest(new MockIntroduceVariableHandler("str", false, false, false, "java.lang.String")); + } + + public void testSubLiteralFromExpression() throws Exception { + doTest(new MockIntroduceVariableHandler("str", false, false, false, "java.lang.String")); + } + + public void testSubPrimitiveLiteral() throws Exception { + doTest(new MockIntroduceVariableHandler("str", false, false, false, "boolean")); + } + + public void testNonExpression() throws Exception { + doTest(new MockIntroduceVariableHandler("sum", true, true, false, "int")); + } + public void testTypeAnnotations() throws Exception { + doTest(new MockIntroduceVariableHandler("y1", true, false, false, "@TA C")); + } + + public void testReturnStatementWithoutSemicolon() throws Exception { + doTest(new MockIntroduceVariableHandler("b", true, true, false, "java.lang.String")); + } + + public void testAndAndSubExpression() throws Exception { + doTest(new MockIntroduceVariableHandler("ab", true, true, false, "boolean")); + } + + public void testNonExpressionPriorityFailure() throws Exception { + doTest(new MockIntroduceVariableHandler("sum", true, true, false, "int"){ + @Override + protected void showErrorMessage(Project project, Editor editor, String message) { + assertEquals("Cannot perform refactoring.\n" + "Selected block should represent an expression.", message); + } + }); + } + + private void doTest(IntroduceVariableBase testMe) throws Exception { + @NonNls String baseName = "/refactoring/introduceVariable/" + getTestName(false); + configureByFile(baseName + ".java"); + testMe.invoke(getProject(), getEditor(), getFile(), null); + checkResultByFile(baseName + ".after.java"); + } + + private LanguageLevel myOldLanguageLevel; + protected void setUp() throws Exception { + super.setUp(); + myOldLanguageLevel = LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).getLanguageLevel(); + LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).setLanguageLevel(LanguageLevel.JDK_1_7); + } + + protected void tearDown() throws Exception { + LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).setLanguageLevel(myOldLanguageLevel); + super.tearDown(); + } + @Override + protected Sdk getProjectJDK() { + return JavaSdkImpl.getMockJdk17("java 1.7"); + } +} diff --git a/java/java-tests/testSrc/com/intellij/refactoring/MockIntroduceVariableHandler.java b/java/java-tests/testSrc/com/intellij/refactoring/MockIntroduceVariableHandler.java new file mode 100644 index 000000000000..677c5f27965a --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/refactoring/MockIntroduceVariableHandler.java @@ -0,0 +1,87 @@ +package com.intellij.refactoring; + +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.project.Project; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiExpression; +import com.intellij.psi.PsiType; +import com.intellij.refactoring.introduceVariable.InputValidator; +import com.intellij.refactoring.introduceVariable.IntroduceVariableBase; +import com.intellij.refactoring.introduceVariable.IntroduceVariableSettings; +import com.intellij.refactoring.ui.TypeSelectorManagerImpl; +import com.intellij.util.containers.MultiMap; +import junit.framework.Assert; +import org.jetbrains.annotations.NonNls; + +/** + * @author dsl + */ +class MockIntroduceVariableHandler extends IntroduceVariableBase { + private final String myName; + private final boolean myReplaceAll; + private final boolean myDeclareFinal; + private final boolean myReplaceLValues; + private final String myExpectedTypeCanonicalName; + + public MockIntroduceVariableHandler(@NonNls final String name, final boolean replaceAll, + final boolean declareFinal, final boolean replaceLValues, + @NonNls final String expectedTypeCanonicalName) { + + myName = name; + myReplaceAll = replaceAll; + myDeclareFinal = declareFinal; + myReplaceLValues = replaceLValues; + myExpectedTypeCanonicalName = expectedTypeCanonicalName; + } + + + protected IntroduceVariableSettings getSettings(Project project, Editor editor, PsiExpression expr, final PsiElement[] occurrences, + boolean anyAssignmentLHS, final boolean declareFinalIfAll, final PsiType type, + TypeSelectorManagerImpl typeSelectorManager, InputValidator validator) { + Assert.assertTrue(type.getCanonicalText(), type.equalsToText(myExpectedTypeCanonicalName)); + IntroduceVariableSettings introduceVariableSettings = new IntroduceVariableSettings() { + public String getEnteredName() { + return myName; + } + + public boolean isReplaceAllOccurrences() { + return myReplaceAll && occurrences.length > 1; + } + + public boolean isDeclareFinal() { + return myDeclareFinal || isReplaceAllOccurrences() && declareFinalIfAll; + } + + public boolean isReplaceLValues() { + return myReplaceLValues; + } + + public PsiType getSelectedType() { + return type; + } + + public boolean isOK() { + return true; + } + }; + final boolean validationResult = validator.isOK(introduceVariableSettings); + assertValidationResult(validationResult); + return introduceVariableSettings; + } + + protected void assertValidationResult(final boolean validationResult) { + Assert.assertTrue(validationResult); + } + + protected void showErrorMessage(Project project, Editor editor, String message) { + throw new RuntimeException("Error message:" + message); + } + + protected void highlightReplacedOccurences(final Project project, Editor editor, final PsiElement[] replacedOccurences) { + + } + + protected boolean reportConflicts(final MultiMap conflicts, final Project project, IntroduceVariableSettings dialog) { + return false; + } +} diff --git a/java/java-tests/testSrc/com/intellij/refactoring/Run.java b/java/java-tests/testSrc/com/intellij/refactoring/Run.java new file mode 100644 index 000000000000..7911081a2934 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/refactoring/Run.java @@ -0,0 +1,14 @@ +package com.intellij.refactoring; + +import junit.textui.TestRunner; +import junit.framework.TestSuite; +import com.intellij.TestAll; + +/** + * @author dsl + */ +public class Run { + public static void main(String[] args) throws Exception { + new TestRunner().doRun(new TestSuite(IntroduceVariableTest.class)); + } +} From 11c45481cd47c3666247735c0531fee6fa971a24 Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 25 Nov 2009 15:24:46 +0300 Subject: [PATCH 05/26] artifacts editor: error highlighting improved --- .../packaging/ui/ArtifactProblemsHolder.java | 2 + .../artifacts/ArtifactProblemsHolderImpl.java | 14 ++++++- .../ArtifactValidationManagerImpl.java | 37 ++++++++----------- .../artifacts/nodes/PackagingElementNode.java | 32 ++++++++++++---- 4 files changed, 54 insertions(+), 31 deletions(-) diff --git a/java/compiler/openapi/src/com/intellij/packaging/ui/ArtifactProblemsHolder.java b/java/compiler/openapi/src/com/intellij/packaging/ui/ArtifactProblemsHolder.java index be3d257a4ad9..575292ece6c3 100644 --- a/java/compiler/openapi/src/com/intellij/packaging/ui/ArtifactProblemsHolder.java +++ b/java/compiler/openapi/src/com/intellij/packaging/ui/ArtifactProblemsHolder.java @@ -33,4 +33,6 @@ public interface ArtifactProblemsHolder { void registerError(@NotNull String message, @Nullable ArtifactProblemQuickFix quickFix); void registerError(@NotNull String message, @Nullable List> pathToPlace, ArtifactProblemQuickFix... quickFixes); + + void registerWarning(@NotNull String message, @Nullable List> pathToPlace, ArtifactProblemQuickFix... quickFixes); } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactProblemsHolderImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactProblemsHolderImpl.java index 2673df78ddc6..4ad1ad75b3b8 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactProblemsHolderImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactProblemsHolderImpl.java @@ -39,7 +39,17 @@ public class ArtifactProblemsHolderImpl extends ArtifactProblemsHolderBase { } public void registerError(@NotNull String message, @Nullable List> pathToPlace, @Nullable ArtifactProblemQuickFix... quickFixes) { - myProblemsHolder.registerProblem(new ArtifactProblemDescription(message, ProjectStructureProblemDescription.Severity.ERROR, pathToPlace, Arrays.asList( - quickFixes))); + registerProblem(message, pathToPlace, ProjectStructureProblemDescription.Severity.ERROR, quickFixes); + } + + private void registerProblem(@NotNull String message, @Nullable List> pathToPlace, + final ProjectStructureProblemDescription.Severity severity, @Nullable ArtifactProblemQuickFix... quickFixes) { + myProblemsHolder.registerProblem(new ArtifactProblemDescription(message, severity, pathToPlace, Arrays.asList(quickFixes))); + } + + public void registerWarning(@NotNull String message, + @Nullable List> pathToPlace, + ArtifactProblemQuickFix... quickFixes) { + registerProblem(message, pathToPlace, ProjectStructureProblemDescription.Severity.WARNING, quickFixes); } } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactValidationManagerImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactValidationManagerImpl.java index 5f023e4c2f7e..0a390ab897ca 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactValidationManagerImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactValidationManagerImpl.java @@ -21,10 +21,8 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStr import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureProblemsHolderImpl; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.MultiValuesMap; -import com.intellij.openapi.util.Pair; import com.intellij.packaging.elements.PackagingElement; import com.intellij.packaging.ui.ArtifactProblemQuickFix; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -39,8 +37,8 @@ import java.util.List; public class ArtifactValidationManagerImpl implements Disposable { private ArtifactErrorPanel myErrorPanel; private final ArtifactEditorImpl myArtifactEditor; - private MultiValuesMap, String> myErrorsForNodes = new MultiValuesMap, String>(true); - private List>>> myProblems = new ArrayList>>>(); + private MultiValuesMap, ArtifactProblemDescription> myProblemsForNodes = new MultiValuesMap, ArtifactProblemDescription>(true); + private List myProblems = new ArrayList(); ArtifactValidationManagerImpl(ArtifactEditorImpl artifactEditor) { Disposer.register(artifactEditor, this); @@ -56,23 +54,19 @@ public class ArtifactValidationManagerImpl implements Disposable { } public void onNodesAdded() { - for (Pair>> problem : myProblems) { - registerProblem(problem.getFirst(), problem.getSecond()); + for (ArtifactProblemDescription problem : myProblems) { + showProblemInTree(problem); } } - private void registerProblem(@NotNull PackagingElementNode node, @NotNull String message) { - myErrorsForNodes.put(node, message); - } - @Nullable - public Collection getProblems(PackagingElementNode node) { - return myErrorsForNodes.get(node); + public Collection getProblems(PackagingElementNode node) { + return myProblemsForNodes.get(node); } public void updateProblems(@Nullable ProjectStructureProblemsHolderImpl holder) { myErrorPanel.clearError(); - myErrorsForNodes.clear(); + myProblemsForNodes.clear(); myProblems.clear(); if (holder != null) { final List problemDescriptions = holder.getProblemDescriptions(); @@ -81,11 +75,11 @@ public class ArtifactValidationManagerImpl implements Disposable { final String message = description.getMessage(); List quickFix = Collections.emptyList(); if (description instanceof ArtifactProblemDescription) { - quickFix = ((ArtifactProblemDescription)description).getQuickFixes(); - final List> pathToPlace = ((ArtifactProblemDescription)description).getPathToPlace(); - if (pathToPlace != null) { - myProblems.add(Pair.create(message, pathToPlace)); - registerProblem(message, pathToPlace); + final ArtifactProblemDescription artifactProblem = (ArtifactProblemDescription)description; + quickFix = artifactProblem.getQuickFixes(); + if (artifactProblem.getPathToPlace() != null) { + myProblems.add(artifactProblem); + showProblemInTree(artifactProblem); } } myErrorPanel.showError(message, quickFix); @@ -95,13 +89,14 @@ public class ArtifactValidationManagerImpl implements Disposable { myArtifactEditor.getLayoutTreeComponent().updateTreeNodesPresentation(); } - private void registerProblem(String message, List> pathToPlace) { + private void showProblemInTree(ArtifactProblemDescription problem) { final LayoutTree layoutTree = myArtifactEditor.getLayoutTreeComponent().getLayoutTree(); PackagingElementNode node = layoutTree.getRootPackagingNode(); - if (node != null) { + final List> pathToPlace = problem.getPathToPlace(); + if (node != null && pathToPlace != null) { List> nodes = node.getNodesByPath(pathToPlace.subList(1, pathToPlace.size())); for (PackagingElementNode elementNode : nodes) { - registerProblem(elementNode, message); + myProblemsForNodes.put(elementNode, problem); } } } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java index 170850b1ea6a..349016a15a2e 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java @@ -19,14 +19,16 @@ import com.intellij.ide.projectView.PresentationData; import com.intellij.openapi.editor.markup.EffectType; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.roots.ui.configuration.artifacts.ArtifactEditorImpl; +import com.intellij.openapi.roots.ui.configuration.artifacts.ArtifactProblemDescription; +import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureProblemDescription; import com.intellij.openapi.util.MultiValuesMap; -import com.intellij.openapi.util.text.StringUtil; import com.intellij.packaging.elements.CompositePackagingElement; import com.intellij.packaging.elements.PackagingElement; import com.intellij.packaging.ui.ArtifactEditorContext; import com.intellij.ui.SimpleTextAttributes; import com.intellij.ui.treeStructure.SimpleNode; import com.intellij.util.SmartList; +import com.intellij.util.StringBuilderSpinAllocator; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -93,22 +95,36 @@ public class PackagingElementNode> extends Artifac @Override protected void update(PresentationData presentation) { - final Collection problems = ((ArtifactEditorImpl)myContext.getThisArtifactEditor()).getValidationManager().getProblems(this); + final Collection problems = ((ArtifactEditorImpl)myContext.getThisArtifactEditor()).getValidationManager().getProblems(this); if (problems == null || problems.isEmpty()) { super.update(presentation); return; } - final String message = StringUtil.join(problems, "\n"); + StringBuilder buffer = StringBuilderSpinAllocator.alloc(); + final String tooltip; + boolean isError = false; + try { + buffer.append(""); + for (ArtifactProblemDescription problem : problems) { + isError |= problem.getSeverity() == ProjectStructureProblemDescription.Severity.ERROR; + buffer.append(problem.getMessage()).append("
"); + } + buffer.append(""); + tooltip = buffer.toString(); + } + finally { + StringBuilderSpinAllocator.dispose(buffer); + } - getElementPresentation().render(presentation, addErrorHighlighting(SimpleTextAttributes.REGULAR_ATTRIBUTES), - addErrorHighlighting(SimpleTextAttributes.GRAY_ATTRIBUTES)); - presentation.setTooltip(message); + getElementPresentation().render(presentation, addErrorHighlighting(isError, SimpleTextAttributes.REGULAR_ATTRIBUTES), + addErrorHighlighting(isError, SimpleTextAttributes.GRAY_ATTRIBUTES)); + presentation.setTooltip(tooltip); } - private static SimpleTextAttributes addErrorHighlighting(SimpleTextAttributes attributes) { + private static SimpleTextAttributes addErrorHighlighting(boolean error, SimpleTextAttributes attributes) { final TextAttributes textAttributes = attributes.toTextAttributes(); textAttributes.setEffectType(EffectType.WAVE_UNDERSCORE); - textAttributes.setEffectColor(Color.RED); + textAttributes.setEffectColor(error ? Color.RED : Color.GRAY); return SimpleTextAttributes.fromTextAttributes(textAttributes); } From b463c8ec400398b0a435cc114595a480631e29b1 Mon Sep 17 00:00:00 2001 From: Kirill Kalishev Date: Wed, 25 Nov 2009 15:48:44 +0300 Subject: [PATCH 06/26] macros: typing target for more solid typing to edtior --- .../com/intellij/openapi/ui/TypingTarget.java | 24 ++++++++++ .../intellij/ide/actionMacro/ActionMacro.java | 2 +- .../StartStopMacroRecordingAction.java | 7 ++- .../editor/impl/EditorComponentImpl.java | 8 +++- .../openapi/editor/impl/EditorImpl.java | 15 ++++++- .../commands/AlphaNumericTypeCommand.java | 45 ++++++++++++++++++- .../playback/commands/KeyCodeTypeCommand.java | 29 ++++++++++-- .../src/misc/registry.properties | 1 + 8 files changed, 121 insertions(+), 10 deletions(-) create mode 100644 platform/platform-api/src/com/intellij/openapi/ui/TypingTarget.java diff --git a/platform/platform-api/src/com/intellij/openapi/ui/TypingTarget.java b/platform/platform-api/src/com/intellij/openapi/ui/TypingTarget.java new file mode 100644 index 000000000000..4439e775d1f8 --- /dev/null +++ b/platform/platform-api/src/com/intellij/openapi/ui/TypingTarget.java @@ -0,0 +1,24 @@ +/* + * Copyright 2000-2009 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.openapi.ui; + +import com.intellij.openapi.util.ActionCallback; + +public interface TypingTarget { + + ActionCallback type(String text); + +} diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java index 63a7ecc80c07..fcd575cecfbb 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java @@ -208,7 +208,7 @@ public class ActionMacro implements JDOMExternalizable { myKeyCodes.addAll(keyCodes); myModifiers.addAll(modifiers); - assert myKeyCodes.size() == myModifiers.size(); + assert myKeyCodes.size() == myModifiers.size() : "codes=" + myKeyCodes.toString() + " modifiers=" + myModifiers.toString(); } public TypedDescriptor(char c, int keyCode, int modifiers) { diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/StartStopMacroRecordingAction.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/StartStopMacroRecordingAction.java index b508f088a8f4..f750dce297dc 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/StartStopMacroRecordingAction.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/StartStopMacroRecordingAction.java @@ -28,8 +28,11 @@ import com.intellij.openapi.project.DumbAware; */ public class StartStopMacroRecordingAction extends AnAction implements DumbAware { public void update(AnActionEvent e) { - e.getPresentation().setEnabled(e.getDataContext().getData(DataConstants.EDITOR) != null); - e.getPresentation().setText(ActionMacroManager.getInstance().isRecording() + boolean editorAvailable = e.getDataContext().getData(DataConstants.EDITOR) != null; + boolean isRecording = ActionMacroManager.getInstance().isRecording(); + + e.getPresentation().setEnabled(editorAvailable || isRecording); + e.getPresentation().setText(isRecording ? IdeBundle.message("action.stop.macro.recording") : IdeBundle.message("action.start.macro.recording")); } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java index cd1fce386caa..bc0a3fb12e2e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorComponentImpl.java @@ -22,6 +22,8 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.impl.ApplicationImpl; import com.intellij.openapi.ui.TestableUi; import com.intellij.openapi.editor.ex.util.EditorUtil; +import com.intellij.openapi.ui.TypingTarget; +import com.intellij.openapi.util.ActionCallback; import javax.swing.*; import java.awt.*; @@ -33,7 +35,7 @@ import java.util.Map; /** * */ -public class EditorComponentImpl extends JComponent implements Scrollable, DataProvider, TestableUi { +public class EditorComponentImpl extends JComponent implements Scrollable, DataProvider, TestableUi, TypingTarget { private final EditorImpl myEditor; public EditorComponentImpl(EditorImpl editor) { @@ -96,6 +98,10 @@ public class EditorComponentImpl extends JComponent implements Scrollable, DataP } } + public ActionCallback type(String text) { + return myEditor.type(text); + } + public InputMethodRequests getInputMethodRequests() { return myEditor.getInputMethodRequests(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 234cd6fea95e..653e2786735e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -593,17 +593,28 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi myPropertyChangeSupport.firePropertyChange(PROP_FONT_SIZE, oldFontSize, fontSize); } - private void processKeyTyped(char c) { + public ActionCallback type(String text) { + for (int i = 0; i < text.length(); i++) { + if (!processKeyTyped(text.charAt(i))) { + return new ActionCallback.Rejected(); + } + } + return new ActionCallback.Done(); + } + + private boolean processKeyTyped(char c) { // [vova] This is patch for Mac OS X. Under Mac "input methods" // is handled before our EventQueue consume upcoming KeyEvents. IdeEventQueue queue = IdeEventQueue.getInstance(); if (queue.shouldNotTypeInEditor() || ProgressManager.getInstance().hasModalProgressIndicator()) { - return; + return false; } ActionManagerEx actionManager = ActionManagerEx.getInstanceEx(); DataContext dataContext = getDataContext(); actionManager.fireBeforeEditorTyping(c, dataContext); EditorActionManager.getInstance().getTypedAction().actionPerformed(this, c, dataContext); + + return true; } private void fireFocusLost() { diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java index be95759e4fa8..10a938d963ab 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/AlphaNumericTypeCommand.java @@ -15,8 +15,11 @@ */ package com.intellij.openapi.ui.playback.commands; +import com.intellij.openapi.ui.TypingTarget; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.ui.playback.PlaybackRunner; +import com.intellij.openapi.util.registry.Registry; +import org.jetbrains.annotations.Nullable; import java.awt.*; import java.awt.event.KeyEvent; @@ -31,7 +34,28 @@ public class AlphaNumericTypeCommand extends TypeCommand { return type(robot, getText()); } - protected ActionCallback type(Robot robot, String text) { + protected ActionCallback type(final Robot robot, final String text) { + final ActionCallback result = new ActionCallback(); + + TypingTarget typingTarget = findTarget(); + if (typingTarget != null) { + typingTarget.type(text).doWhenDone(new Runnable() { + public void run() { + result.setDone(); + } + }).doWhenRejected(new Runnable() { + public void run() { + typeByRobot(robot, text).notify(result); + } + }); + } else { + typeByRobot(robot, text).notify(result); + } + + return result; + } + + private ActionCallback typeByRobot(Robot robot, String text) { for (int i = 0; i < text.length(); i++) { final char each = text.charAt(i); if ('\\' == each && i + 1 < text.length()) { @@ -60,4 +84,23 @@ public class AlphaNumericTypeCommand extends TypeCommand { } return new ActionCallback.Done(); } + + @Nullable + public static TypingTarget findTarget() { + if (!Registry.is("actionSystem.playback.useTypingTargets")) return null; + + Component each = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); + + while (each != null) { + if (each instanceof TypingTarget) { + return (TypingTarget)each; + } + + each = each.getParent(); + } + + return null; + } + + } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java index 6b13ea242580..b0b8745fa3e4 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/playback/commands/KeyCodeTypeCommand.java @@ -15,9 +15,12 @@ */ package com.intellij.openapi.ui.playback.commands; +import com.intellij.openapi.ui.TypingTarget; import com.intellij.openapi.ui.playback.PlaybackRunner; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.Pair; +import com.intellij.openapi.util.registry.Registry; +import org.jetbrains.annotations.Nullable; import java.awt.*; import java.awt.List; @@ -34,12 +37,12 @@ public class KeyCodeTypeCommand extends AlphaNumericTypeCommand { } @Override - public ActionCallback _execute(PlaybackRunner.StatusCallback cb, Robot robot, boolean directActionCall) { + public ActionCallback _execute(final PlaybackRunner.StatusCallback cb, final Robot robot, boolean directActionCall) { String text = getText().substring(PREFIX.length()).trim(); int textDelim = text.indexOf(" "); - String codes; + final String codes; if (textDelim >= 0) { codes = text.substring(0, textDelim); } else { @@ -53,7 +56,27 @@ public class KeyCodeTypeCommand extends AlphaNumericTypeCommand { unicode = ""; } + final ActionCallback result = new ActionCallback(); + TypingTarget typingTarget = findTarget(); + if (typingTarget != null) { + typingTarget.type(unicode).doWhenDone(new Runnable() { + public void run() { + result.setDone(); + } + }).doWhenRejected(new Runnable() { + public void run() { + typeCodes(cb, robot, codes).notify(result); + } + }); + } else { + typeCodes(cb, robot, codes).notify(result); + } + + return result; + } + + private ActionCallback typeCodes(PlaybackRunner.StatusCallback cb, Robot robot, String codes) { String[] pairs = codes.split(CODE_DELIMITER); for (String eachPair : pairs) { try { @@ -82,7 +105,7 @@ public class KeyCodeTypeCommand extends AlphaNumericTypeCommand { String[] strings = each.split(MODIFIER_DELIMITER); if (strings.length == 2) { codes.add(Integer.valueOf(strings[0])); - codes.add(Integer.valueOf(strings[1])); + modifiers.add(Integer.valueOf(strings[1])); } } } diff --git a/platform/platform-resources-en/src/misc/registry.properties b/platform/platform-resources-en/src/misc/registry.properties index 32bd52c1ebe3..35fe382c6e0b 100644 --- a/platform/platform-resources-en/src/misc/registry.properties +++ b/platform/platform-resources-en/src/misc/registry.properties @@ -17,6 +17,7 @@ actionSystem.typeAheadTimeBeforeDialog.description=If dialog shown as a result o actionSystem.playback.autodelay=20 actionSystem.playback.autodelay.description=Delay between events generated by the playback runner actionSystem.playback.useDirectActionCall=true +actionSystem.playback.useTypingTargets=true actionSystem.focusIdleTimeout=20 actionSystem.mac.screenMenuNotUpdatedFix=false actionSystem.keyGestures.enabled=false From fbdd31abdc0b18744683ae18bcff436cf60dc9ec Mon Sep 17 00:00:00 2001 From: Gregory Shrago Date: Wed, 25 Nov 2009 15:51:46 +0300 Subject: [PATCH 07/26] AE: PsiFileBase.findLanguage --- .../src/com/intellij/lang/xml/XmlFileViewProvider.java | 2 +- .../intellij/psi/CompositeLanguageFileViewProvider.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/lang/xml/XmlFileViewProvider.java b/xml/impl/src/com/intellij/lang/xml/XmlFileViewProvider.java index b74df136d6d5..5f5191200e27 100644 --- a/xml/impl/src/com/intellij/lang/xml/XmlFileViewProvider.java +++ b/xml/impl/src/com/intellij/lang/xml/XmlFileViewProvider.java @@ -30,7 +30,7 @@ public class XmlFileViewProvider extends CompositeLanguageFileViewProvider { private final XMLLanguage myLanguage; public XmlFileViewProvider(final PsiManager manager, final VirtualFile virtualFile, final boolean physical, XMLLanguage language) { - super(manager, virtualFile, physical); + super(manager, virtualFile, physical, language); myLanguage = language; assert !(myLanguage instanceof TemplateLanguage); } diff --git a/xml/impl/src/com/intellij/psi/CompositeLanguageFileViewProvider.java b/xml/impl/src/com/intellij/psi/CompositeLanguageFileViewProvider.java index f447b73127ca..577f58b5d536 100644 --- a/xml/impl/src/com/intellij/psi/CompositeLanguageFileViewProvider.java +++ b/xml/impl/src/com/intellij/psi/CompositeLanguageFileViewProvider.java @@ -60,6 +60,13 @@ public class CompositeLanguageFileViewProvider extends SingleRootFileViewProvide super(manager, virtualFile, physical); } + protected CompositeLanguageFileViewProvider(@NotNull PsiManager manager, + @NotNull VirtualFile virtualFile, + boolean physical, + @NotNull Language language) { + super(manager, virtualFile, physical, language); + } + @NotNull public SingleRootFileViewProvider createCopy(final LightVirtualFile copy) { final CompositeLanguageFileViewProvider viewProvider = cloneInner(copy); From 2cf0b0c3f2253e06cf98e185bb498153462d2d4a Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Wed, 25 Nov 2009 16:04:03 +0300 Subject: [PATCH 08/26] fix editable combobox borders under some LAFs --- .../platform-impl/src/com/intellij/ui/EditorComboBoxEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/ui/EditorComboBoxEditor.java b/platform/platform-impl/src/com/intellij/ui/EditorComboBoxEditor.java index 08521183ea34..346f37eeceb7 100644 --- a/platform/platform-impl/src/com/intellij/ui/EditorComboBoxEditor.java +++ b/platform/platform-impl/src/com/intellij/ui/EditorComboBoxEditor.java @@ -37,7 +37,7 @@ public class EditorComboBoxEditor implements ComboBoxEditor{ myTextField = new EditorTextField((Document)null, project, fileType) { @Override protected boolean shouldHaveBorder() { - return false; + return UIManager.getBorder("ComboBox.border") == null; } }; From 671508bcecad876492b68ad5479990a94a6eb42e Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Wed, 25 Nov 2009 16:17:46 +0300 Subject: [PATCH 09/26] Maven: tests fixed --- .../maven/project/MavenProjectsManager.java | 19 ++++++++----------- .../project/MavenProjectsManagerTest.java | 4 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java index b8b80bdae67e..eeb3f35b398f 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java @@ -36,7 +36,6 @@ import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileManager; -import com.intellij.problems.WolfTheProblemSolver; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; import com.intellij.util.EventDispatcher; @@ -272,7 +271,7 @@ public class MavenProjectsManager extends SimpleProjectComponent implements Pers myImportingQueue.makeDumbAware(myProject); myImportingQueue.makeModalAware(myProject); - mySchedulesQueue = new MavenMergingUpdateQueue(getComponentName() + ": Schedules queue", 500, true, myProject); + mySchedulesQueue = new MavenMergingUpdateQueue(getComponentName() + ": Schedules queue", 500, !isUnitTestMode(), myProject); mySchedulesQueue.setPassThrough(false); } @@ -714,10 +713,6 @@ public class MavenProjectsManager extends SimpleProjectComponent implements Pers scheduleArtifactsDownloading(getProjects()); } - private void scheduleImport(Pair projectWithChanges) { - scheduleImport(Collections.singletonList(projectWithChanges), false); - } - private void scheduleImport(List> projectsWithChanges, boolean forceImport) { scheduleForNextImport(projectsWithChanges); scheduleImport(forceImport); @@ -762,12 +757,14 @@ public class MavenProjectsManager extends SimpleProjectComponent implements Pers @TestOnly public void scheduleImportInTests(List projectFiles) { + List> toImport = new ArrayList>(); for (VirtualFile each : projectFiles) { MavenProject project = findProject(each); if (project != null) { - scheduleImport(Pair.create(project, MavenProjectChanges.ALL)); + toImport.add(Pair.create(project, MavenProjectChanges.ALL)); } } + scheduleImport(toImport, false); } private void scheduleForNextImport(Pair projectWithChanges) { @@ -796,16 +793,16 @@ public class MavenProjectsManager extends SimpleProjectComponent implements Pers } public void performScheduledImport() { - performScheduledImport(false); + performScheduledImport(true); } - public void performScheduledImport(final boolean onlyIfAutoImportMode) { + public void performScheduledImport(final boolean force) { if (!isInitialized()) return; runWhenFullyOpen(new Runnable() { public void run() { // ensure all pending schedules are processed mySchedulesQueue.flush(false); - if (onlyIfAutoImportMode && !myImportingQueue.isActive()) return; + if (!force && !myImportingQueue.isActive()) return; myImportingQueue.flush(false); } }); @@ -1014,7 +1011,7 @@ public class MavenProjectsManager extends SimpleProjectComponent implements Pers } }.execute().getResultObject(); - scheduleImport(Pair.create(mavenProject, MavenProjectChanges.DEPENDENCIES)); + scheduleImport(Collections.singletonList(Pair.create(mavenProject, MavenProjectChanges.DEPENDENCIES)), false); return result; } diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsManagerTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsManagerTest.java index 1fb4e9f21b2d..245fc4539a1c 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsManagerTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/project/MavenProjectsManagerTest.java @@ -245,7 +245,7 @@ public class MavenProjectsManagerTest extends MavenImportingTestCase { myProjectsManager.addManagedFiles(Arrays.asList(m2)); waitForReadingCompletion(); - myProjectsManager.performScheduledImport(true); + myProjectsManager.performScheduledImport(false); assertModules("m1", "m2"); @@ -253,7 +253,7 @@ public class MavenProjectsManagerTest extends MavenImportingTestCase { myProjectsManager.removeManagedFiles(Arrays.asList(m2)); waitForReadingCompletion(); - myProjectsManager.performScheduledImport(true); + myProjectsManager.performScheduledImport(false); assertModules("m1"); } From 30a9b8e392b8905a0d049e3d0a538efa7ba8b154 Mon Sep 17 00:00:00 2001 From: Maas van den Berg Date: Wed, 25 Nov 2009 16:23:32 +0300 Subject: [PATCH 10/26] IDEADEV-41575 --- .../welcomeScreen/RecentProjectsAction.java | 14 ++++++----- .../welcomeScreen/WelcomePopupAction.java | 23 ++++++++++++++++--- .../impl/welcomeScreen/GetFromVcsAction.java | 5 ++++ 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectsAction.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectsAction.java index 00e040e17541..885b9686f9db 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectsAction.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/RecentProjectsAction.java @@ -17,16 +17,13 @@ package com.intellij.openapi.wm.impl.welcomeScreen; import com.intellij.ide.RecentProjectsManagerBase; import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.ui.UIBundle; /** - * Created by IntelliJ IDEA. - * User: pti - * Date: Mar 2, 2005 - * Time: 4:02:31 PM - * To change this template use File | Settings | File Templates. + * @author pti + * Date: Mar 2, 2005 */ public class RecentProjectsAction extends WelcomePopupAction { protected void fillActions(final DefaultActionGroup group) { @@ -44,6 +41,11 @@ public class RecentProjectsAction extends WelcomePopupAction { return ""; } + @Override + protected boolean isSilentlyChooseSingleOption() { + return false; + } + @Override public void update(final AnActionEvent e) { e.getPresentation().setVisible(RecentProjectsManagerBase.getInstance().getRecentProjectsActions(false).length > 0); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomePopupAction.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomePopupAction.java index 484f612cc16c..dd17aa7c1030 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomePopupAction.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomePopupAction.java @@ -16,8 +16,8 @@ package com.intellij.openapi.wm.impl.welcomeScreen; import com.intellij.openapi.actionSystem.*; -import com.intellij.openapi.project.Project; import com.intellij.openapi.project.DumbAware; +import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.ui.popup.ListPopup; import com.intellij.openapi.wm.ex.WindowManagerEx; @@ -36,14 +36,30 @@ public abstract class WelcomePopupAction extends AnAction implements DumbAware { protected abstract String getCaption(); + /** + * When there is only one option to choose from, this method is called to determine whether + * the popup should still be shown or that the option should be chosen silently. + * + * @return true to choose single option silently + * false otherwise + */ + protected abstract boolean isSilentlyChooseSingleOption(); + public void actionPerformed(final AnActionEvent e) { - showPopup(e.getDataContext()); + showPopup(e); } - private void showPopup(final DataContext context) { + private void showPopup(final AnActionEvent e) { final DefaultActionGroup group = new DefaultActionGroup(); fillActions(group); + if (group.getChildrenCount() == 1 && isSilentlyChooseSingleOption()) { + final AnAction[] children = group.getChildren(null); + children[0].actionPerformed(e); + return; + } + + if (group.getChildrenCount() == 0) { group.add(new AnAction(getTextForEmpty()) { public void actionPerformed(AnActionEvent e) { @@ -52,6 +68,7 @@ public abstract class WelcomePopupAction extends AnAction implements DumbAware { } ); } + final DataContext context = e.getDataContext(); final ListPopup popup = JBPopupFactory.getInstance() .createActionGroupPopup(getCaption(), group, diff --git a/platform/vcs-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/GetFromVcsAction.java b/platform/vcs-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/GetFromVcsAction.java index 6d7882791481..966a58abfc8b 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/GetFromVcsAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/GetFromVcsAction.java @@ -46,4 +46,9 @@ public class GetFromVcsAction extends WelcomePopupAction{ protected String getTextForEmpty() { return UIBundle.message("welcome.screen.get.from.vcs.action.no.vcs.plugins.with.check.out.action.installed.action.name"); } + + @Override + protected boolean isSilentlyChooseSingleOption() { + return true; + } } From 5e7865b3cbd7140b41fd7aa7df6586daa06dd204 Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 25 Nov 2009 16:28:45 +0300 Subject: [PATCH 11/26] IDEADEV-41372: Artifacts: exception on right0clicking on just deleted library --- .../ProjectStructureConfigurable.java | 2 +- .../ArtifactsStructureConfigurable.java | 34 +++++++++++++++---- ...factsStructureConfigurableContextImpl.java | 6 ++++ .../openapi/ui/MasterDetailsComponent.java | 2 +- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java index 48afcd6daf75..a35e4ad7e44f 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java @@ -122,7 +122,7 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se myGlobalLibrariesConfig.init(myContext); myModulesConfig.init(myContext); myFacetStructureConfigurable.init(myContext); - myArtifactsStructureConfigurable.init(myContext); + myArtifactsStructureConfigurable.init(myContext, myModulesConfig, myProjectLibrariesConfig, myGlobalLibrariesConfig); final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(myProject); myUiState.lastEditedConfigurable = propertiesComponent.getValue("project.structure.last.edited"); diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurable.java index 914dfd05bed7..48155303906d 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurable.java @@ -23,14 +23,15 @@ import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; +import com.intellij.openapi.module.Module; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectBundle; import com.intellij.openapi.roots.ModifiableRootModel; +import com.intellij.openapi.roots.libraries.Library; import com.intellij.openapi.roots.ui.configuration.ModuleEditor; -import com.intellij.openapi.roots.ui.configuration.projectRoot.BaseStructureConfigurable; -import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext; +import com.intellij.openapi.roots.ui.configuration.projectRoot.*; import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureElement; import com.intellij.openapi.ui.MasterDetailsStateService; import com.intellij.packaging.artifacts.*; @@ -40,7 +41,9 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; /** * @author nik @@ -58,8 +61,8 @@ public class ArtifactsStructureConfigurable extends BaseStructureConfigurable { MasterDetailsStateService.getInstance(project).register("ArtifactsStructureConfigurable.UI", this); } - @Override - public void init(StructureConfigurableContext context) { + public void init(StructureConfigurableContext context, ModuleStructureConfigurable moduleStructureConfigurable, + ProjectLibrariesConfigurable projectLibrariesConfig, GlobalLibrariesConfigurable globalLibrariesConfig) { super.init(context); myPackagingEditorContext = new ArtifactsStructureConfigurableContextImpl(myContext, myProject, myDefaultSettings, new ArtifactAdapter() { @Override @@ -77,6 +80,26 @@ public class ArtifactsStructureConfigurable extends BaseStructureConfigurable { } } }); + final ItemsChangeListener listener = new ItemsChangeListener() { + public void itemChanged(@Nullable Object deletedItem) { + if (deletedItem instanceof Library || deletedItem instanceof Module) { + onElementDeleted(); + } + } + + public void itemsExternallyChanged() { + } + }; + moduleStructureConfigurable.addItemsChangeListener(listener); + projectLibrariesConfig.addItemsChangeListener(listener); + globalLibrariesConfig.addItemsChangeListener(listener); + } + + private void onElementDeleted() { + for (ArtifactEditorImpl editor : myPackagingEditorContext.getArtifactEditors()) { + editor.getSourceItemsTree().rebuildTree(); + editor.queueValidation(); + } } @Nls @@ -251,7 +274,6 @@ public class ArtifactsStructureConfigurable extends BaseStructureConfigurable { return null; } - private class AddArtifactAction extends DumbAwareAction { private final ArtifactType myType; private final ArtifactTemplate myArtifactTemplate; diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurableContextImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurableContextImpl.java index fbe1cebe332f..3e88bd9ce1b6 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurableContextImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsStructureConfigurableContextImpl.java @@ -36,6 +36,8 @@ import com.intellij.packaging.ui.ManifestFileConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -215,6 +217,10 @@ public class ArtifactsStructureConfigurableContextImpl implements ArtifactsStruc myArtifactElements.clear(); } + public Collection getArtifactEditors() { + return Collections.unmodifiableCollection(myArtifactEditors.values()); + } + public void saveEditorSettings() { myEditorSettings.clear(); for (ArtifactEditorImpl artifactEditor : myArtifactEditors.values()) { diff --git a/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java b/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java index 502eb7ed069d..b013d99037d3 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java @@ -260,7 +260,7 @@ public abstract class MasterDetailsComponent implements Configurable, Persistent } } - protected void addItemsChangeListener(ItemsChangeListener l) { + public void addItemsChangeListener(ItemsChangeListener l) { myListners.add(l); } From 794d6afa85e851fafc552ad6847bdef48775d0cb Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Wed, 25 Nov 2009 14:44:54 +0100 Subject: [PATCH 12/26] IDEADEV-41545 (confusing inspection message for static interface declaration inside class) --- .../siyeh/InspectionGadgetsBundle.properties | 5 +++-- ...nnecessaryInterfaceModifierInspection.java | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/plugins/InspectionGadgets/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/src/com/siyeh/InspectionGadgetsBundle.properties index 0986ee4cac5f..f86bd858a29a 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/InspectionGadgetsBundle.properties +++ b/plugins/InspectionGadgets/src/com/siyeh/InspectionGadgetsBundle.properties @@ -1312,7 +1312,8 @@ unnecessarily.qualified.static.usage.problem.descriptor1=Unnecessarily qualified unnecessarily.qualified.static.usage.ignore.field.option=Ignore unnecessarily qualified field accesses unnecessarily.qualified.static.usage.ignore.method.option=Ignore unnecessarily qualified method calls unnecessary.interface.modifier.problem.descriptor=Modifier #ref is redundant for interfaces #loc -unnecessary.interface.modifier.problem.descriptor1=Modifier #ref is redundant for inner interfaces of interfaces #loc +unnecessary.interface.modifier.inner.interface.of.interface.problem.descriptor=Modifier #ref is redundant for inner interfaces of interfaces #loc +unnecessary.interface.modifier.inner.interface.of.class.problem.descriptor=Modifier #ref is redundant for inner interfaces of classes #loc unnecessary.interface.modifier.problem.descriptor2=Modifier #ref is redundant for interface methods #loc unnecessary.interface.modifier.problem.descriptor3=Modifier #ref is redundant for inner classes of interfaces #loc unnecessary.interface.modifier.problem.descriptor4=Modifier #ref is redundant for interface fields #loc @@ -1754,4 +1755,4 @@ unnecessary.javadoc.link.display.name=Unnecessary JavaDoc link unnecessary.javadoc.link.problem.descriptor=#ref is unnecessary unnecessary.javadoc.link.quickfix=Remove unnecessary {0} thread.local.not.static.final.display.name=ThreadLocal field not declared static final -thread.local.not.static.final.problem.descriptor=ThreadLocal #ref is not declared 'static final' \ No newline at end of file +thread.local.not.static.final.problem.descriptor=ThreadLocal #ref is not declared 'static final' diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java index ba33b2c6b63a..666226451957 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/style/UnnecessaryInterfaceModifierInspection.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Dave Griffith, Bas Leijdekkers + * Copyright 2003-2009 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. @@ -65,8 +65,13 @@ public class UnnecessaryInterfaceModifierInspection extends BaseInspection { final PsiClass containingClass = aClass.getContainingClass(); if (containingClass != null) { if (aClass.isInterface()) { - return InspectionGadgetsBundle.message( - "unnecessary.interface.modifier.problem.descriptor1"); + if (containingClass.isInterface()) { + return InspectionGadgetsBundle.message( + "unnecessary.interface.modifier.inner.interface.of.interface.problem.descriptor"); + } else { + return InspectionGadgetsBundle.message( + "unnecessary.interface.modifier.inner.interface.of.class.problem.descriptor"); + } } else { return InspectionGadgetsBundle.message( "unnecessary.interface.modifier.problem.descriptor3"); @@ -91,15 +96,15 @@ public class UnnecessaryInterfaceModifierInspection extends BaseInspection { @Override public InspectionGadgetsFix buildFix(Object... infos) { - return new UnnecessaryInterfaceModifersFix((String) infos[0]); + return new UnnecessaryInterfaceModifiersFix((String) infos[0]); } - private static class UnnecessaryInterfaceModifersFix + private static class UnnecessaryInterfaceModifiersFix extends InspectionGadgetsFix { private final String modifiersText; - private UnnecessaryInterfaceModifersFix(String modifiersText) { + private UnnecessaryInterfaceModifiersFix(String modifiersText) { this.modifiersText = modifiersText; } @@ -217,4 +222,4 @@ public class UnnecessaryInterfaceModifierInspection extends BaseInspection { } } } -} \ No newline at end of file +} From 3e42c3e6ffcb0b5741b751e3d0ed0f97fdf84f48 Mon Sep 17 00:00:00 2001 From: Kirill Kalishev Date: Wed, 25 Nov 2009 16:53:00 +0300 Subject: [PATCH 13/26] macros: write action for typing targets --- .../ide/actionMacro/ActionMacroManager.java | 2 +- .../openapi/editor/impl/EditorImpl.java | 28 +++++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java index 4e8812500227..1820530ad9a8 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java @@ -364,7 +364,7 @@ public class ActionMacroManager implements ExportableApplicationComponent, Named myRecordingMacro.appendKeytyped(e.getKeyChar(), e.getKeyCode(), e.getModifiers()); } else if (e.getID() == KeyEvent.KEY_PRESSED && noModifierKeyIsPressed && (!plainType || isEnter)) { final boolean waiting = IdeEventQueue.getInstance().getKeyEventDispatcher().isWaitingForSecondKeyStroke(); - if (!e.equals(myLastActionInputEvent) && !waiting) { + if ((!e.equals(myLastActionInputEvent) && !waiting) || isEnter) { final String stroke = KeyStroke.getKeyStrokeForEvent(e).toString(); final int pressed = stroke.indexOf("pressed"); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 653e2786735e..bc5d030aa1f1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -24,6 +24,7 @@ import com.intellij.ide.*; import com.intellij.ide.dnd.DnDManager; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.ActionManagerEx; +import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.application.ex.ApplicationManagerEx; @@ -593,13 +594,28 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi myPropertyChangeSupport.firePropertyChange(PROP_FONT_SIZE, oldFontSize, fontSize); } - public ActionCallback type(String text) { - for (int i = 0; i < text.length(); i++) { - if (!processKeyTyped(text.charAt(i))) { - return new ActionCallback.Rejected(); - } + public ActionCallback type(final String text) { + final ActionCallback result = new ActionCallback(); + + Application app = ApplicationManager.getApplication(); + if (!app.isWriteAccessAllowed()) { + result.setRejected(); + } else { + app.runWriteAction(new Runnable() { + public void run() { + for (int i = 0; i < text.length(); i++) { + if (!processKeyTyped(text.charAt(i))) { + result.setRejected(); + return; + } + } + + result.setDone(); + } + }); } - return new ActionCallback.Done(); + + return result; } private boolean processKeyTyped(char c) { From 699abe9d4ba01c8a932c1de9f8a7f254dc8fedb2 Mon Sep 17 00:00:00 2001 From: Kirill Kalishev Date: Wed, 25 Nov 2009 17:30:21 +0300 Subject: [PATCH 14/26] macros: diplication for action element and key shortcut --- .../src/com/intellij/ide/actionMacro/ActionMacroManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java index 1820530ad9a8..4cd3ade5eaa4 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacroManager.java @@ -374,7 +374,9 @@ public class ActionMacroManager implements ExportableApplicationComponent, Named String ready = (modifiers.replaceAll("ctrl", "control").trim() + " " + key.trim()).trim(); myRecordingMacro.appendShortuct(ready); - myLastActionInputEvent = null; + if (!isEnter) { + myLastActionInputEvent = null; + } } } } From 82fdb8d4aa9b6cfa32cb8b195b356d9448da1ea2 Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Wed, 25 Nov 2009 17:51:15 +0300 Subject: [PATCH 15/26] Maven: hiding unnecessary nodes in the 'Select Maven Goal' --- .../navigator/MavenProjectsStructure.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java index 68d29c785d5d..6708aac730dd 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/navigator/MavenProjectsStructure.java @@ -242,16 +242,6 @@ public class MavenProjectsStructure extends SimpleTreeStructure { ALWAYS, NEVER, NORMAL } - private DisplayKind getDisplayKind(CustomNode node) { - Class[] visibles = getVisibleNodesClasses(); - if (visibles == null) return DisplayKind.NORMAL; - - for (Class each : visibles) { - if (each.isInstance(node)) return DisplayKind.ALWAYS; - } - return DisplayKind.NORMAL; - } - protected Class[] getVisibleNodesClasses() { return null; } @@ -353,7 +343,13 @@ public class MavenProjectsStructure extends SimpleTreeStructure { } public DisplayKind getDisplayKind() { - return MavenProjectsStructure.this.getDisplayKind(this); + Class[] visibles = getVisibleNodesClasses(); + if (visibles == null) return DisplayKind.NORMAL; + + for (Class each : visibles) { + if (each.isInstance(this)) return DisplayKind.ALWAYS; + } + return DisplayKind.NEVER; } public CustomNode[] getChildren() { @@ -1094,11 +1090,6 @@ public class MavenProjectsStructure extends SimpleTreeStructure { setNodeErrorLevel(myArtifact.isResolved() ? ErrorLevel.NONE : ErrorLevel.ERROR); } - @Override - public boolean isVisible() { - return true; - } - @Override public Navigatable getNavigatable() { final Module m = myProjectsManager.findModule(myMavenProject); @@ -1119,5 +1110,10 @@ public class MavenProjectsStructure extends SimpleTreeStructure { } }; } + + @Override + public boolean isVisible() { + return getDisplayKind() != DisplayKind.NEVER; + } } } From 6efe77afa23a4bfd1eb4c2b4a1bf2cb741950528 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 25 Nov 2009 18:09:50 +0300 Subject: [PATCH 16/26] Structure view now shows structure for the file selected, not the file currently open in editor. It sure does latter if file editor is currectly active. --- .../ide/impl/ModuleStructureComponent.java | 15 +++++-- .../ide/impl/StructureViewWrapperImpl.java | 44 +++++++++++++++---- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/impl/ModuleStructureComponent.java b/platform/lang-impl/src/com/intellij/ide/impl/ModuleStructureComponent.java index 575e39e8e5ae..8a346bfa23b8 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/ModuleStructureComponent.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/ModuleStructureComponent.java @@ -20,20 +20,27 @@ package com.intellij.ide.impl; import com.intellij.openapi.Disposable; +import com.intellij.openapi.actionSystem.DataProvider; import com.intellij.openapi.module.Module; import com.intellij.openapi.ui.SimpleToolWindowPanel; import com.intellij.openapi.util.Disposer; +import org.jetbrains.annotations.NonNls; + +public class ModuleStructureComponent extends SimpleToolWindowPanel implements Disposable, DataProvider { + private final ModuleStructurePane myStructurePane; -public class ModuleStructureComponent extends SimpleToolWindowPanel implements Disposable { public ModuleStructureComponent(Module module) { super(true, true); - final ModuleStructurePane structurePane = new ModuleStructurePane(module); - Disposer.register(this, structurePane); + myStructurePane = new ModuleStructurePane(module); + Disposer.register(this, myStructurePane); - setContent(structurePane.createComponent()); + setContent(myStructurePane.createComponent()); } + public Object getData(@NonNls String dataId) { + return myStructurePane.getData(dataId); + } public void dispose() { diff --git a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java index 85c681072efe..bc7fedca4ef9 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java @@ -26,15 +26,19 @@ import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorManager; +import com.intellij.openapi.fileEditor.FileEditorProvider; +import com.intellij.openapi.fileEditor.ex.FileEditorProviderManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Disposer; +import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.openapi.wm.ex.IdeFocusTraversalPolicy; import com.intellij.psi.PsiDocumentManager; +import com.intellij.util.Alarm; import com.intellij.util.IJSwingUtilities; import com.intellij.util.ui.UIUtil; @@ -57,6 +61,7 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl private ModuleStructureComponent myModuleStructureComponent; private final JPanel myPanel; + private final Alarm myUpdateAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD); // ------------------------------------------------------------------------- // Constructor @@ -69,7 +74,7 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl ActionManager.getInstance().addTimerListener(500, new TimerListener() { public ModalityState getModalityState() { - return ModalityState.NON_MODAL; + return ModalityState.stateForComponent(myPanel); } public void run() { @@ -80,7 +85,7 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl getComponent().addHierarchyListener(new HierarchyListener() { public void hierarchyChanged(HierarchyEvent e) { if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) { - rebuild(); + scheduleRebuild(); } } }); @@ -104,11 +109,22 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl if (fileEditor != null) { if (Arrays.asList(FileEditorManager.getInstance(myProject).getSelectedEditors()).contains(fileEditor)) { setFileEditor(fileEditor); + return; } } - else { - setModule(LangDataKeys.MODULE_CONTEXT.getData(dataContext)); + + final VirtualFile[] files = PlatformDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext); + if (files != null && files.length == 1) { + FileEditorProviderManager editorProviderManager = FileEditorProviderManager.getInstance(); + final FileEditorProvider[] providers = editorProviderManager.getProviders(myProject, files[0]); + for (FileEditorProvider provider : providers) { + FileEditor tempFileEditor = provider.createEditor(myProject, files[0]); + setFileEditor(tempFileEditor); + return; + } } + + setModule(LangDataKeys.MODULE_CONTEXT.getData(dataContext)); } } @@ -141,28 +157,40 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl private void setModule(Module module) { if (module != myModule) { + myFileEditor = null; myModule = module; - rebuild(); + scheduleRebuild(); + } + else if (module == null) { + setFileEditor(null); } } public void setFileEditor(FileEditor fileEditor) { if (myModule != null) { myModule = null; - rebuild(); + scheduleRebuild(); } else { if (!Comparing.equal(myFileEditor, fileEditor)) { myFileEditor = fileEditor; - rebuild(); + scheduleRebuild(); return; } if (isStructureViewShowing() && myPanel.getComponentCount() == 0 && myFileEditor != null) { - rebuild(); + scheduleRebuild(); } } + } + private void scheduleRebuild() { + myUpdateAlarm.cancelAllRequests(); + myUpdateAlarm.addRequest(new Runnable() { + public void run() { + rebuild(); + } + }, 300, ModalityState.stateForComponent(myPanel)); } public void rebuild() { From ce4816b6148899fc6ea3e6862e0b0f2ea5c44149 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 25 Nov 2009 18:39:02 +0300 Subject: [PATCH 17/26] breakgen for 64-bit --- bin/win/breakgen64.dll | Bin 0 -> 41472 bytes .../rt/execution/application/AppMain.java | 7 ++++++- native/breakgen/AppMain.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 bin/win/breakgen64.dll diff --git a/bin/win/breakgen64.dll b/bin/win/breakgen64.dll new file mode 100644 index 0000000000000000000000000000000000000000..828b6f7acddcbd121ff2555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V{_b`H@}&XU1Gmv`*y3Hus^foOlz+*;C$g+ za&9>HoH%>{XW?7;1u8L%*YP%Pq6&I}PSVdbM+>w>%XFI_P>t)ky>7ytap&Bt?(goB zyX@}u_IvH#J*KYM-{RN!`}}Ud&wnlG4pPDC;LG4lFcORg*Mm@$|NG&!JuWK5R#7d4 zumlKCM3}ncA}La$Ukr*T69WjnBob2L@ri>T3MqIO|7meMiW={Dy4^S=9`d&-?~ z@45*O{6_z(|JC+4f)l}Ta4xtIq=WHbGWc`dA1$HKDi0+>KB~8ldlMBgF~B)B%tt$5FB|n!lkLq2NH{~sPN0N%DT2-g&Rf-)|qPK8fHR=8OZT+r3p+C)~ z)kXb-p3ztIl3v!UdV}?<)yy=0&yJe1R;)r3Hjeqn6xfFyo2lCcd!P|onY{z>4s<~; z9EDSmfRG!IE}NIVUp)@0T=Nm-oiD! zk0IJf1yn@E6sA%tqjIXEtyE2dECSBl2-Q*@=Wdi@)WE8=P#d*VoI2d zAG;z+De9*|8lqtuqj8#~DVnBP%21Z(*)NN9hsNCW`gS*e #if defined(WIN32) #include #else -#include #include #include #include From f038df941a9cbae7921de59c167237f39590238f Mon Sep 17 00:00:00 2001 From: Maxim Medvedev Date: Wed, 25 Nov 2009 18:50:12 +0300 Subject: [PATCH 18/26] domain class 'mappedBy' property --- .../plugins/groovy/annotator/GroovyAnnotator.java | 2 +- .../expressions/literals/GrLiteralImpl.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java index e743e6052466..6665639f686b 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java @@ -425,7 +425,7 @@ public class GroovyAnnotator implements Annotator { for (List args : map.values()) { for (int i = 1; i < args.size(); i++) { GrNamedArgument namedArgument = args.get(i); - holder.createErrorAnnotation(namedArgument, GroovyBundle.message("duplicate.element.in.the.map")); + holder.createWarningAnnotation(namedArgument, GroovyBundle.message("duplicate.element.in.the.map")); } } } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java index 902482de6da2..96a222aeaea9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/literals/GrLiteralImpl.java @@ -22,11 +22,12 @@ import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; +import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; import com.intellij.psi.impl.source.tree.LeafElement; import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; import com.intellij.psi.tree.IElementType; import org.jetbrains.annotations.NotNull; -import static org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes.*; +import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor; import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.literals.GrLiteral; import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.GrExpressionImpl; @@ -36,6 +37,8 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.util.List; +import static org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes.*; + /** * @author ilyas */ @@ -120,6 +123,16 @@ public class GrLiteralImpl extends GrExpressionImpl implements GrLiteral, PsiLan return ReferenceProvidersRegistry.getReferencesFromProviders(this, GrLiteral.class); } + @Nullable + @Override + public PsiReference getReference() { + final PsiReference[] references = getReferences(); + if (references.length > 0) { + return new PsiMultiReference(references, this); + } + return null; + } + public List> getInjectedPsi() { if (!(getValue() instanceof String)) return null; return InjectedLanguageUtil.getInjectedPsiFiles(this); From d5fda774348734bdbc4bf6fd6902c9ca5e1b38bf Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 25 Nov 2009 16:11:52 +0300 Subject: [PATCH 19/26] problem 14824 --- .../intelliLang/util/AnnotationUtilEx.java | 529 +++++++++--------- 1 file changed, 265 insertions(+), 264 deletions(-) diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java index 8547922d2174..a1e46807fd75 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java @@ -1,264 +1,265 @@ -/* - * Copyright 2006 Sascha Weinreuter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.intellij.plugins.intelliLang.util; - -import com.intellij.codeInsight.AnnotationUtil; -import com.intellij.openapi.util.Pair; -import com.intellij.psi.*; -import com.intellij.psi.impl.PsiConstantEvaluationHelperImpl; -import com.intellij.psi.search.searches.SuperMethodsSearch; -import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; -import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.util.Processor; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * Contains some extended utility functions for dealing with annotations. - */ -public class AnnotationUtilEx { - private static final PsiConstantEvaluationHelperImpl CONSTANT_EVALUATION_HELPER = new PsiConstantEvaluationHelperImpl(); - - private AnnotationUtilEx() { - } - - /** - * @see AnnotationUtilEx#getAnnotatedElementFor(com.intellij.psi.PsiElement, LookupType) - */ - public enum LookupType { - PREFER_CONTEXT, PREFER_DECLARATION, CONTEXT_ONLY, DECLRARATION_ONLY - } - - /** - * Determines the PsiModifierListOwner for the passed element depending of the specified LookupType. The LookupType - * decides whether to prefer the element a reference expressions resolves to, or the element that is implied by the - * usage context ("expected type"). - */ - @Nullable - public static PsiModifierListOwner getAnnotatedElementFor(@Nullable PsiElement element, LookupType type) { - while (element != null) { - if (type == LookupType.PREFER_DECLARATION || type == LookupType.DECLRARATION_ONLY) { - if (element instanceof PsiReferenceExpression) { - final PsiElement e = ((PsiReferenceExpression)element).resolve(); - if (e instanceof PsiModifierListOwner) { - return (PsiModifierListOwner)e; - } - if (type == LookupType.DECLRARATION_ONLY) { - return null; - } - } - } - element = ContextComputationProcessor.getTopLevelInjectionTarget(element); - final PsiElement parent = element.getParent(); - - if (element instanceof PsiAssignmentExpression && ((PsiAssignmentExpression)element).getOperationSign().getTokenType() == JavaTokenType.PLUSEQ) { - element = ((PsiAssignmentExpression)element).getLExpression(); - continue; - } - else if (parent instanceof PsiAssignmentExpression) { - final PsiAssignmentExpression p = (PsiAssignmentExpression)parent; - if (p.getRExpression() == element) { - element = p.getLExpression(); - continue; - } - } - else if (parent instanceof PsiReturnStatement) { - final PsiMethod m = PsiTreeUtil.getParentOfType(parent, PsiMethod.class); - if (m != null) { - return m; - } - } - else if (parent instanceof PsiModifierListOwner) { - return (PsiModifierListOwner)parent; - } - else if (parent instanceof PsiArrayInitializerMemberValue) { - final PsiArrayInitializerMemberValue value = (PsiArrayInitializerMemberValue)parent; - final PsiElement pair = value.getParent(); - if (pair instanceof PsiNameValuePair) { - return getAnnotationMethod((PsiNameValuePair)pair, element); - } - } - else if (parent instanceof PsiNameValuePair) { - return getAnnotationMethod((PsiNameValuePair)parent, element); - } - else { - return PsiUtilEx.getParameterForArgument(element); - } - - // If no annotation has been found through the usage context, check if the element - // (i.e. the element the reference refers to) is annotated itself - if (type != LookupType.DECLRARATION_ONLY) { - if (element instanceof PsiReferenceExpression) { - final PsiElement e = ((PsiReferenceExpression)element).resolve(); - if (e instanceof PsiModifierListOwner) { - return (PsiModifierListOwner)e; - } - } - } - return null; - } - return null; - } - - @Nullable - private static PsiModifierListOwner getAnnotationMethod(PsiNameValuePair pair, PsiElement element) { - final PsiAnnotation annotation = PsiTreeUtil.getParentOfType(pair.getParent(), PsiAnnotation.class); - assert annotation != null; - - final String fqn = annotation.getQualifiedName(); - if (fqn == null) return null; - - final PsiClass psiClass = JavaPsiFacade.getInstance(element.getProject()).findClass(fqn, element.getResolveScope()); - if (psiClass != null && psiClass.isAnnotationType()) { - final String name = pair.getName(); - final PsiMethod[] methods = psiClass.findMethodsByName(name != null ? name : "value", false); - return methods.length > 0 ? methods[0] : null; - } - return null; - } - - /** - * Utility method to obtain annotations of a specific type from the supplied PsiModifierListOwner. - * For optimization reasons, this method only looks at elements of type java.lang.String. - *

- * The parameter allowIndirect determines if the method should look for indirect annotations, i.e. - * annotations which have themselves been annotated by the supplied annotation name. Currently, this only allows - * one level of indirection and returns an array of [base-annotation, indirect annotation] - *

- * The annotationName parameter is a pair of the target annotation class' fully qualified name as a - * String and as a Set. This is done for performance reasons because the Set is required by the - * {@link com.intellij.codeInsight.AnnotationUtil} utility class and allows to avoid unecessary object constructions. - */ - @NotNull - public static PsiAnnotation[] getAnnotationFrom(PsiModifierListOwner owner, - Pair> annotationName, - boolean allowIndirect, - boolean inHierarchy) { - if (!PsiUtilEx.isLanguageAnnotationTarget(owner)) return PsiAnnotation.EMPTY_ARRAY; - - final PsiAnnotation directAnnotation = inHierarchy? - AnnotationUtil.findAnnotationInHierarchy(owner, annotationName.second) : - AnnotationUtil.findAnnotation(owner, annotationName.second); - if (directAnnotation != null) { - return new PsiAnnotation[]{directAnnotation}; - } - if (allowIndirect) { - final PsiAnnotation[] annotations = getAnnotations(owner, inHierarchy); - for (PsiAnnotation annotation : annotations) { - PsiJavaCodeReferenceElement nameReference = annotation.getNameReferenceElement(); - if (nameReference == null) continue; - PsiElement resolved = nameReference.resolve(); - if (resolved instanceof PsiClass) { - final PsiAnnotation psiAnnotation = AnnotationUtil.findAnnotationInHierarchy((PsiModifierListOwner)resolved, annotationName.second); - if (psiAnnotation != null) { - return new PsiAnnotation[]{psiAnnotation, annotation}; - } - } - } - } - return PsiAnnotation.EMPTY_ARRAY; - } - - public static PsiAnnotation[] getAnnotationFrom(@NotNull PsiModifierListOwner owner, - @NotNull Pair> annotationName, - boolean allowIndirect) { - return getAnnotationFrom(owner, annotationName, allowIndirect, true); - } - - /** - * Calculates the value of the annotation's attribute referenced by the attr parameter by trying to - * find the attribute in the supplied list of annotations and calculating the constant value for the first attribute - * it finds. - */ - @Nullable - public static String calcAnnotationValue(PsiAnnotation[] annotation, @NonNls String attr) { - for (PsiAnnotation psiAnnotation : annotation) { - final String value = calcAnnotationValue(psiAnnotation, attr); - if (value != null) return value; - } - return null; - } - - @Nullable - public static String calcAnnotationValue(@NotNull PsiAnnotation annotation, @NonNls String attr) { - PsiElement value = annotation.findAttributeValue(attr); - if (value instanceof PsiExpression) { - Object o = CONSTANT_EVALUATION_HELPER.computeConstantExpression(value); - if (o instanceof String) { - return (String)o; - } - } - return null; - } - - /** - * Returns all annotations for listOwner, possibly walking up the method hierarchy. - * - * @see com.intellij.codeInsight.AnnotationUtil#isAnnotated(com.intellij.psi.PsiModifierListOwner, java.lang.String, boolean) - */ - private static PsiAnnotation[] getAnnotations(@NotNull PsiModifierListOwner listOwner, boolean inHierarchy) { - final PsiModifierList modifierList = listOwner.getModifierList(); - if (modifierList == null) { - return PsiAnnotation.EMPTY_ARRAY; - } - if (!inHierarchy) { - return modifierList.getAnnotations(); - } - final Set all = new HashSet() { - public boolean add(PsiAnnotation o) { - // don't overwrite "higher level" annotations - return !contains(o) && super.add(o); - } - }; - if (listOwner instanceof PsiMethod) { - all.addAll(Arrays.asList(modifierList.getAnnotations())); - SuperMethodsSearch.search((PsiMethod)listOwner, null, true, true).forEach(new Processor() { - public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { - all.addAll(Arrays.asList(superMethod.getMethod().getModifierList().getAnnotations())); - return true; - } - }); - return all.toArray(new PsiAnnotation[all.size()]); - } - if (listOwner instanceof PsiParameter) { - PsiParameter parameter = (PsiParameter)listOwner; - PsiElement declarationScope = parameter.getDeclarationScope(); - if (declarationScope instanceof PsiMethod && parameter.getParent() == ((PsiMethod)declarationScope).getParameterList()) { - PsiMethod method = (PsiMethod)declarationScope; - final int parameterIndex = method.getParameterList().getParameterIndex(parameter); - all.addAll(Arrays.asList(modifierList.getAnnotations())); - SuperMethodsSearch.search(method, null, true, true).forEach(new Processor() { - public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { - PsiParameter superParameter = superMethod.getMethod().getParameterList().getParameters()[parameterIndex]; - PsiModifierList modifierList = superParameter.getModifierList(); - if (modifierList != null) { - all.addAll(Arrays.asList(modifierList.getAnnotations())); - } - return true; - } - }); - return all.toArray(new PsiAnnotation[all.size()]); - } - } - return modifierList.getAnnotations(); - } - -} +/* + * Copyright 2006 Sascha Weinreuter + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.intellij.plugins.intelliLang.util; + +import com.intellij.codeInsight.AnnotationUtil; +import com.intellij.openapi.util.Pair; +import com.intellij.psi.*; +import com.intellij.psi.impl.PsiConstantEvaluationHelperImpl; +import com.intellij.psi.search.searches.SuperMethodsSearch; +import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.util.Processor; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Contains some extended utility functions for dealing with annotations. + */ +public class AnnotationUtilEx { + private static final PsiConstantEvaluationHelperImpl CONSTANT_EVALUATION_HELPER = new PsiConstantEvaluationHelperImpl(); + + private AnnotationUtilEx() { + } + + /** + * @see AnnotationUtilEx#getAnnotatedElementFor(com.intellij.psi.PsiElement, LookupType) + */ + public enum LookupType { + PREFER_CONTEXT, PREFER_DECLARATION, CONTEXT_ONLY, DECLRARATION_ONLY + } + + /** + * Determines the PsiModifierListOwner for the passed element depending of the specified LookupType. The LookupType + * decides whether to prefer the element a reference expressions resolves to, or the element that is implied by the + * usage context ("expected type"). + */ + @Nullable + public static PsiModifierListOwner getAnnotatedElementFor(@Nullable PsiElement element, LookupType type) { + while (element != null) { + if (type == LookupType.PREFER_DECLARATION || type == LookupType.DECLRARATION_ONLY) { + if (element instanceof PsiReferenceExpression) { + final PsiElement e = ((PsiReferenceExpression)element).resolve(); + if (e instanceof PsiModifierListOwner) { + return (PsiModifierListOwner)e; + } + if (type == LookupType.DECLRARATION_ONLY) { + return null; + } + } + } + element = ContextComputationProcessor.getTopLevelInjectionTarget(element); + final PsiElement parent = element.getParent(); + + if (element instanceof PsiAssignmentExpression && ((PsiAssignmentExpression)element).getOperationSign().getTokenType() == JavaTokenType.PLUSEQ) { + element = ((PsiAssignmentExpression)element).getLExpression(); + continue; + } + else if (parent instanceof PsiAssignmentExpression) { + final PsiAssignmentExpression p = (PsiAssignmentExpression)parent; + if (p.getRExpression() == element) { + element = p.getLExpression(); + continue; + } + } + else if (parent instanceof PsiReturnStatement) { + final PsiMethod m = PsiTreeUtil.getParentOfType(parent, PsiMethod.class); + if (m != null) { + return m; + } + } + else if (parent instanceof PsiModifierListOwner) { + return (PsiModifierListOwner)parent; + } + else if (parent instanceof PsiArrayInitializerMemberValue) { + final PsiArrayInitializerMemberValue value = (PsiArrayInitializerMemberValue)parent; + final PsiElement pair = value.getParent(); + if (pair instanceof PsiNameValuePair) { + return getAnnotationMethod((PsiNameValuePair)pair, element); + } + } + else if (parent instanceof PsiNameValuePair) { + return getAnnotationMethod((PsiNameValuePair)parent, element); + } + else { + return PsiUtilEx.getParameterForArgument(element); + } + + // If no annotation has been found through the usage context, check if the element + // (i.e. the element the reference refers to) is annotated itself + if (type != LookupType.DECLRARATION_ONLY) { + if (element instanceof PsiReferenceExpression) { + final PsiElement e = ((PsiReferenceExpression)element).resolve(); + if (e instanceof PsiModifierListOwner) { + return (PsiModifierListOwner)e; + } + } + } + return null; + } + return null; + } + + @Nullable + private static PsiModifierListOwner getAnnotationMethod(PsiNameValuePair pair, PsiElement element) { + final PsiAnnotation annotation = PsiTreeUtil.getParentOfType(pair.getParent(), PsiAnnotation.class); + assert annotation != null; + + final String fqn = annotation.getQualifiedName(); + if (fqn == null) return null; + + final PsiClass psiClass = JavaPsiFacade.getInstance(element.getProject()).findClass(fqn, element.getResolveScope()); + if (psiClass != null && psiClass.isAnnotationType()) { + final String name = pair.getName(); + final PsiMethod[] methods = psiClass.findMethodsByName(name != null ? name : "value", false); + return methods.length > 0 ? methods[0] : null; + } + return null; + } + + /** + * Utility method to obtain annotations of a specific type from the supplied PsiModifierListOwner. + * For optimization reasons, this method only looks at elements of type java.lang.String. + *

+ * The parameter allowIndirect determines if the method should look for indirect annotations, i.e. + * annotations which have themselves been annotated by the supplied annotation name. Currently, this only allows + * one level of indirection and returns an array of [base-annotation, indirect annotation] + *

+ * The annotationName parameter is a pair of the target annotation class' fully qualified name as a + * String and as a Set. This is done for performance reasons because the Set is required by the + * {@link com.intellij.codeInsight.AnnotationUtil} utility class and allows to avoid unecessary object constructions. + */ + @NotNull + public static PsiAnnotation[] getAnnotationFrom(PsiModifierListOwner owner, + Pair> annotationName, + boolean allowIndirect, + boolean inHierarchy) { + if (!PsiUtilEx.isLanguageAnnotationTarget(owner)) return PsiAnnotation.EMPTY_ARRAY; + + final PsiAnnotation directAnnotation = inHierarchy? + AnnotationUtil.findAnnotationInHierarchy(owner, annotationName.second) : + AnnotationUtil.findAnnotation(owner, annotationName.second); + if (directAnnotation != null) { + return new PsiAnnotation[]{directAnnotation}; + } + if (allowIndirect) { + final PsiAnnotation[] annotations = getAnnotations(owner, inHierarchy); + for (PsiAnnotation annotation : annotations) { + PsiJavaCodeReferenceElement nameReference = annotation.getNameReferenceElement(); + if (nameReference == null) continue; + PsiElement resolved = nameReference.resolve(); + if (resolved instanceof PsiClass) { + final PsiAnnotation psiAnnotation = AnnotationUtil.findAnnotationInHierarchy((PsiModifierListOwner)resolved, annotationName.second); + if (psiAnnotation != null) { + return new PsiAnnotation[]{psiAnnotation, annotation}; + } + } + } + } + return PsiAnnotation.EMPTY_ARRAY; + } + + public static PsiAnnotation[] getAnnotationFrom(@NotNull PsiModifierListOwner owner, + @NotNull Pair> annotationName, + boolean allowIndirect) { + return getAnnotationFrom(owner, annotationName, allowIndirect, true); + } + + /** + * Calculates the value of the annotation's attribute referenced by the attr parameter by trying to + * find the attribute in the supplied list of annotations and calculating the constant value for the first attribute + * it finds. + */ + @Nullable + public static String calcAnnotationValue(PsiAnnotation[] annotation, @NonNls String attr) { + for (PsiAnnotation psiAnnotation : annotation) { + final String value = calcAnnotationValue(psiAnnotation, attr); + if (value != null) return value; + } + return null; + } + + @Nullable + public static String calcAnnotationValue(@NotNull PsiAnnotation annotation, @NonNls String attr) { + PsiElement value = annotation.findAttributeValue(attr); + if (value instanceof PsiExpression) { + Object o = CONSTANT_EVALUATION_HELPER.computeConstantExpression(value); + if (o instanceof String) { + return (String)o; + } + } + return null; + } + + /** + * Returns all annotations for listOwner, possibly walking up the method hierarchy. + * + * @see com.intellij.codeInsight.AnnotationUtil#isAnnotated(com.intellij.psi.PsiModifierListOwner, java.lang.String, boolean) + */ + private static PsiAnnotation[] getAnnotations(@NotNull PsiModifierListOwner listOwner, boolean inHierarchy) { + final PsiModifierList modifierList = listOwner.getModifierList(); + if (modifierList == null) { + return PsiAnnotation.EMPTY_ARRAY; + } + if (!inHierarchy) { + return modifierList.getAnnotations(); + } + final Set all = new HashSet() { + public boolean add(PsiAnnotation o) { + // don't overwrite "higher level" annotations + return !contains(o) && super.add(o); + } + }; + if (listOwner instanceof PsiMethod) { + all.addAll(Arrays.asList(modifierList.getAnnotations())); + SuperMethodsSearch.search((PsiMethod)listOwner, null, true, true).forEach(new Processor() { + public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { + all.addAll(Arrays.asList(superMethod.getMethod().getModifierList().getAnnotations())); + return true; + } + }); + return all.toArray(new PsiAnnotation[all.size()]); + } + if (listOwner instanceof PsiParameter) { + PsiParameter parameter = (PsiParameter)listOwner; + PsiElement declarationScope = parameter.getDeclarationScope(); + PsiParameterList parameterList; + if (declarationScope instanceof PsiMethod && parameter.getParent() == (parameterList = ((PsiMethod)declarationScope).getParameterList())) { + PsiMethod method = (PsiMethod)declarationScope; + final int parameterIndex = parameterList.getParameterIndex(parameter); + all.addAll(Arrays.asList(modifierList.getAnnotations())); + SuperMethodsSearch.search(method, null, true, true).forEach(new Processor() { + public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { + PsiParameter superParameter = superMethod.getMethod().getParameterList().getParameters()[parameterIndex]; + PsiModifierList modifierList = superParameter.getModifierList(); + if (modifierList != null) { + all.addAll(Arrays.asList(modifierList.getAnnotations())); + } + return true; + } + }); + return all.toArray(new PsiAnnotation[all.size()]); + } + } + return modifierList.getAnnotations(); + } + +} From 85bd7c75cdf9c90ef74c5b2d38e8c270b677b9de Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 25 Nov 2009 18:59:52 +0300 Subject: [PATCH 20/26] really 64-bit dll --- bin/win/breakgen64.dll | Bin 41472 -> 40448 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/win/breakgen64.dll b/bin/win/break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XkChf(v zi)os!F0B32!C5m(Y6S_axpk`xZlMcihC#S zqqy5=CC{2aYZW+Y>#WCSot&kM9~Uph?~m_}Ukz^QHuswi36m326S5L=6V@kePk1z; zG2y2PPbWN=a5%x25SchFF)gt$aeLx}iQh_mE9s*o86!F(c}()8HQ zOiHS*HT?xEEE>{0L<~~esIg6Pi-|-Gl0ZzCvaP8EOlS!;{XxK>m3p#;zWE>QyjVU=-5uBTU0(xB)A$3LCHxH{-Kdh1;+e_h2K&@mGA) zf6qVT&-q2$cdz>)!uu*7s>Cb85%pr9I4ed)Mm#CYxbg{kMV6^bRik>SjH{ zd|%W5YH2yv4(q7(4HNyCDKf&KiI|<{V{_b`H@}&XU1Gmv`*y3Hus^foOlz+*;C$g+ za&9>HoH%>{XW?7;1u8L%*YP%Pq6&I}PSVdbM+>w>%XFI_P>t)ky>7ytap&Bt?(goB zyX@}u_IvH#J*KYM-{RN!`}}Ud&wnlG4pPDC;LG4lFcORg*Mm@$|NG&!JuWK5R#7d4 zumlKCM3}ncA}La$Ukr*T69WjnBob2L@ri>T3MqIO|7meMiW={Dy4^S=9`d&-?~ z@45*O{6_z(|JC+4f)l}Ta4xtIq=WHbGWc`dA1$HKDi0+>KB~8ldlMBgF~B)B%tt$5FB|n!lkLq2NH{~sPN0N%DT2-g&Rf-)|qPK8fHR=8OZT+r3p+C)~ z)kXb-p3ztIl3v!UdV}?<)yy=0&yJe1R;)r3Hjeqn6xfFyo2lCcd!P|onY{z>4s<~; z9EDSmfRG!IE}NIVUp)@0T=Nm-oiD! zk0IJf1yn@E6sA%tqjIXEtyE2dECSBl2-Q*@=Wdi@)WE8=P#d*VoI2d zAG;z+De9*|8lqtuqj8#~DVnBP%21Z(*)NN9hsNCW`gS*e Date: Wed, 25 Nov 2009 19:01:17 +0300 Subject: [PATCH 21/26] Easier and more robust context retreival for structure view. --- .../ide/impl/StructureViewSelectInTarget.java | 2 +- .../ide/impl/StructureViewWrapperImpl.java | 139 +++++++++--------- .../structureView/StructureViewWrapper.java | 3 +- .../impl/StructureViewFactoryImpl.java | 6 +- .../refactoring/copy/CopyHandler.java | 2 +- 5 files changed, 73 insertions(+), 79 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewSelectInTarget.java b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewSelectInTarget.java index f7c6cdf9b3ae..522df36065f1 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewSelectInTarget.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewSelectInTarget.java @@ -52,7 +52,7 @@ public class StructureViewSelectInTarget implements SelectInTarget { StructureViewFactoryEx.getInstanceEx(myProject).runWhenInitialized(new Runnable() { public void run() { final StructureViewWrapper structureView = getStructureViewWrapper(); - structureView.selectCurrentElement(fileEditor,requestFocus); + structureView.selectCurrentElement(fileEditor, context.getVirtualFile(), requestFocus); } }); } diff --git a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java index bc7fedca4ef9..e672c21aafdf 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java @@ -18,17 +18,22 @@ package com.intellij.ide.impl; import com.intellij.ide.DataManager; import com.intellij.ide.IdeBundle; +import com.intellij.ide.projectView.impl.ProjectRootsUtil; import com.intellij.ide.structureView.StructureView; import com.intellij.ide.structureView.StructureViewBuilder; import com.intellij.ide.structureView.StructureViewWrapper; import com.intellij.openapi.Disposable; -import com.intellij.openapi.actionSystem.*; +import com.intellij.openapi.actionSystem.ActionManager; +import com.intellij.openapi.actionSystem.DataContext; +import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.actionSystem.TimerListener; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.FileEditorProvider; import com.intellij.openapi.fileEditor.ex.FileEditorProviderManager; import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleUtil; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Disposer; @@ -41,12 +46,12 @@ import com.intellij.psi.PsiDocumentManager; import com.intellij.util.Alarm; import com.intellij.util.IJSwingUtilities; import com.intellij.util.ui.UIUtil; +import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.awt.event.HierarchyEvent; import java.awt.event.HierarchyListener; -import java.util.Arrays; /** * @author Eugene Belyaev @@ -54,8 +59,7 @@ import java.util.Arrays; public class StructureViewWrapperImpl implements StructureViewWrapper, Disposable { private final Project myProject; - private FileEditor myFileEditor; - private Module myModule; + private VirtualFile myFile; private StructureView myStructureView; private ModuleStructureComponent myModuleStructureComponent; @@ -105,26 +109,20 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl if (owner == null || SwingUtilities.isDescendingFrom(owner, myPanel)) return; final DataContext dataContext = DataManager.getInstance().getDataContext(owner); - final FileEditor fileEditor = PlatformDataKeys.FILE_EDITOR.getData(dataContext); - if (fileEditor != null) { - if (Arrays.asList(FileEditorManager.getInstance(myProject).getSelectedEditors()).contains(fileEditor)) { - setFileEditor(fileEditor); - return; - } - } - final VirtualFile[] files = PlatformDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext); if (files != null && files.length == 1) { - FileEditorProviderManager editorProviderManager = FileEditorProviderManager.getInstance(); - final FileEditorProvider[] providers = editorProviderManager.getProviders(myProject, files[0]); - for (FileEditorProvider provider : providers) { - FileEditor tempFileEditor = provider.createEditor(myProject, files[0]); - setFileEditor(tempFileEditor); - return; - } + setFile(files[0]); } + else { + setFile(null); + } + } + } - setModule(LangDataKeys.MODULE_CONTEXT.getData(dataContext)); + private void setFile(VirtualFile file) { + if (!Comparing.equal(file, myFile)) { + myFile = file; + scheduleRebuild(); } } @@ -138,14 +136,13 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl } public void dispose() { - myFileEditor = null; rebuild(); } - public boolean selectCurrentElement(FileEditor fileEditor, boolean requestFocus) { + public boolean selectCurrentElement(FileEditor fileEditor, VirtualFile file, boolean requestFocus) { if (myStructureView != null) { if (!Comparing.equal(myStructureView.getFileEditor(), fileEditor)) { - setFileEditor(fileEditor); + myFile = file; rebuild(); } return myStructureView.navigateToSelectedElement(requestFocus); @@ -155,35 +152,6 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl } } - private void setModule(Module module) { - if (module != myModule) { - myFileEditor = null; - myModule = module; - scheduleRebuild(); - } - else if (module == null) { - setFileEditor(null); - } - } - - public void setFileEditor(FileEditor fileEditor) { - if (myModule != null) { - myModule = null; - scheduleRebuild(); - } - else { - if (!Comparing.equal(myFileEditor, fileEditor)) { - myFileEditor = fileEditor; - scheduleRebuild(); - return; - } - - if (isStructureViewShowing() && myPanel.getComponentCount() == 0 && myFileEditor != null) { - scheduleRebuild(); - } - } - } - private void scheduleRebuild() { myUpdateAlarm.cancelAllRequests(); myUpdateAlarm.addRequest(new Runnable() { @@ -216,29 +184,48 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl return; } - if (myModule != null) { - myModuleStructureComponent = new ModuleStructureComponent(myModule); - myPanel.add(myModuleStructureComponent, BorderLayout.CENTER); - if (hadFocus) { - JComponent focusedComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myModuleStructureComponent); - if (focusedComponent != null) { - focusedComponent.requestFocus(); - } + VirtualFile file = myFile; + if (file == null) { + final VirtualFile[] selectedFiles = FileEditorManager.getInstance(myProject).getSelectedFiles(); + if (selectedFiles.length > 0) { + file = selectedFiles[0]; } } - else if (myFileEditor != null && myFileEditor.isValid()) { - final StructureViewBuilder structureViewBuilder = myFileEditor.getStructureViewBuilder(); - if (structureViewBuilder != null) { - myStructureView = structureViewBuilder.createStructureView(myFileEditor, myProject); - myPanel.add(myStructureView.getComponent(), BorderLayout.CENTER); - if (hadFocus) { - JComponent focusedComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myStructureView.getComponent()); - if (focusedComponent != null) { - focusedComponent.requestFocus(); + + if (file != null) { + if (file.isDirectory()) { + if (ProjectRootsUtil.isModuleContentRoot(file, myProject)) { + Module module = ModuleUtil.findModuleForFile(file, myProject); + if (module != null) { + myModuleStructureComponent = new ModuleStructureComponent(module); + myPanel.add(myModuleStructureComponent, BorderLayout.CENTER); + if (hadFocus) { + JComponent focusedComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myModuleStructureComponent); + if (focusedComponent != null) { + focusedComponent.requestFocus(); + } + } + } + } + } + else { + FileEditor editor = FileEditorManager.getInstance(myProject).getSelectedEditor(file); + if (editor == null) editor = crteateTempFileEditor(file); + if (editor != null && editor.isValid()) { + final StructureViewBuilder structureViewBuilder = editor.getStructureViewBuilder(); + if (structureViewBuilder != null) { + myStructureView = structureViewBuilder.createStructureView(editor, myProject); + myPanel.add(myStructureView.getComponent(), BorderLayout.CENTER); + if (hadFocus) { + JComponent focusedComponent = IdeFocusTraversalPolicy.getPreferredFocusedComponent(myStructureView.getComponent()); + if (focusedComponent != null) { + focusedComponent.requestFocus(); + } + } + myStructureView.restoreState(); + myStructureView.centerSelectedRow(); } } - myStructureView.restoreState(); - myStructureView.centerSelectedRow(); } } @@ -250,6 +237,16 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl myPanel.repaint(); } + @Nullable + private FileEditor crteateTempFileEditor(VirtualFile file) { + FileEditorProviderManager editorProviderManager = FileEditorProviderManager.getInstance(); + final FileEditorProvider[] providers = editorProviderManager.getProviders(myProject, file); + for (FileEditorProvider provider : providers) { + return provider.createEditor(myProject, file); + } + return null; + } + protected boolean isStructureViewShowing() { ToolWindowManager windowManager = ToolWindowManager.getInstance(myProject); diff --git a/platform/lang-impl/src/com/intellij/ide/structureView/StructureViewWrapper.java b/platform/lang-impl/src/com/intellij/ide/structureView/StructureViewWrapper.java index 6e0fd0696f40..78bdb6f9288b 100644 --- a/platform/lang-impl/src/com/intellij/ide/structureView/StructureViewWrapper.java +++ b/platform/lang-impl/src/com/intellij/ide/structureView/StructureViewWrapper.java @@ -17,6 +17,7 @@ package com.intellij.ide.structureView; import com.intellij.openapi.fileEditor.FileEditor; +import com.intellij.openapi.vfs.VirtualFile; /** * Created by IntelliJ IDEA. @@ -26,5 +27,5 @@ import com.intellij.openapi.fileEditor.FileEditor; * To change this template use File | Settings | File Templates. */ public interface StructureViewWrapper { - boolean selectCurrentElement(FileEditor fileEditor, boolean requestFocus); + boolean selectCurrentElement(FileEditor fileEditor, VirtualFile file, boolean requestFocus); } diff --git a/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java b/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java index 3ee447ce4d84..554d10bda53a 100644 --- a/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/structureView/impl/StructureViewFactoryImpl.java @@ -23,7 +23,6 @@ import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.fileEditor.FileEditor; -import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.MultiValuesMap; @@ -87,10 +86,7 @@ public final class StructureViewFactoryImpl extends StructureViewFactoryEx imple final Content content = ContentFactory.SERVICE.getInstance().createContent(myStructureViewWrapperImpl.getComponent(), "", false); Disposer.register(content, myStructureViewWrapperImpl); toolWindow.getContentManager().addContent(content); - final FileEditor[] fileEditors = FileEditorManager.getInstance(myProject).getSelectedEditors(); - if (fileEditors.length > 0) { - myStructureViewWrapperImpl.setFileEditor(fileEditors [0]); - } + if (myRunWhenInitialized != null) { myRunWhenInitialized.run(); myRunWhenInitialized = null; diff --git a/platform/lang-impl/src/com/intellij/refactoring/copy/CopyHandler.java b/platform/lang-impl/src/com/intellij/refactoring/copy/CopyHandler.java index a212cb6b1c8e..232dc80bae92 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/copy/CopyHandler.java +++ b/platform/lang-impl/src/com/intellij/refactoring/copy/CopyHandler.java @@ -87,7 +87,7 @@ public class CopyHandler { else if (ToolWindowId.STRUCTURE_VIEW.equals(id)) { VirtualFile virtualFile = newElement.getContainingFile().getVirtualFile(); FileEditor editor = FileEditorManager.getInstance(newElement.getProject()).getSelectedEditor(virtualFile); - StructureViewFactoryEx.getInstanceEx(project).getStructureViewWrapper().selectCurrentElement(editor, true); + StructureViewFactoryEx.getInstanceEx(project).getStructureViewWrapper().selectCurrentElement(editor, virtualFile, true); } } } From 1a111d81ca29706f1b99c5ff2c2dcd2ce0b9556b Mon Sep 17 00:00:00 2001 From: Oleg Shpynov Date: Wed, 25 Nov 2009 19:27:29 +0300 Subject: [PATCH 22/26] Capture thread dump action for Linux_x64 --- bin/linux/libbreakgen64.so | Bin 0 -> 8531 bytes .../rt/execution/application/AppMain.java | 2 +- native/breakgen/make.sh | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 bin/linux/libbreakgen64.so create mode 100644 native/breakgen/make.sh diff --git a/bin/linux/libbreakgen64.so b/bin/linux/libbreakgen64.so new file mode 100644 index 0000000000000000000000000000000000000000..ba9c5900404e1c378185da75c14d6685ab67e8fd GIT binary patch literal 8531 zcmeHMeQaA-6~B(-BrR!@eypDxwYmkRu)1xQwP~T?Bu)C-rEO@NDX2p)j_o9`b!_AJ zT+#{XN}5W>L}ZhSn9yj11b^@$6^T`4sK{H(+JJzlV=Pn%3R8vCRBT11%2t>;=e~37 z_g-ubA>c2r^?dI6osWC&dH3VJcTco;c9gkXf{R;xTp%}5Wg>nOj4!4N5Wi>^mGJ+N zSS@uu1<}0P535axsSsWXU>g;1t*ntOP_L{oRmx1fhbY@2i*|mp^OGIZaq0?F>V_x> z8@#TP+({n+85X9fi>2$P5yE;i^}|UYlv+YCWxG#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?A!6R&?6^DsTx!S51@A|8 z+#`6OvEvnj_YXT>DZG>qJ6^+ z@fCvSryXA@c;4CZRaREk&G9}zpE!@o;XAm~0LQ%xW*M)`EXU^x7kmkK=Al{Q^YhRS zcp1EHWq1OSqr+0a5I@h4BZLpq_d_-tCO>|Du^~UD;y3r##lq{z|FhD6ojAuYfaK?_ z#OKHVUBEH^bF{ybx_B8X#quWC<+3|D=Y9Mm`Y)S*AO9lpC1R5!PW*P}0zc02Qx1tL zcJ8tka4*<6i?0OUD*eo#M~cLqUf>H)2|On8`R6X@0be)Yjks3A&!5SU^StEU68hD! zz7{*b!LNtK^3zlT$Mf4_=R-$hSt>3LP(DxVt*{x3+Yu`#U-g zwjWXtwX}A&W7r`*rVa+8p$Hxh$v%+3ouAs*vUhhIpth4Fzn>3;wt~ohN>=13%sexb zM^gn$JU}u}vh3J@=-kYHLT7J+4$JIdk%KloVY4gQ4#phEXa&tCI)E!6*jagyW*))W R1(*dm!?S~Y5+^?w{1bb}#&7@t literal 0 HcmV?d00001 diff --git a/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java b/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java index 8b4232e32f6a..9e306a10e0ab 100644 --- a/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java +++ b/java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java @@ -46,7 +46,7 @@ public class AppMain { libPath = binPath + "breakgen.dll"; } } else if (osName.startsWith("linux")) { - if (System.getProperty("os.name").toLowerCase().equals("amd64")) { + if (System.getProperty("os.arch").toLowerCase().equals("amd64")) { libPath = binPath + "libbreakgen64.so"; } else { libPath = binPath + "libbreakgen.so"; diff --git a/native/breakgen/make.sh b/native/breakgen/make.sh new file mode 100644 index 000000000000..5ef8c5b7cd56 --- /dev/null +++ b/native/breakgen/make.sh @@ -0,0 +1 @@ +gcc -I/opt/jdk1.6.0_16_x64/include/ -I/opt/jdk1.6.0_16_x64/include/linux/ AppMain.c -shared -fPIC -o libbreakgen64.so From 7f60285d527dd38eb7b635e9d23f5899549d2536 Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Wed, 25 Nov 2009 19:28:34 +0300 Subject: [PATCH 23/26] FileTemplateManager: do not process ignored files --- .../ide/fileTemplates/impl/FileTemplateManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateManagerImpl.java b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateManagerImpl.java index 2e07f4d5290e..941c89108a1e 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplateManagerImpl.java @@ -303,7 +303,7 @@ public class FileTemplateManagerImpl extends FileTemplateManager implements Expo List existingTemplates = new ArrayList(); // Read user-defined templates for (File file : files) { - if (file.isDirectory()) { + if (file.isDirectory() || FileTypeManagerEx.getInstance().isFileIgnored(file.getName())) { continue; } String name = file.getName(); @@ -332,6 +332,7 @@ public class FileTemplateManagerImpl extends FileTemplateManager implements Expo LOG.debug("FileTemplateManagerImpl.loadTemplates() reading default templates..."); // Read default templates for (VirtualFile file : defaultTemplates) { + if(FileTypeManagerEx.getInstance().isFileIgnored(file.getName())) continue; String name = file.getName(); //name.extension.ft , e.g. "NewClass.java.ft" @NonNls String extension = myTypeManager.getExtension(name); name = name.substring(0, name.length() - extension.length() - 1); //name="NewClass.java" extension="ft" From fc21543f2e2b1abc9275f5835d02ac27e45194eb Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Wed, 25 Nov 2009 19:51:34 +0300 Subject: [PATCH 24/26] ws --- .../intelliLang/util/AnnotationUtilEx.java | 530 +++++++++--------- 1 file changed, 265 insertions(+), 265 deletions(-) diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java index a1e46807fd75..cbb98ac79f86 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java @@ -1,265 +1,265 @@ -/* - * Copyright 2006 Sascha Weinreuter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.intellij.plugins.intelliLang.util; - -import com.intellij.codeInsight.AnnotationUtil; -import com.intellij.openapi.util.Pair; -import com.intellij.psi.*; -import com.intellij.psi.impl.PsiConstantEvaluationHelperImpl; -import com.intellij.psi.search.searches.SuperMethodsSearch; -import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; -import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.util.Processor; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * Contains some extended utility functions for dealing with annotations. - */ -public class AnnotationUtilEx { - private static final PsiConstantEvaluationHelperImpl CONSTANT_EVALUATION_HELPER = new PsiConstantEvaluationHelperImpl(); - - private AnnotationUtilEx() { - } - - /** - * @see AnnotationUtilEx#getAnnotatedElementFor(com.intellij.psi.PsiElement, LookupType) - */ - public enum LookupType { - PREFER_CONTEXT, PREFER_DECLARATION, CONTEXT_ONLY, DECLRARATION_ONLY - } - - /** - * Determines the PsiModifierListOwner for the passed element depending of the specified LookupType. The LookupType - * decides whether to prefer the element a reference expressions resolves to, or the element that is implied by the - * usage context ("expected type"). - */ - @Nullable - public static PsiModifierListOwner getAnnotatedElementFor(@Nullable PsiElement element, LookupType type) { - while (element != null) { - if (type == LookupType.PREFER_DECLARATION || type == LookupType.DECLRARATION_ONLY) { - if (element instanceof PsiReferenceExpression) { - final PsiElement e = ((PsiReferenceExpression)element).resolve(); - if (e instanceof PsiModifierListOwner) { - return (PsiModifierListOwner)e; - } - if (type == LookupType.DECLRARATION_ONLY) { - return null; - } - } - } - element = ContextComputationProcessor.getTopLevelInjectionTarget(element); - final PsiElement parent = element.getParent(); - - if (element instanceof PsiAssignmentExpression && ((PsiAssignmentExpression)element).getOperationSign().getTokenType() == JavaTokenType.PLUSEQ) { - element = ((PsiAssignmentExpression)element).getLExpression(); - continue; - } - else if (parent instanceof PsiAssignmentExpression) { - final PsiAssignmentExpression p = (PsiAssignmentExpression)parent; - if (p.getRExpression() == element) { - element = p.getLExpression(); - continue; - } - } - else if (parent instanceof PsiReturnStatement) { - final PsiMethod m = PsiTreeUtil.getParentOfType(parent, PsiMethod.class); - if (m != null) { - return m; - } - } - else if (parent instanceof PsiModifierListOwner) { - return (PsiModifierListOwner)parent; - } - else if (parent instanceof PsiArrayInitializerMemberValue) { - final PsiArrayInitializerMemberValue value = (PsiArrayInitializerMemberValue)parent; - final PsiElement pair = value.getParent(); - if (pair instanceof PsiNameValuePair) { - return getAnnotationMethod((PsiNameValuePair)pair, element); - } - } - else if (parent instanceof PsiNameValuePair) { - return getAnnotationMethod((PsiNameValuePair)parent, element); - } - else { - return PsiUtilEx.getParameterForArgument(element); - } - - // If no annotation has been found through the usage context, check if the element - // (i.e. the element the reference refers to) is annotated itself - if (type != LookupType.DECLRARATION_ONLY) { - if (element instanceof PsiReferenceExpression) { - final PsiElement e = ((PsiReferenceExpression)element).resolve(); - if (e instanceof PsiModifierListOwner) { - return (PsiModifierListOwner)e; - } - } - } - return null; - } - return null; - } - - @Nullable - private static PsiModifierListOwner getAnnotationMethod(PsiNameValuePair pair, PsiElement element) { - final PsiAnnotation annotation = PsiTreeUtil.getParentOfType(pair.getParent(), PsiAnnotation.class); - assert annotation != null; - - final String fqn = annotation.getQualifiedName(); - if (fqn == null) return null; - - final PsiClass psiClass = JavaPsiFacade.getInstance(element.getProject()).findClass(fqn, element.getResolveScope()); - if (psiClass != null && psiClass.isAnnotationType()) { - final String name = pair.getName(); - final PsiMethod[] methods = psiClass.findMethodsByName(name != null ? name : "value", false); - return methods.length > 0 ? methods[0] : null; - } - return null; - } - - /** - * Utility method to obtain annotations of a specific type from the supplied PsiModifierListOwner. - * For optimization reasons, this method only looks at elements of type java.lang.String. - *

- * The parameter allowIndirect determines if the method should look for indirect annotations, i.e. - * annotations which have themselves been annotated by the supplied annotation name. Currently, this only allows - * one level of indirection and returns an array of [base-annotation, indirect annotation] - *

- * The annotationName parameter is a pair of the target annotation class' fully qualified name as a - * String and as a Set. This is done for performance reasons because the Set is required by the - * {@link com.intellij.codeInsight.AnnotationUtil} utility class and allows to avoid unecessary object constructions. - */ - @NotNull - public static PsiAnnotation[] getAnnotationFrom(PsiModifierListOwner owner, - Pair> annotationName, - boolean allowIndirect, - boolean inHierarchy) { - if (!PsiUtilEx.isLanguageAnnotationTarget(owner)) return PsiAnnotation.EMPTY_ARRAY; - - final PsiAnnotation directAnnotation = inHierarchy? - AnnotationUtil.findAnnotationInHierarchy(owner, annotationName.second) : - AnnotationUtil.findAnnotation(owner, annotationName.second); - if (directAnnotation != null) { - return new PsiAnnotation[]{directAnnotation}; - } - if (allowIndirect) { - final PsiAnnotation[] annotations = getAnnotations(owner, inHierarchy); - for (PsiAnnotation annotation : annotations) { - PsiJavaCodeReferenceElement nameReference = annotation.getNameReferenceElement(); - if (nameReference == null) continue; - PsiElement resolved = nameReference.resolve(); - if (resolved instanceof PsiClass) { - final PsiAnnotation psiAnnotation = AnnotationUtil.findAnnotationInHierarchy((PsiModifierListOwner)resolved, annotationName.second); - if (psiAnnotation != null) { - return new PsiAnnotation[]{psiAnnotation, annotation}; - } - } - } - } - return PsiAnnotation.EMPTY_ARRAY; - } - - public static PsiAnnotation[] getAnnotationFrom(@NotNull PsiModifierListOwner owner, - @NotNull Pair> annotationName, - boolean allowIndirect) { - return getAnnotationFrom(owner, annotationName, allowIndirect, true); - } - - /** - * Calculates the value of the annotation's attribute referenced by the attr parameter by trying to - * find the attribute in the supplied list of annotations and calculating the constant value for the first attribute - * it finds. - */ - @Nullable - public static String calcAnnotationValue(PsiAnnotation[] annotation, @NonNls String attr) { - for (PsiAnnotation psiAnnotation : annotation) { - final String value = calcAnnotationValue(psiAnnotation, attr); - if (value != null) return value; - } - return null; - } - - @Nullable - public static String calcAnnotationValue(@NotNull PsiAnnotation annotation, @NonNls String attr) { - PsiElement value = annotation.findAttributeValue(attr); - if (value instanceof PsiExpression) { - Object o = CONSTANT_EVALUATION_HELPER.computeConstantExpression(value); - if (o instanceof String) { - return (String)o; - } - } - return null; - } - - /** - * Returns all annotations for listOwner, possibly walking up the method hierarchy. - * - * @see com.intellij.codeInsight.AnnotationUtil#isAnnotated(com.intellij.psi.PsiModifierListOwner, java.lang.String, boolean) - */ - private static PsiAnnotation[] getAnnotations(@NotNull PsiModifierListOwner listOwner, boolean inHierarchy) { - final PsiModifierList modifierList = listOwner.getModifierList(); - if (modifierList == null) { - return PsiAnnotation.EMPTY_ARRAY; - } - if (!inHierarchy) { - return modifierList.getAnnotations(); - } - final Set all = new HashSet() { - public boolean add(PsiAnnotation o) { - // don't overwrite "higher level" annotations - return !contains(o) && super.add(o); - } - }; - if (listOwner instanceof PsiMethod) { - all.addAll(Arrays.asList(modifierList.getAnnotations())); - SuperMethodsSearch.search((PsiMethod)listOwner, null, true, true).forEach(new Processor() { - public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { - all.addAll(Arrays.asList(superMethod.getMethod().getModifierList().getAnnotations())); - return true; - } - }); - return all.toArray(new PsiAnnotation[all.size()]); - } - if (listOwner instanceof PsiParameter) { - PsiParameter parameter = (PsiParameter)listOwner; - PsiElement declarationScope = parameter.getDeclarationScope(); - PsiParameterList parameterList; - if (declarationScope instanceof PsiMethod && parameter.getParent() == (parameterList = ((PsiMethod)declarationScope).getParameterList())) { - PsiMethod method = (PsiMethod)declarationScope; - final int parameterIndex = parameterList.getParameterIndex(parameter); - all.addAll(Arrays.asList(modifierList.getAnnotations())); - SuperMethodsSearch.search(method, null, true, true).forEach(new Processor() { - public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { - PsiParameter superParameter = superMethod.getMethod().getParameterList().getParameters()[parameterIndex]; - PsiModifierList modifierList = superParameter.getModifierList(); - if (modifierList != null) { - all.addAll(Arrays.asList(modifierList.getAnnotations())); - } - return true; - } - }); - return all.toArray(new PsiAnnotation[all.size()]); - } - } - return modifierList.getAnnotations(); - } - -} +/* + * Copyright 2006 Sascha Weinreuter + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.intellij.plugins.intelliLang.util; + +import com.intellij.codeInsight.AnnotationUtil; +import com.intellij.openapi.util.Pair; +import com.intellij.psi.*; +import com.intellij.psi.impl.PsiConstantEvaluationHelperImpl; +import com.intellij.psi.search.searches.SuperMethodsSearch; +import com.intellij.psi.util.MethodSignatureBackedByPsiMethod; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.util.Processor; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Contains some extended utility functions for dealing with annotations. + */ +public class AnnotationUtilEx { + private static final PsiConstantEvaluationHelperImpl CONSTANT_EVALUATION_HELPER = new PsiConstantEvaluationHelperImpl(); + + private AnnotationUtilEx() { + } + + /** + * @see AnnotationUtilEx#getAnnotatedElementFor(com.intellij.psi.PsiElement, LookupType) + */ + public enum LookupType { + PREFER_CONTEXT, PREFER_DECLARATION, CONTEXT_ONLY, DECLRARATION_ONLY + } + + /** + * Determines the PsiModifierListOwner for the passed element depending of the specified LookupType. The LookupType + * decides whether to prefer the element a reference expressions resolves to, or the element that is implied by the + * usage context ("expected type"). + */ + @Nullable + public static PsiModifierListOwner getAnnotatedElementFor(@Nullable PsiElement element, LookupType type) { + while (element != null) { + if (type == LookupType.PREFER_DECLARATION || type == LookupType.DECLRARATION_ONLY) { + if (element instanceof PsiReferenceExpression) { + final PsiElement e = ((PsiReferenceExpression)element).resolve(); + if (e instanceof PsiModifierListOwner) { + return (PsiModifierListOwner)e; + } + if (type == LookupType.DECLRARATION_ONLY) { + return null; + } + } + } + element = ContextComputationProcessor.getTopLevelInjectionTarget(element); + final PsiElement parent = element.getParent(); + + if (element instanceof PsiAssignmentExpression && ((PsiAssignmentExpression)element).getOperationSign().getTokenType() == JavaTokenType.PLUSEQ) { + element = ((PsiAssignmentExpression)element).getLExpression(); + continue; + } + else if (parent instanceof PsiAssignmentExpression) { + final PsiAssignmentExpression p = (PsiAssignmentExpression)parent; + if (p.getRExpression() == element) { + element = p.getLExpression(); + continue; + } + } + else if (parent instanceof PsiReturnStatement) { + final PsiMethod m = PsiTreeUtil.getParentOfType(parent, PsiMethod.class); + if (m != null) { + return m; + } + } + else if (parent instanceof PsiModifierListOwner) { + return (PsiModifierListOwner)parent; + } + else if (parent instanceof PsiArrayInitializerMemberValue) { + final PsiArrayInitializerMemberValue value = (PsiArrayInitializerMemberValue)parent; + final PsiElement pair = value.getParent(); + if (pair instanceof PsiNameValuePair) { + return getAnnotationMethod((PsiNameValuePair)pair, element); + } + } + else if (parent instanceof PsiNameValuePair) { + return getAnnotationMethod((PsiNameValuePair)parent, element); + } + else { + return PsiUtilEx.getParameterForArgument(element); + } + + // If no annotation has been found through the usage context, check if the element + // (i.e. the element the reference refers to) is annotated itself + if (type != LookupType.DECLRARATION_ONLY) { + if (element instanceof PsiReferenceExpression) { + final PsiElement e = ((PsiReferenceExpression)element).resolve(); + if (e instanceof PsiModifierListOwner) { + return (PsiModifierListOwner)e; + } + } + } + return null; + } + return null; + } + + @Nullable + private static PsiModifierListOwner getAnnotationMethod(PsiNameValuePair pair, PsiElement element) { + final PsiAnnotation annotation = PsiTreeUtil.getParentOfType(pair.getParent(), PsiAnnotation.class); + assert annotation != null; + + final String fqn = annotation.getQualifiedName(); + if (fqn == null) return null; + + final PsiClass psiClass = JavaPsiFacade.getInstance(element.getProject()).findClass(fqn, element.getResolveScope()); + if (psiClass != null && psiClass.isAnnotationType()) { + final String name = pair.getName(); + final PsiMethod[] methods = psiClass.findMethodsByName(name != null ? name : "value", false); + return methods.length > 0 ? methods[0] : null; + } + return null; + } + + /** + * Utility method to obtain annotations of a specific type from the supplied PsiModifierListOwner. + * For optimization reasons, this method only looks at elements of type java.lang.String. + *

+ * The parameter allowIndirect determines if the method should look for indirect annotations, i.e. + * annotations which have themselves been annotated by the supplied annotation name. Currently, this only allows + * one level of indirection and returns an array of [base-annotation, indirect annotation] + *

+ * The annotationName parameter is a pair of the target annotation class' fully qualified name as a + * String and as a Set. This is done for performance reasons because the Set is required by the + * {@link com.intellij.codeInsight.AnnotationUtil} utility class and allows to avoid unecessary object constructions. + */ + @NotNull + public static PsiAnnotation[] getAnnotationFrom(PsiModifierListOwner owner, + Pair> annotationName, + boolean allowIndirect, + boolean inHierarchy) { + if (!PsiUtilEx.isLanguageAnnotationTarget(owner)) return PsiAnnotation.EMPTY_ARRAY; + + final PsiAnnotation directAnnotation = inHierarchy? + AnnotationUtil.findAnnotationInHierarchy(owner, annotationName.second) : + AnnotationUtil.findAnnotation(owner, annotationName.second); + if (directAnnotation != null) { + return new PsiAnnotation[]{directAnnotation}; + } + if (allowIndirect) { + final PsiAnnotation[] annotations = getAnnotations(owner, inHierarchy); + for (PsiAnnotation annotation : annotations) { + PsiJavaCodeReferenceElement nameReference = annotation.getNameReferenceElement(); + if (nameReference == null) continue; + PsiElement resolved = nameReference.resolve(); + if (resolved instanceof PsiClass) { + final PsiAnnotation psiAnnotation = AnnotationUtil.findAnnotationInHierarchy((PsiModifierListOwner)resolved, annotationName.second); + if (psiAnnotation != null) { + return new PsiAnnotation[]{psiAnnotation, annotation}; + } + } + } + } + return PsiAnnotation.EMPTY_ARRAY; + } + + public static PsiAnnotation[] getAnnotationFrom(@NotNull PsiModifierListOwner owner, + @NotNull Pair> annotationName, + boolean allowIndirect) { + return getAnnotationFrom(owner, annotationName, allowIndirect, true); + } + + /** + * Calculates the value of the annotation's attribute referenced by the attr parameter by trying to + * find the attribute in the supplied list of annotations and calculating the constant value for the first attribute + * it finds. + */ + @Nullable + public static String calcAnnotationValue(PsiAnnotation[] annotation, @NonNls String attr) { + for (PsiAnnotation psiAnnotation : annotation) { + final String value = calcAnnotationValue(psiAnnotation, attr); + if (value != null) return value; + } + return null; + } + + @Nullable + public static String calcAnnotationValue(@NotNull PsiAnnotation annotation, @NonNls String attr) { + PsiElement value = annotation.findAttributeValue(attr); + if (value instanceof PsiExpression) { + Object o = CONSTANT_EVALUATION_HELPER.computeConstantExpression(value); + if (o instanceof String) { + return (String)o; + } + } + return null; + } + + /** + * Returns all annotations for listOwner, possibly walking up the method hierarchy. + * + * @see com.intellij.codeInsight.AnnotationUtil#isAnnotated(com.intellij.psi.PsiModifierListOwner, java.lang.String, boolean) + */ + private static PsiAnnotation[] getAnnotations(@NotNull PsiModifierListOwner listOwner, boolean inHierarchy) { + final PsiModifierList modifierList = listOwner.getModifierList(); + if (modifierList == null) { + return PsiAnnotation.EMPTY_ARRAY; + } + if (!inHierarchy) { + return modifierList.getAnnotations(); + } + final Set all = new HashSet() { + public boolean add(PsiAnnotation o) { + // don't overwrite "higher level" annotations + return !contains(o) && super.add(o); + } + }; + if (listOwner instanceof PsiMethod) { + all.addAll(Arrays.asList(modifierList.getAnnotations())); + SuperMethodsSearch.search((PsiMethod)listOwner, null, true, true).forEach(new Processor() { + public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { + all.addAll(Arrays.asList(superMethod.getMethod().getModifierList().getAnnotations())); + return true; + } + }); + return all.toArray(new PsiAnnotation[all.size()]); + } + if (listOwner instanceof PsiParameter) { + PsiParameter parameter = (PsiParameter)listOwner; + PsiElement declarationScope = parameter.getDeclarationScope(); + PsiParameterList parameterList; + if (declarationScope instanceof PsiMethod && parameter.getParent() == (parameterList = ((PsiMethod)declarationScope).getParameterList())) { + PsiMethod method = (PsiMethod)declarationScope; + final int parameterIndex = parameterList.getParameterIndex(parameter); + all.addAll(Arrays.asList(modifierList.getAnnotations())); + SuperMethodsSearch.search(method, null, true, true).forEach(new Processor() { + public boolean process(final MethodSignatureBackedByPsiMethod superMethod) { + PsiParameter superParameter = superMethod.getMethod().getParameterList().getParameters()[parameterIndex]; + PsiModifierList modifierList = superParameter.getModifierList(); + if (modifierList != null) { + all.addAll(Arrays.asList(modifierList.getAnnotations())); + } + return true; + } + }); + return all.toArray(new PsiAnnotation[all.size()]); + } + } + return modifierList.getAnnotations(); + } + +} From c0e4585e199eae6e1e1ce506440313b48a8276c2 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 25 Nov 2009 20:19:29 +0300 Subject: [PATCH 25/26] Compromise solution for module groups vs. disk directories battle. It groups top level modules into module groups (if any) but doesn't show inner modules at top level and also doesn't exclude their content from the parent modules. --- .../impl/nodes/AbstractModuleNode.java | 3 +++ .../impl/nodes/ProjectViewModuleNode.java | 3 +++ .../impl/nodes/ProjectViewProjectNode.java | 11 ++++++++++ .../impl/nodes/PsiDirectoryNode.java | 20 ++++++++++++------- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java index b827926bd315..a91d98658569 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java @@ -23,6 +23,7 @@ import com.intellij.openapi.module.ModuleUtil; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.ui.SimpleTextAttributes; import org.jetbrains.annotations.NotNull; public abstract class AbstractModuleNode extends ProjectViewNode { @@ -36,6 +37,8 @@ public abstract class AbstractModuleNode extends ProjectViewNode { return; } presentation.setPresentableText(getValue().getName()); + presentation.addText(getValue().getName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + presentation.setOpenIcon(getValue().getModuleType().getNodeIcon(true)); presentation.setClosedIcon(getValue().getModuleType().getNodeIcon(false)); } diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewModuleNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewModuleNode.java index a38440091491..2f27d6f1e799 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewModuleNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewModuleNode.java @@ -62,9 +62,12 @@ public class ProjectViewModuleNode extends AbstractModuleNode { PsiDirectoryNode directoryNode = new PsiDirectoryNode(getProject(), psiDirectory, getSettings()); children.add(directoryNode); } + + /* if (getSettings().isShowLibraryContents()) { children.add(new LibraryGroupNode(getProject(), new LibraryGroupElement(getValue()), getSettings())); } + */ return children; } diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewProjectNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewProjectNode.java index de8955f25638..725d33dbff81 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewProjectNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewProjectNode.java @@ -45,11 +45,22 @@ public class ProjectViewProjectNode extends AbstractProjectNode { public Collection getChildren() { List topLevelContentRoots = ProjectViewDirectoryHelper.getInstance(myProject).getTopLevelRoots(); + Set modules = new LinkedHashSet(topLevelContentRoots.size()); + + for (VirtualFile root : topLevelContentRoots) { + modules.add(ModuleUtil.findModuleForFile(root, myProject)); + } + ArrayList nodes = new ArrayList(); final PsiManager psiManager = PsiManager.getInstance(getProject()); + + /* for (VirtualFile root : reduceRoots(topLevelContentRoots)) { nodes.add(new PsiDirectoryNode(getProject(), psiManager.findDirectory(root), getSettings())); } + */ + + nodes.addAll(modulesAndGroups(modules.toArray(new Module[modules.size()]))); final VirtualFile baseDir = getProject().getBaseDir(); if (baseDir == null) return nodes; diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java index 208223f8b3e6..047e12c09453 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/PsiDirectoryNode.java @@ -57,21 +57,27 @@ public class PsiDirectoryNode extends BasePsiNode { final PsiDirectory psiDirectory = getValue(); final VirtualFile directoryFile = psiDirectory.getVirtualFile(); + final Object parentValue = getParentValue(); if (ProjectRootsUtil.isModuleContentRoot(directoryFile, project)) { ProjectFileIndex fi = ProjectRootManager.getInstance(project).getFileIndex(); Module module = fi.getModuleForFile(directoryFile); data.setPresentableText(directoryFile.getName()); if (module != null) { - if (Comparing.equal(module.getName(), directoryFile.getName())) { - data.addText(directoryFile.getName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + if (!(parentValue instanceof Module )) { + if (Comparing.equal(module.getName(), directoryFile.getName())) { + data.addText(directoryFile.getName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + } + else { + data.addText(directoryFile.getName() + " ", SimpleTextAttributes.REGULAR_ATTRIBUTES); + data.addText("[" + module.getName() + "]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + } } else { - data.addText(directoryFile.getName() + " ", SimpleTextAttributes.REGULAR_ATTRIBUTES); - data.addText("[" + module.getName() + "]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); + data.addText(directoryFile.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); } - if (getParentValue() instanceof Project) { + if (parentValue instanceof Project || parentValue instanceof Module) { data.addText(" (" + directoryFile.getPresentableUrl() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES); } else if (ProjectRootsUtil.isSourceOrTestRoot(directoryFile, project)) { @@ -89,9 +95,9 @@ public class PsiDirectoryNode extends BasePsiNode { } } - final String name = getParentValue() instanceof Project + final String name = parentValue instanceof Project ? psiDirectory.getVirtualFile().getPresentableUrl() - : ProjectViewDirectoryHelper.getInstance(psiDirectory.getProject()).getNodeName(getSettings(), getParentValue(), psiDirectory); + : ProjectViewDirectoryHelper.getInstance(psiDirectory.getProject()).getNodeName(getSettings(), parentValue, psiDirectory); if (name == null) { setValue(null); return; From 00234cbd4a6e28e3fdfb39519e1e73f4a4a3a4b7 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 25 Nov 2009 20:28:56 +0300 Subject: [PATCH 26/26] Fix Select In. --- .../projectView/impl/nodes/PackageViewModuleNode.java | 10 ++++++++-- .../projectView/impl/nodes/AbstractModuleNode.java | 11 +++++++---- .../impl/nodes/StructureViewModuleNode.java | 6 ++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageViewModuleNode.java b/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageViewModuleNode.java index 112af5accbbf..d2430b7a4e11 100644 --- a/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageViewModuleNode.java +++ b/java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageViewModuleNode.java @@ -18,14 +18,15 @@ package com.intellij.ide.projectView.impl.nodes; import com.intellij.ide.projectView.ViewSettings; import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleUtil; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.Collection; -import org.jetbrains.annotations.NotNull; - public class PackageViewModuleNode extends AbstractModuleNode{ public PackageViewModuleNode(Project project, Module value, ViewSettings viewSettings) { super(project, value, viewSettings); @@ -45,4 +46,9 @@ public class PackageViewModuleNode extends AbstractModuleNode{ } + public boolean contains(@NotNull VirtualFile file) { + Module module = getValue(); + return module != null && !module.isDisposed() && + (ModuleUtil.moduleContainsFile(module, file, false) || ModuleUtil.moduleContainsFile(module, file, true)); + } } diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java index a91d98658569..a1e5831efbc6 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/AbstractModuleNode.java @@ -19,9 +19,10 @@ import com.intellij.ide.projectView.PresentationData; import com.intellij.ide.projectView.ProjectViewNode; import com.intellij.ide.projectView.ViewSettings; import com.intellij.openapi.module.Module; -import com.intellij.openapi.module.ModuleUtil; import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ModuleRootManager; import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; +import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.SimpleTextAttributes; import org.jetbrains.annotations.NotNull; @@ -48,10 +49,12 @@ public abstract class AbstractModuleNode extends ProjectViewNode { return "Module"; } + @Override public boolean contains(@NotNull VirtualFile file) { - Module module = getValue(); - return module != null && !module.isDisposed() && - (ModuleUtil.moduleContainsFile(module, file, false) || ModuleUtil.moduleContainsFile(module, file, true)); + for (VirtualFile root : ModuleRootManager.getInstance(getValue()).getContentRoots()) { + if (VfsUtil.isAncestor(root, file, false)) return true; + } + return false; } public String getToolTip() { diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/StructureViewModuleNode.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/StructureViewModuleNode.java index 397064957117..fc663a133279 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/StructureViewModuleNode.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/StructureViewModuleNode.java @@ -21,6 +21,7 @@ import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; +import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -48,4 +49,9 @@ public class StructureViewModuleNode extends AbstractModuleNode { public int getTypeSortWeight(final boolean sortByType) { return 2; } + + @Override + public boolean contains(@NotNull VirtualFile file) { + return false; + } }