hotspot/src/share/vm/prims/jniCheck.cpp
changeset 8725 8c1e3dd5fe1b
parent 8107 78e5bd944384
child 10969 3ecf25293e5a
equal deleted inserted replaced
8724:693c6b883b54 8725:8c1e3dd5fe1b
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   222   klassOop f_oop = id->holder();
   222   klassOop f_oop = id->holder();
   223   if (!instanceKlass::cast(k_oop)->is_subtype_of(f_oop))
   223   if (!instanceKlass::cast(k_oop)->is_subtype_of(f_oop))
   224     ReportJNIFatalError(thr, fatal_wrong_static_field);
   224     ReportJNIFatalError(thr, fatal_wrong_static_field);
   225 
   225 
   226   /* check for proper field type */
   226   /* check for proper field type */
   227   if (!instanceKlass::cast(f_oop)->find_local_field_from_offset(
   227   if (!id->find_local_field(&fd))
   228           id->offset(), true, &fd))
       
   229     ReportJNIFatalError(thr, fatal_static_field_not_found);
   228     ReportJNIFatalError(thr, fatal_static_field_not_found);
   230   if ((fd.field_type() != ftype) &&
   229   if ((fd.field_type() != ftype) &&
   231       !(fd.field_type() == T_ARRAY && ftype == T_OBJECT)) {
   230       !(fd.field_type() == T_ARRAY && ftype == T_OBJECT)) {
   232     ReportJNIFatalError(thr, fatal_static_field_mismatch);
   231     ReportJNIFatalError(thr, fatal_static_field_mismatch);
   233   }
   232   }