From: Bryce McKinlay Date: Thu, 22 Mar 2001 06:37:16 +0000 (+0000) Subject: Method.java (getExceptionTypes): Call getType() to initialize if exception_types... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=595420bfea88f5c0117e887cf70345a61f26e893;p=gcc.git Method.java (getExceptionTypes): Call getType() to initialize if exception_types is null. * java/lang/reflect/Method.java (getExceptionTypes): Call getType() to initialize if exception_types is null. * java/lang/reflect/Constructor.java: Likewise. * java/lang/reflect/natConstructor.cc (getType): Initialize exception_types to an empty Object array. From-SVN: r40730 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 54c06b7af5f..d74bd217a1c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2001-03-22 Bryce McKinlay + + * java/lang/reflect/Method.java (getExceptionTypes): Call getType() to + initialize if exception_types is null. + * java/lang/reflect/Constructor.java: Likewise. + * java/lang/reflect/natConstructor.cc (getType): Initialize + exception_types to an empty Object array. + 2001-03-21 Tom Tromey * configure: Rebuilt. diff --git a/libjava/java/lang/reflect/Constructor.java b/libjava/java/lang/reflect/Constructor.java index 77c437e24fa..2d527c3ba75 100644 --- a/libjava/java/lang/reflect/Constructor.java +++ b/libjava/java/lang/reflect/Constructor.java @@ -1,6 +1,6 @@ // Constructor.java - Represents a constructor for a class. -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. @@ -38,6 +38,8 @@ public final class Constructor extends AccessibleObject implements Member public Class[] getExceptionTypes () { + if (exception_types == null) + getType(); return (Class[]) exception_types.clone(); } diff --git a/libjava/java/lang/reflect/Method.java b/libjava/java/lang/reflect/Method.java index 119a56f2141..e616670e587 100644 --- a/libjava/java/lang/reflect/Method.java +++ b/libjava/java/lang/reflect/Method.java @@ -1,6 +1,6 @@ // Method.java - Represent method of class or interface. -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. @@ -39,6 +39,8 @@ public final class Method extends AccessibleObject implements Member public Class[] getExceptionTypes () { + if (exception_types == null) + getType(); return (Class[]) exception_types.clone(); } diff --git a/libjava/java/lang/reflect/natConstructor.cc b/libjava/java/lang/reflect/natConstructor.cc index a8da794bdb8..2209ad9fa64 100644 --- a/libjava/java/lang/reflect/natConstructor.cc +++ b/libjava/java/lang/reflect/natConstructor.cc @@ -34,6 +34,10 @@ java::lang::reflect::Constructor::getType () declaringClass, ¶meter_types, NULL); + + // FIXME: for now we have no way to get exception information. + exception_types = + (JArray *) JvNewObjectArray (0, &java::lang::Class::class$, NULL); } jobject