mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+1
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 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.
|
||||
@@ -24,10 +24,6 @@
|
||||
package com.intellij.codeInsight.daemon.impl.quickfix;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.infos.CandidateInfo;
|
||||
@@ -35,7 +31,6 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.intellij.refactoring.util.RefactoringChangeUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -81,7 +76,6 @@ public class QualifyThisArgumentFix extends QualifyThisOrSuperArgumentFix{
|
||||
for (CandidateInfo candidate : candidates) {
|
||||
PsiMethod method = (PsiMethod)candidate.getElement();
|
||||
PsiSubstitutor substitutor = candidate.getSubstitutor();
|
||||
assert method != null;
|
||||
PsiParameter[] parameters = method.getParameterList().getParameters();
|
||||
if (expressions.length != parameters.length) {
|
||||
continue;
|
||||
|
||||
@@ -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.
|
||||
@@ -938,7 +938,6 @@ public class ExpectedTypesProvider {
|
||||
for (CandidateInfo candidate : methodCandidates) {
|
||||
PsiMethod method = (PsiMethod)candidate.getElement();
|
||||
PsiSubstitutor substitutor = candidate.getSubstitutor();
|
||||
assert method != null;
|
||||
PsiParameter[] params = method.getParameterList().getParameters();
|
||||
if (params.length <= index) continue;
|
||||
PsiParameter param = params[index];
|
||||
|
||||
+1
-2
@@ -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.
|
||||
@@ -97,7 +97,6 @@ public class JavaGenerateMemberCompletionContributor {
|
||||
private static void addSuperSignatureElements(final PsiClass parent, boolean implemented, CompletionResultSet result, Set<MethodSignature> addedSignatures) {
|
||||
for (CandidateInfo candidate : OverrideImplementExploreUtil.getMethodsToOverrideImplement(parent, implemented)) {
|
||||
PsiMethod baseMethod = (PsiMethod)candidate.getElement();
|
||||
assert baseMethod != null;
|
||||
PsiClass baseClass = baseMethod.getContainingClass();
|
||||
PsiSubstitutor substitutor = candidate.getSubstitutor();
|
||||
if (!baseMethod.isConstructor() && baseClass != null && addedSignatures.add(baseMethod.getSignature(substitutor))) {
|
||||
|
||||
@@ -275,10 +275,8 @@ public abstract class PsiJavaFileBaseImpl extends PsiFileImpl implements PsiJava
|
||||
@NotNull PsiElement place) {
|
||||
assert isValid();
|
||||
|
||||
// TODO den remove
|
||||
boolean allowCaching = true;
|
||||
|
||||
if (allowCaching && processor instanceof ClassResolverProcessor && isPhysical() &&
|
||||
if (processor instanceof ClassResolverProcessor &&
|
||||
isPhysical() &&
|
||||
(getUserData(PsiFileEx.BATCH_REFERENCE_PROCESSING) == Boolean.TRUE || myResolveCache.hasUpToDateValue())) {
|
||||
final ClassResolverProcessor hint = (ClassResolverProcessor)processor;
|
||||
String name = hint.getName(state);
|
||||
|
||||
+13
-17
@@ -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.
|
||||
@@ -148,18 +148,16 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
ProgressManager.checkCanceled();
|
||||
final CandidateInfo conflict = iterator.next();
|
||||
final PsiMethod method = (PsiMethod)conflict.getElement();
|
||||
if (method != null) {
|
||||
final PsiParameter[] methodParameters = method.getParameterList().getParameters();
|
||||
if (methodParameters.length == 0) continue;
|
||||
final PsiParameter param = i < methodParameters.length ? methodParameters[i] : methodParameters[methodParameters.length - 1];
|
||||
final PsiType paramType = param.getType();
|
||||
// http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.12.2.1
|
||||
// A lambda expression or a method reference expression is potentially compatible with a type variable if the type variable is a type parameter of the candidate method.
|
||||
final PsiClass paramClass = PsiUtil.resolveClassInType(paramType);
|
||||
if (paramClass instanceof PsiTypeParameter && ((PsiTypeParameter)paramClass).getOwner() == method) continue;
|
||||
if (!lambdaExpression.isAcceptable(((MethodCandidateInfo)conflict).getSubstitutor(false).substitute(paramType), lambdaExpression.hasFormalParameterTypes())) {
|
||||
iterator.remove();
|
||||
}
|
||||
final PsiParameter[] methodParameters = method.getParameterList().getParameters();
|
||||
if (methodParameters.length == 0) continue;
|
||||
final PsiParameter param = i < methodParameters.length ? methodParameters[i] : methodParameters[methodParameters.length - 1];
|
||||
final PsiType paramType = param.getType();
|
||||
// http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.12.2.1
|
||||
// A lambda expression or a method reference expression is potentially compatible with a type variable if the type variable is a type parameter of the candidate method.
|
||||
final PsiClass paramClass = PsiUtil.resolveClassInType(paramType);
|
||||
if (paramClass instanceof PsiTypeParameter && ((PsiTypeParameter)paramClass).getOwner() == method) continue;
|
||||
if (!lambdaExpression.isAcceptable(((MethodCandidateInfo)conflict).getSubstitutor(false).substitute(paramType), lambdaExpression.hasFormalParameterTypes())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,7 +238,6 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
ProgressManager.checkCanceled();
|
||||
CandidateInfo info = conflicts.get(i);
|
||||
PsiMethod method = (PsiMethod)info.getElement();
|
||||
assert method != null;
|
||||
|
||||
if (!method.hasModifierProperty(PsiModifier.STATIC) && superMethods.contains(method)) {
|
||||
conflicts.remove(i);
|
||||
@@ -258,7 +255,6 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
continue;
|
||||
}
|
||||
PsiMethod existingMethod = (PsiMethod)existing.getElement();
|
||||
assert existingMethod != null;
|
||||
PsiClass existingClass = existingMethod.getContainingClass();
|
||||
if (class1 != null && existingClass != null &&
|
||||
class1.isInterface() && CommonClassNames.JAVA_LANG_OBJECT.equals(existingClass.getQualifiedName())) { //prefer interface methods to methods from Object
|
||||
@@ -768,7 +764,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
for (CandidateInfo conflict : conflicts) {
|
||||
ProgressManager.checkCanceled();
|
||||
PsiMethod method = (PsiMethod)conflict.getElement();
|
||||
if (method != objectVararg && method != null && method.isVarArgs()) {
|
||||
if (method != objectVararg && method.isVarArgs()) {
|
||||
final int paramsCount = method.getParameterList().getParametersCount();
|
||||
final PsiType type = method.getParameterList().getParameters()[paramsCount - 1].getType();
|
||||
final PsiType componentType = ((PsiArrayType)type).getComponentType();
|
||||
@@ -784,7 +780,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
@Nullable
|
||||
private static PsiType getFunctionalType(int functionalTypeIdx, CandidateInfo candidateInfo) {
|
||||
final PsiMethod psiMethod = (PsiMethod)candidateInfo.getElement();
|
||||
LOG.assertTrue(psiMethod != null);
|
||||
LOG.assertTrue(true);
|
||||
final PsiParameter[] methodParameters = psiMethod.getParameterList().getParameters();
|
||||
if (methodParameters.length == 0) return null;
|
||||
final PsiParameter param = functionalTypeIdx < methodParameters.length ? methodParameters[functionalTypeIdx] : methodParameters[methodParameters.length - 1];
|
||||
|
||||
+1
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
@@ -50,7 +50,6 @@ public class JavaVariableConflictResolver implements PsiConflictResolver{
|
||||
for (int i = 1; i < uncheckedResult.length; i++) {
|
||||
final CandidateInfo candidate = uncheckedResult[i];
|
||||
final PsiElement otherElement = candidate.getElement();
|
||||
if (otherElement == null) continue;
|
||||
|
||||
if (!(otherElement instanceof PsiField)) {
|
||||
if (otherElement instanceof PsiLocalVariable) {
|
||||
|
||||
-4
@@ -154,10 +154,6 @@ public class GrClosableBlockImpl extends GrBlockImpl implements GrClosableBlock
|
||||
@Nullable final PsiType classToDelegate) {
|
||||
if (classToDelegate == null) return true;
|
||||
|
||||
if (state.get(ClassHint.RESOLVE_CONTEXT) == null) {
|
||||
state = state.put(ClassHint.RESOLVE_CONTEXT, this);
|
||||
}
|
||||
|
||||
return ResolveUtil.processAllDeclarationsSeparately(classToDelegate, processor, nonCodeProcessor,
|
||||
state.put(ClassHint.RESOLVE_CONTEXT, this), place);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user