mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
usability: MethodReturnValueWatcher to store results from non-void methods only (IDEA-57994)
This commit is contained in:
+8
-2
@@ -52,14 +52,20 @@ public class MethodReturnValueWatcher {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
myLastExecutedMethod = event.method();
|
||||
final Method method = event.method();
|
||||
//myLastMethodReturnValue = event.returnValue();
|
||||
try {
|
||||
if (myReturnValueMethod == null) {
|
||||
//noinspection HardCodedStringLiteral
|
||||
myReturnValueMethod = MethodExitEvent.class.getDeclaredMethod("returnValue", ArrayUtil.EMPTY_CLASS_ARRAY);
|
||||
}
|
||||
myLastMethodReturnValue = (Value)myReturnValueMethod.invoke(event);
|
||||
final Value retVal = (Value)myReturnValueMethod.invoke(event);
|
||||
|
||||
if (method == null || !"void".equals(method.returnTypeName())) {
|
||||
// remember methods with non-void return types only
|
||||
myLastExecutedMethod = method;
|
||||
myLastMethodReturnValue = retVal;
|
||||
}
|
||||
}
|
||||
catch (NoSuchMethodException ignored) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user