From 3dba01f5a87cd8e6775c3b6dfc15f7c484342603 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 8 Feb 2010 14:35:57 +0300 Subject: [PATCH 1/7] avoid 'already disposed' exception in OptionsEditor (RUBY-5629) --- .../openapi/options/newEditor/OptionsEditor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java index d5e4c80c1ce1..69dca22b7752 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java @@ -102,10 +102,12 @@ public class OptionsEditor extends JPanel implements DataProvider, Place.Navigat private boolean myFilterFocumentWasChanged; //[back/forward] private ActionToolbar myToolbar; private Window myWindow; + private PropertiesComponent myProperties; public OptionsEditor(Project project, ConfigurableGroup[] groups, Configurable preselectedConfigurable) { myProject = project; myGroups = groups; + myProperties = PropertiesComponent.getInstance(project); myFilter = new Filter(); myContext = new OptionsEditorContext(myFilter); @@ -244,7 +246,7 @@ public class OptionsEditor extends JPanel implements DataProvider, Place.Navigat private float readPropertion(final float defaultValue, final String propertyName) { float proportion = defaultValue; try { - final String p = PropertiesComponent.getInstance(myProject).getValue(propertyName); + final String p = myProperties.getValue(propertyName); if (p != null) { proportion = Float.valueOf(p); } @@ -829,10 +831,9 @@ public class OptionsEditor extends JPanel implements DataProvider, Place.Navigat } public void dispose() { - final PropertiesComponent props = PropertiesComponent.getInstance(myProject); - props.setValue(MAIN_SPLITTER_PROPORTION, String.valueOf(myMainSplitter.getProportion())); - props.setValue(DETAILS_SPLITTER_PROPORTION, String.valueOf(myContentWrapper.myLastSplitterProproprtion)); - props.setValue(SEARCH_VISIBLE, Boolean.valueOf(isFilterFieldVisible()).toString()); + myProperties.setValue(MAIN_SPLITTER_PROPORTION, String.valueOf(myMainSplitter.getProportion())); + myProperties.setValue(DETAILS_SPLITTER_PROPORTION, String.valueOf(myContentWrapper.myLastSplitterProproprtion)); + myProperties.setValue(SEARCH_VISIBLE, Boolean.valueOf(isFilterFieldVisible()).toString()); Toolkit.getDefaultToolkit().removeAWTEventListener(this); From e84e6e32c27325ca4ddf31acd69ce0fb9cccd132 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 8 Feb 2010 14:38:35 +0300 Subject: [PATCH 2/7] do not log ProcessCanceledException (RUBY-5523) --- .../com/intellij/openapi/application/impl/ApplicationImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java index 910dfab558bd..db43f3e3f90b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java @@ -328,6 +328,9 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application try { action.run(); } + catch (ProcessCanceledException e) { + // ignore + } catch (Throwable t) { LOG.error(t); } From 04c9d9520508e90d432599cc53ceed7ab1460200 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 8 Feb 2010 15:44:03 +0300 Subject: [PATCH 3/7] plugins with unparseable build number are incompatible (IDEA-52098) --- .../src/com/intellij/ide/plugins/PluginManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/platform-api/src/com/intellij/ide/plugins/PluginManager.java b/platform/platform-api/src/com/intellij/ide/plugins/PluginManager.java index e3ad5c08158c..4ba1aef918a9 100644 --- a/platform/platform-api/src/com/intellij/ide/plugins/PluginManager.java +++ b/platform/platform-api/src/com/intellij/ide/plugins/PluginManager.java @@ -398,7 +398,13 @@ public class PluginManager { } public static boolean isIncompatible(final IdeaPluginDescriptor descriptor) { - BuildNumber buildNumber = getBuildNumber(); + BuildNumber buildNumber = null; + try { + buildNumber = getBuildNumber(); + } + catch (RuntimeException e) { + return false; + } if (!StringUtil.isEmpty(descriptor.getSinceBuild())) { BuildNumber sinceBuild = BuildNumber.fromString(descriptor.getSinceBuild()); From c638216d7e7549e742871980f74041b59ead42c9 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Mon, 8 Feb 2010 17:53:25 +0300 Subject: [PATCH 4/7] WI-938: Correctly use ALL of the name separators provided by a model. --- .../ide/util/gotoByName/ChooseByNameBase.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java index 86ef94aacb20..6ec50fe404c2 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java @@ -1188,11 +1188,14 @@ public abstract class ChooseByNameBase{ } private List split(String s) { - for (String separator : myModel.getSeparators()) { - final List result = StringUtil.split(s, separator); - if (!result.isEmpty()) return result; + List answer = new ArrayList(); + for (String token : StringUtil.tokenize(s, StringUtil.join(myModel.getSeparators(), ""))) { + if (token.length() > 0) { + answer.add(token); + } } - return Collections.singletonList(s); + + return answer.isEmpty() ? Collections.singletonList(s) : answer; } private boolean matchesQualifier(final Object element, final String qualifierPattern) { From 0d2a5bb19a98b6acd3621a049ed7bdb7c1a85116 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 8 Feb 2010 14:49:02 +0300 Subject: [PATCH 5/7] renamed --- .../daemon/impl/PostHighlightingPass.java | 8 +++---- .../deadCode/DummyEntryPointsTool.java | 4 ++-- ....java => UnusedDeclarationInspection.java} | 24 +++++++++---------- .../ex/GlobalJavaInspectionContextImpl.java | 6 ++--- .../ex/StandardInspectionToolsProvider.java | 4 ++-- .../codeInspection/ui/EntryPointsNode.java | 4 ++-- ...deTest.java => UnusedDeclarationTest.java} | 8 +++---- .../testFramework/InspectionTestCase.java | 4 ++-- 8 files changed, 31 insertions(+), 31 deletions(-) rename java/java-impl/src/com/intellij/codeInspection/deadCode/{DeadCodeInspection.java => UnusedDeclarationInspection.java} (97%) rename java/java-tests/testSrc/com/intellij/codeInspection/{DeadCodeTest.java => UnusedDeclarationTest.java} (94%) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java index 86c0da0a6c75..a2a26bdf6229 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java @@ -30,7 +30,7 @@ import com.intellij.codeInsight.daemon.impl.quickfix.*; import com.intellij.codeInsight.intention.EmptyIntentionAction; import com.intellij.codeInspection.InspectionProfile; import com.intellij.codeInspection.InspectionsBundle; -import com.intellij.codeInspection.deadCode.DeadCodeInspection; +import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.codeInspection.ex.InspectionManagerEx; import com.intellij.codeInspection.ex.LocalInspectionToolWrapper; import com.intellij.codeInspection.unusedImport.UnusedImportLocalInspection; @@ -97,7 +97,7 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { private int myCurentEntryIndex; private boolean myHasMissortedImports; private final ImplicitUsageProvider[] myImplicitUsageProviders; - private DeadCodeInspection myDeadCodeInspection; + private UnusedDeclarationInspection myDeadCodeInspection; private UnusedSymbolLocalInspection myUnusedSymbolInspection; private HighlightDisplayKey myUnusedSymbolKey; private boolean myDeadCodeEnabled; @@ -220,8 +220,8 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { myUnusedSymbolInspection = unusedSymbolTool == null ? null : (UnusedSymbolLocalInspection)unusedSymbolTool.getTool(); LOG.assertTrue(ApplicationManager.getApplication().isUnitTestMode() || myUnusedSymbolInspection != null); - myDeadCodeKey = HighlightDisplayKey.find(DeadCodeInspection.SHORT_NAME); - myDeadCodeInspection = (DeadCodeInspection)profile.getInspectionTool(DeadCodeInspection.SHORT_NAME, myFile); + myDeadCodeKey = HighlightDisplayKey.find(UnusedDeclarationInspection.SHORT_NAME); + myDeadCodeInspection = (UnusedDeclarationInspection)profile.getInspectionTool(UnusedDeclarationInspection.SHORT_NAME, myFile); myDeadCodeEnabled = profile.isToolEnabled(myDeadCodeKey, myFile); if (unusedImportEnabled && JspPsiUtil.isInJspFile(myFile)) { final JspFile jspFile = JspPsiUtil.getJspFile(myFile); diff --git a/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsTool.java b/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsTool.java index 665dae4fdebf..850b2d1d3906 100644 --- a/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsTool.java +++ b/java/java-impl/src/com/intellij/codeInspection/deadCode/DummyEntryPointsTool.java @@ -30,10 +30,10 @@ import org.jetbrains.annotations.NotNull; */ public class DummyEntryPointsTool extends FilteringInspectionTool { private RefEntryPointFilter myFilter; - private final DeadCodeInspection myOwner; + private final UnusedDeclarationInspection myOwner; private QuickFixAction[] myQuickFixActions; - public DummyEntryPointsTool(DeadCodeInspection owner) { + public DummyEntryPointsTool(UnusedDeclarationInspection owner) { myOwner = owner; } diff --git a/java/java-impl/src/com/intellij/codeInspection/deadCode/DeadCodeInspection.java b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java similarity index 97% rename from java/java-impl/src/com/intellij/codeInspection/deadCode/DeadCodeInspection.java rename to java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java index ac48132b8cba..5d8d41d6226c 100644 --- a/java/java-impl/src/com/intellij/codeInspection/deadCode/DeadCodeInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java @@ -75,7 +75,7 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.List; -public class DeadCodeInspection extends FilteringInspectionTool { +public class UnusedDeclarationInspection extends FilteringInspectionTool { public boolean ADD_MAINS_TO_ENTRIES = true; public boolean ADD_APPLET_TO_ENTRIES = true; @@ -83,7 +83,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { public boolean ADD_NONJAVA_TO_ENTRIES = true; public JDOMExternalizableStringList ADDITIONAL_ANNOTATIONS = new JDOMExternalizableStringList(); - private static final String[] ADDITIONAL_ANNOS = { + @NonNls private static final String[] ADDITIONAL_ANNOS = { "javax.ws.rs.*" }; @@ -104,7 +104,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { public final UnusedCodeExtension[] myExtensions; - public DeadCodeInspection() { + public UnusedDeclarationInspection() { ADDITIONAL_ANNOTATIONS.addAll(Arrays.asList(ADDITIONAL_ANNOS)); myQuickFixActions = new QuickFixAction[]{new PermanentDeleteAction(), new CommentOutBin(), new MoveToEntries()}; ExtensionPoint point = Extensions.getRootArea().getExtensionPoint(ExtensionPoints.DEAD_CODE_TOOL); @@ -317,8 +317,8 @@ public class DeadCodeInspection extends FilteringInspectionTool { final RefElementImpl refElement = (RefElementImpl)refEntity; final PsiElement element = refElement.getElement(); if (element == null) return; - final boolean isSuppressed = ((RefElementImpl)refElement).isSuppressed(getShortName()); - if (!getContext().isToCheckMember(element, DeadCodeInspection.this) || isSuppressed) { + final boolean isSuppressed = refElement.isSuppressed(getShortName()); + if (!getContext().isToCheckMember(element, UnusedDeclarationInspection.this) || isSuppressed) { if (isSuppressed || !scope.contains(element)) { getEntryPointsManager().addEntryPoint(refElement, false); } @@ -370,7 +370,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { checkForReachables(); ProgressManager.getInstance().runProcess(new Runnable() { public void run() { - final RefFilter filter = new StrictUnreferencedFilter(DeadCodeInspection.this); + final RefFilter filter = new StrictUnreferencedFilter(UnusedDeclarationInspection.this); final PsiSearchHelper helper = PsiManager.getInstance(getRefManager().getProject()).getSearchHelper(); getRefManager().iterate(new RefJavaVisitor() { @Override public void visitElement(final RefEntity refEntity) { @@ -529,7 +529,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { if (isSerializablePatternMethod(psiMethod)) { getEntryPointsManager().addEntryPoint(refMethod, false); } - else if (!refMethod.isExternalOverride() && refMethod.getAccessModifier() != PsiModifier.PRIVATE) { + else if (!refMethod.isExternalOverride() && !PsiModifier.PRIVATE.equals(refMethod.getAccessModifier())) { for (final RefMethod derivedMethod : refMethod.getDerivedMethods()) { myProcessedSuspicious.add(derivedMethod); } @@ -721,7 +721,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { private class PermanentDeleteAction extends QuickFixAction { private PermanentDeleteAction() { - super(DELETE_QUICK_FIX, IconLoader.getIcon("/actions/cancel.png"), KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), DeadCodeInspection.this); + super(DELETE_QUICK_FIX, IconLoader.getIcon("/actions/cancel.png"), KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), UnusedDeclarationInspection.this); } protected boolean applyFix(final RefElement[] refElements) { @@ -739,7 +739,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { final Project project = getContext().getProject(); SafeDeleteHandler.invoke(project, psiElements.toArray(new PsiElement[psiElements.size()]), false, new Runnable(){ public void run() { - removeElements(refElements, project, DeadCodeInspection.this); + removeElements(refElements, project, UnusedDeclarationInspection.this); } }); } @@ -789,7 +789,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { private class CommentOutBin extends QuickFixAction { private CommentOutBin() { super(COMMENT_OUT_QUICK_FIX, null, KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK), - DeadCodeInspection.this); + UnusedDeclarationInspection.this); } protected boolean applyFix(RefElement[] refElements) { @@ -846,7 +846,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { private class MoveToEntries extends QuickFixAction { private MoveToEntries() { - super(InspectionsBundle.message("inspection.dead.code.entry.point.quickfix"), null, KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0), DeadCodeInspection.this); + super(InspectionsBundle.message("inspection.dead.code.entry.point.quickfix"), null, KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0), UnusedDeclarationInspection.this); } protected boolean applyFix(RefElement[] refElements) { @@ -871,7 +871,7 @@ public class DeadCodeInspection extends FilteringInspectionTool { final RefJavaElementImpl refElement = (RefJavaElementImpl)refEntity; final PsiElement element = refElement.getElement(); if (element == null) return; - if (!getContext().isToCheckMember(refElement, DeadCodeInspection.this)) return; + if (!getContext().isToCheckMember(refElement, UnusedDeclarationInspection.this)) return; refElement.setReachable(false); } } diff --git a/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java b/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java index 0fc5602f70ac..1c146d85d50b 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java +++ b/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java @@ -26,7 +26,7 @@ import com.intellij.codeInspection.GlobalInspectionContext; import com.intellij.codeInspection.GlobalJavaInspectionContext; import com.intellij.codeInspection.InspectionProfileEntry; import com.intellij.codeInspection.InspectionsBundle; -import com.intellij.codeInspection.deadCode.DeadCodeInspection; +import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.codeInspection.reference.*; import com.intellij.lang.StdLanguages; import com.intellij.openapi.application.ApplicationManager; @@ -393,8 +393,8 @@ public class GlobalJavaInspectionContextImpl extends GlobalJavaInspectionContext getEntryPointsManager(context.getRefManager()).resolveEntryPoints(context.getRefManager()); ContainerUtil.quickSort(globalTools, new Comparator() { public int compare(Tools o1, Tools o2) { - if (o1.getTool() instanceof DeadCodeInspection) return -1; - if (o2.getTool() instanceof DeadCodeInspection) return 1; + if (o1.getTool() instanceof UnusedDeclarationInspection) return -1; + if (o2.getTool() instanceof UnusedDeclarationInspection) return 1; return 0; } }); diff --git a/java/java-impl/src/com/intellij/codeInspection/ex/StandardInspectionToolsProvider.java b/java/java-impl/src/com/intellij/codeInspection/ex/StandardInspectionToolsProvider.java index 9978aecbd1ec..84f7f4b08e5a 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ex/StandardInspectionToolsProvider.java +++ b/java/java-impl/src/com/intellij/codeInspection/ex/StandardInspectionToolsProvider.java @@ -23,7 +23,7 @@ import com.intellij.codeInspection.accessStaticViaInstance.AccessStaticViaInstan import com.intellij.codeInspection.canBeFinal.CanBeFinalInspection; import com.intellij.codeInspection.concurrencyAnnotations.*; import com.intellij.codeInspection.dataFlow.DataFlowInspection; -import com.intellij.codeInspection.deadCode.DeadCodeInspection; +import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.codeInspection.defUse.DefUseInspection; import com.intellij.codeInspection.defaultFileTemplateUsage.DefaultFileTemplateUsageInspection; import com.intellij.codeInspection.dependencyViolation.DependencyInspection; @@ -66,7 +66,7 @@ public class StandardInspectionToolsProvider implements InspectionToolProvider { public Class[] getInspectionClasses() { return new Class[] { - DeadCodeInspection.class, + UnusedDeclarationInspection.class, UnusedLibrariesInspection.class, InconsistentLanguageLevelInspection.class, VisibilityInspection.class, diff --git a/java/java-impl/src/com/intellij/codeInspection/ui/EntryPointsNode.java b/java/java-impl/src/com/intellij/codeInspection/ui/EntryPointsNode.java index 3cb9b2a0a229..9fb69df6b7c6 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ui/EntryPointsNode.java +++ b/java/java-impl/src/com/intellij/codeInspection/ui/EntryPointsNode.java @@ -15,7 +15,7 @@ */ package com.intellij.codeInspection.ui; -import com.intellij.codeInspection.deadCode.DeadCodeInspection; +import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.codeInspection.deadCode.DummyEntryPointsTool; import com.intellij.openapi.util.IconLoader; @@ -26,7 +26,7 @@ import javax.swing.*; */ public class EntryPointsNode extends InspectionNode { private static final Icon ENTRY_POINTS = IconLoader.getIcon("/nodes/entryPoints.png"); - public EntryPointsNode(DeadCodeInspection tool) { + public EntryPointsNode(UnusedDeclarationInspection tool) { super(new DummyEntryPointsTool(tool)); getTool().updateContent(); } diff --git a/java/java-tests/testSrc/com/intellij/codeInspection/DeadCodeTest.java b/java/java-tests/testSrc/com/intellij/codeInspection/UnusedDeclarationTest.java similarity index 94% rename from java/java-tests/testSrc/com/intellij/codeInspection/DeadCodeTest.java rename to java/java-tests/testSrc/com/intellij/codeInspection/UnusedDeclarationTest.java index d90f59a5ab52..eccd785e7e14 100644 --- a/java/java-tests/testSrc/com/intellij/codeInspection/DeadCodeTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInspection/UnusedDeclarationTest.java @@ -1,7 +1,7 @@ package com.intellij.codeInspection; import com.intellij.JavaTestUtil; -import com.intellij.codeInspection.deadCode.DeadCodeInspection; +import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.JavaPsiFacade; @@ -10,8 +10,8 @@ import com.intellij.testFramework.InspectionTestCase; /** * @author max */ -public class DeadCodeTest extends InspectionTestCase { - private DeadCodeInspection myTool; +public class UnusedDeclarationTest extends InspectionTestCase { + private UnusedDeclarationInspection myTool; @Override protected String getTestDataPath() { @@ -20,7 +20,7 @@ public class DeadCodeTest extends InspectionTestCase { protected void setUp() throws Exception { super.setUp(); - myTool = new DeadCodeInspection(); + myTool = new UnusedDeclarationInspection(); LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_3); } diff --git a/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java b/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java index e40ecdc44734..c8a758ca7d24 100644 --- a/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java +++ b/java/testFramework/src/com/intellij/testFramework/InspectionTestCase.java @@ -28,7 +28,7 @@ import com.intellij.analysis.AnalysisScope; import com.intellij.codeInspection.GlobalInspectionTool; import com.intellij.codeInspection.InspectionManager; import com.intellij.codeInspection.LocalInspectionTool; -import com.intellij.codeInspection.deadCode.DeadCodeInspection; +import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.codeInspection.ex.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ex.PathManagerEx; @@ -114,7 +114,7 @@ public abstract class InspectionTestCase extends PsiTestCase { globalContext.setCurrentScope(scope); if (runDeadCodeFirst) { - runTool(new DeadCodeInspection(), scope, globalContext, inspectionManager); + runTool(new UnusedDeclarationInspection(), scope, globalContext, inspectionManager); } runTool(tool, scope, globalContext, inspectionManager); } From 0d9368ba7353c1cd65da97b2c454a40d8d3d7953 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 8 Feb 2010 18:08:29 +0300 Subject: [PATCH 6/7] unused overloaded methods --- .../intellij/codeInsight/daemon/impl/PostHighlightingPass.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java index a2a26bdf6229..83ac2642fd4e 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java @@ -542,7 +542,7 @@ public class PostHighlightingPass extends TextEditorHighlightingPass { if (count[0] == 0 && !canbeReferencedViaWeirdNames(member)) return true; Query query = member instanceof PsiMethod - ? MethodReferencesSearch.search((PsiMethod)member, scope, false) + ? MethodReferencesSearch.search((PsiMethod)member, scope, true) : ReferencesSearch.search(member, scope, true); return query.findFirst() == null; } From 5259740df56b701f20e031fcb5a41f44cb8d6a51 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 8 Feb 2010 18:28:46 +0300 Subject: [PATCH 7/7] cleanup --- .../org/intellij/plugins/intelliLang/Configuration.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java index 8967e530ef64..e7a8cdbc053a 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/Configuration.java @@ -20,7 +20,6 @@ import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.command.undo.DocumentReference; import com.intellij.openapi.command.undo.UndoManager; import com.intellij.openapi.command.undo.UndoableAction; -import com.intellij.openapi.command.undo.UnexpectedUndoException; import com.intellij.openapi.components.*; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; @@ -277,7 +276,7 @@ public final class Configuration implements PersistentStateComponent { } @Nullable - public static Configuration load(final InputStream is) throws IOException, JDOMException, InvalidDataException { + public static Configuration load(final InputStream is) throws IOException, JDOMException { try { final Document document = JDOMUtil.loadDocument(is); final ArrayList elements = new ArrayList(); @@ -465,11 +464,11 @@ public final class Configuration implements PersistentStateComponent { final List psiElementsToRemove, final PairProcessor actualProcessor) { final UndoableAction action = new UndoableAction() { - public void undo() throws UnexpectedUndoException { + public void undo() { actualProcessor.process(remove, add); } - public void redo() throws UnexpectedUndoException { + public void redo() { actualProcessor.process(add, remove); }