mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
performance
This commit is contained in:
+4
-1
@@ -49,6 +49,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.pom.PomNamedTarget;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
|
||||
@@ -77,6 +78,7 @@ import java.util.*;
|
||||
public class PostHighlightingPass extends ProgressableTextEditorHighlightingPass {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.PostHighlightingPass");
|
||||
private static final Key<Long> LAST_POST_PASS_TIMESTAMP = Key.create("LAST_POST_PASS_TIMESTAMP");
|
||||
private final LanguageLevel myLanguageLevel;
|
||||
private RefCountHolder myRefCountHolder;
|
||||
private final PsiFile myFile;
|
||||
@Nullable private final Editor myEditor;
|
||||
@@ -109,6 +111,7 @@ public class PostHighlightingPass extends ProgressableTextEditorHighlightingPass
|
||||
myEndOffset = file.getTextLength();
|
||||
|
||||
myCurrentEntryIndex = -1;
|
||||
myLanguageLevel = PsiUtil.getLanguageLevel(file);
|
||||
}
|
||||
|
||||
static boolean isUpToDate(@NotNull PsiFile file) {
|
||||
@@ -509,7 +512,7 @@ public class PostHighlightingPass extends ProgressableTextEditorHighlightingPass
|
||||
//parameter is defined by functional interface
|
||||
final PsiElement declarationScope = parameter.getDeclarationScope();
|
||||
if (declarationScope instanceof PsiMethod &&
|
||||
myRefCountHolder.isReferencedByMethodReference((PsiMethod)declarationScope)) {
|
||||
myRefCountHolder.isReferencedByMethodReference((PsiMethod)declarationScope, myLanguageLevel)) {
|
||||
return null;
|
||||
}
|
||||
String message = JavaErrorMessages.message("parameter.is.not.used", identifier.getText());
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.UserDataHolderEx;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiMatcherImpl;
|
||||
import com.intellij.psi.util.PsiMatchers;
|
||||
@@ -204,8 +205,8 @@ public class RefCountHolder {
|
||||
return usedStatus == Boolean.TRUE;
|
||||
}
|
||||
|
||||
public boolean isReferencedByMethodReference(@NotNull PsiMethod method) {
|
||||
if (!PsiUtil.isLanguageLevel8OrHigher(method)) return false;
|
||||
public boolean isReferencedByMethodReference(@NotNull PsiMethod method, @NotNull LanguageLevel languageLevel) {
|
||||
if (!languageLevel.isAtLeast(LanguageLevel.JDK_1_8)) return false;
|
||||
|
||||
List<PsiReference> array;
|
||||
synchronized (myLocalRefsMap) {
|
||||
|
||||
Reference in New Issue
Block a user