Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2012)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/util/ExecutionUtils.java

Issue 10051030: Fix for local variable rename, when it is expression of invocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/util/ExecutionUtils.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/util/ExecutionUtils.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/util/ExecutionUtils.java
index 9c57f363a41117bf7bf512cdf10626bff5a0f3be..c947e9191419a271afa337378eaa904aeb1ce3b5 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/util/ExecutionUtils.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/util/ExecutionUtils.java
@@ -81,4 +81,18 @@ public class ExecutionUtils {
}
}
+ /**
+ * Runs given {@link RunnableObjectEx} and ignores exception.
+ *
+ * @return the {@link Object} returned by {@link RunnableObjectEx#run()}, or default value if
+ * exception happens.
+ */
+ public static <T> T runObjectIgnore(RunnableObjectEx<T> runnable, T defaultValue) {
+ try {
+ return runnable.runObject();
+ } catch (Throwable e) {
+ return defaultValue;
+ }
+ }
+
}

Powered by Google App Engine
This is Rietveld 408576698