test/tools/javac/lambda/methodReferenceExecution/pkg/B.java

Fri, 22 Jan 2016 10:49:45 +0300

author
aefimov
date
Fri, 22 Jan 2016 10:49:45 +0300
changeset 3076
30f0dce3fbd3
permissions
-rw-r--r--

8068254: Method reference uses wrong qualifying type
Summary: Generated code fails with IllegalAccessError due to compiler's mishandling of packageprivate classes in method reference expressions.
Reviewed-by: rfield, mcimadamore

aefimov@3076 1 /*
aefimov@3076 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
aefimov@3076 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aefimov@3076 4 *
aefimov@3076 5 * This code is free software; you can redistribute it and/or modify it
aefimov@3076 6 * under the terms of the GNU General Public License version 2 only, as
aefimov@3076 7 * published by the Free Software Foundation.
aefimov@3076 8 *
aefimov@3076 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aefimov@3076 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aefimov@3076 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aefimov@3076 12 * version 2 for more details (a copy is included in the LICENSE file that
aefimov@3076 13 * accompanied this code).
aefimov@3076 14 *
aefimov@3076 15 * You should have received a copy of the GNU General Public License version
aefimov@3076 16 * 2 along with this work; if not, write to the Free Software Foundation,
aefimov@3076 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aefimov@3076 18 *
aefimov@3076 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aefimov@3076 20 * or visit www.oracle.com if you need additional information or have any
aefimov@3076 21 * questions.
aefimov@3076 22 */
aefimov@3076 23
aefimov@3076 24 package pkg;
aefimov@3076 25 class A {
aefimov@3076 26 public static void m() {
aefimov@3076 27 B.result += "A.m()";
aefimov@3076 28 }
aefimov@3076 29 }
aefimov@3076 30
aefimov@3076 31 public class B extends A {
aefimov@3076 32 public static String result = "";
aefimov@3076 33 }

mercurial