< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java

Print this page

130             if (cache != null && (vm.traceFlags & VirtualMachine.TRACE_OBJREFS) != 0) {
131                 vm.printTrace("Clearing temporary cache for " + description());
132             }
133             disableCache();
134             if (addedListener) {
135                 /*
136                  * If a listener was added (i.e. this is not a
137                  * ObjectReference that adds a listener on startup),
138                  * remove it here.
139                  */
140                 addedListener = false;
141                 return false;  // false says remove
142             } else {
143                 return true;
144             }
145         }
146     }
147 
148     public boolean equals(Object obj) {
149         if ((obj != null) && (obj instanceof ObjectReferenceImpl)) {
150             ObjectReferenceImpl other = (ObjectReferenceImpl)obj;
151             return (ref() == other.ref()) &&
152                    super.equals(obj);
153         } else {
154             return false;
155         }
156     }
157 
158     public int hashCode() {
159         return(int)ref();
160     }
161 
162     public Type type() {
163         return referenceType();
164     }
165 
166     public ReferenceType referenceType() {
167         if (type == null) {
168             try {
169                 JDWP.ObjectReference.ReferenceType rtinfo =
170                     JDWP.ObjectReference.ReferenceType.process(vm, this);
171                 type = vm.referenceType(rtinfo.typeID,
172                                         rtinfo.refTypeTag);

130             if (cache != null && (vm.traceFlags & VirtualMachine.TRACE_OBJREFS) != 0) {
131                 vm.printTrace("Clearing temporary cache for " + description());
132             }
133             disableCache();
134             if (addedListener) {
135                 /*
136                  * If a listener was added (i.e. this is not a
137                  * ObjectReference that adds a listener on startup),
138                  * remove it here.
139                  */
140                 addedListener = false;
141                 return false;  // false says remove
142             } else {
143                 return true;
144             }
145         }
146     }
147 
148     public boolean equals(Object obj) {
149         if ((obj != null) && (obj instanceof ObjectReferenceImpl)) {
150             ObjectReferenceImpl other = (ObjectReferenceImpl) obj;
151             return (ref() == other.ref()) &&
152                     super.equals(obj);
153         } else {
154             return false;
155         }
156     }
157 
158     public int hashCode() {
159         return(int)ref();
160     }
161 
162     public Type type() {
163         return referenceType();
164     }
165 
166     public ReferenceType referenceType() {
167         if (type == null) {
168             try {
169                 JDWP.ObjectReference.ReferenceType rtinfo =
170                     JDWP.ObjectReference.ReferenceType.process(vm, this);
171                 type = vm.referenceType(rtinfo.typeID,
172                                         rtinfo.refTypeTag);
< prev index next >