/** Get the annotation default value for an annotation method */ @Pure public Object getAnnotationDefault() { synchronized (annotationDefaults) { Object value = annotationDefaults.get(this); if (value instanceof TypeReference || value instanceof Object[]) { value = RVMAnnotation.firstUse(value); annotationDefaults.put(this, value); } return value; } }
/** * Construct a read method * * @param declaringClass the RVMClass object of the class that declared this field * @param memRef the canonical memberReference for this method. * @param modifiers modifiers associated with this method. * @param exceptionTypes exceptions thrown by this method. * @param signature generic type of this method. * @param annotations array of runtime visible annotations * @param parameterAnnotations array of runtime visible parameter annotations * @param annotationDefault value for this annotation that appears */ protected RVMMethod( TypeReference declaringClass, MemberReference memRef, short modifiers, TypeReference[] exceptionTypes, Atom signature, RVMAnnotation[] annotations, RVMAnnotation[][] parameterAnnotations, Object annotationDefault) { super( declaringClass, memRef, (short) (modifiers & APPLICABLE_TO_METHODS), signature, annotations); if (parameterAnnotations != null) { synchronized (RVMMethod.parameterAnnotations) { RVMMethod.parameterAnnotations.put(this, parameterAnnotations); } } if (exceptionTypes != null) { synchronized (RVMMethod.exceptionTypes) { RVMMethod.exceptionTypes.put(this, exceptionTypes); } } if (annotationDefault != null) { synchronized (annotationDefaults) { annotationDefaults.put(this, annotationDefault); } } }