mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+5
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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.
|
||||
@@ -986,15 +986,18 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
|
||||
}
|
||||
|
||||
boolean defaultInterfaceMethod = false;
|
||||
boolean mustBeVararg = false;
|
||||
|
||||
if (psiMethod != null) {
|
||||
processBoxingConversions(psiMethod.getParameterList().getParameters(), argExpressions, resolveResult.getSubstitutor(), argumentEvaluators);
|
||||
argumentEvaluators = wrapVarargs(psiMethod.getParameterList().getParameters(), argExpressions, resolveResult.getSubstitutor(), argumentEvaluators);
|
||||
defaultInterfaceMethod = psiMethod.hasModifierProperty(PsiModifier.DEFAULT);
|
||||
mustBeVararg = psiMethod.isVarArgs();
|
||||
}
|
||||
|
||||
myResult = new MethodEvaluator(objectEvaluator, contextClass, methodExpr.getReferenceName(),
|
||||
psiMethod != null ? JVMNameUtil.getJVMSignature(psiMethod) : null, argumentEvaluators, defaultInterfaceMethod);
|
||||
psiMethod != null ? JVMNameUtil.getJVMSignature(psiMethod) : null, argumentEvaluators,
|
||||
defaultInterfaceMethod, mustBeVararg);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+29
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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.
|
||||
@@ -44,18 +44,30 @@ public class MethodEvaluator implements Evaluator {
|
||||
private final Evaluator[] myArgumentEvaluators;
|
||||
private final Evaluator myObjectEvaluator;
|
||||
private final boolean myCheckDefaultInterfaceMethod;
|
||||
private final boolean myMustBeVararg;
|
||||
|
||||
public MethodEvaluator(Evaluator objectEvaluator, JVMName className, String methodName, JVMName signature, Evaluator[] argumentEvaluators) {
|
||||
this(objectEvaluator, className, methodName, signature, argumentEvaluators, false);
|
||||
public MethodEvaluator(Evaluator objectEvaluator,
|
||||
JVMName className,
|
||||
String methodName,
|
||||
JVMName signature,
|
||||
Evaluator[] argumentEvaluators) {
|
||||
this(objectEvaluator, className, methodName, signature, argumentEvaluators, false, false);
|
||||
}
|
||||
|
||||
public MethodEvaluator(Evaluator objectEvaluator, JVMName className, String methodName, JVMName signature, Evaluator[] argumentEvaluators, boolean checkDefaultInterfaceMethod) {
|
||||
public MethodEvaluator(Evaluator objectEvaluator,
|
||||
JVMName className,
|
||||
String methodName,
|
||||
JVMName signature,
|
||||
Evaluator[] argumentEvaluators,
|
||||
boolean checkDefaultInterfaceMethod,
|
||||
boolean mustBeVararg) {
|
||||
myObjectEvaluator = new DisableGC(objectEvaluator);
|
||||
myClassName = className;
|
||||
myMethodName = methodName;
|
||||
myMethodSignature = signature;
|
||||
myArgumentEvaluators = argumentEvaluators;
|
||||
myCheckDefaultInterfaceMethod = checkDefaultInterfaceMethod;
|
||||
myMustBeVararg = mustBeVararg;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -147,6 +159,19 @@ public class MethodEvaluator implements Evaluator {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (myMustBeVararg && jdiMethod != null && !jdiMethod.isVarArgs() && jdiMethod.isBridge()) {
|
||||
// see IDEA-129869, avoid bridge methods for varargs
|
||||
int retTypePos = signature.lastIndexOf(")");
|
||||
if (retTypePos >= 0) {
|
||||
String signatureNoRetType = signature.substring(0, retTypePos + 1);
|
||||
for (Method method : _refType.visibleMethods()) {
|
||||
if (method.name().equals(myMethodName) && method.signature().startsWith(signatureNoRetType) && !method.isBridge() && !method.isAbstract()) {
|
||||
jdiMethod = method;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jdiMethod == null) {
|
||||
throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.no.instance.method", methodName));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user