resolve.cc (_Jv_ResolvePoolEntry): Put field name in exception.
authorGary Benson <gbenson@redhat.com>
Thu, 1 Apr 2004 17:07:03 +0000 (17:07 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 1 Apr 2004 17:07:03 +0000 (17:07 +0000)
2004-04-01  Gary Benson  <gbenson@redhat.com>

* resolve.cc (_Jv_ResolvePoolEntry): Put field name in exception.
(_Jv_SearchMethodInClass): Likewise.

From-SVN: r80305

libjava/ChangeLog
libjava/resolve.cc

index 6ff59e661dd839577f7f0f42923f926926e13fbc..7a56c40822cc3e6bf24c222cd326d022ca758af1 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-01  Gary Benson  <gbenson@redhat.com>
+
+       * resolve.cc (_Jv_ResolvePoolEntry): Put field name in exception.
+       (_Jv_SearchMethodInClass): Likewise.
+
 2004-03-26  Peter Moon  <peterm@miraculum.com>
 
        * java/text/NumberFormat.java: Fix spelling of setCurrency
index d71e1251ff0946a7ad5aac730819f77816cb7b4f..5a859a73f6cdd41b4f44c093647c5f92efeafe55 100644 (file)
@@ -1,6 +1,6 @@
 // resolve.cc - Code for linking and resolving classes and pool entries.
 
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
 
    This file is part of libgcj.
 
@@ -185,7 +185,14 @@ _Jv_ResolvePoolEntry (jclass klass, int index)
                }
              else
                {
-                 throw new java::lang::IllegalAccessError;
+                 java::lang::StringBuffer *sb
+                   = new java::lang::StringBuffer ();
+                 sb->append(klass->getName());
+                 sb->append(JvNewStringLatin1(": "));
+                 sb->append(cls->getName());
+                 sb->append(JvNewStringLatin1("."));
+                 sb->append(_Jv_NewStringUtf8Const (field_name));
+                 throw new java::lang::IllegalAccessError(sb->toString());
                }
            }
        }
@@ -343,7 +350,16 @@ _Jv_SearchMethodInClass (jclass cls, jclass klass,
       if (_Jv_CheckAccess (klass, cls, method->accflags))
        return method;
       else
-       throw new java::lang::IllegalAccessError;
+       {
+         java::lang::StringBuffer *sb = new java::lang::StringBuffer();
+         sb->append(klass->getName());
+         sb->append(JvNewStringLatin1(": "));
+         sb->append(cls->getName());
+         sb->append(JvNewStringLatin1("."));
+         sb->append(_Jv_NewStringUTF(method_name->data));
+         sb->append(_Jv_NewStringUTF(method_signature->data));
+         throw new java::lang::IllegalAccessError (sb->toString());
+       }
     }
   return 0;
 }