diff options
Diffstat (limited to 'luni-kernel/src')
3 files changed, 37 insertions, 9 deletions
diff --git a/luni-kernel/src/main/java/java/lang/reflect/Constructor.java b/luni-kernel/src/main/java/java/lang/reflect/Constructor.java index c6927eb..3918d7e 100644 --- a/luni-kernel/src/main/java/java/lang/reflect/Constructor.java +++ b/luni-kernel/src/main/java/java/lang/reflect/Constructor.java @@ -161,12 +161,12 @@ public final class Constructor<T> extends AccessibleObject implements GenericDec appendArrayGenericType(sb, Types.getClonedTypeArray(genericParameterTypes)); sb.append(')'); - // append exeptions if any - Type[] genericEceptionTypeArray = + // append exceptions if any + Type[] genericExceptionTypeArray = Types.getClonedTypeArray(genericExceptionTypes); - if (genericEceptionTypeArray.length > 0) { + if (genericExceptionTypeArray.length > 0) { sb.append(" throws "); - appendArrayGenericType(sb, genericEceptionTypeArray); + appendArrayGenericType(sb, genericExceptionTypeArray); } return sb.toString(); } @@ -314,7 +314,7 @@ public final class Constructor<T> extends AccessibleObject implements GenericDec public Class<?>[] getExceptionTypes() { if (exceptionTypes == null) return new Class[0]; - return exceptionTypes; + return exceptionTypes.clone(); } /** @@ -354,7 +354,7 @@ public final class Constructor<T> extends AccessibleObject implements GenericDec * @since Android 1.0 */ public Class<?>[] getParameterTypes() { - return parameterTypes; + return parameterTypes.clone(); } /** diff --git a/luni-kernel/src/main/java/java/lang/reflect/Method.java b/luni-kernel/src/main/java/java/lang/reflect/Method.java index 473726d..dabf9a4 100644 --- a/luni-kernel/src/main/java/java/lang/reflect/Method.java +++ b/luni-kernel/src/main/java/java/lang/reflect/Method.java @@ -383,7 +383,7 @@ public final class Method extends AccessibleObject implements GenericDeclaration return new Class[0]; } - return exceptionTypes; + return exceptionTypes.clone(); } /** @@ -424,7 +424,7 @@ public final class Method extends AccessibleObject implements GenericDeclaration * @since Android 1.0 */ public Class<?>[] getParameterTypes() { - return parameterTypes; + return parameterTypes.clone(); } /** @@ -521,7 +521,7 @@ public final class Method extends AccessibleObject implements GenericDeclaration return invokeNative (receiver, args, declaringClass, parameterTypes, returnType, slot, flag); } - private native Object invokeNative(Object obj, Object[] args, Class<?> declaringClass, Class<?>[] parameterTYpes, Class<?> returnType, int slot, boolean noAccessCheck) + private native Object invokeNative(Object obj, Object[] args, Class<?> declaringClass, Class<?>[] parameterTypes, Class<?> returnType, int slot, boolean noAccessCheck) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException; diff --git a/luni-kernel/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java b/luni-kernel/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java new file mode 100644 index 0000000..a59cc3e --- /dev/null +++ b/luni-kernel/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package tests.api.org.apache.harmony.kernel.dalvik; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class AllTests { + public static final Test suite() { + TestSuite suite = tests.TestSuiteFactory.createTestSuite(); + suite.addTestSuite(tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.class); + return suite; + } +} |