Code review cleanup
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java
index ba624b1..047f486 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/debug/core/IJavaExceptionBreakpoint.java
@@ -42,6 +42,8 @@
* Sets whether this breakpoint suspends execution when the associated
* exception is thrown and caught.
*
+ * @param caught whether or not this breakpoint suspends execution when the
+ * associated exception is thrown and caught
* @exception CoreException if a <code>CoreException</code> is
* thrown accessing this breakpoint's underlying marker
*/
@@ -50,6 +52,8 @@
* Sets whether this breakpoint suspends execution when the associated
* exception is thrown and not caught.
*
+ * @param uncaught whether or not this breakpoint suspends execution when the
+ * associated exception is thrown and not caught
* @exception CoreException if a <code>CoreException</code> is
* thrown accessing this breakpoint's underlying marker
*/
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/AbstractJavaLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/AbstractJavaLineBreakpoint.java
index 1cd6205..e87079d 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/AbstractJavaLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/AbstractJavaLineBreakpoint.java
@@ -8,7 +8,6 @@
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.IDebugConstants;
import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.internal.debug.core.IJavaDebugConstants;
import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import com.sun.jdi.*;
@@ -184,8 +183,8 @@
int hitCount= getHitCount();
if (hitCount > 0) {
request.addCountFilter(hitCount);
- request.putProperty(IJavaDebugConstants.HIT_COUNT, new Integer(hitCount));
- request.putProperty(IJavaDebugConstants.EXPIRED, Boolean.FALSE);
+ request.putProperty(HIT_COUNT, new Integer(hitCount));
+ request.putProperty(EXPIRED, Boolean.FALSE);
}
// Important: only enable a request after it has been configured
updateEnabledState(request);
@@ -215,13 +214,6 @@
}
/**
- * Returns the <code>METHOD_HANDLE</code> attribute of the given breakpoint.
- */
- public String getMethodHandleIdentifier() throws CoreException {
- return (String) ensureMarker().getAttribute(IJavaDebugConstants.METHOD_HANDLE);
- }
-
- /**
* @see IJavaLineBreakpoint#getMember()
*/
public IMember getMember() throws CoreException {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJavaDebugConstants.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJavaDebugConstants.java
deleted file mode 100644
index a6d9fe6..0000000
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/IJavaDebugConstants.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package org.eclipse.jdt.internal.debug.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Defines constants for the JDI debug model plug-in.
- * <p>
- * Constants only; not intended to be implemented.
- * </p>
- * <p>
- * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * </p>
- */
-
-public interface IJavaDebugConstants {
-
- /**
- * Java breakpoint marker type
- * (value <code>"org.eclipse.jdt.debug.javaBreakpointMarker"</code>).
- */
- public static final String JAVA_BREAKPOINT= "org.eclipse.jdt.debug.javaBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Java line breakpoint marker type
- * (value <code>"org.eclipse.jdt.debug.javaLineBreakpointMarker"</code>).
- */
- public static final String JAVA_LINE_BREAKPOINT = "org.eclipse.jdt.debug.javaLineBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Java run-to-line breakpoint marker type
- * (value <code>"org.eclipse.jdt.debug.javaRunToLineBreakpointMarker"</code>).
- */
- public static final String JAVA_RUN_TO_LINE_BREAKPOINT = "org.eclipse.jdt.debug.javaRunToLineBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Java exception breakpoint marker type
- * (value <code>"org.eclipse.jdt.debug.javaExceptionBreakpointMarker"</code>).
- */
- public static final String JAVA_EXCEPTION_BREAKPOINT = "org.eclipse.jdt.debug.javaExceptionBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Java watchpoint marker type
- * (value <code>"org.eclipse.jdt.debug.javaWatchpointMarker"</code>).
- */
- public static final String JAVA_WATCHPOINT= "org.eclipse.jdt.debug.javaWatchpointMarker"; //$NON-NLS-1$
-
- /**
- * Java method entry breakpoint marker type
- * (value <code>"org.eclipse.jdt.debug.javaMethodEntryBreakpointMarker"</code>).
- */
- public static final String JAVA_METHOD_ENTRY_BREAKPOINT = "org.eclipse.jdt.debug.javaMethodEntryBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Pattern breakpoint marker type
- * (value <code>"org.eclipse.jdt.debug.patternBreakpointMarker"</code>).
- */
- public static final String PATTERN_BREAKPOINT = "org.eclipse.jdt.debug.patternBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Snippet support line breakpoint marker type
- * (value <code>"org.eclipse.jdt.debug.snippetSupportLineBreakpointMarker"</code>).
- */
- public static final String SNIPPET_SUPPORT_LINE_BREAKPOINT= "org.eclipse.jdt.debug.snippetSupportLineBreakpointMarker"; //$NON-NLS-1$
-
- /**
- * Breakpoint attribute storing the handle identifier of the Java element
- * corresponding to the type in which a breakpoint is contained
- * (value <code>"typeHandle"</code>). This attribute is a <code>String</code>.
- */
- public static final String TYPE_HANDLE = "typeHandle"; //$NON-NLS-1$
-
- /**
- * Breakpoint attribute storing the handle identifier of the Java element
- * corresponding to the field on which a breakpoint is set
- * (value <code>"fieldHandle"</code>). This attribute is a <code>String</code>.
- */
- public static final String FIELD_HANDLE= "fieldHandle"; //$NON-NLS-1$
-
- /**
- * Breakpoint attribute storing the handle identifier of the Java element
- * corresponding to the method in which a breakpoint is contained
- * (value <code>"methodHandle"</code>). This attribute is a <code>String</code>.
- */
- public static final String METHOD_HANDLE = "methodHandle"; //$NON-NLS-1$
-
- /**
- * Breakpoint attribute storing the pattern identifier of the source
- * file in which a breakpoint is created
- * (value <code>"patternHandle"</code>). This attribute is a <code>String</code>.
- */
- public static final String PATTERN = "pattern"; //$NON-NLS-1$
-
- /**
- * Breakpoint attribute storing the number of debug targets a
- * breakpoint is installed in (value <code>"installCount"</code>).
- * This attribute is a <code>int</code>.
- */
- public static final String INSTALL_COUNT = "installCount"; //$NON-NLS-1$
-
- /**
- * Breakpoint attribute storing a breakpoint's hit count value
- * (value <code>"hitCount"</code>). This attribute is stored as an
- * <code>int</code>.
- */
- public static final String HIT_COUNT = "hitCount"; //$NON-NLS-1$
-
- /**
- * Breakpoint attribute storing the expired value (value <code>"expired"</code>).
- * This attribute is stored as a <code>boolean</code>. Once a hit count has
- * been reached, a breakpoint is considered to be "expired".
- */
- public static final String EXPIRED = "expired"; //$NON-NLS-1$
-
-
-
- /**
- * Exception breakpoint attribute storing the suspend on uncaught value
- * (value <code>"uncaught"</code>). This attribute is stored as a
- * <code>boolean</code>. When this attribute is <code>true</code>, an uncaught
- * exception of the associated type will cause excecution to suspend. .
- */
- public static final String UNCAUGHT = "uncaught"; //$NON-NLS-1$
-
- /**
- * Exception breakpoint attribute storing the checked value (value <code>"checked"</code>).
- * This attribute is stored as a <code>boolean</code>, indicating whether an
- * exception is a checked exception.
- */
- public static final String CHECKED = "checked"; //$NON-NLS-1$
-
-
-
- /**
- * Watchpoint attribute storing the modification value (value <code>"modification"</code>).
- * This attribute is stored as a <code>boolean</code>, indicating whether a
- * watchpoint is a modification watchpoint.
- */
- public static final String MODIFICATION= "modification"; //$NON-NLS-1$
-
-
-
-}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaBreakpoint.java
index b67b0c4..7762564 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaBreakpoint.java
@@ -39,6 +39,31 @@
public abstract class JavaBreakpoint extends Breakpoint implements IJavaBreakpoint, IJDIEventListener {
+ /**
+ * Breakpoint attribute storing the expired value (value <code>"expired"</code>).
+ * This attribute is stored as a <code>boolean</code>. Once a hit count has
+ * been reached, a breakpoint is considered to be "expired".
+ */
+ protected static final String EXPIRED = "expired"; //$NON-NLS-1$
+ /**
+ * Breakpoint attribute storing a breakpoint's hit count value
+ * (value <code>"hitCount"</code>). This attribute is stored as an
+ * <code>int</code>.
+ */
+ protected static final String HIT_COUNT = "hitCount"; //$NON-NLS-1$
+ /**
+ * Breakpoint attribute storing the number of debug targets a
+ * breakpoint is installed in (value <code>"installCount"</code>).
+ * This attribute is a <code>int</code>.
+ */
+ protected static final String INSTALL_COUNT = "installCount"; //$NON-NLS-1$
+ /**
+ * Breakpoint attribute storing the handle identifier of the Java element
+ * corresponding to the type in which a breakpoint is contained
+ * (value <code>"typeHandle"</code>). This attribute is a <code>String</code>.
+ */
+ protected static final String TYPE_HANDLE = "typeHandle"; //$NON-NLS-1$
+
protected HashMap fRequestsByTarget;
/**
@@ -49,7 +74,7 @@
/**
* JavaBreakpoint attributes
*/
- protected static final String[] fgExpiredEnabledAttributes= new String[]{IJavaDebugConstants.EXPIRED, IDebugConstants.ENABLED};
+ protected static final String[] fgExpiredEnabledAttributes= new String[]{EXPIRED, IDebugConstants.ENABLED};
public JavaBreakpoint() {
fRequestsByTarget = new HashMap(2);
@@ -144,10 +169,10 @@
*/
public void expireHitCount(Event event) {
EventRequest request= event.request();
- Integer requestCount= (Integer) request.getProperty(IJavaDebugConstants.HIT_COUNT);
+ Integer requestCount= (Integer) request.getProperty(HIT_COUNT);
if (requestCount != null) {
try {
- request.putProperty(IJavaDebugConstants.EXPIRED, Boolean.TRUE);
+ request.putProperty(EXPIRED, Boolean.TRUE);
setEnabled(false);
// make a note that we auto-disabled this breakpoint.
setExpired(true);
@@ -191,7 +216,7 @@
*/
protected boolean hasHitCountChanged(EventRequest request) throws CoreException {
int hitCount= getHitCount();
- Integer requestCount= (Integer) request.getProperty(IJavaDebugConstants.HIT_COUNT);
+ Integer requestCount= (Integer) request.getProperty(HIT_COUNT);
int oldCount = -1;
if (requestCount != null) {
oldCount = requestCount.intValue();
@@ -269,14 +294,14 @@
* Returns whether this breakpoint has expired.
*/
public boolean isExpired() throws CoreException {
- return ensureMarker().getAttribute(IJavaDebugConstants.EXPIRED, false);
+ return ensureMarker().getAttribute(EXPIRED, false);
}
/**
* Returns whether the given request is expired
*/
protected boolean isExpired(EventRequest request) {
- Boolean requestExpired= (Boolean) request.getProperty(IJavaDebugConstants.EXPIRED);
+ Boolean requestExpired= (Boolean) request.getProperty(EXPIRED);
if (requestExpired == null) {
return false;
}
@@ -287,7 +312,7 @@
* @see IJavaBreakpoint#isInstalled()
*/
public boolean isInstalled() throws CoreException {
- return ensureMarker().getAttribute(IJavaDebugConstants.INSTALL_COUNT, 0) > 0;
+ return ensureMarker().getAttribute(INSTALL_COUNT, 0) > 0;
}
/**
@@ -295,7 +320,7 @@
*/
public void incrementInstallCount() throws CoreException {
int count = getInstallCount();
- ensureMarker().setAttribute(IJavaDebugConstants.INSTALL_COUNT, count + 1);
+ ensureMarker().setAttribute(INSTALL_COUNT, count + 1);
}
/**
@@ -303,7 +328,7 @@
* or 0 if the attribute is not set.
*/
public int getInstallCount() throws CoreException {
- return ensureMarker().getAttribute(IJavaDebugConstants.INSTALL_COUNT, 0);
+ return ensureMarker().getAttribute(INSTALL_COUNT, 0);
}
/**
@@ -312,7 +337,7 @@
public void decrementInstallCount() throws CoreException {
int count= getInstallCount();
if (count > 0) {
- ensureMarker().setAttribute(IJavaDebugConstants.INSTALL_COUNT, count - 1);
+ ensureMarker().setAttribute(INSTALL_COUNT, count - 1);
}
if (count == 1) {
if (isExpired()) {
@@ -336,7 +361,7 @@
* Sets the <code>TYPE_HANDLE</code> attribute of the given breakpoint.
*/
public void setTypeHandleIdentifier(String identifier) throws CoreException {
- ensureMarker().setAttribute(IJavaDebugConstants.TYPE_HANDLE, identifier);
+ ensureMarker().setAttribute(TYPE_HANDLE, identifier);
}
/**
@@ -354,7 +379,7 @@
* Returns the <code>TYPE_HANDLE</code> attribute of the given breakpoint.
*/
public String getTypeHandleIdentifier() throws CoreException {
- return (String) ensureMarker().getAttribute(IJavaDebugConstants.TYPE_HANDLE);
+ return (String) ensureMarker().getAttribute(TYPE_HANDLE);
}
/**
@@ -400,12 +425,12 @@
List attributes= new ArrayList(3);
List values= new ArrayList(3);
if (isInstalled()) {
- attributes.add(IJavaDebugConstants.INSTALL_COUNT);
+ attributes.add(INSTALL_COUNT);
values.add(new Integer(0));
}
if (isExpired()) {
// if breakpoint was auto-disabled, re-enable it
- attributes.add(IJavaDebugConstants.EXPIRED);
+ attributes.add(EXPIRED);
values.add(Boolean.FALSE);
attributes.add(IDebugConstants.ENABLED);
values.add(Boolean.TRUE);
@@ -434,7 +459,7 @@
* @see IJavaBreakpoint#getHitCount()
*/
public int getHitCount() throws CoreException {
- return ensureMarker().getAttribute(IJavaDebugConstants.HIT_COUNT, -1);
+ return ensureMarker().getAttribute(HIT_COUNT, -1);
}
/**
@@ -442,10 +467,10 @@
*/
public void setHitCount(int count) throws CoreException {
if (!isEnabled() && count > -1) {
- ensureMarker().setAttributes(new String []{IJavaDebugConstants.HIT_COUNT, IJavaDebugConstants.EXPIRED, IDebugConstants.ENABLED},
+ ensureMarker().setAttributes(new String []{HIT_COUNT, EXPIRED, IDebugConstants.ENABLED},
new Object[]{new Integer(count), Boolean.FALSE, Boolean.TRUE});
} else {
- ensureMarker().setAttributes(new String[]{IJavaDebugConstants.HIT_COUNT, IJavaDebugConstants.EXPIRED},
+ ensureMarker().setAttributes(new String[]{HIT_COUNT, EXPIRED},
new Object[]{new Integer(count), Boolean.FALSE});
}
}
@@ -454,7 +479,7 @@
* Sets the <code>EXPIRED</code> attribute of the given breakpoint.
*/
public void setExpired(boolean expired) throws CoreException {
- ensureMarker().setAttribute(IJavaDebugConstants.EXPIRED, expired);
+ ensureMarker().setAttribute(EXPIRED, expired);
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaExceptionBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaExceptionBreakpoint.java
index 683f6cc..611f943 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaExceptionBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaExceptionBreakpoint.java
@@ -27,18 +27,31 @@
public class JavaExceptionBreakpoint extends JavaBreakpoint implements IJavaExceptionBreakpoint {
+ private static final String JAVA_EXCEPTION_BREAKPOINT= "org.eclipse.jdt.debug.javaExceptionBreakpointMarker"; //$NON-NLS-1$
+
/**
* Exception breakpoint attribute storing the suspend on caught value
* (value <code>"caught"</code>). This attribute is stored as a <code>boolean</code>.
* When this attribute is <code>true</code>, a caught exception of the associated
* type will cause excecution to suspend .
*/
- public static final String CAUGHT = "caught"; //$NON-NLS-1$
+ private static final String CAUGHT = "caught"; //$NON-NLS-1$
+ /**
+ * Exception breakpoint attribute storing the suspend on uncaught value
+ * (value <code>"uncaught"</code>). This attribute is stored as a
+ * <code>boolean</code>. When this attribute is <code>true</code>, an uncaught
+ * exception of the associated type will cause excecution to suspend. .
+ */
+ public static final String UNCAUGHT = "uncaught"; //$NON-NLS-1$
+ /**
+ * Exception breakpoint attribute storing the checked value (value <code>"checked"</code>).
+ * This attribute is stored as a <code>boolean</code>, indicating whether an
+ * exception is a checked exception.
+ */
+ private static final String CHECKED = "checked"; //$NON-NLS-1$
// Attribute strings
- protected static final String[] fgExceptionBreakpointAttributes= new String[]{IJavaDebugConstants.CHECKED, IJavaDebugConstants.TYPE_HANDLE};
-
- static String fMarkerType= IJavaDebugConstants.JAVA_EXCEPTION_BREAKPOINT;
+ protected static final String[] fgExceptionBreakpointAttributes= new String[]{CHECKED, TYPE_HANDLE};
public JavaExceptionBreakpoint() {
}
@@ -71,7 +84,7 @@
}
// create the marker
- fMarker= resource.createMarker(fMarkerType);
+ fMarker= resource.createMarker(JAVA_EXCEPTION_BREAKPOINT);
// configure the standard attributes
setEnabled(true);
// configure caught, uncaught, checked, and the type attributes
@@ -104,7 +117,7 @@
public void setDefaultCaughtAndUncaught() throws CoreException {
Object[] values= new Object[]{Boolean.TRUE, Boolean.TRUE};
- String[] attributes= new String[]{CAUGHT, IJavaDebugConstants.UNCAUGHT};
+ String[] attributes= new String[]{CAUGHT, UNCAUGHT};
ensureMarker().setAttributes(attributes, values);
}
@@ -152,8 +165,8 @@
int hitCount= getHitCount();
if (hitCount > 0) {
request.addCountFilter(hitCount);
- request.putProperty(IJavaDebugConstants.HIT_COUNT, new Integer(hitCount));
- request.putProperty(IJavaDebugConstants.EXPIRED, Boolean.FALSE);
+ request.putProperty(HIT_COUNT, new Integer(hitCount));
+ request.putProperty(EXPIRED, Boolean.FALSE);
}
} catch (VMDisconnectedException e) {
if (target.isTerminated() || target.isDisconnected()) {
@@ -224,7 +237,7 @@
* @see IJavaExceptionBreakpoint#isUncaught()
*/
public boolean isUncaught() throws CoreException {
- return ensureMarker().getAttribute(IJavaDebugConstants.UNCAUGHT, false);
+ return ensureMarker().getAttribute(UNCAUGHT, false);
}
/**
@@ -235,7 +248,7 @@
if (uncaught == isUncaught()) {
return;
}
- ensureMarker().setAttribute(IJavaDebugConstants.UNCAUGHT, uncaught);
+ ensureMarker().setAttribute(UNCAUGHT, uncaught);
if (uncaught && !isEnabled()) {
setEnabled(true);
} else if (!(uncaught || isCaught())) {
@@ -247,7 +260,7 @@
* @see IJavaExceptionBreakpoint#isChecked()
*/
public boolean isChecked() throws CoreException {
- return ensureMarker().getAttribute(IJavaDebugConstants.CHECKED, false);
+ return ensureMarker().getAttribute(CHECKED, false);
}
/**
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaLineBreakpoint.java
index c5f3df2..272708f 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaLineBreakpoint.java
@@ -8,7 +8,6 @@
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.IDebugConstants;
import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.internal.debug.core.IJavaDebugConstants;
import org.eclipse.jdt.debug.core.IJavaLineBreakpoint;
import com.sun.jdi.*;
@@ -17,20 +16,24 @@
public class JavaLineBreakpoint extends AbstractJavaLineBreakpoint implements IJavaLineBreakpoint {
- static String fMarkerType= IJavaDebugConstants.JAVA_LINE_BREAKPOINT;
+ /**
+ * Java line breakpoint marker type
+ * (value <code>"org.eclipse.jdt.debug.javaLineBreakpointMarker"</code>).
+ */
+ private static final String JAVA_LINE_BREAKPOINT = "org.eclipse.jdt.debug.javaLineBreakpointMarker"; //$NON-NLS-1$
/**
* Sets of attributes used to configure a line breakpoint
*/
- protected static final String[] fgTypeAndHitCountAttributes= new String[]{IJavaDebugConstants.TYPE_HANDLE, IJavaDebugConstants.HIT_COUNT, IJavaDebugConstants.EXPIRED};
+ protected static final String[] fgTypeAndHitCountAttributes= new String[]{TYPE_HANDLE, HIT_COUNT, EXPIRED};
public JavaLineBreakpoint() {
}
public JavaLineBreakpoint(IType type, int lineNumber, int charStart, int charEnd, int hitCount) throws DebugException {
- this(type, lineNumber, charStart, charEnd, hitCount, fMarkerType);
+ this(type, lineNumber, charStart, charEnd, hitCount, JAVA_LINE_BREAKPOINT);
}
-
+
public JavaLineBreakpoint(final IType type, final int lineNumber, final int charStart, final int charEnd, final int hitCount, final String markerType) throws DebugException {
IWorkspaceRunnable wr= new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
@@ -58,7 +61,7 @@
}
public static String getMarkerType() {
- return fMarkerType;
+ return JAVA_LINE_BREAKPOINT;
}
/**
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaMethodEntryBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaMethodEntryBreakpoint.java
index 747198d..8b3a6cc 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaMethodEntryBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaMethodEntryBreakpoint.java
@@ -7,7 +7,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.*;
import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.internal.debug.core.IJavaDebugConstants;
import org.eclipse.jdt.debug.core.IJavaMethodEntryBreakpoint;
import com.sun.jdi.*;
@@ -18,7 +17,13 @@
public class JavaMethodEntryBreakpoint extends JavaLineBreakpoint implements IJavaMethodEntryBreakpoint {
- static String fMarkerType= IJavaDebugConstants.JAVA_METHOD_ENTRY_BREAKPOINT;
+ private static final String JAVA_METHOD_ENTRY_BREAKPOINT = "org.eclipse.jdt.debug.javaMethodEntryBreakpointMarker"; //$NON-NLS-1$
+ /**
+ * Breakpoint attribute storing the handle identifier of the Java element
+ * corresponding to the method in which a breakpoint is contained
+ * (value <code>"methodHandle"</code>). This attribute is a <code>String</code>.
+ */
+ private static final String METHOD_HANDLE = "methodHandle"; //$NON-NLS-1$
public JavaMethodEntryBreakpoint() {
}
@@ -48,7 +53,7 @@
}
// create the marker
- fMarker= resource.createMarker(fMarkerType);
+ fMarker= resource.createMarker(JAVA_METHOD_ENTRY_BREAKPOINT);
// find the source range if available
int start = -1;
@@ -95,7 +100,7 @@
request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
int hitCount = getHitCount();
if (hitCount > 0) {
- request.putProperty(IJavaDebugConstants.HIT_COUNT, new Integer(hitCount));
+ request.putProperty(HIT_COUNT, new Integer(hitCount));
}
request.setEnabled(isEnabled());
} catch (VMDisconnectedException e) {
@@ -124,7 +129,7 @@
if (hitCount > 0) {
hc = new Integer(hitCount);
}
- request.putProperty(IJavaDebugConstants.HIT_COUNT, hc);
+ request.putProperty(HIT_COUNT, hc);
} catch (VMDisconnectedException e) {
if (target.isTerminated() || target.isDisconnected()) {
return request;
@@ -152,10 +157,18 @@
* Sets the <code>METHOD_HANDLE</code> attribute of this breakpoint.
*/
public void setMethodHandleIdentifier(String identifier) throws CoreException {
- ensureMarker().setAttribute(IJavaDebugConstants.METHOD_HANDLE, identifier);
+ ensureMarker().setAttribute(METHOD_HANDLE, identifier);
}
/**
+ * Returns the <code>METHOD_HANDLE</code> attribute of the given breakpoint.
+ */
+ public String getMethodHandleIdentifier() throws CoreException {
+ return (String) ensureMarker().getAttribute(METHOD_HANDLE);
+ }
+
+
+ /**
* Handles a method entry event. If this method entry event is
* in a method that a method entry breakpoint has been set for,
* dispatch the event to the correct breakpoint.
@@ -173,7 +186,7 @@
if (nameSignature != null && nameSignature[0].equals(enteredMethodName) &&
nameSignature[1].equals(enteredMethod.signature())) {
// simulate hit count
- Integer count = (Integer)request.getProperty(IJavaDebugConstants.HIT_COUNT);
+ Integer count = (Integer)request.getProperty(HIT_COUNT);
if (count != null) {
return handleHitCountMethodEntryBreakpoint(event, count, target);
} else {
@@ -210,7 +223,7 @@
if (hitCount > 0) {
hitCount--;
count = new Integer(hitCount);
- event.request().putProperty(IJavaDebugConstants.HIT_COUNT, count);
+ event.request().putProperty(HIT_COUNT, count);
if (hitCount == 0) {
// the count has reached 0, breakpoint hit
boolean resume = doSuspend(event.thread(), target);
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaPatternBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaPatternBreakpoint.java
index f3094b6..e32a380 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaPatternBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaPatternBreakpoint.java
@@ -15,11 +15,19 @@
public class JavaPatternBreakpoint extends AbstractJavaLineBreakpoint implements IJavaPatternBreakpoint {
- public static String fMarkerType= IJavaDebugConstants.PATTERN_BREAKPOINT;
- protected static final String[] fgPatternAndHitCountAttributes= new String[]{IJavaDebugConstants.PATTERN, IJavaDebugConstants.HIT_COUNT, IJavaDebugConstants.EXPIRED};
+ private static final String PATTERN_BREAKPOINT = "org.eclipse.jdt.debug.patternBreakpointMarker"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint attribute storing the pattern identifier of the source
+ * file in which a breakpoint is created
+ * (value <code>"patternHandle"</code>). This attribute is a <code>String</code>.
+ */
+ private static final String PATTERN = "pattern"; //$NON-NLS-1$
+
+ protected static final String[] fgPatternAndHitCountAttributes= new String[]{PATTERN, HIT_COUNT, EXPIRED};
public JavaPatternBreakpoint(IResource resource, String pattern, int lineNumber, int hitCount) throws DebugException {
- this(resource, pattern, lineNumber, hitCount, fMarkerType);
+ this(resource, pattern, lineNumber, hitCount, PATTERN_BREAKPOINT);
}
public JavaPatternBreakpoint(final IResource resource, final String pattern, final int lineNumber, final int hitCount, final String markerType) throws DebugException {
@@ -110,14 +118,14 @@
* Sets the <code>PATTERN</code> attribute of this breakpoint.
*/
public void setPattern(String pattern) throws CoreException {
- ensureMarker().setAttribute(IJavaDebugConstants.PATTERN, pattern);
+ ensureMarker().setAttribute(PATTERN, pattern);
}
/**
* Returns the <code>PATTERN</code> attribute of this breakpoint
*/
public String getPattern() throws CoreException {
- return (String) ensureMarker().getAttribute(IJavaDebugConstants.PATTERN);
+ return (String) ensureMarker().getAttribute(PATTERN);
}
}
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaRunToLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaRunToLineBreakpoint.java
index 75d25ae..0db48c7 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaRunToLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaRunToLineBreakpoint.java
@@ -3,12 +3,11 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.internal.debug.core.IJavaDebugConstants;
import org.eclipse.jdt.debug.core.IJavaRunToLineBreakpoint;
public class JavaRunToLineBreakpoint extends JavaLineBreakpoint implements IJavaRunToLineBreakpoint {
-
- static String fMarkerType= IJavaDebugConstants.JAVA_RUN_TO_LINE_BREAKPOINT;
+
+ private static final String JAVA_RUN_TO_LINE_BREAKPOINT = "org.eclipse.jdt.debug.javaRunToLineBreakpointMarker"; //$NON-NLS-1$
/**
* Create a run to line breakpoint
@@ -35,21 +34,8 @@
* to a lower level exception.
*/
public JavaRunToLineBreakpoint(IType type, int lineNumber, int charStart, int charEnd) throws DebugException {
- super(type, lineNumber, charStart, charEnd, 1, fMarkerType);
+ super(type, lineNumber, charStart, charEnd, 1, JAVA_RUN_TO_LINE_BREAKPOINT);
}
-
-/* public String getFormattedThreadText(String threadName, String typeName, boolean systemThread) {
- int lineNumber= getAttribute(IMarker.LINE_NUMBER, -1);
- if (lineNumber > -1) {
- if (systemThread) {
- return getFormattedString(RUN_TO_LINE_SYS, new String[] {threadName, String.valueOf(lineNumber), typeName});
- } else {
- return getFormattedString(RUN_TO_LINE_USR, new String[] {threadName, String.valueOf(lineNumber), typeName});
- }
- }
- return "";
- }
- */
/**
* Run to line breakpoints should not be added to the breakpoint
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaWatchpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaWatchpoint.java
index 5fe92c8..883fd72 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaWatchpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/JavaWatchpoint.java
@@ -32,7 +32,7 @@
public class JavaWatchpoint extends JavaLineBreakpoint implements IJavaWatchpoint {
- static String fMarkerType= IJavaDebugConstants.JAVA_WATCHPOINT;
+ public static final String JAVA_WATCHPOINT= "org.eclipse.jdt.debug.javaWatchpointMarker"; //$NON-NLS-1$
/**
* Watchpoint attribute storing the access value (value <code>"access"</code>).
@@ -41,11 +41,23 @@
*/
private static final String ACCESS= "access"; //$NON-NLS-1$
/**
+ * Watchpoint attribute storing the modification value (value <code>"modification"</code>).
+ * This attribute is stored as a <code>boolean</code>, indicating whether a
+ * watchpoint is a modification watchpoint.
+ */
+ private static final String MODIFICATION= "modification"; //$NON-NLS-1$
+ /**
* Watchpoint attribute storing the auto_disabled value (value <code>"auto_disabled"</code>).
* This attribute is stored as a <code>boolean</code>, indicating whether a
* watchpoint has been auto-disabled (as opposed to being disabled explicitly by the user)
*/
- private static final String AUTO_DISABLED="auto_disabled"; //$NON-NLS-1$
+ private static final String AUTO_DISABLED="auto_disabled"; //$NON-NLS-1$
+ /**
+ * Breakpoint attribute storing the handle identifier of the Java element
+ * corresponding to the field on which a breakpoint is set
+ * (value <code>"fieldHandle"</code>). This attribute is a <code>String</code>.
+ */
+ private static final String FIELD_HANDLE= "fieldHandle"; //$NON-NLS-1$
private final static Integer ACCESS_EVENT= new Integer(0);
private final static Integer MODIFICATION_EVENT= new Integer(1);
@@ -82,7 +94,7 @@
if (fMarker == null) {
// Only create a marker if one is not already assigned
- fMarker= resource.createMarker(fMarkerType);
+ fMarker= resource.createMarker(JAVA_WATCHPOINT);
}
// configure the standard attributes
@@ -289,7 +301,7 @@
* @see IJavaWatchpoint#isModification
*/
public boolean isModification() throws CoreException {
- return ensureMarker().getAttribute(IJavaDebugConstants.MODIFICATION, false);
+ return ensureMarker().getAttribute(MODIFICATION, false);
}
/**
@@ -299,7 +311,7 @@
if (modification == isModification()) {
return;
}
- ensureMarker().setAttribute(IJavaDebugConstants.MODIFICATION, modification);
+ ensureMarker().setAttribute(MODIFICATION, modification);
if (modification && !isEnabled()) {
setEnabled(true);
} else if (!(modification || isAccess())) {
@@ -317,7 +329,7 @@
*/
private void setDefaultAccessAndModification() throws CoreException {
Object[] values= new Object[]{Boolean.FALSE, Boolean.TRUE};
- String[] attributes= new String[]{ACCESS, IJavaDebugConstants.MODIFICATION};
+ String[] attributes= new String[]{ACCESS, MODIFICATION};
ensureMarker().setAttributes(attributes, values);
}
@@ -334,7 +346,7 @@
* Sets the <code>FIELD_HANDLE</code> attribute of the given breakpoint.
*/
public void setFieldHandleIdentifier(String handle) throws CoreException {
- ensureMarker().setAttribute(IJavaDebugConstants.FIELD_HANDLE, handle);
+ ensureMarker().setAttribute(FIELD_HANDLE, handle);
}
/**
@@ -391,7 +403,7 @@
* Returns the <code>FIELD_HANDLE</code> attribute of this watchpoint.
*/
public String getFieldHandleIdentifier() throws CoreException {
- return (String) ensureMarker().getAttribute(IJavaDebugConstants.FIELD_HANDLE);
+ return (String) ensureMarker().getAttribute(FIELD_HANDLE);
}
/*
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/SnippetSupportLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/SnippetSupportLineBreakpoint.java
index 2558980..e7bd367 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/SnippetSupportLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/SnippetSupportLineBreakpoint.java
@@ -1,14 +1,18 @@
package org.eclipse.jdt.internal.debug.core;
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
import org.eclipse.core.resources.IResource;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.internal.debug.core.IJavaDebugConstants;
import org.eclipse.jdt.debug.core.ISnippetSupportLineBreakpoint;
public class SnippetSupportLineBreakpoint extends JavaLineBreakpoint implements ISnippetSupportLineBreakpoint {
- static String fMarkerType= IJavaDebugConstants.SNIPPET_SUPPORT_LINE_BREAKPOINT;
+ private static final String SNIPPET_SUPPORT_LINE_BREAKPOINT= "org.eclipse.jdt.debug.snippetSupportLineBreakpointMarker"; //$NON-NLS-1$
/**
* Constructor for SnippetSupportLineBreakpoint
@@ -21,7 +25,7 @@
* Constructor for SnippetSupportLineBreakpoint
*/
public SnippetSupportLineBreakpoint(IType type, int lineNumber, int charStart, int charEnd, int hitCount) throws DebugException {
- super(type, lineNumber, charStart, charEnd, hitCount, fMarkerType);
+ super(type, lineNumber, charStart, charEnd, hitCount, SNIPPET_SUPPORT_LINE_BREAKPOINT);
}
/**