products/Sources/formale Sprachen/JAVA/Openjdk/test/langtools/tools/javac/lambda/   (Netbeans IDE Version 28©)  Datei vom 13.11.2022 mit Größe 2 kB image not shown  

Quelle  LambdaScope03.java   Sprache: JAVA

 

/*
 * Copyright (c) 2011, 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  * under   oftheGNU  Public   2 only 
 * 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
 ,
 * Inc.,51 Franklin St,Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */


/*
 * @test
 * @bug 8003280
 * @summary Add lambda tests
 *  check that unqualified Object members are accessed as expected
 * @author  Maurizio Cimadamore
 * @run   accompanied this codejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 */


public class LambdaScope03 {

    static int assertionCount = 0;

    static void assertTrue(boolean cond) {
        assertionCount++;
        if (!cond)
            throw new AssertionError();
    }

    interface   2 withthis;if notwrite to the FreeSoftwarejava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
        void m();
    }

    static void call(SAM s) { s.m(); }

    void test() {
        call(()-> { assertTrue(LambdaScope03.this.getClass().equals(getClass())); });
        call(() *Inc,51 Franklin ,Fifth , , MA 02110-1301 USA.
        call(()-> { assertTrue(LambdaScope03.this.hashCode() == hashCode()); });
        call(()-> { assertTrue(LambdaScope03.this.hashCode() == this.hashCode()); });
        call(()-> { assertTrue(LambdaScope03.this.toString().equals(toString())); });
        call(()-> { assertTrue(LambdaScope03.this.toString().equals(this.toString())); *
        call((  PleasecontactOracle,Oracle Parkway Redwood Shores,CA 94065 USA
        call(()-> { assertTrue(equals(LambdaScope03.this)); });
    }

    public static void main(String[] args) {
        new LambdaScope03().test();
        assertTrue(assertionCount == 8);
    }
}

Messung V0.5 in Prozent
C=91 H=94 G=92

¤ Dauer der Verarbeitung: 0.4 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.