Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: method.c 8295 2007-08-11 17:57:24Z michi $
+ $Id: method.c 8315 2007-08-15 22:49:20Z panzi $
*/
*******************************************************************************/
-annotation_bytearray_t *method_get_annotations(methodinfo *m)
+java_bytearray *method_get_annotations(methodinfo *m)
{
- classinfo *c = m->class;
- int slot = m - c->methods;
-
+ classinfo *c = m->class;
+ int slot = m - c->methods;
+ annotation_bytearray_t *ba = NULL;
+ java_bytearray *annotations = NULL;
+
if (c->method_annotations != NULL && c->method_annotations->size > slot) {
- return c->method_annotations->data[slot];
+ ba = c->method_annotations->data[slot];
+
+ if (ba != NULL) {
+ annotations = builtin_newarray_byte(ba->size);
+
+ if (annotations != NULL) {
+ MCOPY(annotations->data, ba->data, uint8_t, ba->size);
+ }
+ }
}
-
- return NULL;
+
+ return annotations;
}
*******************************************************************************/
-annotation_bytearray_t *method_get_parameterannotations(methodinfo *m)
+java_bytearray *method_get_parameterannotations(methodinfo *m)
{
- classinfo *c = m->class;
- int slot = m - c->methods;
+ classinfo *c = m->class;
+ int slot = m - c->methods;
+ annotation_bytearray_t *ba = NULL;
+ java_bytearray *parameterAnnotations = NULL;
if (c->method_parameterannotations != NULL &&
c->method_parameterannotations->size > slot) {
- return c->method_parameterannotations->data[slot];
+ ba = c->method_parameterannotations->data[slot];
+
+ if (ba != NULL) {
+ parameterAnnotations = builtin_newarray_byte(ba->size);
+
+ if (parameterAnnotations != NULL) {
+ MCOPY(parameterAnnotations->data, ba->data, uint8_t, ba->size);
+ }
+ }
}
-
- return NULL;
+
+ return parameterAnnotations;
}
*******************************************************************************/
-annotation_bytearray_t *method_get_annotationdefault(methodinfo *m)
+java_bytearray *method_get_annotationdefault(methodinfo *m)
{
- classinfo *c = m->class;
- int slot = m - c->methods;
+ classinfo *c = m->class;
+ int slot = m - c->methods;
+ annotation_bytearray_t *ba = NULL;
+ java_bytearray *annotationDefault = NULL;
if (c->method_annotationdefaults != NULL &&
c->method_annotationdefaults->size > slot) {
- return c->method_annotationdefaults->data[slot];
+ ba = c->method_annotationdefaults->data[slot];
+
+ if (ba != NULL) {
+ annotationDefault = builtin_newarray_byte(ba->size);
+
+ if (annotationDefault != NULL) {
+ MCOPY(annotationDefault->data, ba->data, uint8_t, ba->size);
+ }
+ }
}
-
- return NULL;
+
+ return annotationDefault;
}
#endif