mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
some very minor optimizations
This commit is contained in:
@@ -33,9 +33,6 @@ public class MethodSignatureBackedByPsiMethod extends MethodSignatureBase {
|
||||
@NotNull PsiTypeParameter[] methodTypeParameters) {
|
||||
super(substitutor, parameterTypes, methodTypeParameters);
|
||||
myIsRaw = isRaw;
|
||||
if (!method.isValid()) {
|
||||
LOG.error("Invalid method: "+method, new PsiInvalidElementAccessException(method));
|
||||
}
|
||||
myMethod = method;
|
||||
myName = method.getName();
|
||||
}
|
||||
@@ -86,7 +83,6 @@ public class MethodSignatureBackedByPsiMethod extends MethodSignatureBase {
|
||||
PsiType[] parameterTypes = new PsiType[parameters.length];
|
||||
for (int i = 0; i < parameterTypes.length; i++) {
|
||||
PsiType type = parameters[i].getType();
|
||||
assert type.isValid();
|
||||
parameterTypes[i] = isRaw ? TypeConversionUtil.erasure(substitutor.substitute(type)) : type;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,9 @@ public abstract class MethodSignatureBase implements MethodSignature {
|
||||
myParameterTypes = parameterTypes.length == 0 ? PsiType.EMPTY_ARRAY : new PsiType[parameterTypes.length];
|
||||
for (int i = 0; i < parameterTypes.length; i++) {
|
||||
PsiType type = parameterTypes[i];
|
||||
assert type == null || type.isValid();
|
||||
if (type != null) {
|
||||
PsiUtil.ensureValidType(type);
|
||||
}
|
||||
if (type instanceof PsiEllipsisType) type = ((PsiEllipsisType) type).toArrayType();
|
||||
myParameterTypes[i] = substitutor.substitute(type);
|
||||
}
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.intellij.psi.scope.PsiConflictResolver;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.*;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import gnu.trove.THashMap;
|
||||
import gnu.trove.THashSet;
|
||||
import gnu.trove.TIntArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -189,7 +190,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
private void checkSameSignatures(final List<CandidateInfo> conflicts) {
|
||||
// candidates should go in order of class hierarchy traversal
|
||||
// in order for this to work
|
||||
Map<MethodSignature, CandidateInfo> signatures = new HashMap<MethodSignature, CandidateInfo>();
|
||||
Map<MethodSignature, CandidateInfo> signatures = new THashMap<MethodSignature, CandidateInfo>(conflicts.size());
|
||||
Set<PsiMethod> superMethods = new HashSet<PsiMethod>();
|
||||
for (CandidateInfo conflict : conflicts) {
|
||||
final PsiMethod method = ((MethodCandidateInfo)conflict).getElement();
|
||||
|
||||
Reference in New Issue
Block a user