Extra tests (and a bug fix).
I've also added a trailing " " to the CHECK/UNIMPLEMENTED macros'
output, to make it more natural for callers to add their own detail.
Change-Id: I59bc51ac54aaff93f37a6b35082301e19db91304
diff --git a/src/object.h b/src/object.h
index 4da6725..da4d6f3 100644
--- a/src/object.h
+++ b/src/object.h
@@ -631,6 +631,7 @@
Thread* self = Thread::Current();
self->ThrowNewException("Ljava/lang/ArrayIndexOutOfBoundsException;",
"length=%i; index=%i", length_, index);
+ return false;
}
return true;
}
@@ -1216,6 +1217,8 @@
template<class T>
class PrimitiveArray : public Array {
public:
+ typedef T ElementType;
+
static PrimitiveArray<T>* Alloc(size_t length);
const T* GetData() const {
@@ -1228,7 +1231,7 @@
T Get(int32_t i) const {
if (!IsValidIndex(i)) {
- return T();
+ return T(0);
}
return GetData()[i];
}
@@ -1281,9 +1284,8 @@
self->ThrowNewException("Ljava/lang/StringIndexOutOfBoundsException;",
"length=%i; index=%i", count_, index);
return 0;
- } else {
- return GetCharArray()->Get(index + GetOffset());
}
+ return GetCharArray()->Get(index + GetOffset());
}
static String* AllocFromUtf16(int32_t utf16_length,