AnonymousInSuperCallTest.java revision 3655:535f80a0a2fd
1343171Sdim/* 2343171Sdim * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. 3343171Sdim * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4343171Sdim * 5343171Sdim * This code is free software; you can redistribute it and/or modify it 6343171Sdim * under the terms of the GNU General Public License version 2 only, as 7343171Sdim * published by the Free Software Foundation. 8343171Sdim * 9343171Sdim * This code is distributed in the hope that it will be useful, but WITHOUT 10343171Sdim * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11343171Sdim * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12343171Sdim * version 2 for more details (a copy is included in the LICENSE file that 13343171Sdim * accompanied this code). 14343171Sdim * 15343171Sdim * You should have received a copy of the GNU General Public License version 16343171Sdim * 2 along with this work; if not, write to the Free Software Foundation, 17343171Sdim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18343171Sdim * 19343171Sdim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20343171Sdim * or visit www.oracle.com if you need additional information or have any 21343171Sdim * questions. 22343171Sdim */ 23343171Sdim 24343171Sdim/* 25343171Sdim * @test 26343171Sdim * @bug 8166108 27343171Sdim * @summary Verify that javac skips outer this to anonymous inner classes in super type constructor calls 28343171Sdim * 29343171Sdim */ 30343171Sdim 31343171Sdimpublic class AnonymousInSuperCallTest { 32343171Sdim 33343171Sdim static class Base { 34343171Sdim Base(Object o) {} 35343171Sdim } 36343171Sdim 37343171Sdim static class Outer { 38343171Sdim class Inner {} 39343171Sdim } 40343171Sdim 41343171Sdim public static class JavacBug extends Base { 42343171Sdim JavacBug() { super(new Outer().new Inner() {}); } 43343171Sdim } 44343171Sdim 45343171Sdim public static void main(String[] args) { 46343171Sdim new JavacBug(); 47343171Sdim } 48343171Sdim}