src/share/classes/java/lang/reflect/Constructor.java
Print this page
@@ -62,12 +62,12 @@
GenericDeclaration,
Member {
private Class<T> clazz;
private int slot;
- private Class[] parameterTypes;
- private Class[] exceptionTypes;
+ private Class<?>[] parameterTypes;
+ private Class<?>[] exceptionTypes;
private int modifiers;
// Generics and annotations support
private transient String signature;
// generic info repository; lazily initialized
private transient ConstructorRepository genericInfo;
@@ -78,11 +78,11 @@
// it is necessary to perform somewhat expensive security checks.
// If the security check succeeds for a given class, it will
// always succeed (it is not affected by the granting or revoking
// of permissions); we speed up the check in the common case by
// remembering the last Class for which the check succeeded.
- private volatile Class securityCheckCache;
+ private volatile Class<?> securityCheckCache;
// Generics infrastructure
// Accessor for factory
private GenericsFactory getFactory() {
// create scope and factory
@@ -111,12 +111,12 @@
* Package-private constructor used by ReflectAccess to enable
* instantiation of these objects in Java code from the java.lang
* package via sun.reflect.LangReflectAccess.
*/
Constructor(Class<T> declaringClass,
- Class[] parameterTypes,
- Class[] checkedExceptions,
+ Class<?>[] parameterTypes,
+ Class<?>[] checkedExceptions,
int modifiers,
int slot,
String signature,
byte[] annotations,
byte[] parameterAnnotations)
@@ -305,15 +305,15 @@
* the same if they were declared by the same class and have the
* same formal parameter types.
*/
public boolean equals(Object obj) {
if (obj != null && obj instanceof Constructor) {
- Constructor other = (Constructor)obj;
+ Constructor<?> other = (Constructor<?>)obj;
if (getDeclaringClass() == other.getDeclaringClass()) {
/* Avoid unnecessary cloning */
- Class[] params1 = parameterTypes;
- Class[] params2 = other.parameterTypes;
+ Class<?>[] params1 = parameterTypes;
+ Class<?>[] params2 = other.parameterTypes;
if (params1.length == params2.length) {
for (int i = 0; i < params1.length; i++) {
if (params1[i] != params2[i])
return false;
}
@@ -355,18 +355,18 @@
if (mod != 0) {
sb.append(Modifier.toString(mod) + " ");
}
sb.append(Field.getTypeName(getDeclaringClass()));
sb.append("(");
- Class[] params = parameterTypes; // avoid clone
+ Class<?>[] params = parameterTypes; // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(Field.getTypeName(params[j]));
if (j < (params.length - 1))
sb.append(",");
}
sb.append(")");
- Class[] exceptions = exceptionTypes; // avoid clone
+ Class<?>[] exceptions = exceptionTypes; // avoid clone
if (exceptions.length > 0) {
sb.append(" throws ");
for (int k = 0; k < exceptions.length; k++) {
sb.append(exceptions[k].getName());
if (k < (exceptions.length - 1))
@@ -450,11 +450,11 @@
Type[] exceptions = getGenericExceptionTypes();
if (exceptions.length > 0) {
sb.append(" throws ");
for (int k = 0; k < exceptions.length; k++) {
sb.append((exceptions[k] instanceof Class)?
- ((Class)exceptions[k]).getName():
+ ((Class<?>)exceptions[k]).getName():
exceptions[k].toString());
if (k < (exceptions.length - 1))
sb.append(",");
}
}
@@ -516,11 +516,11 @@
throws InstantiationException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException
{
if (!override) {
if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
- Class caller = Reflection.getCallerClass(2);
+ Class<?> caller = Reflection.getCallerClass(2);
if (securityCheckCache != caller) {
Reflection.ensureMemberAccess(caller, clazz, null, modifiers);
securityCheckCache = caller;
}
}
@@ -623,13 +623,13 @@
*/
public Annotation[] getDeclaredAnnotations() {
return AnnotationParser.toArray(declaredAnnotations());
}
- private transient Map<Class, Annotation> declaredAnnotations;
+ private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations;
- private synchronized Map<Class, Annotation> declaredAnnotations() {
+ private synchronized Map<Class<? extends Annotation>, Annotation> declaredAnnotations() {
if (declaredAnnotations == null) {
declaredAnnotations = AnnotationParser.parseAnnotations(
annotations, sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
getDeclaringClass());