mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
remove GNU Classpath and Apache Harmony compatibility code
Rather than try to support mixing Avian's core classes with those of an external class library -- which necessitates adding a lot of stub methods which throw UnsupportedOperationExceptions, among other comprimises -- we're looking to support such external class libraries in their unmodified forms. The latter strategy has already proven successful with OpenJDK's class library. Thus, this commit removes the stub methods, etc., which not only cleans up the code but avoids misleading application developers as to what classes and methods Avian's built-in class library supports.
This commit is contained in:
@ -13,7 +13,6 @@ package java.lang;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.Comparator;
|
||||
import java.util.Formatter;
|
||||
import java.util.Locale;
|
||||
import java.io.Serializable;
|
||||
import avian.Utf8;
|
||||
@ -507,9 +506,7 @@ public final class String
|
||||
}
|
||||
|
||||
public static String valueOf(int v) {
|
||||
// use Integer.toString(int, int), because GNU Classpath's
|
||||
// Integer.toString(int) just calls String.valueOf(int):
|
||||
return Integer.toString(v, 10);
|
||||
return Integer.toString(v);
|
||||
}
|
||||
|
||||
public static String valueOf(long v) {
|
||||
@ -575,37 +572,4 @@ public final class String
|
||||
public int codePointCount(int start, int end) {
|
||||
return Character.codePointCount(this, start, end);
|
||||
}
|
||||
|
||||
public String replace(CharSequence match, CharSequence replacement) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public String toUpperCase(Locale locale) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public String toLowerCase(Locale locale) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static String format(Locale locale, String format, Object ... args) {
|
||||
return new Formatter(locale).format(format, args).toString();
|
||||
}
|
||||
|
||||
public static String format(String format, Object ... args) {
|
||||
return format(Locale.getDefault(), format, args);
|
||||
}
|
||||
|
||||
// for GNU Classpath compatibility:
|
||||
static char[] zeroBasedStringValue(String s) {
|
||||
if (s.offset == 0) {
|
||||
if (s.data instanceof char[]) {
|
||||
char[] data = (char[]) s.data;
|
||||
if (data.length == s.length) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
return s.toCharArray();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user