diff options
author | Tor Norbye <tnorbye@google.com> | 2013-06-21 16:58:30 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2013-06-21 16:58:30 -0700 |
commit | c6218e46d5d2017e987ecdbd99b318a95c42abc0 (patch) | |
tree | 85106b3c757a794fb274159cebe07c8d979740a5 /java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java | |
parent | 0e154c74931b6ff5ad6e0ec512b32e30df3cb068 (diff) | |
download | idea-c6218e46d5d2017e987ecdbd99b318a95c42abc0.tar.gz |
Snapshot d8891a7de15cebb78b6ce5711e50e531b42c0baf from master branch of git://git.jetbrains.org/idea/community.git
Change-Id: Ida9d1b0a2341112b9ebcf67bf560c8f62f0afdc6
Diffstat (limited to 'java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java')
-rw-r--r-- | java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java | 25 |
1 files changed, 16 insertions, 9 deletions
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 f3bdaf20aeea..86ff16ca9553 100644 --- a/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java +++ b/java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java @@ -23,6 +23,7 @@ package com.intellij.codeInspection.ex; import com.intellij.CommonBundle; import com.intellij.analysis.AnalysisScope; import com.intellij.codeInspection.*; +import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.codeInspection.reference.*; import com.intellij.lang.StdLanguages; import com.intellij.openapi.application.ApplicationManager; @@ -412,26 +413,32 @@ public class GlobalJavaInspectionContextImpl extends GlobalJavaInspectionContext } @Override - public void performPreRunActivities(@NotNull final List<Tools> globalTools, - @NotNull final List<Tools> localTools, - @NotNull final GlobalInspectionContext context) { + public void performPreRunActivities(final List<Tools> globalTools, final List<Tools> localTools, + final GlobalInspectionContext context) { getEntryPointsManager(context.getRefManager()).resolveEntryPoints(context.getRefManager()); + for (int i = 0; i < globalTools.size(); i++) { + InspectionProfileEntry tool = globalTools.get(i).getTool(); + if (UnusedDeclarationInspection.SHORT_NAME.equals(tool.getShortName())) { + Collections.swap(globalTools, i, 0); + break; + } + } } @Override - public void performPostRunActivities(@NotNull List<InspectionProfileEntry> needRepeatSearchRequest, @NotNull final GlobalInspectionContext context) { + public void performPostRunActivities(List<InspectionProfileEntry> needRepeatSearchRequest, final GlobalInspectionContext context) { JobDescriptor progress = context.getStdJobDescriptors().FIND_EXTERNAL_USAGES; progress.setTotalAmount(getRequestCount()); do { processSearchRequests(context); - InspectionToolWrapper[] requestors = needRepeatSearchRequest.toArray(new InspectionToolWrapper[needRepeatSearchRequest.size()]); - for (InspectionToolWrapper wrapper : requestors) { - InspectionProfileEntry requestor = wrapper.getTool(); - if (requestor instanceof InspectionTool && !((InspectionTool)requestor).queryExternalUsagesRequests(InspectionManager.getInstance(context.getProject()))) { - needRepeatSearchRequest.remove(wrapper); + InspectionProfileEntry[] requestors = needRepeatSearchRequest.toArray(new InspectionProfileEntry[needRepeatSearchRequest.size()]); + for (InspectionProfileEntry requestor : requestors) { + if (requestor instanceof InspectionTool && + !((InspectionTool)requestor).queryExternalUsagesRequests(InspectionManager.getInstance(context.getProject()))) { + needRepeatSearchRequest.remove(requestor); } } int oldSearchRequestCount = progress.getTotalAmount(); |