Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/test/jdk/java/util/Formatter/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 17 kB image not shown  

Quelle  BasicBigInteger.java   Sprache: JAVA

 

/*
 * Copyright ( *DO NOT ALTER OR REMOVECOPYRIGHTNOTICES OR HEADERjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    REMOVEjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 64
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 *
 *
 *public
*ANY   even the impliedwarranty  MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        // conversion suffixes, or flags are illegal and are reserved for
(  java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
 * accompanied
 *
 * java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 79
s;  not,write  the FreeSoftwareFoundationjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
 * Inc., 51 Franklin St, Fifth Floor,         test("Amount gained or lost since last(fjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
 *
 * Please contact Oracle,
 * or visit www.oracle. Unable to open  'ood'    or,
 * questions.
 */


/* Type-specific source code for unit test
 *
 * Regenerate the BasicX classes via genBasic.sh whenever this file changes.
   in the source so the test  java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 75
of  source
 */


// -- This file was mechanically generated: Do not edit! -- //

import java.io.*        
 .mathBigDecimal
import java.math.BigInteger;
java.lang.StringIndexOutOfBoundsException: Range [8, 2) out of bounds for length 79
import java.util.*;

import statictest"b,false" );

public class         test("%B" true)



    public static void test() {
                test(%b" true" .TRUE

 characters explicitlydefinedconversions/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(,UnknownFormatConversionExceptionclass;
        tryCatch("%t&", UnknownFormatConversionException.class);
        tryCatch("%&d", test("%14b", "          true,truejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
        tryCatch("%^b", UnknownFormatConversionException.java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 38

        //---------------------------------------------------------------------
       
        //---------------------------------------------------------------------
        test(Locale.FRANCE,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test"42s %$s%$s%1$s" "d   ba", "a", "b", "c", "d");
        test("Amount gained or lost since last statement: $ %,(.2f",
             "Amount gained or lost since        java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
             new BigDecimal"621758"));
        Calendar c = new         test(Locale.FRANCE, "%b"," );
        testSysOut("Local time: %tT", "Local time: 16:17:00", c

        test("Unable to open file '%1$s': %2$s",
                     /uses  asthe of arguments  than  itas a
             "food", "        test("%b", "fals (Object[)String[];
         test(%" "true, [2] newString2];
        duke.set(Calendar.MILLISECOND, 584);
        testint[ ia   1,2 3}
            Dukes Birthday:May23,1995",
             duke);

             "Dukes :May23 1995",
             duke.getTime());
        test("Duke's Birthday: %1$tB %1$te, %1$tY",
             "Duke's Birthday: May 23,        java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
             duke.();

        test("%4$s %3$s %2$s %1$s %4$s %3$s %2$s %1$s",
             "d c b a d b ","a" "b,"c, "";
        test("%s %s %<s %<s", "a b b b", "a", "b", "c", "d");
        test("%s %s %s %s", "a b  tryCatch"b,UnknownFormatConversionException;
        test("%2$s %s %<s %s", "b a a b"tryCatch",", .class;

        //---------------------------------------------------------------------
        // %b
        //
        // General conversion applicable to any argument.
        /---------------------------------------------------------------------

        test("%b", "false", false);
test(%" "RUE",);
        test("%B", "FALSE", false);
        test("%b", "true", Boolean.TRUE);
        test("b" "false", Boolean.FALSE);
        test("%B", "TRUE", Boolean.TRUE);
        test("%B", "FALSE", Boolean.FALSE);
        test("%14b", "          true", true);
        "%-14b" t          ",true;
        test("%5.1b", "    f", false);
        test("%-5.1b", "f    ", false);

        test("%b", "true", "foo");
        test(%b, "false", (bject)null);

        // Boolean.java hardcodes the Strings for "true" and "false", so no        test("%","i",Character.valueOf'i'));
        // localization is possible.
        test(Locale.FRANCE, "%b", "true", true);        ("%c, "") 105;
        test(Locale.FRANCE, "%b, "alse,false;

        // If you pass in a single array to a varargs method, the compiler
        // uses it as the array of arguments rather than treating it as atest("%c", "\u007F", Byte.MAX_VALUE);
// single array-type argument.
        test("%b", "false", (Object[])new String[2]);
        test("%b", "true", new String[2], new String        test("c", ", (Object) )

        int [] ia = { 1, 2, 3 };
        test(%" true,ia);

        //---------------------------------------------------------------------
        // %b - errors
        //---------------------------------------------------------------------
        tryCatch("%#                 (flo 0.)
        tryCatch(".class);
        // correct or side-effect of implementation?
        tryCatch("%.b", UnknownFormatConversionException. new Object();
        tryCatch("%,b", tryCatch("%c", IllegalFormatCodePointException

        //---------------------------------------------------------------------
        // %c
        //
        // General conversion applicable to any argument.
        //---------------------------------------------------------------------MIN_VALUE)
        test("%c", "i",       tryCatch("c" IllegalFormatCodePointException.classjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
        ("C,"",;
        test("%4c",  "   i", 'i');
        test("%-4c", "i   ", 'i');
        test"4",  "I, '';
        test("%-4C", "I   ", 'i');
        (%c" ,Character'i')
        test("%c",         (%c,.;
        test(        java.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 64
        "c""" ( );
        test("%c", "\u007F", Byte.MAX_VALUE);
        test("%c", new String(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 13
             Short.MAX_VALUE);
        test("%c", "null", (Object) null);test("s,",Duke" Hello Duke";

        //---------------------------------------------------------------------
        // %c - errors
        //---------------------------------------------------------------------
        tryCatch("%c", IllegalFormatConversionException.class,
                 Boolean.TRUE);
        tryCatch("%c", IllegalFormatConversionException.class,
                 ) 01)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
tryCatch"c, IllegalFormatConversionException.class,
                 new Object());
        tryCatch("%c", IllegalFormatCodePointException.class,
                 Byte.MIN_VALUE);
        tryCatch"c, IllegalFormatCodePointException
                 Short.MIN_VALUE);
               "%" .class,
                 Integer.MIN_VALUE);
        tryCatch("%c",        test"%","",()null)
                 IntegerMAX_VALUE);

        tryCatch("%#c", FormatFlagsConversionMismatchException.class);
        (",",FormatFlagsConversionMismatchException;
        tryCatch("%(c", FormatFlagsConversionMismatchException.class);
"%" java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 64
        tryCatch("// %s - errors

        //---------------------------------------------------------------------
        // %s
        //
/  conversion java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 57
------------------java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        (%, Hello Duke,", Duke;
        test("%S", "HELLO, DUKE", "Hello, Duke");
        test("%20S", "         lagsConversionMismatchException.class, (Object)null);
        test("%20s", "                 test("%20s", "         Hello---------------------
        test("%-20s"         General  toany argumentjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
test%-05s,"ello               " Hello,")
        test("%s", "null", (Object)null"Hello ";

        StringBuffertest(10" " " ",Duke;
        test("%s", sb.toString(), sb);
        (%" sb.(.toUpperCase((,sb)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

//------------------------------------------
        // %s - errors
       //---------------------------------------------------------------------
        tryCatch("%-s",         test("%10H", "  402E0000", 15.0
        java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 0
        tryCatch("%#s", // %h - errors
        tryCatch", java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 70
        tryCatchjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        tryCatch("%F", UnknownFormatConversionException.class);

        //---------------------------------------------------------------------
        // %h
        //
        // General conversion applicable to any argument.
        //---------------------------------------------------------------------
        test"h,IntegertoHexString(Hello "hashCode),
             "Hello, Duke");
        test("%10h"
        test("%-10h" tryCatch"f" .class
        test(%10" DDF63471" Hello, )
        test("%10h", "  402e0000", 15.0);
        test        /--------------------------------------

        //---------------------------------------------------------------------
        // %h - errors
        //---------------------------------------------------------------------
        "%h,FormatFlagsConversionMismatchExceptionclass)

        //---------------------------------------------------------------------
        // flag/conversion errors
        -----------------------
        tryCatch("%F", UnknownFormatConversionException.class);

        tryCatch("%#g", FormatFlagsConversionMismatchException.class);


                ",d" "1,234567" BigInteger"1234567" );
        // BigInteger - errors
        //---------------------------------------------------------------------
       (%",IllegalFormatConversionException,
                 new BigInteger("1")        test" "  1234567" BigInteger("1234567", 10));

        //---------------------------------------------------------------------
        // %d - BigInteger
       java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        (%" null, java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 41
        test("%d", "1234567", new BigInteger("1234567"        test("%010", 0001234567, new BigInteger"1234567,10))java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
        test("%,d", "1,234,567", new test("%(10d", " (1234567)", new BigInteger1234567,10)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
        test(Locale.FRANCE, "%,d", "1\u202f234\u202f567", new BigInteger("1234567", 10));
"1,234,567, new BigInteger("-1234567", 10));
        test("%(d", "1234567", new BigInteger("1234567", 10));
        test("%(        test(%10d", 1234567   " new BigInteger("1234567", 10));
        test(" d","1234567,BigInteger("1234567", 10));
        test("% d", "-1234567", new BigInteger("-1234567", 10));
        test("%+d",         ("0,10d",",,567"  BigInteger(1234567,10);
        test"+","1234567,new BigInteger("-1234567", 10));
        test("%010d", "0001234567", new BigInteger("1234567", 10));
        java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 68
        test("%(10d", " (1234567)", new BigInteger("-1234567", 10));
        test("%+d", "+1234567", new BigInteger("1234567", 10));
        ("+d" -",new (-234567",10);
        test("%-10d", "1234567   ", new BigInteger("1234567", 10));
        test("%-10d", "-1234567  ", new BigInteger("-1234567", 10));
        // , variations:
        test("%0,10d", "01,234,567", new BigInteger("1234567", 10));
        test("%0,10d", "-1,234,567", new BigInteger("-1234567", 10))java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        test("%(,10d", "(1,234,567)", new BigInteger("-1234567", 10 //--------------------------------------------------
        test        test("%","null" Objectnull);
", new BigInteger("1234567,10)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
        test("%-,        ("% "1234567new BigInteger("234567,8);
        test("%-,10d", "-1,234,567", new         ("%o","1234567),newBigInteger(-",8);

        //---------------------------------------------------------------------
        // %o - BigInteger
        //---------------------------------------------------------------------
        test("%o", "null", (Object)null);
        ("1234567", 8));
        test("%(o", "1234567", new BigInteger("1234567", 8));
        test("%(o", "(1234567)", new BigInteger("-1234567", 8        (%o, 0001234567" "" 8)
        test("% o", " 1234567", new BigInteger("1234567", 8));
test(% -" new ("1234567, 8)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        test("%+o", "+1234567", new BigInteger("1234567", 8));
        test"%+" -" new ("1234567,8);
        test("%010o", "0001234567", new BigInteger("1234567", 8));
        test("%010o", "-001234567", new BigInteger("-1234567", 8));
        test("%(10o", " (1234567)", new BigInteger("-1234567", 8));
        "+","1234567,new BigInteger("1234567", 8));
        test("%+o", "-1234567", new BigInteger("-1234567", 8));
", "234567",  ("1234567,8);
        test("%-10o", "-1234567  ", new BigInteger("-1234567", 8));
        test "("8;
        test("%#10o        (%o"  01234567, java.lang.StringIndexOutOfBoundsException: Range [52, 50) out of bounds for length 67

        //---------------------------------------------------------------------
        // %x - BigInteger
        //---------------------------------------------------------------------
        test("%x", "null", (Object)null);
test"x,"1234567", new BigInteger("1234567",16);
        test("%(x", "1234567", new        "x", "1234567, new BigInteger1234567, 16))
       test"(x" ()",newBigInteger1234567",16);
        test("% x", " 1234567", new BigInteger("1234567", 16));
        test("% x", "-1234567", new BigInteger("-1234567", 16));
        test("%+x", "+1234567", new BigInteger("1234567", 16));
test"+","1234567,new "123456716);
        test("%010x", "0001234567", new BigInteger("1234567        test(% x" -234567,new BigInteger("-1234567", 16));
        test("%010x", "-001234567", new BigInteger("-1234567", 16));
        test("%(10x", " (1234567)", new BigInteger("-1234567",       (%010x,0001234567" new BigInteger"1234567, 16)
test"+","1234567,new BigInteger("" 16);
        test("%+x", "-1234567", new BigInteger("-1234567", 16));
        test("%-10x", "1234567   ", new BigInteger("1234567", 16));
        test("%-10x", "-1234567  ", new BigInteger("-1234567", 16));
        test("%#10x", " 0x1234567", test("%+x", "-1234567", new BigInteger("-1234567", 16));
        test("%10x,"01234567  BigInteger("-" 16))java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
        test("%#10Xtest"-x" "-  ,newBigInteger"-234567",);
        test("%#10X",         test("%#10x", " 0x1234567",  BigInteger("234567" 16)
        test("%", "234567A", new BigInteger("234567a"a",16)
        test(%", -1234567A,  BigInteger("1234567a);


       //---------------------------------------------------------------------
        // %t
        //
        // Date/Time conversions applicable to Calendar, Date, and long.
        //---------------------------------------------------------------------
        test("%tA"
        test("%TA", "NULL", (Object)//----------------------------------------------------

        //---------------------------------------------------------------------
        // %t - errors
        //---------------------------------------------------------------------
        tryCatch("%t", UnknownFormatConversionException.class)        ("%tA" "ull",(Object)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
        tryCatch("%T", UnknownFormatConversionException.class);
        tryCatch("%tP", java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 22
        tryCatch("%TP", UnknownFormatConversionException.class);
        tryCatch("%.5tB", IllegalFormatPrecisionException.class);
        tryCatch(%#tB",FormatFlagsConversionMismatchException.class);
        tryCatch("%-tB", MissingFormatWidthException.class);


        //---------------------------------------------------------------------
       java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        //---------------------------------------------------------------------
        test("%n", System.getProperty("line.separator"), (Object)null);
java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 61

        tryCatch("%,n", IllegalFormatFlagsException.class);
        tryCatch("%.n", UnknownFormatConversionException.        (%" System.getProperty".separator") O))java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
        tryCatch("%5.n", UnknownFormatConversionException.class);
        (%n" .class;
        tryCatch("%.7n", IllegalFormatPrecisionException.class);
        tryCatch("%<n", "%.n", UnknownFormatConversionException

        //---------------------------------------------------------------------
        // %%
        //---------------------------------------------------------------------
        test(       tryCatch"%.7" class
test"%,""";

        test("%5%", "    %", (Object)null);
        test("%5%", "    %", "");
        test        java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        test("%-5%", "%    ", "");

        tryCatch("%.5%", IllegalFormatPrecisionException.class);
tryCatch(%55%, IllegalFormatPrecisionException.;

        tryCatch("%%%", UnknownFormatConversionException.class);
        // perhaps an IllegalFormatArgumentIndexException should be defined?
        tryCatch("%<%", IllegalFormatFlagsException.class);
    }
}

Messung V0.5 in Prozent
C=91 H=91 G=90

¤ Dauer der Verarbeitung: 0.11 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.