mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-06 11:03:43 +08:00
natField.cc (getAddr): Allow setting of final field when it is accessible.
* java/lang/reflect/natField.cc (getAddr): Allow setting of final field when it is accessible. From-SVN: r114896
This commit is contained in:
parent
746907b225
commit
6d82bb8521
@ -1,3 +1,8 @@
|
||||
2006-06-22 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* java/lang/reflect/natField.cc (getAddr): Allow setting of final
|
||||
field when it is accessible.
|
||||
|
||||
2006-06-21 Bryce McKinlay <mckinlay@redhat.com>
|
||||
|
||||
* include/win32-threads.h (_Jv_ThreadDesc_t): New typedef.
|
||||
|
@ -72,6 +72,10 @@ getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj,
|
||||
|
||||
// Setting a final field is usually not allowed.
|
||||
if (checkFinal
|
||||
// As of 1.5, you can set a non-static final field if it is
|
||||
// accessible.
|
||||
&& (! field->isAccessible()
|
||||
|| (field->getModifiers() & java::lang::reflect::Modifier::STATIC))
|
||||
&& (field->getModifiers() & java::lang::reflect::Modifier::FINAL))
|
||||
throw new java::lang::IllegalAccessException(JvNewStringUTF
|
||||
("Field is final"));
|
||||
|
Loading…
Reference in New Issue
Block a user