From e3669c8d2c5ff3c10eec554b2d37faf6a2e746fb Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 21 Jan 2015 12:25:42 +0300 Subject: [PATCH] minor cleanup --- .../engine/evaluation/expression/BoxingEvaluator.java | 11 +++-------- .../evaluation/expression/UnBoxingEvaluator.java | 8 +++----- .../debugger/ui/tree/render/BatchEvaluator.java | 5 +++-- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/BoxingEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/BoxingEvaluator.java index 2d757a358f22..4ebd5c3f1abc 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/BoxingEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/BoxingEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 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. @@ -22,7 +22,7 @@ import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; import com.sun.jdi.*; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -87,12 +87,7 @@ public class BoxingEvaluator implements Evaluator{ if (methods.size() == 0) { throw new EvaluateException("Cannot construct wrapper object for value of type " + value.type() + ": Unable to find either valueOf() or constructor method"); } - - final Method factoryMethod = methods.get(0); - final ArrayList args = new ArrayList(); - args.add(value); - - return process.invokeMethod(context, wrapperClass, factoryMethod, args); + return process.invokeMethod(context, wrapperClass, methods.get(0), Collections.singletonList(value)); } } diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnBoxingEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnBoxingEvaluator.java index c0d9e1355fea..6c6d46257044 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnBoxingEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnBoxingEvaluator.java @@ -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. @@ -26,7 +26,7 @@ import com.sun.jdi.ObjectReference; import com.sun.jdi.Value; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -86,8 +86,6 @@ public class UnBoxingEvaluator implements Evaluator{ conversionMethodName + conversionMethodSignature); } - final Method method = methods.get(0); - - return process.invokeMethod(context, value, method, new ArrayList()); + return process.invokeMethod(context, value, methods.get(0), Collections.emptyList()); } } \ No newline at end of file diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java index 59749a2b001a..0f73fdb09c28 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/BatchEvaluator.java @@ -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. @@ -33,6 +33,7 @@ import com.intellij.util.containers.HashMap; import com.sun.jdi.*; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -99,7 +100,7 @@ public class BatchEvaluator { if(constructor != null){ ObjectReference evaluator = null; try { - evaluator = myDebugProcess.newInstance(evaluationContext, batchEvaluatorClass, constructor, new ArrayList()); + evaluator = myDebugProcess.newInstance(evaluationContext, batchEvaluatorClass, constructor, Collections.emptyList()); } catch (Exception e) { LOG.debug(e);