Commit 666ff4f6 by Mark Wielaard Committed by Tom Tromey

Character.java: Re-merged with Classpath.

2007-03-05  Mark Wielaard  <mark@klomp.org>

	* java/lang/Character.java: Re-merged with Classpath.
	* java/lang/natString.cc (nativeCompareTo): Renamed from
	compareTo.
	* java/lang/StringBuilder.java: Re-merged with Classpath.
	* java/lang/String.java: Re-merged with Classpath.
	(nativeCompareTo): Renamed from compareTo.
	* java/lang/StringBuffer.java: Re-merged with Classpath.
	* jni.cc (_Jv_JNI_GetAnyMethodID): Split calls to append.

From-SVN: r122560
parent b48a4592
2007-03-05 Mark Wielaard <mark@klomp.org>
* java/lang/Character.java: Re-merged with Classpath.
* java/lang/natString.cc (nativeCompareTo): Renamed from
compareTo.
* java/lang/StringBuilder.java: Re-merged with Classpath.
* java/lang/String.java: Re-merged with Classpath.
(nativeCompareTo): Renamed from compareTo.
* java/lang/StringBuffer.java: Re-merged with Classpath.
* jni.cc (_Jv_JNI_GetAnyMethodID): Split calls to append.
2007-03-05 Andrew Haley <aph@redhat.com> 2007-03-05 Andrew Haley <aph@redhat.com>
* java/lang/reflect/natVMProxy.cc (ncode_closure.meth): Delete. * java/lang/reflect/natVMProxy.cc (ncode_closure.meth): Delete.
......
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __java_lang_Character$UnicodeBlock$NameType__
#define __java_lang_Character$UnicodeBlock$NameType__
#pragma interface
#include <java/lang/Enum.h>
#include <gcj/array.h>
class java::lang::Character$UnicodeBlock$NameType : public ::java::lang::Enum
{
Character$UnicodeBlock$NameType(::java::lang::String *, jint);
public:
static JArray< ::java::lang::Character$UnicodeBlock$NameType * > * values();
static ::java::lang::Character$UnicodeBlock$NameType * valueOf(::java::lang::String *);
static ::java::lang::Character$UnicodeBlock$NameType * CANONICAL;
static ::java::lang::Character$UnicodeBlock$NameType * NO_SPACES;
static ::java::lang::Character$UnicodeBlock$NameType * CONSTANT;
private:
static JArray< ::java::lang::Character$UnicodeBlock$NameType * > * ENUM$VALUES;
public:
static ::java::lang::Class class$;
};
#endif // __java_lang_Character$UnicodeBlock$NameType__
...@@ -18,13 +18,12 @@ public: ...@@ -18,13 +18,12 @@ public:
static ::java::lang::Character$UnicodeBlock * of(jchar); static ::java::lang::Character$UnicodeBlock * of(jchar);
static ::java::lang::Character$UnicodeBlock * of(jint); static ::java::lang::Character$UnicodeBlock * of(jint);
static ::java::lang::Character$UnicodeBlock * forName(::java::lang::String *); static ::java::lang::Character$UnicodeBlock * forName(::java::lang::String *);
public: // actually package-private
static JArray< jint > * $SWITCH_TABLE$java$lang$Character$UnicodeBlock$NameType();
private: private:
jint __attribute__((aligned(__alignof__( ::java::lang::Character$Subset)))) start; jint __attribute__((aligned(__alignof__( ::java::lang::Character$Subset)))) start;
jint end; jint end;
::java::lang::String * canonicalName; ::java::lang::String * canonicalName;
static const jint CANONICAL_NAME = 0;
static const jint NO_SPACES_NAME = 1;
static const jint CONSTANT_NAME = 2;
public: public:
static ::java::lang::Character$UnicodeBlock * BASIC_LATIN; static ::java::lang::Character$UnicodeBlock * BASIC_LATIN;
static ::java::lang::Character$UnicodeBlock * LATIN_1_SUPPLEMENT; static ::java::lang::Character$UnicodeBlock * LATIN_1_SUPPLEMENT;
...@@ -154,6 +153,7 @@ public: ...@@ -154,6 +153,7 @@ public:
static ::java::lang::Character$UnicodeBlock * SURROGATES_AREA; static ::java::lang::Character$UnicodeBlock * SURROGATES_AREA;
private: private:
static JArray< ::java::lang::Character$UnicodeBlock * > * sets; static JArray< ::java::lang::Character$UnicodeBlock * > * sets;
static JArray< jint > * $SWITCH_TABLE$java$lang$Character$UnicodeBlock$NameType__;
public: public:
static ::java::lang::Class class$; static ::java::lang::Class class$;
}; };
......
...@@ -34,6 +34,10 @@ public: ...@@ -34,6 +34,10 @@ public:
static jboolean isDefined(jint); static jboolean isDefined(jint);
static jboolean isLetter(jchar); static jboolean isLetter(jchar);
static jboolean isLetter(jint); static jboolean isLetter(jint);
static jint offsetByCodePoints(::java::lang::CharSequence *, jint, jint);
static jint offsetByCodePoints(JArray< jchar > *, jint, jint, jint, jint);
static jint codePointCount(::java::lang::CharSequence *, jint, jint);
static jint codePointCount(JArray< jchar > *, jint, jint);
static jboolean isLetterOrDigit(jchar); static jboolean isLetterOrDigit(jchar);
static jboolean isLetterOrDigit(jint); static jboolean isLetterOrDigit(jint);
static jboolean isJavaLetter(jchar); static jboolean isJavaLetter(jchar);
...@@ -72,8 +76,7 @@ public: ...@@ -72,8 +76,7 @@ public:
static jbyte getDirectionality(jint); static jbyte getDirectionality(jint);
static jboolean isMirrored(jchar); static jboolean isMirrored(jchar);
static jboolean isMirrored(jint); static jboolean isMirrored(jint);
jint compareTo(::java::lang::Character *); jint target$compareTo(::java::lang::Character *);
jint compareTo(::java::lang::Object *);
static ::java::lang::Character * valueOf(jchar); static ::java::lang::Character * valueOf(jchar);
static jchar reverseBytes(jchar); static jchar reverseBytes(jchar);
static JArray< jchar > * toChars(jint); static JArray< jchar > * toChars(jint);
...@@ -91,6 +94,7 @@ public: ...@@ -91,6 +94,7 @@ public:
static jint codePointBefore(JArray< jchar > *, jint); static jint codePointBefore(JArray< jchar > *, jint);
static jint codePointBefore(JArray< jchar > *, jint, jint); static jint codePointBefore(JArray< jchar > *, jint, jint);
static jint codePointBefore(::java::lang::CharSequence *, jint); static jint codePointBefore(::java::lang::CharSequence *, jint);
jint compareTo(::java::lang::Object *);
private: private:
jchar __attribute__((aligned(__alignof__( ::java::lang::Object)))) value; jchar __attribute__((aligned(__alignof__( ::java::lang::Object)))) value;
static const jlong serialVersionUID = 3786198910865385080LL; static const jlong serialVersionUID = 3786198910865385080LL;
...@@ -99,6 +103,15 @@ public: ...@@ -99,6 +103,15 @@ public:
static const jint MAX_RADIX = 36; static const jint MAX_RADIX = 36;
static const jchar MIN_VALUE = 0; static const jchar MIN_VALUE = 0;
static const jchar MAX_VALUE = 65535; static const jchar MAX_VALUE = 65535;
static const jint MIN_CODE_POINT = 0;
static const jint MAX_CODE_POINT = 1114111;
static const jchar MIN_HIGH_SURROGATE = 55296;
static const jchar MAX_HIGH_SURROGATE = 56319;
static const jchar MIN_LOW_SURROGATE = 56320;
static const jchar MAX_LOW_SURROGATE = 57343;
static const jchar MIN_SURROGATE = 55296;
static const jchar MAX_SURROGATE = 57343;
static const jint MIN_SUPPLEMENTARY_CODE_POINT = 65536;
static ::java::lang::Class * TYPE; static ::java::lang::Class * TYPE;
static const jint SIZE = 16; static const jint SIZE = 16;
private: private:
...@@ -160,15 +173,6 @@ private: ...@@ -160,15 +173,6 @@ private:
static const jint NO_BREAK_MASK = 32; static const jint NO_BREAK_MASK = 32;
static const jint MIRROR_MASK = 64; static const jint MIRROR_MASK = 64;
public: public:
static const jint MIN_SUPPLEMENTARY_CODE_POINT = 65536;
static const jint MIN_CODE_POINT = 0;
static const jint MAX_CODE_POINT = 1114111;
static const jchar MIN_HIGH_SURROGATE = 55296;
static const jchar MAX_HIGH_SURROGATE = 56319;
static const jchar MIN_LOW_SURROGATE = 56320;
static const jchar MAX_LOW_SURROGATE = 57343;
static const jchar MIN_SURROGATE = 55296;
static const jchar MAX_SURROGATE = 57343;
static ::java::lang::Class class$; static ::java::lang::Class class$;
}; };
......
...@@ -14,6 +14,7 @@ class java::lang::String$CaseInsensitiveComparator : public ::java::lang::Object ...@@ -14,6 +14,7 @@ class java::lang::String$CaseInsensitiveComparator : public ::java::lang::Object
public: // actually package-private public: // actually package-private
String$CaseInsensitiveComparator(); String$CaseInsensitiveComparator();
public: public:
jint target$compare(::java::lang::String *, ::java::lang::String *);
jint compare(::java::lang::Object *, ::java::lang::Object *); jint compare(::java::lang::Object *, ::java::lang::Object *);
private: private:
static const jlong serialVersionUID = 8575799808933029326LL; static const jlong serialVersionUID = 8575799808933029326LL;
......
...@@ -62,8 +62,10 @@ public: ...@@ -62,8 +62,10 @@ public:
jboolean contentEquals(::java::lang::StringBuffer *); jboolean contentEquals(::java::lang::StringBuffer *);
jboolean contentEquals(::java::lang::CharSequence *); jboolean contentEquals(::java::lang::CharSequence *);
jboolean equalsIgnoreCase(::java::lang::String *); jboolean equalsIgnoreCase(::java::lang::String *);
jint compareTo(::java::lang::String *); jint target$compareTo(::java::lang::String *);
jint compareTo(::java::lang::Object *); private:
jint nativeCompareTo(::java::lang::String *);
public:
jint compareToIgnoreCase(::java::lang::String *); jint compareToIgnoreCase(::java::lang::String *);
jboolean regionMatches(jint, ::java::lang::String *, jint, jint); jboolean regionMatches(jint, ::java::lang::String *, jint, jint);
jboolean regionMatches(jboolean, jint, ::java::lang::String *, jint, jint); jboolean regionMatches(jboolean, jint, ::java::lang::String *, jint, jint);
...@@ -107,15 +109,22 @@ public: ...@@ -107,15 +109,22 @@ public:
static ::java::lang::String * valueOf(jlong); static ::java::lang::String * valueOf(jlong);
static ::java::lang::String * valueOf(jfloat); static ::java::lang::String * valueOf(jfloat);
static ::java::lang::String * valueOf(jdouble); static ::java::lang::String * valueOf(jdouble);
static ::java::lang::String * format(::java::util::Locale *, ::java::lang::String *, JArray< ::java::lang::Object * > *);
static ::java::lang::String * format(::java::lang::String *, JArray< ::java::lang::Object * > *);
::java::lang::String * intern(); ::java::lang::String * intern();
jint codePointCount(jint, jint); jint codePointCount(jint, jint);
jboolean contains(::java::lang::CharSequence *); jboolean contains(::java::lang::CharSequence *);
::java::lang::String * replace(::java::lang::CharSequence *, ::java::lang::CharSequence *); ::java::lang::String * replace(::java::lang::CharSequence *, ::java::lang::CharSequence *);
jint offsetByCodePoints(jint, jint);
jboolean isEmpty();
private: private:
void init(JArray< jchar > *, jint, jint, jboolean); void init(JArray< jchar > *, jint, jint, jboolean);
void init(JArray< jbyte > *, jint, jint, jint); void init(JArray< jbyte > *, jint, jint, jint);
void init(JArray< jbyte > *, jint, jint, ::java::lang::String *); void init(JArray< jbyte > *, jint, jint, ::java::lang::String *);
void init(::gnu::gcj::runtime::StringBuffer *); void init(::gnu::gcj::runtime::StringBuffer *);
public:
jint compareTo(::java::lang::Object *);
private:
static const jlong serialVersionUID = -6849794470754667710LL; static const jlong serialVersionUID = -6849794470754667710LL;
::java::lang::Object * __attribute__((aligned(__alignof__( ::java::lang::Object)))) data; ::java::lang::Object * __attribute__((aligned(__alignof__( ::java::lang::Object)))) data;
jint boffset; jint boffset;
......
...@@ -30,13 +30,13 @@ public: ...@@ -30,13 +30,13 @@ public:
::java::lang::StringBuffer * append(::java::lang::Object *); ::java::lang::StringBuffer * append(::java::lang::Object *);
::java::lang::StringBuffer * append(::java::lang::String *); ::java::lang::StringBuffer * append(::java::lang::String *);
::java::lang::StringBuffer * append(::java::lang::StringBuffer *); ::java::lang::StringBuffer * append(::java::lang::StringBuffer *);
::java::lang::StringBuffer * append(::java::lang::CharSequence *);
::java::lang::StringBuffer * append(::java::lang::CharSequence *, jint, jint);
::java::lang::StringBuffer * append(JArray< jchar > *); ::java::lang::StringBuffer * append(JArray< jchar > *);
::java::lang::StringBuffer * append(JArray< jchar > *, jint, jint); ::java::lang::StringBuffer * append(JArray< jchar > *, jint, jint);
::java::lang::StringBuffer * append(jboolean);
::java::lang::StringBuffer * append(jchar);
::java::lang::StringBuffer * appendCodePoint(jint); ::java::lang::StringBuffer * appendCodePoint(jint);
::java::lang::StringBuffer * append(jboolean);
::java::lang::StringBuffer * target$append(jchar);
::java::lang::StringBuffer * target$append(::java::lang::CharSequence *);
::java::lang::StringBuffer * target$append(::java::lang::CharSequence *, jint, jint);
::java::lang::StringBuffer * append(jint); ::java::lang::StringBuffer * append(jint);
::java::lang::StringBuffer * append(jlong); ::java::lang::StringBuffer * append(jlong);
::java::lang::StringBuffer * append(jfloat); ::java::lang::StringBuffer * append(jfloat);
...@@ -71,6 +71,11 @@ public: ...@@ -71,6 +71,11 @@ public:
private: private:
void ensureCapacity_unsynchronized(jint); void ensureCapacity_unsynchronized(jint);
jboolean regionMatches(jint, ::java::lang::String *); jboolean regionMatches(jint, ::java::lang::String *);
public:
::java::lang::Appendable * append(::java::lang::CharSequence *, jint, jint);
::java::lang::Appendable * append(::java::lang::CharSequence *);
::java::lang::Appendable * append(jchar);
private:
static const jlong serialVersionUID = 3388685877147921107LL; static const jlong serialVersionUID = 3388685877147921107LL;
public: // actually package-private public: // actually package-private
jint __attribute__((aligned(__alignof__( ::java::lang::Object)))) count; jint __attribute__((aligned(__alignof__( ::java::lang::Object)))) count;
......
/* StringBuffer.java -- Growable strings /* StringBuffer.java -- Growable strings
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -72,8 +72,12 @@ import java.io.Serializable; ...@@ -72,8 +72,12 @@ import java.io.Serializable;
* @since 1.0 * @since 1.0
* @status updated to 1.4 * @status updated to 1.4
*/ */
public final class StringBuffer implements Serializable, CharSequence public final class StringBuffer
implements Serializable, CharSequence, Appendable
{ {
// Implementation note: if you change this class, you usually will
// want to change StringBuilder as well.
/** /**
* Compatible with JDK 1.0+. * Compatible with JDK 1.0+.
*/ */
...@@ -152,17 +156,16 @@ public final class StringBuffer implements Serializable, CharSequence ...@@ -152,17 +156,16 @@ public final class StringBuffer implements Serializable, CharSequence
* specified <code>CharSequence</code>. Initial capacity will be the * specified <code>CharSequence</code>. Initial capacity will be the
* size of the CharSequence plus 16. * size of the CharSequence plus 16.
* *
* @param sequence the <code>String</code> to convert * @param seq the <code>String</code> to convert
* @throws NullPointerException if str is null * @throws NullPointerException if str is null
*
* @since 1.5 * @since 1.5
*/ */
public StringBuffer(CharSequence sequence) public StringBuffer(CharSequence seq)
{ {
count = Math.max(0, sequence.length()); count = Math.max(0, seq.length());
value = new char[count + DEFAULT_CAPACITY]; value = new char[count + DEFAULT_CAPACITY];
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
value[i] = sequence.charAt(i); value[i] = seq.charAt(i);
} }
/** /**
...@@ -391,46 +394,6 @@ public final class StringBuffer implements Serializable, CharSequence ...@@ -391,46 +394,6 @@ public final class StringBuffer implements Serializable, CharSequence
} }
/** /**
* Append the <code>CharSequence</code> value of the argument to this
* <code>StringBuffer</code>.
*
* @param sequence the <code>CharSequence</code> to append
* @return this <code>StringBuffer</code>
* @see #append(Object)
* @since 1.5
*/
public synchronized StringBuffer append(CharSequence sequence)
{
if (sequence == null)
sequence = "null";
return append(sequence, 0, sequence.length());
}
/**
* Append the specified subsequence of the <code>CharSequence</code>
* argument to this <code>StringBuffer</code>.
*
* @param sequence the <code>CharSequence</code> to append
* @param start the starting index
* @param end one past the ending index
* @return this <code>StringBuffer</code>
* @see #append(Object)
* @since 1.5
*/
public synchronized StringBuffer append(CharSequence sequence,
int start, int end)
{
if (sequence == null)
sequence = "null";
if (start < 0 || end < 0 || start > end || end > sequence.length())
throw new IndexOutOfBoundsException();
ensureCapacity_unsynchronized(this.count + end - start);
for (int i = start; i < end; ++i)
value[count++] = sequence.charAt(i);
return this;
}
/**
* Append the <code>char</code> array to this <code>StringBuffer</code>. * Append the <code>char</code> array to this <code>StringBuffer</code>.
* This is similar (but more efficient) than * This is similar (but more efficient) than
* <code>append(new String(data))</code>, except in the case of null. * <code>append(new String(data))</code>, except in the case of null.
...@@ -470,6 +433,25 @@ public final class StringBuffer implements Serializable, CharSequence ...@@ -470,6 +433,25 @@ public final class StringBuffer implements Serializable, CharSequence
} }
/** /**
* Append the code point to this <code>StringBuffer</code>.
* This is like #append(char), but will append two characters
* if a supplementary code point is given.
*
* @param code the code point to append
* @return this <code>StringBuffer</code>
* @see Character#toChars(int, char[], int)
* @since 1.5
*/
public synchronized StringBuffer appendCodePoint(int code)
{
int len = Character.charCount(code);
ensureCapacity_unsynchronized(count + len);
Character.toChars(code, value, count);
count += len;
return this;
}
/**
* Append the <code>String</code> value of the argument to this * Append the <code>String</code> value of the argument to this
* <code>StringBuffer</code>. Uses <code>String.valueOf()</code> to convert * <code>StringBuffer</code>. Uses <code>String.valueOf()</code> to convert
* to <code>String</code>. * to <code>String</code>.
...@@ -497,21 +479,41 @@ public final class StringBuffer implements Serializable, CharSequence ...@@ -497,21 +479,41 @@ public final class StringBuffer implements Serializable, CharSequence
} }
/** /**
* Append the code point to this <code>StringBuffer</code>. * Append the <code>CharSequence</code> value of the argument to this
* This is like #append(char), but will append two characters * <code>StringBuffer</code>.
* if a supplementary code point is given.
* *
* @param code the code point to append * @param seq the <code>CharSequence</code> to append
* @return this <code>StringBuffer</code> * @return this <code>StringBuffer</code>
* @see Character#toChars(int, char[], int) * @see #append(Object)
* @since 1.5 * @since 1.5
*/ */
public synchronized StringBuffer appendCodePoint(int code) public synchronized StringBuffer append(CharSequence seq)
{ {
int len = Character.charCount(code); if (seq == null)
ensureCapacity_unsynchronized(count + len); seq = "null";
Character.toChars(code, value, count); return append(seq, 0, seq.length());
count += len; }
/**
* Append the specified subsequence of the <code>CharSequence</code>
* argument to this <code>StringBuffer</code>.
*
* @param seq the <code>CharSequence</code> to append
* @param start the starting index
* @param end one past the ending index
* @return this <code>StringBuffer</code>
* @see #append(Object)
* @since 1.5
*/
public synchronized StringBuffer append(CharSequence seq, int start, int end)
{
if (seq == null)
seq = "null";
if (start < 0 || end < 0 || start > end || end > seq.length())
throw new IndexOutOfBoundsException();
ensureCapacity_unsynchronized(this.count + end - start);
for (int i = start; i < end; ++i)
value[count++] = seq.charAt(i);
return this; return this;
} }
......
...@@ -66,6 +66,10 @@ public: ...@@ -66,6 +66,10 @@ public:
private: private:
jboolean regionMatches(jint, ::java::lang::String *); jboolean regionMatches(jint, ::java::lang::String *);
public: public:
jint codePointAt(jint);
jint codePointBefore(jint);
jint codePointCount(jint, jint);
void trimToSize();
::java::lang::Appendable * append(::java::lang::CharSequence *, jint, jint); ::java::lang::Appendable * append(::java::lang::CharSequence *, jint, jint);
::java::lang::Appendable * append(::java::lang::CharSequence *); ::java::lang::Appendable * append(::java::lang::CharSequence *);
::java::lang::Appendable * append(jchar); ::java::lang::Appendable * append(jchar);
......
/* StringBuilder.java -- Unsynchronized growable strings /* StringBuilder.java -- Unsynchronized growable strings
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -998,4 +998,65 @@ public final class StringBuilder ...@@ -998,4 +998,65 @@ public final class StringBuilder
*/ */
// GCJ LOCAL: Native to access String internals properly. // GCJ LOCAL: Native to access String internals properly.
private native boolean regionMatches(int toffset, String other); private native boolean regionMatches(int toffset, String other);
/**
* Get the code point at the specified index. This is like #charAt(int),
* but if the character is the start of a surrogate pair, and the
* following character completes the pair, then the corresponding
* supplementary code point is returned.
* @param index the index of the codepoint to get, starting at 0
* @return the codepoint at the specified index
* @throws IndexOutOfBoundsException if index is negative or &gt;= length()
* @since 1.5
*/
public int codePointAt(int index)
{
return Character.codePointAt(value, index, count);
}
/**
* Get the code point before the specified index. This is like
* #codePointAt(int), but checks the characters at <code>index-1</code> and
* <code>index-2</code> to see if they form a supplementary code point.
* @param index the index just past the codepoint to get, starting at 0
* @return the codepoint at the specified index
* @throws IndexOutOfBoundsException if index is negative or &gt;= length()
* @since 1.5
*/
public int codePointBefore(int index)
{
// Character.codePointBefore() doesn't perform this check. We
// could use the CharSequence overload, but this is just as easy.
if (index >= count)
throw new IndexOutOfBoundsException();
return Character.codePointBefore(value, index, 1);
}
/**
* Returns the number of Unicode code points in the specified sub sequence.
* Surrogate pairs count as one code point.
* @param beginIndex the start of the subarray
* @param endIndex the index after the last char in the subarray
* @return the number of code points
* @throws IndexOutOfBoundsException if beginIndex is less than zero or
* greater than endIndex or if endIndex is greater than the length of this
* StringBuilder
*/
public int codePointCount(int beginIndex,int endIndex)
{
if (beginIndex < 0 || beginIndex > endIndex || endIndex > count)
throw new IndexOutOfBoundsException("invalid indices: " + beginIndex
+ ", " + endIndex);
return Character.codePointCount(value, beginIndex, endIndex - beginIndex);
}
public void trimToSize()
{
if (count < value.length)
{
char[] newValue = new char[count];
System.arraycopy(value, 0, newValue, 0, count);
value = newValue;
}
}
} }
...@@ -707,7 +707,7 @@ java::lang::String::regionMatches (jint toffset, ...@@ -707,7 +707,7 @@ java::lang::String::regionMatches (jint toffset,
} }
jint jint
java::lang::String::compareTo (jstring anotherString) java::lang::String::nativeCompareTo (jstring anotherString)
{ {
jchar *tptr = JvGetStringChars (this); jchar *tptr = JvGetStringChars (this);
jchar *optr = JvGetStringChars (anotherString); jchar *optr = JvGetStringChars (anotherString);
......
...@@ -751,7 +751,8 @@ _Jv_JNI_GetAnyMethodID (JNIEnv *env, jclass clazz, ...@@ -751,7 +751,8 @@ _Jv_JNI_GetAnyMethodID (JNIEnv *env, jclass clazz,
java::lang::StringBuffer *name_sig = java::lang::StringBuffer *name_sig =
new java::lang::StringBuffer (JvNewStringUTF (name)); new java::lang::StringBuffer (JvNewStringUTF (name));
name_sig->append ((jchar) ' ')->append (JvNewStringUTF (s)); name_sig->append ((jchar) ' ');
name_sig->append (JvNewStringUTF (s));
env->ex = new java::lang::NoSuchMethodError (name_sig->toString ()); env->ex = new java::lang::NoSuchMethodError (name_sig->toString ());
} }
catch (jthrowable t) catch (jthrowable t)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment