diff --git a/classpath/java/lang/Class.java b/classpath/java/lang/Class.java index 213d8d58c6..2d907f064b 100644 --- a/classpath/java/lang/Class.java +++ b/classpath/java/lang/Class.java @@ -219,6 +219,25 @@ public final class Class { } } + public Constructor getDeclaredConstructor(Class ... parameterTypes) + throws NoSuchMethodException + { + Constructor c = null; + Constructor[] constructors = getDeclaredConstructors(); + + for (int i = 0; i < constructors.length; ++i) { + if (match(parameterTypes, constructors[i].getParameterTypes())) { + c = constructors[i]; + } + } + + if (c == null) { + throw new NoSuchMethodException(); + } else { + return c; + } + } + private int countConstructors(boolean publicOnly) { int count = 0; if (methodTable != null) {