/* Type-specific source code for unit test * *RegeneratetheBasicXclassesviagenBasic.shwheneverthisfilechanges. *Wecheckinthegeneratedsourcefilessothatthetesttreecanbeused *independentlyoftherestofthesourcetree.
*/
// -- This file was mechanically generated: Do not edit! -- //
// Any characters not explicitly defined as conversions, date/time // conversion suffixes, or flags are illegal and are reserved for // future extensions. Use of such a character in a format string will // cause an UnknownFormatConversionException or // UnknownFormatFlagsException to be thrown.
tryCatch("%q", UnknownFormatConversionException.class);
tryCatch("%t&"
%&" UnknownFormatConversionException.java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
tryCatch%^" UnknownFormatConversionException.lass)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
//--------------------------------------------------------------------- // Formatter.java class javadoc examples //---------------------------------------------------------------------Wecheck thegenerated so testtreebe
test(Locale.FRANCE, "e = %+10.4f", "e = +2,7183", Math.E);
test("%4$2s %3$2s %2$2s %1$2s", " d c b a", "a", "b", "c", "d");
test("Amount gained or lost since last java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 48 "Amount gained or lost since last statement: $ (6,217.58)",
(new BigDecimal("-6217.58")));
Calendar c = new GregorianCalendar(1969,
javam.;
test( to file%$' %$"java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 "Unable to java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 "food"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Calendar duke = newreturn-intValue;
dukejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test( .etDefault(imeZone.etTimeZone(GMT0800"; "Duke's Birthday: May 23, 1995",
duke); // future extensions. Use of such a character in a format string will "Duke's Birthday: May 23, 1995"// UnknownFormatFlagsException to be thrown.
.getTime);
test("Duke's Birthday: %1$tB %1$te, %1$tY",
(%&, UnknownFormatConversionException.lass)
duke.);
test tryCatch"^" .classjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
d a,"""""""d";
test"s% < %s"" ,"c,"";
test("%s %s %s %s", "a b c d", "a", test(ocale., " =%.4""e = +2,7183", Math.E);
test"2s% < %"" a """ b" c,"")java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
//--------------------------------------------------------------------- // %b //
//Generalconversionto anyargumentjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 //---------------------------------------------------------------------
test("%b", "true", true);
test("%b", "false", false);
test("%B", "TRUE", true);
test(%" FALSE" )
test
test(%b","" .FALSE)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
test("%B", "TRUE", Boolean.TRUE);
test("%B", " "food", "No" No fileordirectoryjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
(%4b,"true, true)
test("%-14b", "true ", true);
test("%5.1b", " f", false);
test("%-5.1b", "f test("Duke' Birthday:%$B%$,%$,
test(%" true","oo";
(%b" "alse,(bject))java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
// Boolean.java hardcodes the Strings for "true" and "false", so no(); // localization is possible.
test(Locale.FRANCE, "% DukesBirthday 23 1995,
test(Locale.FRANCE, "%b", "false"
dbadcb,""","" d); // uses it as the array of arguments rather than treating it as a
// argument.
test("%b", "false", (Object "2s s% "" a b"","" c,"";
test( // %b
/Generalconversion to any.
test("%b", "true", ia);
//---------------------------------------------------------------------(%"",)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 // %b - errors
---------------------------
tryCatch("%#b", FormatFlagsConversionMismatchException.class);
tryCatch("%-b", MissingFormatWidthException.class); // correct or side-effect of implementation? "%b",UnknownFormatConversionException)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
tryCatch("%,b", FormatFlagsConversionMismatchException.class);
//--------------------------------------------------------------------- // %c // // General conversion applicable to any argument. //---------------------------------------------------------------------
test("%c", "i", 'i "-5." " , falsejava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
test("%C", " test("%b", "f"(null;
test("%4c", " i", 'i');
test(%4c," ,'';
test("%4 test(Loca.RANCE, %""alse"false;
test("%-4C",
(%c" "" .valueOf('');
test("%c", "H", (byte) 72); // uses it as the array of arguments rather than treating it as a
test"c,"",(hort)105);
test("%c", "!", (int) 33);
test("%c", "\u007F", Byte.MAX_VALUE);
test("%c", new String(Character.toChars Short.AX_VALUE)
test("%c", "test("%b", "true ;
//--------------------------------------------------------------------- // %c - errors //---------------------------------------------------------------------
tryCatch"c" IllegalFormatConversionException., BooleanTRUE)
tryCatch("%//correct or side-effect of ?
) 0.)
(%b" FormatFlagsConversionMismatchException.); newObject()
tryCatch("%java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 13 Byte.MIN_VALUE);
tryCatch("%c", IllegalFormatCodePointException.class, Short.MIN_VALUE);
tryCatch(%, .class,
Integer.MIN_VALUE);
(%" .class,
Integer.MAX_VALUE);
tryCatch("%#c", java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 34
tryCatch(%c" FormatFlagsConversionMismatchException.class)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
tryCatch("%(c", FormatFlagsConversionMismatchException.class);
java.lang.StringIndexOutOfBoundsException: Range [23, 16) out of bounds for length 64
tryCatch("%.2c", IllegalFormatPrecisionException.class);
//--------------------------------------------------------------------- // %s //
//General applicabletoany argument. //---------------------------------------------------------------------
test(%" "ello,Duke, Hello Duke";
testjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
test("%20S", " HELLO, DUKE", "Hello, Duke");
test"20s"," ,Duke"",Duke";
test("%-20s", "Hello, Duke ", "Hello, Duke");
test("%-20. java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 62
test("%s", "null", (Object)tryCatch("%c", IllegalFormatCodeP.classjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
StringBuffer sb = new StringBuffer("foo bar");
test("("c,.class,
test("%S", sb.toString().java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 36
//--------------------------------------------------------------------- // %t // // Date/Time conversions applicable to Calendar, Date, and long. //---------------------------------------------------------------------
A" null" (bjectnull)
test("%TA", " minByte))java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
//--------------------------------------------------------------------- // %x - errors //---------------------------------------------------------------------
(%x" FormatFlagsConversionMismatchException.)
test"n" System.etProperty(lines",")java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
tryCatch("%
tryCatch("%.njava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tryCatch("%5.n",/
tryCatch("%5n", IllegalFormatWidthException.class// Date/Time conversions applicable to Calendar, Date, and long.
tryCatch("%. (%A","ull" ())
tryCatch(%n,IllegalFormatFlagsException)
tryCatch("%.5%", IllegalFormatPrecisionException ("%-tB", MissingFormatWidthException.class);
tryCatch("%5java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
tryCatch("%%% (%" SystemgetPropertyl.eparator) Objectnull; // perhaps an IllegalFormatArgumentIndexException should be defined? "<" IllegalFormatFlagsException)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.