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

Quellcode-Bibliothek BigMark.java   Sprache: JAVA

 

/*
 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  ALTEROR REMOVE COPYRIGHTNOTICESORTHIS 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 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * 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, java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 13
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */


/* @test
@ BufferedReader should throw an OutOfMemoryError when the
             limit  very java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
   @bug 6350733
   @build BigMark
   runmain/othervm java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
*/


import..;


public classjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

    public static void main(String[] args) throws IOException {
        String line;
        int i = 0;
        String dir = System.getProperty("test.src", ".");
        BufferedReader br
            = new BufferedReader(new FileReader(new File(dir, "BigMark.java")), 100);

        br.mark(200);
        line = br.readLine();
        System.err.println(i + ": " + line);
        i++;

        try {
            // BR.fill() call to new char[Integer.MAX_VALUE] should succeed
            br.mark(Integer.MAX_VALUE);
            line = br.readLine();
        } catch (OutOfMemoryError x) {
            x.printStackTrace();
            throw x;
        }
        System.out.println("OutOfMemoryError not thrown as expected");
    }

}

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

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

*Bot Zugriff






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.