src/share/classes/java/lang/reflect/Field.java
Print this page
@@ -56,16 +56,16 @@
* @author Nakul Saraiya
*/
public final
class Field extends AccessibleObject implements Member {
- private Class clazz;
+ private Class<?> clazz;
private int slot;
// This is guaranteed to be interned by the VM in the 1.4
// reflection implementation
private String name;
- private Class type;
+ private Class<?> type;
private int modifiers;
// Generics and annotations support
private transient String signature;
// generic info repository; lazily initialized
private transient FieldRepository genericInfo;
@@ -79,12 +79,12 @@
// potentially many Field objects pointing to it.)
private Field root;
// More complicated security check cache needed here than for
// Class.newInstance() and Constructor.newInstance()
- private Class securityCheckCache;
- private Class securityCheckTargetClassCache;
+ private Class<?> securityCheckCache;
+ private Class<?> securityCheckTargetClassCache;
// Generics infrastructure
private String getGenericSignature() {return signature;}
@@ -110,13 +110,13 @@
/**
* Package-private constructor used by ReflectAccess to enable
* instantiation of these objects in Java code from the java.lang
* package via sun.reflect.LangReflectAccess.
*/
- Field(Class declaringClass,
+ Field(Class<?> declaringClass,
String name,
- Class type,
+ Class<?> type,
int modifiers,
int slot,
String signature,
byte[] annotations)
{
@@ -962,12 +962,12 @@
// routine. The depth of the "getCallerClass" call is hardwired so
// that the compiler can have an easier time if this gets inlined.
private void doSecurityCheck(Object obj) throws IllegalAccessException {
if (!override) {
if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
- Class caller = Reflection.getCallerClass(4);
- Class targetClass = ((obj == null || !Modifier.isProtected(modifiers))
+ Class<?> caller = Reflection.getCallerClass(4);
+ Class<?> targetClass = ((obj == null || !Modifier.isProtected(modifiers))
? clazz
: obj.getClass());
synchronized (this) {
if ((securityCheckCache == caller)
@@ -985,14 +985,14 @@
}
/*
* Utility routine to paper over array type names
*/
- static String getTypeName(Class type) {
+ static String getTypeName(Class<?> type) {
if (type.isArray()) {
try {
- Class cl = type;
+ Class<?> cl = type;
int dimensions = 0;
while (cl.isArray()) {
dimensions++;
cl = cl.getComponentType();
}
@@ -1023,13 +1023,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());