exception.cc (java_eh_info): Make value type jthrowable.
* exception.cc (java_eh_info): Make value type jthrowable. (_Jv_type_matcher): Remove now unneeded cast. (_Jv_Throw): Make argument type jthrowable. Munge name for SJLJ_EXCEPTIONS here ... * gcj/cni.h: ... not here. (JvThrow): Remove. * gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations. * defineclass.cc, interpret.cc, jni.cc, posix-threads.cc, prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc, gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc, gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc, gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc, java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc, java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc, java/lang/natClass.cc, java/lang/natClassLoader.cc, java/lang/natDouble.cc, java/lang/natObject.cc, java/lang/natPosixProcess.cc, java/lang/natRuntime.cc, java/lang/natString.cc, java/lang/natSystem.cc, java/lang/natThread.cc, java/lang/reflect/natArray.cc, java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc, java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc, java/util/zip/natInflater.cc: Use throw, not JvThrow or _Jv_Throw. From-SVN: r40838
This commit is contained in:
parent
56b8908481
commit
b3208f56cb
36 changed files with 294 additions and 284 deletions
|
@ -378,11 +378,11 @@ java::lang::String::init(jcharArray chars, jint offset, jint count,
|
|||
jboolean dont_copy)
|
||||
{
|
||||
if (! chars)
|
||||
JvThrow (new NullPointerException);
|
||||
throw new NullPointerException;
|
||||
jsize data_size = JvGetArrayLength (chars);
|
||||
if (offset < 0 || count < 0 || offset + count < 0
|
||||
|| offset + count > data_size)
|
||||
JvThrow (new StringIndexOutOfBoundsException());
|
||||
throw new StringIndexOutOfBoundsException;
|
||||
jcharArray array;
|
||||
jchar *pdst;
|
||||
if (! dont_copy)
|
||||
|
@ -408,11 +408,11 @@ java::lang::String::init(jbyteArray ascii, jint hibyte, jint offset,
|
|||
jint count)
|
||||
{
|
||||
if (! ascii)
|
||||
JvThrow (new NullPointerException);
|
||||
throw new NullPointerException;
|
||||
jsize data_size = JvGetArrayLength (ascii);
|
||||
if (offset < 0 || count < 0 || offset + count < 0
|
||||
|| offset + count > data_size)
|
||||
JvThrow (new java::lang::StringIndexOutOfBoundsException());
|
||||
throw new java::lang::StringIndexOutOfBoundsException;
|
||||
jcharArray array = JvNewCharArray(count);
|
||||
jbyte *psrc = elements (ascii) + offset;
|
||||
jchar *pdst = elements (array);
|
||||
|
@ -431,11 +431,11 @@ java::lang::String::init (jbyteArray bytes, jint offset, jint count,
|
|||
jstring encoding)
|
||||
{
|
||||
if (! bytes)
|
||||
JvThrow (new NullPointerException);
|
||||
throw new NullPointerException;
|
||||
jsize data_size = JvGetArrayLength (bytes);
|
||||
if (offset < 0 || count < 0 || offset + count < 0
|
||||
|| offset + count > data_size)
|
||||
JvThrow (new StringIndexOutOfBoundsException);
|
||||
throw new StringIndexOutOfBoundsException;
|
||||
jcharArray array = JvNewCharArray (count);
|
||||
gnu::gcj::convert::BytesToUnicode *converter
|
||||
= gnu::gcj::convert::BytesToUnicode::getDecoder(encoding);
|
||||
|
@ -493,7 +493,7 @@ jchar
|
|||
java::lang::String::charAt(jint i)
|
||||
{
|
||||
if (i < 0 || i >= count)
|
||||
JvThrow (new java::lang::StringIndexOutOfBoundsException());
|
||||
throw new java::lang::StringIndexOutOfBoundsException;
|
||||
return JvGetStringChars(this)[i];
|
||||
}
|
||||
|
||||
|
@ -504,7 +504,7 @@ java::lang::String::getChars(jint srcBegin, jint srcEnd,
|
|||
jint dst_length = JvGetArrayLength (dst);
|
||||
if (srcBegin < 0 || srcBegin > srcEnd || srcEnd > count
|
||||
|| dstBegin < 0 || dstBegin + (srcEnd-srcBegin) > dst_length)
|
||||
JvThrow (new java::lang::StringIndexOutOfBoundsException());
|
||||
throw new java::lang::StringIndexOutOfBoundsException;
|
||||
jchar *dPtr = elements (dst) + dstBegin;
|
||||
jchar *sPtr = JvGetStringChars (this) + srcBegin;
|
||||
jint i = srcEnd-srcBegin;
|
||||
|
@ -554,7 +554,7 @@ java::lang::String::getBytes(jint srcBegin, jint srcEnd,
|
|||
jint dst_length = JvGetArrayLength (dst);
|
||||
if (srcBegin < 0 || srcBegin > srcEnd || srcEnd > count
|
||||
|| dstBegin < 0 || dstBegin + (srcEnd-srcBegin) > dst_length)
|
||||
JvThrow (new java::lang::StringIndexOutOfBoundsException());
|
||||
throw new java::lang::StringIndexOutOfBoundsException;
|
||||
jbyte *dPtr = elements (dst) + dstBegin;
|
||||
jchar *sPtr = JvGetStringChars (this) + srcBegin;
|
||||
jint i = srcEnd-srcBegin;
|
||||
|
@ -745,7 +745,7 @@ jstring
|
|||
java::lang::String::substring (jint beginIndex, jint endIndex)
|
||||
{
|
||||
if (beginIndex < 0 || endIndex > count || beginIndex > endIndex)
|
||||
JvThrow (new StringIndexOutOfBoundsException());
|
||||
throw new StringIndexOutOfBoundsException;
|
||||
if (beginIndex == 0 && endIndex == count)
|
||||
return this;
|
||||
jint newCount = endIndex - beginIndex;
|
||||
|
@ -944,7 +944,7 @@ java::lang::String::valueOf(jcharArray data, jint offset, jint count)
|
|||
{
|
||||
jint data_length = JvGetArrayLength (data);
|
||||
if (offset < 0 || count < 0 || offset+count > data_length)
|
||||
JvThrow (new java::lang::IndexOutOfBoundsException());
|
||||
throw new java::lang::IndexOutOfBoundsException;
|
||||
jstring result = JvAllocString(count);
|
||||
jchar *sPtr = elements (data) + offset;
|
||||
jchar *dPtr = JvGetStringChars(result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue