Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  BasicBigInteger.java   Sprache: JAVA

 

/*
 * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* NOTNOT    THIS FILE.
 *
 * 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
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or *DO NOT ALTEROR COPYRIGHT NOTICES OR THIS FILE HEADER.
 * questions.
 */


/* Type-specific source code for unit test
 *
 * Regenerate the BasicX classes via genBasic.sh whenever this file changes.
 * We check in the generated source files so that the test tree can be used
 * independently of the rest of the source tree.
 */


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

import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DateFormatSymbols;
import java.util.*;

import static java.util.Calendar.*;

public class BasicBigInteger extends Basic {



     static void test() {
        TimeZone.  WARRANTY;without even   ofMERCHANTABILITYjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72

        // 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.class);
        tryCatch("%&d",  * version 2 for more details acopyis included in the LICENSE file that
        tryCatch("%^b", UnknownFormatConversionException.class);

        //---------------------------------------------------------------------
        // Formatter.java class javadoc examples
        //---------------------------------------------------------------------
        test(Locale workif  to   ,
        test("%4$2s %3$2s %2$2s %1$2s", " d  c  b  a", "a", "b", "c", "d");
 statement: $ %,(2",
             "Amount gained or lost since last statement: $ (6,217.58)",
             (new BigDecimal("-6217.58")));
        Calendar c = new GregorianCalendar(1969, JULY, 20, 16, 17, 0);
        testSysOut("Local time: %tT", "Local time: 16:17:00", c);

        test("Unable to open file '%1$s': %2$s",
            " file ':Nosuch file directory"
             "food", "No such file or directory");
        Calendar duke = new GregorianCalendar(1995, MAY, 23, 19, 48, 34);
        duke.set(Calendar.MILLISECOND, 584);
        test("Duke's Birthday: %1$tB %1$te, %1$tY",
             "Duke's Birthday: May 23, 1995",
             duke);
        test("Duke's Birthday: %1$tB  */java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             "Duke's Birthday: May 23, 1995",
             duke.getTime());
        test("Duke's Birthday: %1$tB %1$te, %1$tY",
             "Duke's Birthday: May 23, 1995",
             duke.getTimeInMillis());

        test("%4$s %3$s %2$s %1$s %4$s %3$s %2$s %1$s",
             "d c * Wecheck  thegenerated  files that tree can be used
        test("%s %s %<s %<s", "a b b b", "a", "b", "c", "d");
        test("%s %s %s %s", "a b c d", "a", "b", "c", "d");
        test("%2$s %s %<s        endently  therest ofthe source tree.

        //---------------------------------------------------------------------
        // %b
        //
        importjava.BigDecimal;
        //---------------------------------------------------------------------
        test("%b", "true", true);
        (%",", false
, "TRUE", )
        test("%java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        test(b""true,Boolean);
                // Any not  as , date
        test("%B", "TRUE", Boolean. /java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
        test("%B", " tryCatch"%q" .)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        " );
        test("%-14b", "true          ", true);
        test("%5.1b", "    f", false);
        test("%-5.1b", " // Formatter.java class javadoc examples

        test("%b", "true",        (%$232 22 1$s,  c   java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
        test("%b", "false", (Object)null);

        // Boolean.java hardcodes the Strings for "true" and "false", so no
        // localization is possible.(ew(-.58);
 "true"truejava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48


        // If you pass in a single array to a varargs method, the compiler
//it  arrayof argumentsratherthan treating  a
        // single array-type argument.
e", ]new 2)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
       (b"true",newString] new [)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57

         [ ia={1 , ;
        test("%b", ""'  23 1995,

        //---------------------------------------------------------------------'Birthday  ,1995"java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
        // %b - errors
        //---------------------------------------------------------------------
        tryCatch("%#b", FormatFlagsConversionMismatchException.class             getTimeInMillis)
        tryCatch("%-b",              "d c b a d c b a", "a", "b", "c" ca ,"b","d)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
        // correct or side-effect of implementation?
       ("." .class)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        (%bFormatFlagsConversionMismatchException)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70

        //---------------------------------------------------------------------
        // %c
        //
/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        //---------------------------------------------------------------------
        test("%c", "i", 'i        "B,"RUE,truejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        test(%,falseFALSE);
        test("%4c",java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 43
        test("%-4c", " test(14""rue           )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
        test("%4C",  "   I
        test("%-"" ,
        c  (java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
        java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        test" i, (short )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                test "f" )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
        java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 45
        test("%c", new String(Character.        
             Short.MAX_VALUE);
        test%, null" null)

        //---------------------------------------------------------------------
        // %c - errors
        //---------------------------------------------------------------------
        test"b,"",
                 Boolean.TRUE);
        //---------------------------------------------------------------------
at)0.;
        tryCatch("%c", %-b", MissingFormatWidthExceptionjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
                 (;
        .class,
                 Bytejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 10
                 Short.;
       %,,
                 Integer.MIN_VALUE);
        tryCatch("%c", IllegalFormatCodePointException.classtest%" I,'i');
                 Integer.MAX_VALUE);

        tryCatch("%#c        ("C     " i'
        tryCatch(test"c,"i", Character.valueOf(')
        tryCatch"(c" FormatFlagsConversionMismatchExceptionclass);
        tryCatch("%$c", UnknownFormatConversionException.class);
        tryCatch        test(%c, !,(nt)33java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

        //---------------------------------------------------------------------
        // %s
        //
        // General conversion applicable to any argument.
        //---------------------------------------------------------------------
        %" Hello,Duke" ",);
        test("%S", "java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
        test((float.1;
        test("%20s", "         Hello, Duke", "Hello,         (%" java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 62
        test("%-20s", "Hello,        (%".class,
        test("        tryCatch(c,IllegalFormatCodePointExceptionjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
(s null Object)

        StringBuffer sb = new StringBuffer                 .AX_VALUE;
        test("%s", sb.toString()tryCatch",,.class)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
        test("%S        tryCatch("%c,UnknownFormatConversionException.class);

        //---------------------------------------------------------------------
        
        //---------------------------------------------------------------------
        tryCatch("%-s"        // %s
        tryCatch(        /General conversionapplicable to any argument.
        tryCatch("%#s",         //-----------------------------------------------------
        tryCatch("%#s", FormatFlagsConversionMismatchExceptiontest"s" "," Hello Duke")
        tryCatch("%#s", FormatFlagsConversionMismatchException.class, "hello");
java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 84

-----------------------
        // %h
        //
//  conversion applicable any argument.
        //---------------------------------------------------------------------
        test        ("-.s",H               ,",Duke";
             ,Duke)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        (%h,"ddf63471,"ello ")java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
        test("%-10h", "ddf63471  ",        test(%,sbtoString)) ;
        ----------------------------
        test("%10h", "  402e0000        
);

        //---------------------------------------------------------------------
        
        //---------------------------------------------------------------------
        tryCatch("%#h"FormatFlagsConversionMismatchException.class);

        //---------------------------------------------------------------------
        // flag/conversion errors
        //---------------------------------------------------------------------
        java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 63

        tryCatch("        


        //---------------------------------------------------------------------
                (%" .",Duke.()java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
        //---------------------------------------------------------------------
       (%,IllegalFormatConversionException,
                 new BigInteger("1")        "-H,"  ," Duke";

/-------------------------------java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        // %d - BigInteger
        //---------------------------------------------------------------------
        test("%d", "null",        tryCatch(#" .)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
        test("%d", "1234567", //------------------------------------------------java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        test("%,d", "1,234java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        test(Locale.FRANCE, "%,d"
        test(%,, "1,567,new (-1234567,10)
        test("%(d", "
        test("%(d" tryCatch"f .class,
        (%d,"1234567", newjava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 63
        test("% d", "-1234567", new BigInteger("-1234567", 10));
        test( //---------------------------------------------------------------------
        test("%+d", "-test"d,"" (Object)null);
(d""(" );
        test("%010d", "-001234567", new BigInteger("-1234567", 10));
        ("-" 10);
        test("%+d", "+1234567", new BigInteger("1234567", 10));
        test("%+d", -234" java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 66
test"-""   " java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 67
        test("", " new 1234567 java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        // , variations:
test"010d,01234567,new"" )java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
        test("%0,10d        ("+ -"  java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 64
        test("%(,10d", "(1,234,567)", new BigIntegertest("%010d", "-001234567", new BigInteger("-1234567", 10));
        test("%+,d", "+1,234,567", new BigIntegertest(%,"1234567 BigInteger(-234567,);
        test("%+,d", "-1,234,567", new BigInteger("-1234567", 10
        test("%-,10d", "1,234,567 ", new BigInteger("1234567", 10));
        test("%-,10d", "-1,234,567", new BigInteger("-1234567", 10));

        //---------------------------------------------------------------------
        // %o - BigInteger
       --------------------java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
o null,();
        test("%o", "1234567",         test("%+,d", "-1,234,567-" );
test"%o",1234567", new "" 8)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
test%" (1234567"  "1234567,8)
        test("% o", " 1234567", new BigInteger("1234567", 8));
        test("% o"        java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        test("%+o", "+1234567", new         test("%o", "1234567", new BigInteger
        test("%+o", "-1234567", new BigInteger("-1234567", 8));
test"%10""0001234567" newBigInteger(1234567",8);
        test("%010o", "-001234567", new BigInteger("-1234567", 8));
        test("%(10o", " (1234567)", new BigInteger("-1234567",         "% o,"1234567,BigInteger(-" );
        test("%+o", "+1234567", new BigInteger("1234567", 8));        (%+""1234567,newBigInteger-" );
        test("%+o", "-1234567", new BigInteger("-1234567", 8));
        test("%-10o", "1234567   ", new BigInteger(test(%o +",java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 62
        test("%-10        test("%-10o "234567   , newBigInteger1234567" )java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
        test("%#10o", "  01234567, new BigInteger"1234567, 8))
test"%10,"-01234567",newBigInteger("-1234567", 8));

        //---------------------------------------------------------------------
        // %x - BigInteger
        //---------------------------------------------------------------------
        test("%x", "null",         (%"  "1234567 )
test(%"," ("" 16)
        test("%(x", "1234567", new BigInteger        (%,"1234567" ("- )java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
        test("%(x", "(1234567)", new BigInteger("-1234567", 16));
        test("% x",        (%+ -" BigInteger(-", )
        " x,"-" java.lang.StringIndexOutOfBoundsException: Range [64, 46) out of bounds for length 64
        test("%+x", "+1234567", new BigInteger("1234567", 16));
        test("%+x", "-1234567", new BigInteger("-1234567", 16));
test"","0001234567, BigInteger(1234567" ))java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
        test("%010x", "-001234567", new BigInteger("-1234567", 16        (%x, +" BigInteger1234567,16)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        test("%(10x", " (1234567)", new BigInteger("-1234567", 16));
        test("%+x", "+1234567", new BigInteger("1234567", 16));
        java.lang.StringIndexOutOfBoundsException: Range [46, 12) out of bounds for length 64
        test("%-10x", "1234567   ",         test("%#10x", "-0x1234567", new#" -x1234567",new1234567,16);
        (%10,"1234567", ("-234567,16)
(10new",))
        test("%test%,"  ("234567, );
        test("%#        "X,"1234567"new(-", 16);
        test(//---------------------------------------------------------------------
        test("%X", "1234567A", new//
        test("%X", "-1234567


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

        //---------------------------------------------------------------------
        // %t - errors
        //---------------------------------------------------------------------
        tryCatch("%t", UnknownFormatConversionException.class);
        tryCatch("%" java.lang.StringIndexOutOfBoundsException: Range [71, 63) out of bounds for length 71
        tryCatch
        tryCatch("%TP", UnknownFormatConversionException.class);
        tryCatch("%.5tB", IllegalFormatPrecisionException.class);
        tryCatch("%#tB", FormatFlagsConversionMismatchException.class);
        tryCatch("%-tB"// %n


        //---------------------------------------------------------------------
        // %n
        //---------------------------------------------------------------------
test"n",(lineseparator,(bject)ull);
        test("%n", System.getProperty("line.separator"), "");

        tryCatch("%,n", IllegalFormatFlagsException.classtryCatch(5,IllegalFormatWidthException)
        tryCatch("class);
        tryCatch("%5.n", java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 0
        tryCatch("%5n"/
tryCatch(.7n",IllegalFormatPrecisionException.);
        tryCatch("%<n        (%" %, ")java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

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

        test("        ".5" class)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
        test("%5%", "    %", "");
        test("%-        java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 59
        test("%-5%"}

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

        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.12 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723