imm_union value;
java_handle_t *o;
+ if (a == NULL) {
+ exceptions_throw_nullpointerexception();
+ return NULL;
+ }
+
v = LLNI_vftbl_direct(a);
type = v->arraydesc->arraytype;
int type;
imm_union value;
+ if (a == NULL) {
+ exceptions_throw_nullpointerexception();
+ value.a = NULL;
+ return value;
+ }
+
v = LLNI_vftbl_direct(a);
type = v->arraydesc->arraytype;
vftbl_t *v;
int type;
+ if (a == NULL) {
+ exceptions_throw_nullpointerexception();
+ return;
+ }
+
v = LLNI_vftbl_direct(a);
type = v->arraydesc->arraytype;
\
size = LLNI_array_size(a); \
\
- if ((index < 0) || (index > size)) { \
+ if ((index < 0) || (index >= size)) { \
exceptions_throw_arrayindexoutofboundsexception(); \
return (type) 0; \
} \
size = LLNI_array_size(a);
- if ((index < 0) || (index > size)) {
+ if ((index < 0) || (index >= size)) {
exceptions_throw_arrayindexoutofboundsexception();
return NULL;
}
\
size = LLNI_array_size(a); \
\
- if ((index < 0) || (index > size)) { \
+ if ((index < 0) || (index >= size)) { \
exceptions_throw_arrayindexoutofboundsexception(); \
return; \
} \
return;
}
+ /* Sanity check. */
+
+ assert(a->header.objheader.vftbl->arraydesc->arraytype == ARRAYTYPE_OBJECT);
+
+ if (value != NULL) {
+ if (builtin_canstore(a, value) == false) {
+ exceptions_throw_illegalargumentexception();
+ return;
+ }
+ }
+
size = LLNI_array_size(a);
- if ((index < 0) || (index > size)) {
+ if ((index < 0) || (index >= size)) {
exceptions_throw_arrayindexoutofboundsexception();
return;
}
Returns a the length of the given Java array.
+ ARGUMENTS:
+ a ... Java array
+
+ RETURN VALUE:
+ -1 ... exception thrown
+ >= 0 ... length of the Java array
+
*******************************************************************************/
int32_t array_length_get(java_handle_t *a)
if (a == NULL) {
exceptions_throw_nullpointerexception();
- return 0;
+ return -1;
}
LLNI_class_get(a, c);
if (!class_is_array(c)) {
/* exceptions_throw_illegalargumentexception("Argument is not an array"); */
exceptions_throw_illegalargumentexception();
- return 0;
+ return -1;
}
size = LLNI_array_size(a);