src/share/vm/runtime/jniHandles.hpp

changeset 1352
1760a1cbed36
parent 435
a61af66fc99e
child 1445
354d3184f6b2
child 1890
d3562366cbfd
     1.1 --- a/src/share/vm/runtime/jniHandles.hpp	Tue Jul 28 13:50:07 2009 -0600
     1.2 +++ b/src/share/vm/runtime/jniHandles.hpp	Tue Aug 11 11:57:51 2009 -0600
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -196,12 +196,16 @@
    1.11  };
    1.12  
    1.13  inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) {
    1.14 -  jobject handle = (jobject)mid;
    1.15 -  if (is_weak_global_handle(handle)) {
    1.16 -    return (methodOop) resolve_non_null(handle);
    1.17 -  } else {
    1.18 +  if (mid == NULL) {
    1.19      return (methodOop) NULL;
    1.20    }
    1.21 +
    1.22 +  oop o = resolve_non_null((jobject) mid);
    1.23 +  if (!o->is_method()) {
    1.24 +    return (methodOop) NULL;
    1.25 +  }
    1.26 +
    1.27 +  return (methodOop) o;
    1.28  };
    1.29  
    1.30  

mercurial