+ To catch-up with JDI capabilities and be able to implement new enhancements,
+we need to add support for new breakpoint properties into the debugger JPDA API.
+These are mainly class and thread filters and hit counts.
+
+ Added methods:
+ ExceptionBreakpoint.getClassFilters()
,
+ ExceptionBreakpoint.setClassFilters()
,
+ ExceptionBreakpoint.getClassExclusionFilters()
,
+ ExceptionBreakpoint.setClassExclusionFilters()
,
+ FieldBreakpoint.getInstanceFilters()
,
+ FieldBreakpoint.setInstanceFilters()
,
+ FieldBreakpoint.getThreadFilters()
,
+ FieldBreakpoint.setThreadFilters()
,
+ JPDABreakpoint.getHitCountFilter()
,
+ JPDABreakpoint.getHitCountFilteringStyle()
,
+ JPDABreakpoint.setHitCountFilter()
,
+ LineBreakpoint.getInstanceFilters()
,
+ LineBreakpoint.setInstanceFilters()
,
+ LineBreakpoint.getThreadFilters()
,
+ LineBreakpoint.setThreadFilters()
,
+ MethodBreakpoint.getMethodSignature()
,
+ MethodBreakpoint.setMethodSignature()
,
+ MethodBreakpoint.getInstanceFilters()
,
+ MethodBreakpoint.setInstanceFilters()
,
+ MethodBreakpoint.getThreadFilters()
,
+ MethodBreakpoint.setThreadFilters()
.
+
+ Added fields:
+ ExceptionBreakpoint.PROP_CLASS_FILTERS
,
+ ExceptionBreakpoint.PROP_CLASS_EXCLUSION_FILTERS
,
+ FieldBreakpoint.PROP_INSTANCE_FILTERS
,
+ FieldBreakpoint.PROP_THREAD_FILTERS
,
+ JPDABreakpoint.PROP_HIT_COUNT_FILTER
,
+ JPDABreakpoint.HIT_COUNT_FILTERING_STYLE
,
+ LineBreakpoint.PROP_INSTANCE_FILTERS
,
+ LineBreakpoint.PROP_THREAD_FILTERS
,
+ MethodBreakpoint.PROP_METHOD_SIGNATURE
,
+ MethodBreakpoint.PROP_INSTANCE_FILTERS
,
+ MethodBreakpoint.PROP_THREAD_FILTERS
.
+
null
when there is no instance restriction.
+ */
+ public ObjectVariable[] getInstanceFilters(JPDADebugger session) {
+ if (instanceFilters != null) {
+ return instanceFilters.get(session);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the instance filter for a specific debugger session. This restricts
+ * the breakpoint to specific instances in that session.
+ * @param session the debugger session
+ * @param instances the object instances or null
to unset the filter.
+ */
+ public void setInstanceFilters(JPDADebugger session, ObjectVariable[] instances) {
+ if (instanceFilters == null) {
+ instanceFilters = new WeakHashMapnull
when there is no thread restriction.
+ */
+ public JPDAThread[] getThreadFilters(JPDADebugger session) {
+ if (threadFilters != null) {
+ return threadFilters.get(session);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the thread filter for a specific debugger session. This restricts
+ * the breakpoint to specific threads in that session.
+ * @param session the debugger session
+ * @param threads the threads or null
to unset the filter.
+ */
+ public void setThreadFilters(JPDADebugger session, JPDAThread[] threads) {
+ if (threadFilters == null) {
+ threadFilters = new WeakHashMapzero
when no hit count filter is set.
+ */
+ public int getHitCountFilter() {
+ return hitCountFilter;
+ }
+
+ /**
+ * Get the style of hit count filtering.
+ * @return the style of hit count filtering, or zero
to unset the filter.
+ * @param hitCountFilteringStyle the style of hit count filtering.
+ */
+ public void setHitCountFilter(int hitCountFilter, HIT_COUNT_FILTERING_STYLE hitCountFilteringStyle) {
+ if (hitCountFilter == this.hitCountFilter && hitCountFilteringStyle == this.hitCountFilteringStyle) {
+ return ;
+ }
+ if (hitCountFilteringStyle == null && hitCountFilter > 0) {
+ throw new NullPointerException("hitCountFilteringStyle must not be null.");
+ }
+ this.hitCountFilter = hitCountFilter;
+ this.hitCountFilteringStyle = hitCountFilteringStyle;
+ firePropertyChange(PROP_HIT_COUNT_FILTER, null, new Object[] { hitCountFilter, hitCountFilteringStyle });
}
/**
Index: src/org/netbeans/api/debugger/jpda/LineBreakpoint.java
===================================================================
RCS file: /cvs/debuggerjpda/api/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java,v
retrieving revision 1.19
diff -u -r1.19 LineBreakpoint.java
--- src/org/netbeans/api/debugger/jpda/LineBreakpoint.java 2 Mar 2007 15:10:17 -0000 1.19
+++ src/org/netbeans/api/debugger/jpda/LineBreakpoint.java 14 May 2007 18:17:58 -0000
@@ -13,7 +13,7 @@
* "Portions Copyrighted [year] [name of copyright owner]"
*
* The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
* Microsystems, Inc. All Rights Reserved.
*/
@@ -21,6 +21,8 @@
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Map;
+import java.util.WeakHashMap;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.netbeans.api.debugger.Breakpoint;
@@ -66,6 +68,10 @@
public static final String PROP_STRATUM = "stratum"; // NOI18N
/** Property name constant. */
public static final String PROP_PREFERRED_CLASS_NAME = "classNamePreferred"; // NOI18N
+ /** Property name constant */
+ public static final String PROP_INSTANCE_FILTERS = "instanceFilters"; // NOI18N
+ /** Property name constant */
+ public static final String PROP_THREAD_FILTERS = "threadFilters"; // NOI18N
private String url = ""; // NOI18N
private int lineNumber;
@@ -74,6 +80,8 @@
private String sourcePath = null;
private String stratum = "Java"; // NOI18N
private String className = null;
+ private Mapnull
when there is no instance restriction.
+ */
+ public ObjectVariable[] getInstanceFilters(JPDADebugger session) {
+ if (instanceFilters != null) {
+ return instanceFilters.get(session);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the instance filter for a specific debugger session. This restricts
+ * the breakpoint to specific instances in that session.
+ * @param session the debugger session
+ * @param instances the object instances or null
to unset the filter.
+ */
+ public void setInstanceFilters(JPDADebugger session, ObjectVariable[] instances) {
+ if (instanceFilters == null) {
+ instanceFilters = new WeakHashMapnull
when there is no thread restriction.
+ */
+ public JPDAThread[] getThreadFilters(JPDADebugger session) {
+ if (threadFilters != null) {
+ return threadFilters.get(session);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the thread filter for a specific debugger session. This restricts
+ * the breakpoint to specific threads in that session.
+ * @param session the debugger session
+ * @param threads the threads or null
to unset the filter.
+ */
+ public void setThreadFilters(JPDADebugger session, JPDAThread[] threads) {
+ if (threadFilters == null) {
+ threadFilters = new WeakHashMapnull
when there is no instance restriction.
+ */
+ public ObjectVariable[] getInstanceFilters(JPDADebugger session) {
+ if (instanceFilters != null) {
+ return instanceFilters.get(session);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the instance filter for a specific debugger session. This restricts
+ * the breakpoint to specific instances in that session.
+ * @param session the debugger session
+ * @param instances the object instances or null
to unset the filter.
+ */
+ public void setInstanceFilters(JPDADebugger session, ObjectVariable[] instances) {
+ if (instanceFilters == null) {
+ instanceFilters = new WeakHashMapnull
when there is no thread restriction.
+ */
+ public JPDAThread[] getThreadFilters(JPDADebugger session) {
+ if (threadFilters != null) {
+ return threadFilters.get(session);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the thread filter for a specific debugger session. This restricts
+ * the breakpoint to specific threads in that session.
+ * @param session the debugger session
+ * @param threads the threads or null
to unset the filter.
+ */
+ public void setThreadFilters(JPDADebugger session, JPDAThread[] threads) {
+ if (threadFilters == null) {
+ threadFilters = new WeakHashMap