mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+3
-4
@@ -21,7 +21,6 @@ import com.intellij.codeInsight.daemon.GroupNames;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.reference.*;
|
||||
import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel;
|
||||
import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel;
|
||||
import com.intellij.codeInspection.unusedSymbol.VisibilityModifierChooser;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
@@ -73,7 +72,7 @@ public class UnusedReturnValue extends GlobalJavaBatchInspectionTool{
|
||||
if (refMethod.isExternalOverride() && !isNative) return null;
|
||||
if (RefUtil.isImplicitRead(psiMethod)) return null;
|
||||
if (canIgnoreReturnValue(psiMethod)) return null;
|
||||
return new ProblemDescriptor[]{createProblemDescriptor(psiMethod, manager, processor, isNative)};
|
||||
return new ProblemDescriptor[]{createProblemDescriptor(psiMethod, manager, processor, isNative, false)};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,11 +163,11 @@ public class UnusedReturnValue extends GlobalJavaBatchInspectionTool{
|
||||
static ProblemDescriptor createProblemDescriptor(@NotNull PsiMethod psiMethod,
|
||||
@NotNull InspectionManager manager,
|
||||
@Nullable ProblemDescriptionsProcessor processor,
|
||||
boolean isNative) {
|
||||
boolean isNative, boolean isOnTheFly) {
|
||||
return manager.createProblemDescriptor(psiMethod.getNameIdentifier(),
|
||||
InspectionsBundle.message("inspection.unused.return.value.problem.descriptor"),
|
||||
isNative ? null : new MakeVoidQuickFix(processor),
|
||||
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||
false);
|
||||
isOnTheFly);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class UnusedReturnValueLocalInspection extends AbstractBaseJavaLocalInspe
|
||||
PsiType.VOID.equals(LambdaUtil.getFunctionalInterfaceReturnType((PsiFunctionalExpression)element));
|
||||
})) {
|
||||
if (atLeastOneUsageExists[0]) {
|
||||
return new ProblemDescriptor[]{UnusedReturnValue.createProblemDescriptor(method, manager, null, false)};
|
||||
return new ProblemDescriptor[]{UnusedReturnValue.createProblemDescriptor(method, manager, null, false, isOnTheFly)};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -136,7 +136,7 @@ public class FileBasedIndexImpl extends FileBasedIndex implements BaseComponent,
|
||||
private final Set<Project> myProjectsBeingUpdated = ContainerUtil.newConcurrentSet();
|
||||
private final IndexAccessValidator myAccessValidator = new IndexAccessValidator();
|
||||
|
||||
@SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"}) private volatile boolean myInitialized;
|
||||
private volatile boolean myInitialized;
|
||||
|
||||
private Future<IndexConfiguration> myStateFuture;
|
||||
private volatile IndexConfiguration myState;
|
||||
@@ -274,15 +274,14 @@ public class FileBasedIndexImpl extends FileBasedIndex implements BaseComponent,
|
||||
}
|
||||
}
|
||||
|
||||
boolean processChangedFiles(@NotNull Project project, Processor<VirtualFile> processor) {
|
||||
Set<VirtualFile> changed = new THashSet<>();
|
||||
|
||||
Stream<VirtualFile> stream = Stream.concat(
|
||||
myChangedFilesCollector.myVfsEventsMerger.getChangedFiles(), // avoid missing files when events are processed concurrently
|
||||
myChangedFilesCollector.myFilesToUpdate.values().stream()
|
||||
).filter(filesToBeIndexedForProjectCondition(project)).filter(changed::add);
|
||||
|
||||
return ContainerUtil.process(stream::iterator, processor);
|
||||
boolean processChangedFiles(@NotNull Project project, @NotNull Processor<? super VirtualFile> processor) {
|
||||
// avoid missing files when events are processed concurrently
|
||||
return Stream.concat(myChangedFilesCollector.myVfsEventsMerger.getChangedFiles(),
|
||||
myChangedFilesCollector.myFilesToUpdate.values().stream())
|
||||
.filter(filesToBeIndexedForProjectCondition(project))
|
||||
.distinct()
|
||||
.mapToInt(f -> processor.process(f) ? 1 : 0)
|
||||
.allMatch(success -> success == 1);
|
||||
}
|
||||
|
||||
public static boolean isProjectOrWorkspaceFile(@NotNull VirtualFile file, @Nullable FileType fileType) {
|
||||
|
||||
Reference in New Issue
Block a user