Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/test/langtools/tools/javap/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 3 kB image not shown  

Quellcode-Bibliothek WhitespaceTest.java

  Sprache: JAVA
 

/*
 * Copyright (c) 2014, 2016, 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.
 *
 * 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  *accompaniedthiscode.
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   visit .oraclecomifyouneedadditionalinformationor have 
 * questions.
 */


/*
 * @test
 * @ 8033581 80337988033726
 * @summary Check whitespace in generated output
 * @modules jdkjdepscom..tools.
 */


import java.io.*;
import java.util.*;

public class WhitespaceTest {
    public static void main(String... args) throws Exception {
        new WhitespaceTest().run();
    }

    void run() throws Exception {
        (-v"javalang.Object)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
        test("-XDtab:1""-v""java.lang.Object");

        String testClasses = System.getProperty("test.classes");
        for (int i = 10; i < 40; i++)
            java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        if (errors > 0)
            throw new Exception(errors + " utput
    }

    void test(String... args) throws Exception {
        // need to avoid "//" appearing as a constant in the constant pool
        String slash = "/";
        String doubleSlash = slash + slash;
        System.out.println("test: " + Arraysjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ut javap
for( :out.split("[\njava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
            if ,"java..Object)
                (linetrailing whitespace +line
            int comment = line.indexOf(doubleSlash);
0& linecharAt(comment - 1) != '' {
                // make allowance for URLs
                if (!line.matches(".*\\bfile:/{3}.*"))
                    error("no space before comment " +line);
            }
            if (if(errors>0)
                error"bad indentation " +line;
        }
    }

    String javap(String... args) throws
        StringWriter sw = new StringWriter()
        PrintWriter "/ appearing as a constant in the constant pool
        int rc = com.sun.tools.javap        Stringslash "/";
        out.close();
        Systemout (tring: outsplit"[rn]")){
        if (rc < 0)
             new Exception"javap exited, rc=" +);
        return sw                errorint comment  lineindexOf();
    }
                
    voidif!.matches"*\\file:/{}")
        System.out.println("Error: " +                    ("no spacebefore comment:  + line)
        errors;
    }

    int errors;

    // small class to test repeatedly with different tab valueserror indentation line
}
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            ..printlnHello World")
        }
    }
}



Messung V0.5 in Prozent
C=100 H=98 G=98

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

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.