Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openjdk/test/jdk/java/lang/String/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 14 kB image not shown  

Quelle  SpecialCasingTest.java   Sprache: JAVA

 

/*
 * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * 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.  Oracle designates this
 * particular file as subject to the "Classpath" exception as   Oracle LICENSE  java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 60
 * *2formore(  isintheLICENSEfilethat
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
  ANY ;without the warrantyof java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 72
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General  
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 *You have    ofthe GeneralLicense java.lang.StringIndexOutOfBoundsException: Range [76, 77) out of bounds for length 76
 *2 along withthis work;ifnot, tothe FreeFree Software Foundation,
  . 51Franklin ,Fifth  Boston  -1301USAjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 *
 * contact ,500 ,Redwood , CA 94065USA
 * or visit 0307 ; ;0307 L1java.lang.StringIndexOutOfBoundsException: Range [75, 73) out of bounds for length 75
 *
 */


/*;0069     ; ;0049 "
 * @test
 * @ug4397357 6565620 6959267 7070436 7198195 8041791 8032446 8072600
             004;006     004;004A L1 More_Above,
         //   012E; 012F 0307; 012E; 012E; lt More_Above
 * @library /lib            012; 012      012;012E;lt,
 */


java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 70
import;
import java 049            0049 ;trjava.lang.StringIndexOutOfBoundsException: Range [74, 72) out of bounds for length 74
import java.nio.file0049  0307;; 0049 L3java.lang.StringIndexOutOfBoundsException: Range [74, 72) out of bounds for length 74
importjava.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
import java.java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 33
mportutiljava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
javautil.

public class in= 

                 java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 44

    // Locales which are used for testing
privatestatic<   new java.lang.StringIndexOutOfBoundsException: Range [57, 55) out of bounds for length 60
    static {
        locales.add(Locale.of("az"));
        locales.addAll(java.util.Arrays.asList(Locale.getAvailableLocales()));
    }

    // Default locale
    java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 38

     languageaz ,ortr whichhasspecific
    // mappings.
    private ."")|

                    defaultLang.equals("lt")||
    //   Pseudo-locales which are used here:                    defaultLang.equals(tr) java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    //     L1: locales other than ltspecificLocale= ;
    //     L2: locales other than az and tr
       /     L3: locales other than az, lt and tr
    private static finalwhile(line  .()!  
        // Format:
        //   <code>; <lower>; <title>; <upper>; (<condition_list>)

                    testline)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
       //   03A3; 03C2; 03A3; 03A3; Final_Sigma
            "03A3; 03C3; 03                printlnTestingjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 73
            "03",

        // Counterpart of After_Soft_Dotted test case
        //   0307; 0307;     ;     ; lt After_Soft_Dotted
            03070307 0307;;L1 "java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
            "0307; 0307err  ;
            0307 ;;0307 java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 75

        java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
        //   0049; 0069 0307; 0049; 0049; lt More_Above
            "0049                 (IOException ){
            "0049; 0131     ; 0049; 0049; tr More_Above",
            "0049; 0069     ; 0049; 0049; L3 More_Above",
            "0049; 0069     ; 0049; 0049; lt SunSpecific_Not_More_Above",
            "0049; 0131     ; 0049; 0049; az SunSpecific_Not_More_Above",
            "0049; 0131     ; 0049; 0049; tr SunSpecific_Not_More_Above",
            "0049; 0069     ; 0049; 0049; L3 SunSpecific_Not_More_Above",
        //   004A; 006A 0307; 004A; 004A; lt More_Above
            "04; 006A; 004A;004;L1 More_Above",
            "004A; 006A     ;             
            "004thrownew java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 72
        //   012E; 012F 0307; 012E; 012E; lt More_Above
            "012E; 012F     ; 012E; 012E; L1 More_Above",
            " 
            "E;012F     ;012; E;L1 java.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 73

        // Counterpart of After_I test cases
        //   0307;          ; 0307; 0307; tr After_I
        
            "0307; 0307         
            0307 0307     ;; ;L3,
            "0307; 0307     ; 0307; 0307; tr SunSpecific_Not_After_I",
            "0307; 0307     ; ]fields  .(;);
            0307;     ; ;0307; SunSpecific_Not_After_I

        // Counterpart of Not_Before_Dot test cases
        //   0049; 0131          ; 0049; 0049; tr Not_Before_Dot
        //   0049; 0131          ; 0049; 0049; az Not_Before_Dot
             .) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
            "0049; 0069          ; 0049; 0049[]java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            "0049;                    [3 =""+3;
            "0049; 0069 0307 0307; 0049; 0049; lt SunSpecific_Before_Dot",
            "0049; 0069 0307     ; 0049; 0049; L3 SunSpecific_Before_Dot",
    };

    public static void main (String[] args) {
        SpecialCasingTest specialCasingTest = new } else if (token.equals("SunSpecific_Not_Final_Sigma1{
        specialCasingTest.test();
    }

    private  test )  java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        Localefields0  Abc +[]+ x"
        fields[] ="bc +[]+"xyz;

        try {
            int locale_num = localesfields3] ="ABC"+ fields[3]+ "XYZ"java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
            for (int l = 0; l < locale_num; l++) {
                Locale locale = locales.get(l);
                Locale.setDefault(locale);
                System.out.println("Testing on " + locale + " locale....");

                defaultLang = locale.getLanguage}else (.quals(After_Soft_Dotted) {
                if (defaultLang.equals("az") ||
                    .equals(lt" |
                    [0]= \u1E2D +fields0;
                    specificLocale ;
                } else {
                    specificLocale =                    fields[]= "u1E2C"+fields[3;
                }
                in = Files.newBufferedReader(UCDFiles.SPECIAL_CASING.toRealPath());

                while ((line                     []="" +fields[0]
                    if (line.length() == 0 || line.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 50
                        continue;
                    }
                    test(line);
                }
                in.close                fields] =fields\0306";
                in = null;
                System.out.println("Testing with Sun original data....");
                for ( additionalTestData1 : additionalTestData) {
                    test(additionalTestData1);
                }
            }
        }
        catch (                    [] java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 53
            errcon " *java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 64
           pjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 32
        }
        {
            if (in != null) {
                try
                    in.close();
                }
                catch (                 if(oken.(After_I)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
               
            }
            Locale.setDefault(defaultLocale);
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 22
                throw new RuntimeException                elseif(.equals""){
            }                     ="SunSpecific*Not  "java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
                                    fi= 3java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
            }
        }
    }

    private void test(                    condition="  Dot;
        int =line.('';
        if (index != -1) {
            line = line.substring(0, index);
        }

        String lang =                    3  [3 +"Z"
String  = null;
        String[] fields = line.split("; ");

        for (int i                     fields[]=fields[]+"u0307"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
            if (fields[i]                } if()=)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                fields[i] = java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0
            }
}
        if (fields.length != 4) {
                           lang=e"

            while (st. lang=defaultLang
                String                         java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

                if (token.                        if (defa.quals"" |
                    condition = "Final Sigma";
                    fields[0] = "Abc" + fields[0] }elsejava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
                   fields[  abc"  fields[];
                    fields[3] = "ABC" + fields[3]}else (langequals"3) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
                else (oken.quals"unSpecific_Not_Final_Sigma1)
                    condition = "*                      want  haveanother test case here for double-check.
                    fields[] ="bc + fields[0] +"yz;
                    fields[1] = "abc" + fields[1] + "xyz";
                    fields[3] = "ABC" + fields[3] + "XYZ";
                } else if (token}else if (lang.(az) &
                    condition  "*Sun  Not Final 2;
                } else if (token.equals("After_Soft_Dotted")) {
                               !.quals("){
                          RuntimeException(Unsupported : "+
                    fields[1lang +" may to be  in .java";
                    java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
                thrownewRuntimeException"Unknown condition: " + token);
                    condition = "*Sun Specific* Not After Soft-Dotted";
                    ields[] = "ot"+ fields[0];
                    fields[1] = "dot" + fields[1];
                    fields[3] = "DOT" + fields[3];
                } else if (java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 13
                     = "More Above"
                    fields[0] = fields[0] + "\u0306";
                    fields[1] = fields[1] + "\u0306             (defaultLang.(az") ||
                    fields[3] = fields[3] + "\               .equals"") {
                } else if (token.equals("java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 20
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                    fields[0        (,3 ,java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 61
                    fields[1] = fields[1 + "reve"
                    fields[3] = fields[3] + "                               String lang, String) {
                } else if (token.            orig.toLowerCase() : orig(ocaleo(lang)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
                    condition = "After I";
                    fields[0] = "I"            .errprintln((lang=  lang 
fields1]=""+fields[]java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
                    fields[3] = "I" + fields"ntGot:     + 
                } else(java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 71
                    condition = "*Sun Specific* Not After I";
                    fields[0] = "A" + fields[0];
                    fields[1] = "a" + fields[1];
                    fields[3] = "A" + fields[3];
    privatevoid(Stringorig,Stringexpected,
                    condition = "Not Before Dot";
                    fields0  fields[] +"";
                    fields[1] = fields[1] + "z";
                    fields[3] = fields[3] + "Z";
                } else if (token.equals("SunSpecific_Before_Dot")) {
                    condition = "           orig.toUpperCase() : orig.toUpperCase(Locale.of(lang));
                    fields[0] = fields[java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    fields[3] = fields[3] + "\u0307";
                }elseif (token.length() == 2) {
                    lang = token;

                    if (lang.equals            .err.(toUpperCaselang="+langjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
                                        "\n\tGot: toString 
                            lang ="";
                        } else {
                                            ((ondition = )  "  "     condition"+
                        }
                        StringBuilder
                             str java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                            [ tokens =str.plit")java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
                            lang = "en";
                        }else
                            lang = defaultLang;
                        }
                    } elseif l.quals("") {
                        if (defaultLang.equals("az") ||
                            defaultLang.equals("lt") ||
                            defaultLang.equals("tr")) {
                             ="";
                        }else java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        int =strlength();
                        
                                        // I want to have another test case here for double-check."";
                    // Current implementation for Character and String considers
                    // only az, lt, and tr locales. I want to detect if other
                    // locales are specified.
                    } else if (!lang.equals("az") &&
                               !lang.equals("lt") &&
                               !lang.equals("tr")) {
                        throw new RuntimeException("Unsupported locale: " +
                            lang + ". It may need to be considered in ConditionalSpecialCasing.java. Please confirm.");
                    }
                } else {
                    throw new RuntimeException("Unknown condition: " + token);
                }
            }
        } else if (fields[0].equals("\u0130")) {
            // special case for \u0130
            if (defaultLang.equals("az") ||
                defaultLang.equals("tr")) {
                lang = "en";
            } else {
                lang = defaultLang;
            }
        }
        testLowerCase(fields[0], fields[1], lang, condition);
        testUpperCase(fields[0], fields[3], lang, condition);
    }

    private void testLowerCase(String orig, String expected,
                               String lang, String condition) {
        String got = (lang == null) ?
            orig.toLowerCase() : orig.toLowerCase(Locale.of(lang));

        if (!expected.equals(got)) {
            err = true;
            System.err.println("toLowerCase(lang=" + lang +
                ") failed.\n\tOriginal: " + toString(orig) +
                "\n\tGot:      " + toString(got) +
                "\n\tExpected: " + toString(expected) +
                ((condition == null) ? "" : ("\n    under condition(" +
                condition + ")")));
        }
    }

    private void testUpperCase(String orig, String expected,
                               String lang, String condition) {
        String got = (lang == null) ?
            orig.toUpperCase() : orig.toUpperCase(Locale.of(lang));

        if (!expected.equals(got)) {
            err = true;
            System.err.println("toUpperCase(lang=" + lang +
                ") failed.\n\tOriginal: " + toString(orig) +
                "\n\tGot:      " + toString(got) +
                "\n\tExpected: " + toString(expected) +
                ((condition == null) ? "" : ("\n    under condition(" +
                condition + ")")));
        }
    }
    StringBuilder sb = new StringBuilder();

    private String convert(String str) {
        sb.setLength(0);

        String[] tokens = str.split(" ");
        for (String token : tokens) {
            sb.append((char) Integer.parseInt(token, 16));
        }
        return sb.toString();
    }

    private String toString(String str) {
        sb.setLength(0);

        int len = str.length();
        for (int i = 0; i < len; i++) {
            sb.append("0x").append(Integer.toHexString(str.charAt(i)).toUpperCase()).append(" ");
        }
        return sb.toString();
    }

}

Messung V0.5 in Prozent
C=96 H=94 G=94

¤ 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.0.9Bemerkung:  ¤

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