(declaredAnnotations): Added generic type parameters to Class.
* src/lib/gnu/java/lang/reflect/Field.java
(declaredAnnotations): Added generic type parameters to Class.
* src/lib/gnu/java/lang/reflect/Constructor.java
(declaredAnnotations): Added generic type parameters to Class.
* src/lib/gnu/sun/reflect/annotation/AnnotationParser.java: Fixed formatting.
* src/native/vm/gnu/sun_reflect_ConstantPool.c
(Java_sun_reflect_ConstantPool_getMemberRefInfoAt0):
Fixed formatting of log output.
* src/native/vm/gnu/java_lang_reflect_Method.c
(Java_java_lang_reflect_Method_getDefaultValue),
(Java_java_lang_reflect_Method_declaredAnnotations),
(Java_java_lang_reflect_Method_getParameterAnnotations):
Use LLNI_class_get macro.
* src/native/vm/gnu/java_lang_reflect_Field.c
(Java_java_lang_reflect_Method_declaredAnnotations):
Use LLNI_class_get macro.
* src/native/vm/gnu/java_lang_reflect_Constructor.c
(Java_java_lang_reflect_Method_declaredAnnotations),
(Java_java_lang_reflect_Method_getParameterAnnotations):
Use LLNI_class_get macro.
* src/native/vm/sun/jvm.c
(JVM_GetClassConstantPool): Fixed formatting of log output.
* src/native/vm/reflect.c
(reflect_get_declaredannotatios): Fixed comment.
* src/vmcore/class.h
(classinfo): Added comments for annottation fields.
* src/vmcore/annotation.h
(annotation_t), (element_value_t): Removed unused structs.
private int slot;
private byte[] annotations = null;
private byte[] parameterAnnotations = null;
- private transient Map<Class, Annotation> declaredAnnotations = null;
+ private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations = null;
private static final int CONSTRUCTOR_MODIFIERS
= Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC;
/**
* @since 1.5
*/
- public Annotation[] getDeclaredAnnotations() {
+ public Annotation[] getDeclaredAnnotations() {
return declaredAnnotations().values().toArray(EMPTY_ANNOTATIONS_ARRAY);
}
- private synchronized native Map<Class, Annotation> declaredAnnotations();
+ private synchronized native Map<Class<? extends Annotation>, Annotation> declaredAnnotations();
/**
* Returns an array of arrays that represent the annotations on the formal
private String name;
private int slot;
private byte[] annotations = null;
- private transient Map<Class, Annotation> declaredAnnotations = null;
+ private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations = null;
private static final int FIELD_MODIFIERS
= Modifier.FINAL | Modifier.PRIVATE | Modifier.PROTECTED
/**
* @since 1.5
*/
- public Annotation[] getDeclaredAnnotations() {
+ public Annotation[] getDeclaredAnnotations() {
return declaredAnnotations().values().toArray(EMPTY_ANNOTATIONS_ARRAY);
}
- private synchronized native Map<Class, Annotation> declaredAnnotations();
+ private synchronized native Map<Class<? extends Annotation>, Annotation> declaredAnnotations();
}
private byte[] annotations = null;
private byte[] parameterAnnotations = null;
private byte[] annotationDefault = null;
- private transient Map<Class, Annotation> declaredAnnotations = null;
+ private transient Map<Class<? extends Annotation>, Annotation> declaredAnnotations = null;
private static final int METHOD_MODIFIERS
= Modifier.ABSTRACT | Modifier.FINAL | Modifier.NATIVE
/**
* @since 1.5
*/
- public Annotation[] getDeclaredAnnotations() {
+ public Annotation[] getDeclaredAnnotations() {
return declaredAnnotations().values().toArray(EMPTY_ANNOTATIONS_ARRAY);
}
- private synchronized native Map<Class, Annotation> declaredAnnotations();
+ private synchronized native Map<Class<? extends Annotation>, Annotation> declaredAnnotations();
/**
* Returns an array of arrays that represent the annotations on the formal
public static Annotation[][] parseParameterAnnotations(
byte[] parameterAnnotations,
ConstantPool constPool,
- Class container,
- int numParameters) {
+ Class container,
+ int numParameters) {
if (parameterAnnotations == null)
return new Annotation[numParameters][0];
private static Class<?> parseSig(String sig, Class container) {
if (sig.equals("V")) {
return void.class;
- }
- else {
+ }
+ else {
return toClass(new FieldSignatureParser(container, sig).getFieldType());
- }
+ }
}
static Class<?> toClass(Type o) {
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_reflect_Constructor.c 8326 2007-08-16 17:45:49Z twisti $
+ $Id: java_lang_reflect_Constructor.c 8393 2007-08-22 01:10:09Z panzi $
*/
struct java_util_Map *declaredAnnotations = NULL;
java_handle_bytearray_t *annotations = NULL;
java_lang_Class *declaringClass = NULL;
+ classinfo *referer = NULL;
LLNI_field_get_ref(this, declaredAnnotations, declaredAnnotations);
if (declaredAnnotations == NULL) {
LLNI_field_get_val(this, annotations, annotations);
LLNI_field_get_ref(this, clazz, declaringClass);
+ LLNI_class_get(this, referer);
- declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, o->vftbl->class);
+ declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, referer);
LLNI_field_set_ref(this, declaredAnnotations, declaredAnnotations);
}
java_handle_bytearray_t *parameterAnnotations = NULL;
int32_t slot = -1;
java_lang_Class *declaringClass = NULL;
+ classinfo *referer = NULL;
LLNI_field_get_ref(this, parameterAnnotations, parameterAnnotations);
LLNI_field_get_val(this, slot, slot);
LLNI_field_get_ref(this, clazz, declaringClass);
+ LLNI_class_get(this, referer);
- return reflect_get_parameterannotations((java_handle_t*)parameterAnnotations, slot, declaringClass, o->vftbl->class);
+ return reflect_get_parameterannotations((java_handle_t*)parameterAnnotations, slot, declaringClass, referer);
}
#endif
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_reflect_Field.c 8343 2007-08-17 21:39:32Z michi $
+ $Id: java_lang_reflect_Field.c 8393 2007-08-22 01:10:09Z panzi $
*/
struct java_util_Map *declaredAnnotations = NULL;
java_handle_bytearray_t *annotations = NULL;
java_lang_Class *declaringClass = NULL;
+ classinfo *referer = NULL;
LLNI_field_get_ref(this, declaredAnnotations, declaredAnnotations);
if (declaredAnnotations == NULL) {
LLNI_field_get_val(this, annotations, annotations);
LLNI_field_get_ref(this, clazz, declaringClass);
+ LLNI_class_get(this, referer);
- declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, o->vftbl->class);
+ declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, referer);
LLNI_field_set_ref(this, declaredAnnotations, declaredAnnotations);
}
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_reflect_Method.c 8343 2007-08-17 21:39:32Z michi $
+ $Id: java_lang_reflect_Method.c 8393 2007-08-22 01:10:09Z panzi $
*/
sun_reflect_ConstantPool *constantPool = NULL;
java_handle_t *o = (java_handle_t*)this;
java_lang_Class *constantPoolOop = NULL;
+ classinfo *referer = NULL;
if (this == NULL) {
exceptions_throw_nullpointerexception();
return NULL;
}
+ LLNI_class_get(this, referer);
+
m_parseAnnotationDefault = class_resolveclassmethod(
class_sun_reflect_annotation_AnnotationParser,
utf_parseAnnotationDefault,
utf_desc,
- o->vftbl->class,
+ referer,
true);
- if (m_parseAnnotationDefault == NULL)
- {
+ if (m_parseAnnotationDefault == NULL) {
/* method not found */
return NULL;
}
struct java_util_Map *declaredAnnotations = NULL;
java_handle_bytearray_t *annotations = NULL;
java_lang_Class *declaringClass = NULL;
+ classinfo *referer = NULL;
LLNI_field_get_ref(this, declaredAnnotations, declaredAnnotations);
if (declaredAnnotations == NULL) {
LLNI_field_get_val(this, annotations, annotations);
LLNI_field_get_ref(this, clazz, declaringClass);
+ LLNI_class_get(this, referer);
- declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, o->vftbl->class);
+ declaredAnnotations = reflect_get_declaredannotatios(annotations, declaringClass, referer);
LLNI_field_set_ref(this, declaredAnnotations, declaredAnnotations);
}
java_handle_bytearray_t *parameterAnnotations = NULL;
int32_t slot = -1;
java_lang_Class *declaringClass = NULL;
+ classinfo *referer = NULL;
LLNI_field_get_ref(this, parameterAnnotations, parameterAnnotations);
LLNI_field_get_val(this, slot, slot);
LLNI_field_get_ref(this, clazz, declaringClass);
+ LLNI_class_get(this, referer);
- return reflect_get_parameterannotations((java_handle_t*)parameterAnnotations, slot, declaringClass, o->vftbl->class);
+ return reflect_get_parameterannotations((java_handle_t*)parameterAnnotations, slot, declaringClass, referer);
}
#endif
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: sun_reflect_ConstantPool.c 8346 2007-08-17 22:13:31Z twisti $
+ $Id: sun_reflect_ConstantPool.c 8393 2007-08-22 01:10:09Z panzi $
*/
*/
JNIEXPORT java_handle_objectarray_t* JNICALL Java_sun_reflect_ConstantPool_getMemberRefInfoAt0(JNIEnv *env, struct sun_reflect_ConstantPool* this, struct java_lang_Object* jcpool, int32_t index)
{
- log_println("Java_sun_reflect_ConstantPool_getMemberRefInfoAt0: jcpool=%p, index=%d, IMPLEMENT ME!", jcpool, index);
+ log_println("Java_sun_reflect_ConstantPool_getMemberRefInfoAt0(env=%p, jcpool=%p, index=%d): IMPLEMENT ME!", env, jcpool, index);
return NULL;
}
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: reflect.c 8357 2007-08-19 22:59:43Z twisti $
+ $Id: reflect.c 8393 2007-08-22 01:10:09Z panzi $
*/
#if defined(WITH_CLASSPATH_GNU) && defined(ENABLE_ANNOTATIONS)
/* reflect_get_declaredannotatios *********************************************
- Returns a java.util.Map<Class, Annotation> of the declared
- annotations.
+ Returns a java.util.Map<Class<? extends Annotation>, Annotation>
+ of the declared annotations.
*******************************************************************************/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: jvm.c 8387 2007-08-21 15:37:47Z twisti $
+ $Id: jvm.c 8393 2007-08-22 01:10:09Z panzi $
*/
sun_reflect_ConstantPool *constantPool = NULL;
java_lang_Object *constantPoolOop = (java_lang_Object*)cls;
- TRACEJVMCALLS("JVM_GetClassConstantPool: cls=%p", cls);
-
- assert(cls != NULL);
+ TRACEJVMCALLS("JVM_GetClassConstantPool(env=%p, cls=%p)", env, cls);
constantPool =
(sun_reflect_ConstantPool*)native_new_and_init(
return (jobject)constantPool;
#else
- log_println("JVM_GetClassConstantPool: cls=%p, not implemented in this configuration!", cls);
+ log_println("JVM_GetClassConstantPool(env=%p, cls=%p): not implemented in this configuration!", env, cls);
return NULL;
#endif
}
uint8_t data[1];
};
+
/* annotation_bytearrays ******************************************************/
struct annotation_bytearrays_t {
annotation_bytearray_t *data[1];
};
-/* annotation *****************************************************************/
-
-struct annotation_t {
- utf *type;
- s4 element_valuescount;
- element_value_t *element_values;
-};
-
-/* element_value **************************************************************/
-
-struct element_value_t {
- utf *name;
- u1 tag;
-};
-
/* function prototypes ********************************************************/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: class.h 8387 2007-08-21 15:37:47Z twisti $
+ $Id: class.h 8393 2007-08-22 01:10:09Z panzi $
*/
#if defined(ENABLE_JAVASE)
utf *signature; /* Signature attribute */
#if defined(ENABLE_ANNOTATIONS)
- annotation_bytearray_t *annotations;
+ /* all the anntation attributes are NULL (and not a zero length array)
+ if there is nothing */
+ annotation_bytearray_t *annotations; /* annotations of this class */
- annotation_bytearrays_t *method_annotations;
- annotation_bytearrays_t *method_parameterannotations;
- annotation_bytearrays_t *method_annotationdefaults;
-
- annotation_bytearrays_t *field_annotations;
+ annotation_bytearrays_t *method_annotations; /* array of annotations for */
+ /* the methods */
+ annotation_bytearrays_t *method_parameterannotations; /* array of */
+ /* parameter annotations for the methods */
+ annotation_bytearrays_t *method_annotationdefaults; /* array for */
+ /* annotation default values for the */
+ /* methods */
+
+ annotation_bytearrays_t *field_annotations; /* array of annotations for */
+ /* the fields */
#endif
#endif
classloader *classloader; /* NULL for bootstrap classloader */