Quellcodebibliothek Statistik Leitseite products/Sources   (Sun/Oracle ©)  Datei vom mit Größe 0 B image not shown  

SSL BadAccess.java   Sprache: JAVA

 

/*
 * @test /nodynamiccopyright/
 * @bug 8003280
 * @summary Add lambda tests
 *  check that non-static variables are not accessible from static lambdas
 * @author  Maurizio Cimadamore
 * @compile/fail/ref=BadAccess.out -XDrawDiagnostics BadAccess.java
 */


public class BadAccess {

    int i;
    static int I;

    interface SAM {
        int m();
    }

    static void test1() {
        int l = 0; //effectively final
        final int L = 0;
        SAM s = ()-> i + I + l + L;
    }

    void test2() {
        int l = 0; //effectively final
        final int L = 0;
        SAM s = ()-> i + I + l + L;
    }
}

Messung V0.5 in Prozent
C=91 H=100 G=95

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-09-29) ¤

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

sprechenden Kalenders