mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+14
-4
@@ -27,7 +27,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersionUtil;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionService;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
@@ -509,7 +509,8 @@ public class GenericsHighlightUtil {
|
||||
final PsiType retErasure2 = TypeConversionUtil.erasure(superMethod.getReturnType());
|
||||
|
||||
boolean differentReturnTypeErasure = !Comparing.equal(retErasure1, retErasure2);
|
||||
if (checkEqualsSuper && JavaSdkVersionUtil.isAtLeast(checkMethod, JavaSdkVersion.JDK_1_7)) {
|
||||
final boolean atLeast17 = JavaVersionService.getInstance().isAtLeast(checkMethod, JavaSdkVersion.JDK_1_7);
|
||||
if (checkEqualsSuper && atLeast17) {
|
||||
if (retErasure1 != null && retErasure2 != null) {
|
||||
differentReturnTypeErasure = !TypeConversionUtil.isAssignable(retErasure1, retErasure2);
|
||||
} else {
|
||||
@@ -520,8 +521,17 @@ public class GenericsHighlightUtil {
|
||||
if (differentReturnTypeErasure &&
|
||||
!TypeConversionUtil.isVoidType(retErasure1) &&
|
||||
!TypeConversionUtil.isVoidType(retErasure2) &&
|
||||
!(checkEqualsSuper && Arrays.equals(superSignature.getParameterTypes(), signatureToCheck.getParameterTypes()))) {
|
||||
return null;
|
||||
!(checkEqualsSuper && Arrays.equals(superSignature.getParameterTypes(), signatureToCheck.getParameterTypes())) &&
|
||||
!atLeast17) {
|
||||
int idx = 0;
|
||||
final PsiType[] parameterTypes = signatureToCheck.getParameterTypes();
|
||||
boolean erasure = parameterTypes.length > 0;
|
||||
for (PsiType type : superSignature.getParameterTypes()) {
|
||||
erasure &= Comparing.equal(type, TypeConversionUtil.erasure(parameterTypes[idx]));
|
||||
idx++;
|
||||
}
|
||||
|
||||
if (!erasure) return null;
|
||||
}
|
||||
|
||||
if (!checkEqualsSuper && MethodSignatureUtil.isSubsignature(superSignature, signatureToCheck)) {
|
||||
|
||||
+3
-7
@@ -30,6 +30,7 @@ import com.intellij.codeInsight.hint.QuestionAction;
|
||||
import com.intellij.codeInsight.intention.HighPriorityAction;
|
||||
import com.intellij.codeInspection.HintAction;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.impl.LaterInvocator;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -67,13 +68,7 @@ public abstract class ImportClassFixBase<T extends PsiElement & PsiReference> im
|
||||
return false;
|
||||
}
|
||||
PsiManager manager = file.getManager();
|
||||
if (!manager.isInProject(file)) {
|
||||
return false;
|
||||
}
|
||||
if (getClassesToImport().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return manager.isInProject(file) && !getClassesToImport().isEmpty();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -188,6 +183,7 @@ public abstract class ImportClassFixBase<T extends PsiElement & PsiReference> im
|
||||
CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY)
|
||||
&& (ApplicationManager.getApplication().isUnitTestMode() || codeAnalyzer.canChangeFileSilently(psiFile))
|
||||
&& !autoImportWillInsertUnexpectedCharacters(classes[0])
|
||||
&& !LaterInvocator.isInModalContext()
|
||||
) {
|
||||
CommandProcessor.getInstance().runUndoTransparentAction(new Runnable() {
|
||||
@Override
|
||||
|
||||
-1
@@ -40,7 +40,6 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
|
||||
@@ -192,6 +192,7 @@ public class EntryPointsManagerImpl implements PersistentStateComponent<Element>
|
||||
public void resolveEntryPoints(final RefManager manager) {
|
||||
if (!myResolved) {
|
||||
myResolved = true;
|
||||
cleanup();
|
||||
validateEntryPoints();
|
||||
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.openapi.projectRoots;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
|
||||
/**
|
||||
@@ -22,8 +23,15 @@ import com.intellij.psi.PsiElement;
|
||||
* Date: 3/28/12
|
||||
*/
|
||||
public class JavaVersionServiceImpl extends JavaVersionService {
|
||||
private boolean myTestVersion = false;
|
||||
|
||||
public void setTestVersion(boolean testVersion) {
|
||||
myTestVersion = testVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAtLeast(PsiElement element, JavaSdkVersion version) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) return myTestVersion;
|
||||
return JavaSdkVersionUtil.isAtLeast(element, version);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user