natArray.cc (BooleanClass): New define.

* java/lang/reflect/natArray.cc (BooleanClass): New define.
	(get): Ensure Boolean class is initialized.
	* java/lang/reflect/natField.cc (BooleanClass): New define.
	(get): Ensure Boolean class is initialized.

From-SVN: r36391
This commit is contained in:
Tom Tromey 2000-09-13 18:15:42 +00:00 committed by Tom Tromey
parent 1ca04dc8b6
commit 96fa18eb49
3 changed files with 27 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2000-09-13 Tom Tromey <tromey@cygnus.com>
* java/lang/reflect/natArray.cc (BooleanClass): New define.
(get): Ensure Boolean class is initialized.
* java/lang/reflect/natField.cc (BooleanClass): New define.
(get): Ensure Boolean class is initialized.
2000-09-13 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/String.java (CASE_INSENSITIVE_ORDER): New static field.

View File

@ -25,6 +25,9 @@ details. */
#include <java/lang/Boolean.h>
#include <java/lang/Character.h>
#define BooleanClass _CL_Q34java4lang7Boolean
extern java::lang::Class BooleanClass;
jobject
java::lang::reflect::Array::newInstance (jclass componentType, jint length)
{
@ -211,10 +214,13 @@ java::lang::reflect::Array::get (jobject array, jint index)
if (elementType == JvPrimClass (char))
return new java::lang::Character (elements ((jcharArray) array) [index]);
if (elementType == JvPrimClass (boolean))
if (elements ((jbooleanArray) array) [index])
return java::lang::Boolean::TRUE;
else
return java::lang::Boolean::FALSE;
{
_Jv_InitClass (&BooleanClass);
if (elements ((jbooleanArray) array) [index])
return java::lang::Boolean::TRUE;
else
return java::lang::Boolean::FALSE;
}
JvThrow (new java::lang::IllegalArgumentException());
}

View File

@ -26,6 +26,9 @@ details. */
#include <java/lang/Boolean.h>
#include <java/lang/Character.h>
#define BooleanClass _CL_Q34java4lang7Boolean
extern java::lang::Class BooleanClass;
jint
java::lang::reflect::Field::getModifiers ()
{
@ -251,10 +254,13 @@ java::lang::reflect::Field::get (jclass caller, jobject obj)
if (fld->type == JvPrimClass (char))
return new java::lang::Character (* (jchar*) addr);
if (fld->type == JvPrimClass (boolean))
if (* (jboolean*) addr)
return java::lang::Boolean::TRUE;
else
return java::lang::Boolean::FALSE;
{
_Jv_InitClass (&BooleanClass);
if (* (jboolean*) addr)
return java::lang::Boolean::TRUE;
else
return java::lang::Boolean::FALSE;
}
JvThrow (new java::lang::IllegalArgumentException());
}