Commit 0196f4e0 by Tom Tromey Committed by Tom Tromey

re PR libgcj/11779 (Field reflection incorrectly throws IllegalAccessException)

	Fix for PR libgcj/11779:
	* java/lang/reflect/natField.cc (getAddr): Skip frames in Field
	class.

From-SVN: r70185
parent 0d4d2279
2003-08-05 Tom Tromey <tromey@redhat.com> 2003-08-05 Tom Tromey <tromey@redhat.com>
Fix for PR libgcj/11779:
* java/lang/reflect/natField.cc (getAddr): Skip frames in Field
class.
* java/lang/reflect/Method.java: Updated status comment. * java/lang/reflect/Method.java: Updated status comment.
Imported javadoc from Classpath and re-ordered methods. Imported javadoc from Classpath and re-ordered methods.
* java/lang/reflect/Constructor.java: Reindented. Updated * java/lang/reflect/Constructor.java: Reindented. Updated
......
...@@ -59,14 +59,15 @@ getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj) ...@@ -59,14 +59,15 @@ getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
// calls. However, we never implemented that, so we have to find // calls. However, we never implemented that, so we have to find
// the caller by hand instead. // the caller by hand instead.
gnu::gcj::runtime::StackTrace *t gnu::gcj::runtime::StackTrace *t
= new gnu::gcj::runtime::StackTrace(4); = new gnu::gcj::runtime::StackTrace(7);
try try
{ {
for (int i = 1; !caller; i++) // We want to skip all the frames on the stack from this class.
{ for (int i = 1;
!caller || caller == &java::lang::reflect::Field::class$;
i++)
caller = t->classAt (i); caller = t->classAt (i);
} }
}
catch (::java::lang::ArrayIndexOutOfBoundsException *e) catch (::java::lang::ArrayIndexOutOfBoundsException *e)
{ {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment