jjg@1563: /* jjg@1563: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. jjg@1563: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@1563: * jjg@1563: * This code is free software; you can redistribute it and/or modify it jjg@1563: * under the terms of the GNU General Public License version 2 only, as jjg@1563: * published by the Free Software Foundation. jjg@1563: * jjg@1563: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@1563: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@1563: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@1563: * version 2 for more details (a copy is included in the LICENSE file that jjg@1563: * accompanied this code). jjg@1563: * jjg@1563: * You should have received a copy of the GNU General Public License version jjg@1563: * 2 along with this work; if not, write to the Free Software Foundation, jjg@1563: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@1563: * jjg@1563: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jjg@1563: * or visit www.oracle.com if you need additional information or have any jjg@1563: * questions. jjg@1563: */ jjg@1563: jjg@1563: /* jjg@1563: * @test jjg@1563: * @bug 8008077 jjg@1563: * @summary new type annotation location: lambda expressions jjg@1563: * @compile Lambda.java jjg@1563: * @author Werner Dietl jjg@1563: */ jjg@1563: jjg@1563: import java.lang.annotation.*; jjg@1563: jjg@1563: public class Lambda { jjg@1563: jjg@1563: interface LambdaInt { jjg@1563: void generic(S p1, T p2); jjg@1563: } jjg@1563: jjg@1563: static class LambdaImpl implements LambdaInt { jjg@1563: LambdaImpl(S p1, T p2) {} jjg@1563: public void generic(S p1, T p2) {} jjg@1563: } jjg@1563: jjg@1563: LambdaInt getMethodRefTA(LambdaImpl r) { jjg@1563: return r::<@TA Object, @TB Object>generic; jjg@1563: } jjg@1563: jjg@1563: LambdaInt getConstructorRefTA() { jjg@1563: return LambdaImpl::<@TA Object, @TB Object>new; jjg@1563: } jjg@1563: jjg@1563: } jjg@1563: jjg@1563: @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) jjg@1563: @interface TA { } jjg@1563: jjg@1563: @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) jjg@1563: @interface TB { }