Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: reflect.c 8318 2007-08-16 10:05:34Z michi $
+ $Id: reflect.c 8322 2007-08-16 15:54:38Z twisti $
*/
java_handle_t *o;
java_lang_reflect_Constructor *rc;
int32_t slot;
- java_handle_bytearray_t *annotations = NULL;
- java_handle_bytearray_t *parameterAnnotations = NULL;
/* get declaring class */
slot = m - c->methods;
-#if defined(ENABLE_ANNOTATIONS)
- /* get annotations */
-
- annotations = method_get_annotations(m);
-
- /* get parameter annotations */
-
- parameterAnnotations = method_get_parameterannotations(m);
-#endif
-
#if defined(WITH_CLASSPATH_GNU)
LLNI_field_set_cls(rc, clazz , c);
LLNI_field_set_val(rc, slot , slot);
- LLNI_field_set_ref(rc, annotations , annotations);
- LLNI_field_set_ref(rc, parameterAnnotations, parameterAnnotations);
+ LLNI_field_set_ref(rc, annotations , method_get_annotations(m));
+ LLNI_field_set_ref(rc, parameterAnnotations, method_get_parameterannotations(m));
#elif defined(WITH_CLASSPATH_SUN)
LLNI_field_set_val(rc, modifiers , m->flags & ACC_CLASS_REFLECT_MASK);
LLNI_field_set_val(rc, slot , slot);
LLNI_field_set_ref(rc, signature , m->signature ? (java_lang_String *) javastring_new(m->signature) : NULL);
- LLNI_field_set_ref(rc, annotations , annotations);
- LLNI_field_set_ref(rc, parameterAnnotations, parameterAnnotations);
+ LLNI_field_set_ref(rc, annotations , method_get_annotations(m));
+ LLNI_field_set_ref(rc, parameterAnnotations, method_get_parameterannotations(m));
#else
# error unknown classpath configuration
java_handle_t *o;
java_lang_reflect_Field *rf;
int32_t slot;
- java_handle_bytearray_t *annotations = NULL;
/* get declaring class */
slot = f - c->fields;
-#if defined(ENABLE_ANNOTATIONS)
- /* get annotations */
-
- annotations = field_get_annotations(f);
-#endif
-
#if defined(WITH_CLASSPATH_GNU)
LLNI_field_set_cls(rf, clazz , c);
LLNI_field_set_ref(rf, name , _Jv_java_lang_String_intern((java_lang_String *) javastring_new(f->name)));
LLNI_field_set_val(rf, slot , slot);
- LLNI_field_set_ref(rf, annotations , annotations);
+ LLNI_field_set_ref(rf, annotations , field_get_annotations(f));
#elif defined(WITH_CLASSPATH_SUN)
LLNI_field_set_val(rf, modifiers , f->flags);
LLNI_field_set_val(rf, slot , slot);
LLNI_field_set_ref(rf, signature , f->signature ? (java_lang_String *) javastring_new(f->signature) : NULL);
- LLNI_field_set_ref(rf, annotations , annotations);
+ LLNI_field_set_ref(rf, annotations , field_get_annotations(f));
#else
# error unknown classpath configuration
java_handle_t *o;
java_lang_reflect_Method *rm;
int32_t slot;
- java_handle_bytearray_t *annotations = NULL;
- java_handle_bytearray_t *parameterAnnotations = NULL;
- java_handle_bytearray_t *annotationDefault = NULL;
/* get declaring class */
slot = m - c->methods;
-#if defined(ENABLE_ANNOTATIONS)
- /* get annotations */
-
- annotations = method_get_annotations(m);
-
- /* get parameter annotations */
-
- parameterAnnotations = method_get_parameterannotations(m);
-
- /* get annotation default value */
-
- annotationDefault = method_get_annotationdefault(m);
-#endif
-
#if defined(WITH_CLASSPATH_GNU)
LLNI_field_set_cls(rm, clazz , m->class);
LLNI_field_set_ref(rm, name , _Jv_java_lang_String_intern((java_lang_String *) javastring_new(m->name)));
LLNI_field_set_val(rm, slot , slot);
- LLNI_field_set_ref(rm, annotations , annotations);
- LLNI_field_set_ref(rm, parameterAnnotations, parameterAnnotations);
- LLNI_field_set_ref(rm, annotationDefault , annotationDefault);
+ LLNI_field_set_ref(rm, annotations , method_get_annotations(m));
+ LLNI_field_set_ref(rm, parameterAnnotations, method_get_parameterannotations(m));
+ LLNI_field_set_ref(rm, annotationDefault , method_get_annotationdefault(m));
#elif defined(WITH_CLASSPATH_SUN)
LLNI_field_set_val(rm, modifiers , m->flags & ACC_CLASS_REFLECT_MASK);
LLNI_field_set_val(rm, slot , slot);
LLNI_field_set_ref(rm, signature , m->signature ? (java_lang_String *) javastring_new(m->signature) : NULL);
- LLNI_field_set_ref(rm, annotations , annotations);
- LLNI_field_set_ref(rm, parameterAnnotations, parameterAnnotations);
- LLNI_field_set_ref(rm, annotationDefault , annotationDefault);
+ LLNI_field_set_ref(rm, annotations , method_get_annotations(m));
+ LLNI_field_set_ref(rm, parameterAnnotations, method_get_parameterannotations(m));
+ LLNI_field_set_ref(rm, annotationDefault , method_get_annotationdefault(m));
#else
# error unknown classpath configuration
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: method.c 8318 2007-08-16 10:05:34Z michi $
+ $Id: method.c 8322 2007-08-16 15:54:38Z twisti $
*/
}
-#if defined(ENABLE_ANNOTATIONS)
/* method_get_annotations ******************************************************
Gets a methods' annotations (or NULL if none).
*******************************************************************************/
-java_bytearray *method_get_annotations(methodinfo *m)
+java_handle_bytearray_t *method_get_annotations(methodinfo *m)
{
- classinfo *c = m->class;
- int slot = m - c->methods;
- annotation_bytearray_t *ba = NULL;
- java_bytearray *annotations = NULL;
+#if defined(ENABLE_ANNOTATIONS)
+ classinfo *c;
+ int slot;
+ annotation_bytearray_t *ba;
+ java_handle_bytearray_t *annotations;
+
+ c = m->class;
+ slot = m - c->methods;
+ annotations = NULL;
if (c->method_annotations != NULL && c->method_annotations->size > slot) {
ba = c->method_annotations->data[slot];
}
return annotations;
+#else
+ return NULL;
+#endif
}
*******************************************************************************/
-java_bytearray *method_get_parameterannotations(methodinfo *m)
+java_handle_bytearray_t *method_get_parameterannotations(methodinfo *m)
{
- classinfo *c = m->class;
- int slot = m - c->methods;
- annotation_bytearray_t *ba = NULL;
- java_bytearray *parameterAnnotations = NULL;
+#if defined(ENABLE_ANNOTATIONS)
+ classinfo *c;
+ int slot;
+ annotation_bytearray_t *ba;
+ java_handle_bytearray_t *parameterAnnotations;
+
+ c = m->class;
+ slot = m - c->methods;
+ parameterAnnotations = NULL;
if (c->method_parameterannotations != NULL &&
c->method_parameterannotations->size > slot) {
}
return parameterAnnotations;
+#else
+ return NULL;
+#endif
}
*******************************************************************************/
-java_bytearray *method_get_annotationdefault(methodinfo *m)
+java_handle_bytearray_t *method_get_annotationdefault(methodinfo *m)
{
- classinfo *c = m->class;
- int slot = m - c->methods;
- annotation_bytearray_t *ba = NULL;
- java_bytearray *annotationDefault = NULL;
+#if defined(ENABLE_ANNOTATIONS)
+ classinfo *c;
+ int slot;
+ annotation_bytearray_t *ba;
+ java_handle_bytearray_t *annotationDefault;
+
+ c = m->class;
+ slot = m - c->methods;
+ annotationDefault = NULL;
if (c->method_annotationdefaults != NULL &&
c->method_annotationdefaults->size > slot) {
}
return annotationDefault;
-}
+#else
+ return NULL;
#endif
+}
/* method_add_to_worklist ******************************************************