Index: apichanges.xml =================================================================== RCS file: /shared/data/ccvs/repository/debuggercore/api/apichanges.xml,v retrieving revision 1.9 diff -u -r1.9 apichanges.xml --- apichanges.xml 12 Apr 2007 15:44:57 -0000 1.9 +++ apichanges.xml 15 May 2007 17:13:59 -0000 @@ -14,7 +14,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. --> @@ -192,6 +192,30 @@ Breakpoint.getValidityMessage(), Breakpoint.setValidity() - validity management.

+ + + + + Add filter for hit counts to breakpoints. + + + + + +

+ To be able to set breakpoint for number of iterations, we need to add a filter for hit counts into Breakpoint API. +

+

+ Added methods:
+ Breakpoint.getHitCountFilter(), + Breakpoint.getHitCountFilteringStyle(), + Breakpoint.setHitCountFilter(). +

+

+ Added fields:
+ Breakpoint.PROP_HIT_COUNT_FILTER, + Breakpoint.HIT_COUNT_FILTERING_STYLE. +

Index: manifest.mf =================================================================== RCS file: /shared/data/ccvs/repository/debuggercore/api/manifest.mf,v retrieving revision 1.15 diff -u -r1.15 manifest.mf --- manifest.mf 1 Mar 2007 10:17:08 -0000 1.15 +++ manifest.mf 15 May 2007 17:13:59 -0000 @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.api.debugger/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/Bundle.properties -OpenIDE-Module-Specification-Version: 1.10 +OpenIDE-Module-Specification-Version: 1.11 Index: src/org/netbeans/api/debugger/Breakpoint.java =================================================================== RCS file: /shared/data/ccvs/repository/debuggercore/api/src/org/netbeans/api/debugger/Breakpoint.java,v retrieving revision 1.7 diff -u -r1.7 Breakpoint.java --- src/org/netbeans/api/debugger/Breakpoint.java 1 Mar 2007 10:17:10 -0000 1.7 +++ src/org/netbeans/api/debugger/Breakpoint.java 15 May 2007 17:13:59 -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. */ @@ -38,15 +38,24 @@ public static final String PROP_GROUP_NAME = "groupName"; // NOI18N /** Property name for breakpoint validity */ public static final String PROP_VALIDITY = "validity"; // NOI18N + /** Property name constant. */ + public static final String PROP_HIT_COUNT_FILTER = "hitCountFilter"; // NOI18N /** Validity values */ public static enum VALIDITY { UNKNOWN, VALID, INVALID } + /** The style of filtering of hit counts. + * The breakpoint is reported when the actual hit count is "equal to", + * "greater than" or "multiple of" the number specified by the hit count filter. */ + public static enum HIT_COUNT_FILTERING_STYLE { EQUAL, GREATER, MULTIPLE } + /** Support for property listeners. */ private PropertyChangeSupport pcs; private String groupName = ""; private VALIDITY validity = VALIDITY.UNKNOWN; private String validityMessage; + private int hitCountFilter; + private HIT_COUNT_FILTERING_STYLE hitCountFilteringStyle; { pcs = new PropertyChangeSupport (this); } @@ -104,6 +113,57 @@ this.validity = validity; } firePropertyChange(PROP_VALIDITY, old, validity); + } + + /** + * Get the hit count filter. + * @return a positive hit count filter, or zero when no hit count filter is set. + */ + public final synchronized int getHitCountFilter() { + return hitCountFilter; + } + + /** + * Get the style of hit count filtering. + * @return the style of hit count filtering, or null when no count filter is set. + */ + public final synchronized HIT_COUNT_FILTERING_STYLE getHitCountFilteringStyle() { + return hitCountFilteringStyle; + } + + /** + * Set the hit count filter and the style of filtering. + * @param hitCountFilter a positive hit count filter, or zero to unset the filter. + * @param hitCountFilteringStyle the style of hit count filtering. + * Can be null only when hitCountFilter == 0. + */ + public final void setHitCountFilter(int hitCountFilter, HIT_COUNT_FILTERING_STYLE hitCountFilteringStyle) { + Object[] old; + Object[] newProp; + synchronized (this) { + if (hitCountFilter == this.hitCountFilter && hitCountFilteringStyle == this.hitCountFilteringStyle) { + return ; + } + if (hitCountFilteringStyle == null && hitCountFilter > 0) { + throw new NullPointerException("hitCountFilteringStyle must not be null."); + } + if (hitCountFilter == 0) { + hitCountFilteringStyle = null; + } + if (this.hitCountFilter == 0) { + old = null; + } else { + old = new Object[] { this.hitCountFilter, this.hitCountFilteringStyle }; + } + if (hitCountFilter == 0) { + newProp = null; + } else { + newProp = new Object[] { hitCountFilter, hitCountFilteringStyle }; + } + this.hitCountFilter = hitCountFilter; + this.hitCountFilteringStyle = hitCountFilteringStyle; + } + firePropertyChange(PROP_HIT_COUNT_FILTER, old, newProp); } public String getGroupName () {