test/tools/javac/lambda/WarnUnderscoreAsIdent.out

Tue, 14 May 2013 11:11:09 -0700

author
rfield
date
Tue, 14 May 2013 11:11:09 -0700
changeset 1752
c09b7234cded
parent 0
959103a6100f
permissions
-rw-r--r--

8012556: Implement lambda methods on interfaces as static
8006140: Javac NPE compiling Lambda expression on initialization expression of static field in interface
Summary: Lambdas occurring in static contexts or those not needing instance information should be generated into static methods. This has long been the case for classes. However, as a work-around to the lack of support for statics on interfaces, interface lambda methods have been generated into default methods. For lambdas in interface static contexts (fields and static methods) this causes an NPE in javac because there is no 'this'. MethodHandles now support static methods on interfaces. This changeset allows lambda methods to be generated as static interface methods. An existing bug in Hotspot (8013875) is exposed in a test when the "-esa" flag is used. This test and another test that already exposed this bug have been marked with @ignore.
Reviewed-by: mcimadamore

     1 WarnUnderscoreAsIdent.java:29:9: compiler.warn.underscore.as.identifier
     2 WarnUnderscoreAsIdent.java:29:11: compiler.warn.underscore.as.identifier
     3 WarnUnderscoreAsIdent.java:31:8: compiler.warn.underscore.as.identifier
     4 WarnUnderscoreAsIdent.java:31:10: compiler.warn.underscore.as.identifier
     5 WarnUnderscoreAsIdent.java:33:7: compiler.warn.underscore.as.identifier
     6 WarnUnderscoreAsIdent.java:34:12: compiler.warn.underscore.as.identifier
     7 WarnUnderscoreAsIdent.java:35:10: compiler.warn.underscore.as.identifier
     8 WarnUnderscoreAsIdent.java:35:19: compiler.warn.underscore.as.identifier
     9 WarnUnderscoreAsIdent.java:37:16: compiler.warn.underscore.as.identifier
    10 WarnUnderscoreAsIdent.java:40:18: compiler.warn.underscore.as.identifier
    11 WarnUnderscoreAsIdent.java:40:25: compiler.warn.underscore.as.identifier
    12 WarnUnderscoreAsIdent.java:40:33: compiler.warn.underscore.as.identifier
    13 WarnUnderscoreAsIdent.java:43:34: compiler.warn.underscore.as.identifier
    14 WarnUnderscoreAsIdent.java:46:9: compiler.warn.underscore.as.identifier
    15 WarnUnderscoreAsIdent.java:48:19: compiler.warn.underscore.as.identifier
    16 WarnUnderscoreAsIdent.java:50:9: compiler.warn.underscore.as.identifier
    17 WarnUnderscoreAsIdent.java:52:22: compiler.warn.underscore.as.identifier
    18 - compiler.err.warnings.and.werror
    19 1 error
    20 17 warnings

mercurial