0N/A/*
2362N/A * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/**
0N/A * @test
0N/A * @bug 4472841 4703640 4705681 4705683 4833095 5005831
0N/A * @summary Verify that constructor exceptions are thrown as expected.
0N/A */
0N/A
0N/Aimport java.io.UnsupportedEncodingException;
0N/Aimport java.nio.charset.Charset;
0N/A
0N/Apublic class Exceptions {
0N/A private static final byte [] b = { 0x48, 0x69, 0x2c, 0x20,
0N/A 0x44, 0x75, 0x6b, 0x65, 0x21 };
0N/A
0N/A private static final char [] c
0N/A = "Attack of the Killer Tomatoes!".toCharArray();
0N/A
0N/A private static boolean ok = true;
0N/A
0N/A private static void fail(Class ex, String s) {
0N/A ok = false;
0N/A System.err.println("expected " + ex.getName() + " for " + s
0N/A + " - FAILED");
0N/A }
0N/A
0N/A private static void pass(String s) {
0N/A System.out.println(s + " -- OK");
0N/A }
0N/A
0N/A private static void tryCatch(String s, Class ex, Runnable thunk) {
0N/A Throwable t = null;
0N/A try {
0N/A thunk.run();
0N/A } catch (Throwable x) {
0N/A if (ex.isAssignableFrom(x.getClass()))
0N/A t = x;
0N/A else
0N/A x.printStackTrace();
0N/A }
0N/A if ((t == null) && (ex != null))
0N/A fail(ex, s);
0N/A else
0N/A pass(s);
0N/A }
0N/A
0N/A // -- Constructors --
0N/A
0N/A private static void noArgs() {
0N/A System.out.println("String()");
0N/A tryCatch(" default ctor", null, new Runnable() {
0N/A public void run() {
0N/A new String();
0N/A }});
0N/A }
0N/A
0N/A private static void string() {
0N/A System.out.println("String(String original)");
0N/A tryCatch(" \"foo\"", null, new Runnable() {
0N/A public void run() {
0N/A new String("foo");
0N/A }});
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A new String((String) null);
0N/A }});
0N/A }
0N/A
0N/A private static void charArray() {
0N/A System.out.println("String(char value[])");
0N/A tryCatch(" char [] = \"Duke says \"Hi!\"\"", null, new Runnable() {
0N/A public void run() {
0N/A new String("Duke says \"Hi!\"".toCharArray());
0N/A }});
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A new String((char []) null);
0N/A }});
0N/A }
0N/A
0N/A private static void charArrayOffCount() {
0N/A System.out.println("String(char value[], int offset, int count)");
0N/A tryCatch(" c, 0, 3", null, new Runnable() {
0N/A public void run() {
0N/A new String(c, 0, 3);
0N/A }});
0N/A tryCatch(" null, 1, 2", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A new String((char []) null, 1, 2);
0N/A }});
0N/A tryCatch(" c, -1, 4", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(c, -1, 4);
0N/A }});
0N/A tryCatch(" c, 1, -1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(c, 1, -1);
0N/A }});
0N/A tryCatch(" c, c.lengh + 1, 1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(c, c.length + 1, 1);
0N/A }});
0N/A tryCatch(" c, 0, c.length + 1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(c, 0, c.length + 1);
0N/A }});
0N/A }
0N/A
0N/A private static void byteArrayHiOffCount() {
0N/A System.out.println("String(byte ascii[], int hibyte, int offset, "
0N/A + "int count)");
0N/A tryCatch(" b, 0, 0, b.length", null, new Runnable() {
0N/A public void run() {
0N/A System.out.println(new String(b, 0, 0, b.length));
0N/A }});
0N/A
0N/A tryCatch(" b, -1, 4, 4", null, new Runnable() {
0N/A public void run() {
0N/A new String(b, -1, 4, 4);
0N/A }});
0N/A tryCatch(" null, 0, 0, 0", NullPointerException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String((byte[]) null, 0, 0, 0);
0N/A }});
0N/A tryCatch(" b, 0, -1, r", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, 0, -1, 4);
0N/A }});
0N/A tryCatch(" b, 0, 4, -1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, 0, 4, -1);
0N/A }});
0N/A tryCatch(" b, 0, b.length + 1, 1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, 0, b.length + 1, 1);
0N/A }});
0N/A tryCatch(" b, 0, 0, b.length + 1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, 0, 0, b.length + 1);
0N/A }});
0N/A }
0N/A
0N/A private static void byteArrayHi() {
0N/A System.out.println("String(byte ascii[], int hibyte)");
0N/A tryCatch(" b, 0", null, new Runnable() {
0N/A public void run() {
0N/A new String(b, 0);
0N/A }});
0N/A tryCatch(" null, 0", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A new String((byte []) null, 0);
0N/A }});
0N/A }
0N/A
0N/A private static void byteArrayOffLengthCharset0(String s, Class ex,
0N/A byte [] b, int off,
0N/A int len, Object cs)
0N/A {
0N/A Throwable t = null;
0N/A try {
0N/A if (cs instanceof String)
0N/A new String(b, off, len, (String)cs);
0N/A else // (cs instanceof Charset)
0N/A new String(b, off, len, (Charset)cs);
0N/A } catch (Throwable x) {
0N/A if (ex.isAssignableFrom(x.getClass()))
0N/A t = x;
0N/A else
0N/A x.printStackTrace();
0N/A }
0N/A if ((t == null) && (ex != null))
0N/A fail(ex, s);
0N/A else
0N/A pass(s);
0N/A }
0N/A
0N/A private static void byteArrayOffLengthCharsetName() {
0N/A System.out.println("String(byte bytes[], int offset, int length, "
0N/A + "String charsetName)");
0N/A System.out.println(" throws UnsupportedEncodingException");
0N/A String enc = "UTF-8";
0N/A byteArrayOffLengthCharset0(" b, 0, 0," + enc, null, b, 0, 0, enc);
0N/A byteArrayOffLengthCharset0(" null, 0, 0," + enc,
0N/A NullPointerException.class,
0N/A (byte []) null, 0, 0, enc);
0N/A byteArrayOffLengthCharset0(" b, -1, 0, " + enc,
0N/A IndexOutOfBoundsException.class,
0N/A b, -1, 0, enc);
0N/A byteArrayOffLengthCharset0(" b, 0, -1, " + enc,
0N/A IndexOutOfBoundsException.class,
0N/A b, 0, -1, enc);
0N/A byteArrayOffLengthCharset0(" b, b.length + 1, 1, " + enc,
0N/A IndexOutOfBoundsException.class,
0N/A b, b.length + 1, 1, enc);
0N/A byteArrayOffLengthCharset0(" b, 0, b.length + 1 " + enc,
0N/A IndexOutOfBoundsException.class,
0N/A b, 0, b.length + 1, enc);
0N/A byteArrayOffLengthCharset0(" b, -1, 0, null",
0N/A NullPointerException.class,
0N/A b, -1, 0, null);
0N/A byteArrayOffLengthCharset0(" b, 0, b.length, foo",
0N/A UnsupportedEncodingException.class,
0N/A b, 0, b.length, "foo");
0N/A }
0N/A
0N/A private static void byteArrayOffLengthCharset() {
0N/A System.out.println("String(byte bytes[], int offset, int length, "
0N/A + "Charset charset)");
0N/A Charset cs = Charset.forName("UTF-16BE");
0N/A byteArrayOffLengthCharset0(" b, 0, 0," + cs, null, b, 0, 0, cs);
0N/A byteArrayOffLengthCharset0(" null, 0, 0," + cs,
0N/A NullPointerException.class,
0N/A (byte []) null, 0, 0, cs);
0N/A byteArrayOffLengthCharset0(" b, -1, 0, " + cs,
0N/A IndexOutOfBoundsException.class,
0N/A b, -1, 0, cs);
0N/A byteArrayOffLengthCharset0(" b, 0, -1, " + cs,
0N/A IndexOutOfBoundsException.class,
0N/A b, 0, -1, cs);
0N/A byteArrayOffLengthCharset0(" b, b.length + 1, 1, " + cs,
0N/A IndexOutOfBoundsException.class,
0N/A b, b.length + 1, 1, cs);
0N/A byteArrayOffLengthCharset0(" b, 0, b.length + 1 " + cs,
0N/A IndexOutOfBoundsException.class,
0N/A b, 0, b.length + 1, cs);
0N/A byteArrayOffLengthCharset0(" b, -1, 0, null",
0N/A NullPointerException.class,
0N/A b, -1, 0, null);
0N/A }
0N/A
0N/A private static void byteArrayCharset0(String s, Class ex, byte [] b,
0N/A Object cs)
0N/A {
0N/A Throwable t = null;
0N/A try {
0N/A if (cs instanceof String)
0N/A new String(b, (String)cs);
0N/A else // (cs instanceof Charset)
0N/A new String(b, (Charset)cs);
0N/A } catch (Throwable x) {
0N/A if (ex.isAssignableFrom(x.getClass()))
0N/A t = x;
0N/A else
0N/A x.printStackTrace();
0N/A }
0N/A if ((t == null) && (ex != null))
0N/A fail(ex, s);
0N/A else
0N/A pass(s);
0N/A }
0N/A
0N/A private static void byteArrayCharsetName() {
0N/A System.out.println("String(byte bytes[], String charsetName)");
0N/A System.out.println(" throws UnsupportedEncodingException");
0N/A String enc = "US-ASCII";
0N/A byteArrayCharset0(" b, " + enc, null, b, enc);
0N/A byteArrayCharset0(" null, " + enc, NullPointerException.class,
0N/A (byte []) null, enc);
0N/A byteArrayCharset0(" b, null", NullPointerException.class, b, null);
0N/A byteArrayCharset0(" null, null", NullPointerException.class,
0N/A (byte []) null, null);
0N/A byteArrayCharset0(" b, bar", UnsupportedEncodingException.class,
0N/A b, "bar");
0N/A }
0N/A
0N/A private static void byteArrayCharset() {
0N/A System.out.println("String(byte bytes[], Charset charset)");
0N/A Charset cs = Charset.forName("ISO-8859-1");
0N/A byteArrayCharset0(" b, " + cs, null, b, cs);
0N/A byteArrayCharset0(" null, " + cs, NullPointerException.class,
0N/A (byte []) null, cs);
0N/A byteArrayCharset0(" b, null", NullPointerException.class, b, null);
0N/A byteArrayCharset0(" null, null", NullPointerException.class,
0N/A (byte []) null, null);
0N/A }
0N/A
0N/A private static void byteArrayOffLength() {
0N/A System.out.println("String(byte bytes[], int offset, int length)");
0N/A tryCatch(" b, 0, b.length", null, new Runnable() {
0N/A public void run() {
0N/A new String(b, 0, b.length);
0N/A }});
0N/A tryCatch(" null, 0, 0", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A new String((byte []) null, 0, 0);
0N/A }});
0N/A tryCatch(" b, -1, b.length", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, -1, b.length);
0N/A }});
0N/A tryCatch(" b, 0, -1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, 0, -1);
0N/A }});
0N/A tryCatch(" b, b.length + 1, 1", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, b.length + 1, 1);
0N/A }});
0N/A tryCatch(" b, 0, b.length", IndexOutOfBoundsException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A new String(b, 0, b.length + 1);
0N/A }});
0N/A }
0N/A
0N/A private static void byteArray() {
0N/A System.out.println("String(byte bytes[])");
0N/A tryCatch(" b", null, new Runnable() {
0N/A public void run() {
0N/A new String(b);
0N/A }});
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A new String((byte []) null);
0N/A }});
0N/A }
0N/A
0N/A private static void stringBuffer() {
0N/A System.out.println("String(StringBuffer buffer)");
0N/A tryCatch(" \"bar\"", null, new Runnable() {
0N/A public void run() {
0N/A new String(new StringBuffer("bar"));
0N/A }});
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A new String((StringBuffer) null);
0N/A }});
0N/A }
0N/A
0N/A // -- Methods --
0N/A
0N/A private static void getChars() {
0N/A System.out.println("getChars.(int srcBegin, int srcEnd, char dst[], "
0N/A + " int dstBegin");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".getChars(1, 2, null, 1);
0N/A }});
0N/A }
0N/A
0N/A private static void getBytes() {
0N/A System.out.println("getChars.(int srcBegin, int srcEnd, char dst[], "
0N/A + " int dstBegin");
0N/A tryCatch(" 1, 2, null, 1", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".getBytes(1, 2, null, 1);
0N/A }});
0N/A
0N/A System.out.println("getBytes.(String charsetName)"
0N/A + " throws UnsupportedEncodingException");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A try {
0N/A "foo".getBytes((String)null);
0N/A } catch (UnsupportedEncodingException x) {
0N/A throw new RuntimeException(x);
0N/A }
0N/A }});
0N/A
0N/A System.out.println("getBytes.(Charset charset)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".getBytes((Charset)null);
0N/A }});
0N/A }
0N/A
0N/A private static void contentEquals() {
0N/A System.out.println("contentEquals(StringBuffer sb)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".contentEquals(null);
0N/A }});
0N/A }
0N/A
0N/A private static void compareTo() {
0N/A System.out.println("compareTo(String anotherString)");
0N/A tryCatch(" (String) null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".compareTo((String) null);
0N/A }});
0N/A
0N/A /* 4830291 (javac generics bug) causes this test to fail
0N/A System.out.println("compareTo(Object o)");
0N/A tryCatch(" (Object) null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".compareTo((Object) null);
0N/A }});
0N/A */
0N/A }
0N/A
0N/A private static void compareToIgnoreCase() {
0N/A System.out.println("compareToIgnoreCase(String anotherString)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".compareToIgnoreCase((String) null);
0N/A }});
0N/A }
0N/A
0N/A private static void regionMatches() {
0N/A System.out.println("regionMatches(int toffset, String other,"
0N/A + " int ooffset, int len)");
0N/A tryCatch(" 1, null, 1, 1", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".regionMatches(1, null, 1, 1);
0N/A }});
0N/A
0N/A System.out.println("regionMatches(boolean ignore, int toffset,"
0N/A + " String other, int ooffset, int len)");
0N/A tryCatch(" true, 1, null, 1, 1", NullPointerException.class,
0N/A new Runnable() {
0N/A public void run() {
0N/A "foo".regionMatches(true, 1, null, 1, 1);
0N/A }});
0N/A }
0N/A
0N/A private static void startsWith() {
0N/A System.out.println("startsWith(String prefix, int toffset)");
0N/A tryCatch(" null, 1", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".startsWith(null, 1);
0N/A }});
0N/A
0N/A System.out.println("startsWith(String prefix)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".startsWith(null);
0N/A }});
0N/A }
0N/A
0N/A private static void endsWith() {
0N/A System.out.println("endsWith(String suffix)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".endsWith(null);
0N/A }});
0N/A }
0N/A
0N/A private static void indexOf() {
0N/A System.out.println("indexOf(String str)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".indexOf(null);
0N/A }});
0N/A
0N/A System.out.println("indexOf(String str, int fromIndex)");
0N/A tryCatch(" null, 1", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".indexOf(null, 1);
0N/A }});
0N/A }
0N/A
0N/A private static void lastIndexOf() {
0N/A System.out.println("lastIndexOf(String str)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".lastIndexOf(null);
0N/A }});
0N/A
0N/A System.out.println("lastIndexOf(String str, int fromIndex)");
0N/A tryCatch(" null, 1", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".lastIndexOf(null, 1);
0N/A }});
0N/A }
0N/A
0N/A private static void concat() {
0N/A System.out.println("concat(String str)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".concat(null);
0N/A }});
0N/A }
0N/A
0N/A private static void matches() {
0N/A System.out.println("matches(String regex)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".matches(null);
0N/A }});
0N/A }
0N/A
0N/A private static void replaceFirst() {
0N/A System.out.println("replaceFirst(String regex, String replacement)");
0N/A tryCatch(" \".\", null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".replaceFirst(".", null);
0N/A }});
0N/A tryCatch(" null, \"-\"", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".replaceFirst(null, "-");
0N/A }});
0N/A }
0N/A
0N/A private static void replaceAll() {
0N/A System.out.println("replaceAll(String regex, String replacement)");
0N/A tryCatch(" \".\", null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".replaceAll(".", null);
0N/A }});
0N/A tryCatch(" null, \"-\"", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".replaceAll(null, "-");
0N/A }});
0N/A }
0N/A
0N/A private static void split() {
0N/A System.out.println("split(String regex, int limit)");
0N/A tryCatch(" null, 1", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".split(null, 1);
0N/A }});
0N/A
0N/A System.out.println("split(String regex, int limit)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".split(null);
0N/A }});
0N/A }
0N/A
0N/A private static void toLowerCase() {
0N/A System.out.println("toLowerCase(Locale locale)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".toLowerCase(null);
0N/A }});
0N/A }
0N/A
0N/A private static void toUpperCase() {
0N/A System.out.println("toUpperCase(Locale locale)");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".toUpperCase(null);
0N/A }});
0N/A }
0N/A
0N/A private static void valueOf() {
0N/A System.out.println("valueOf(Object obj)");
0N/A tryCatch(" null", null, new Runnable() {
0N/A public void run() {
0N/A String.valueOf((Object) null);
0N/A }});
0N/A
0N/A System.out.println("valueOf(char data[])");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A String.valueOf((char []) null);
0N/A }});
0N/A
0N/A System.out.println("valueOf(char data[], int offset, int count)");
0N/A tryCatch(" null, 1, 2", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A String.valueOf((char []) null, 1, 2);
0N/A }});
0N/A
0N/A }
0N/A
0N/A private static void copyValueOf() {
0N/A System.out.println("copyValueOf(char data[], int offset, int count)");
0N/A tryCatch(" null, 1, 2", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A "foo".copyValueOf((char []) null, 1, 2);
0N/A }});
0N/A
0N/A System.out.println("copyVlueOf(char data[])");
0N/A tryCatch(" null", NullPointerException.class, new Runnable() {
0N/A public void run() {
0N/A String.copyValueOf((char []) null);
0N/A }});
0N/A }
0N/A
0N/A public static void main(String [] args) {
0N/A
0N/A // -- Constructors --
0N/A
0N/A noArgs(); // String()
0N/A string(); // String(String original)
0N/A charArray(); // String(char value[])
0N/A charArrayOffCount(); // String(char value[], int offset, int count)
0N/A
0N/A // String(byte ascii[], int hibyte, int offset, int count)
0N/A byteArrayHiOffCount();
0N/A
0N/A byteArrayHi(); // String(byte ascii[], int hibyte)
0N/A
0N/A // String(byte bytes[], int offset, int length, String charsetName)
0N/A // throws UnsupportedEncodingException
0N/A byteArrayOffLengthCharsetName();
0N/A
0N/A // String(byte bytes[], int offset, int length, Charset charset)
0N/A byteArrayOffLengthCharset();
0N/A
0N/A // String(byte bytes[], String charsetName)
0N/A // throws UnsupportedEncodingException
0N/A byteArrayCharsetName();
0N/A
0N/A // String(byte bytes[], Charset charset)
0N/A byteArrayCharset();
0N/A
0N/A byteArrayOffLength(); // String(byte bytes[], int offset, int length)
0N/A byteArray(); // String(byte bytes[])
0N/A stringBuffer(); // String(StringBuffer buffer)
0N/A
0N/A // -- Methods --
0N/A
0N/A getChars(); // getChars(int, int. char [], int)
0N/A getBytes(); // getBytes(int, int, byte [], int),
0N/A // getBytes(Locale)
0N/A // getBytes(String)
0N/A // getBytes(Charset)
0N/A contentEquals(); // contentEquals(StringBuffer)
0N/A compareTo(); // compareTo(String), compareTo(Object)
0N/A compareToIgnoreCase();// compareToIgnoreCase(String)
0N/A regionMatches(); // regionMatches(int, String, int, int)
0N/A // regionMatches(boolean, int, String, int, int)
0N/A startsWith(); // startsWith(String, int), startsWith(String)
0N/A endsWith(); // endsWith(String)
0N/A indexOf(); // indexOf(String), indexOf(String, int),
0N/A lastIndexOf(); // lastIndexOf(String), lastIndexOf(String, int)
0N/A concat(); // concat(String)
0N/A matches(); // matches(String)
0N/A replaceFirst(); // replaceFirst(String, String)
0N/A replaceAll(); // replaceAll(String, String)
0N/A split(); // split(String, int), split(String)
0N/A toLowerCase(); // toLowerCase(Locale)
0N/A toUpperCase(); // toUpperCase(Locale)
0N/A valueOf(); // valueOf(Object), valueOf(char []),
0N/A // valueOf(char [], int, int)
0N/A copyValueOf(); // copyValueOf(char [], int, int),
0N/A // copyValueOf(char [])
0N/A
0N/A if (!ok)
0N/A throw new RuntimeException("Some tests FAILED");
0N/A else
0N/A System.out.println("All tests PASSED");
0N/A }
0N/A}