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

Unified Diff: plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/actions/SynchronizeBreakpoints.java

Issue 3402011: Support 'break on exception' feature (Closed)
Patch Set: follow codereview Created 10 years, 3 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: plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/actions/SynchronizeBreakpoints.java
diff --git a/plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/actions/SynchronizeBreakpoints.java b/plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/actions/SynchronizeBreakpoints.java
index 3ba654a0a88666c2309238c3522a6ae27f0570c2..87cdc489001ff6d5e8a94e3a7346f7623a4ab782 100644
--- a/plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/actions/SynchronizeBreakpoints.java
+++ b/plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/actions/SynchronizeBreakpoints.java
@@ -1,3 +1,7 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package org.chromium.debug.ui.actions;
import java.text.MessageFormat;
@@ -75,20 +79,10 @@ public class SynchronizeBreakpoints implements IWorkbenchWindowActionDelegate {
final Set<DebugTargetImpl> targets = new HashSet<DebugTargetImpl>(3);
for (Iterator<?> it = structuredSelection.iterator(); it.hasNext(); ) {
Object element = it.next();
- IDebugTarget debugTarget;
- if (element instanceof ILaunch) {
- ILaunch launch = (ILaunch) element;
- debugTarget = launch.getDebugTarget();
- } else if (element instanceof IDebugElement) {
- IDebugElement debugElement = (IDebugElement) element;
- debugTarget = debugElement.getDebugTarget();
- } else {
- continue;
- }
- if (debugTarget instanceof DebugTargetImpl == false) {
+ DebugTargetImpl debugTargetImpl = getDebugTargetImpl(element);
+ if (debugTargetImpl == null) {
continue;
}
- DebugTargetImpl debugTargetImpl = (DebugTargetImpl) debugTarget;
targets.add(debugTargetImpl);
}
if (targets.isEmpty()) {
@@ -124,4 +118,21 @@ public class SynchronizeBreakpoints implements IWorkbenchWindowActionDelegate {
}
private Runnable currentRunnable;
+
+ public static DebugTargetImpl getDebugTargetImpl(Object element) {
+ IDebugTarget debugTarget;
+ if (element instanceof ILaunch) {
+ ILaunch launch = (ILaunch) element;
+ debugTarget = launch.getDebugTarget();
+ } else if (element instanceof IDebugElement) {
+ IDebugElement debugElement = (IDebugElement) element;
+ debugTarget = debugElement.getDebugTarget();
+ } else {
+ return null;
+ }
+ if (debugTarget instanceof DebugTargetImpl == false) {
+ return null;
+ }
+ return (DebugTargetImpl) debugTarget;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698