hotspot/src/share/vm/runtime/jniHandles.hpp
changeset 3672 65e946046d1e
parent 1 489c9b5090e2
child 5530 bc95d7f52f82
child 4013 b154310845de
--- a/hotspot/src/share/vm/runtime/jniHandles.hpp	Tue Jul 28 13:50:07 2009 -0600
+++ b/hotspot/src/share/vm/runtime/jniHandles.hpp	Tue Aug 11 11:57:51 2009 -0600
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -196,12 +196,16 @@
 };
 
 inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) {
-  jobject handle = (jobject)mid;
-  if (is_weak_global_handle(handle)) {
-    return (methodOop) resolve_non_null(handle);
-  } else {
+  if (mid == NULL) {
     return (methodOop) NULL;
   }
+
+  oop o = resolve_non_null((jobject) mid);
+  if (!o->is_method()) {
+    return (methodOop) NULL;
+  }
+
+  return (methodOop) o;
 };