diff options
Diffstat (limited to 'runtime/jdwp')
-rw-r--r-- | runtime/jdwp/object_registry.cc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/runtime/jdwp/object_registry.cc b/runtime/jdwp/object_registry.cc index 7408e92..369eddd 100644 --- a/runtime/jdwp/object_registry.cc +++ b/runtime/jdwp/object_registry.cc @@ -133,9 +133,7 @@ void ObjectRegistry::DisableCollection(JDWP::ObjectId id) { Thread* self = Thread::Current(); MutexLock mu(self, lock_); id_iterator it = id_to_entry_.find(id); - if (it == id_to_entry_.end()) { - return; - } + CHECK(it != id_to_entry_.end()); Promote(*(it->second)); } @@ -143,9 +141,7 @@ void ObjectRegistry::EnableCollection(JDWP::ObjectId id) { Thread* self = Thread::Current(); MutexLock mu(self, lock_); id_iterator it = id_to_entry_.find(id); - if (it == id_to_entry_.end()) { - return; - } + CHECK(it != id_to_entry_.end()); Demote(*(it->second)); } @@ -175,9 +171,7 @@ bool ObjectRegistry::IsCollected(JDWP::ObjectId id) { Thread* self = Thread::Current(); MutexLock mu(self, lock_); id_iterator it = id_to_entry_.find(id); - if (it == id_to_entry_.end()) { - return true; // TODO: can we report that this was an invalid id? - } + CHECK(it != id_to_entry_.end()); ObjectRegistryEntry& entry = *(it->second); if (entry.jni_reference_type == JNIWeakGlobalRefType) { |