Initial Commit
[packages] / xemacs-packages / jde / java / src / jde / debugger / spec / ModificationWatchpointSpec.java
1 package jde.debugger.spec;
2
3 import com.sun.jdi.*;
4 import com.sun.jdi.request.*;
5 import jde.debugger.JDEException;
6
7 /**
8  * ModificationWatchpointSpec.java
9  * <p>
10  * 
11  * <p>
12  * Created: Tue Aug  3 15:42:41 1999
13  * 
14  * @author Amit Kumar
15  * @since 0.1
16  * @version $Revision: 1.3 $
17  */
18
19 public class ModificationWatchpointSpec extends WatchpointSpec {
20
21   public ModificationWatchpointSpec(ReferenceTypeSpec refSpec, String fieldName) {
22     super(refSpec, fieldName);
23   }
24
25   boolean resolve(ReferenceType refType) throws JDEException {
26     Field field = refType.fieldByName(fieldName);
27     if (field == null) {
28       throw new JDEException("'"+fieldName+"' does not exist in the class");
29     }
30     EventRequest er = refType.virtualMachine().eventRequestManager().createModificationWatchpointRequest(field);
31     setRequest(er);
32     return true;
33   }
34
35 } // ModificationWatchpointSpec
36
37 /*
38  * $Log: ModificationWatchpointSpec.java,v $
39  * Revision 1.3  2003/01/15 06:06:15  paulk
40  * Petter Mahlen's changes.
41  *
42  */
43
44 // End of ModificationWatchpointSpec.java