Fri, 17 Apr 2015 08:55:59 -0600
8075520: Varargs access check mishandles capture variables
8077786: Check varargs access against inferred signature
Reviewed-by: vromero
vromero@2535 | 1 | /* |
dlsmith@2788 | 2 | * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
vromero@2535 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
vromero@2535 | 4 | * |
vromero@2535 | 5 | * This code is free software; you can redistribute it and/or modify it |
vromero@2535 | 6 | * under the terms of the GNU General Public License version 2 only, as |
vromero@2535 | 7 | * published by the Free Software Foundation. |
vromero@2535 | 8 | * |
vromero@2535 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
vromero@2535 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
vromero@2535 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
vromero@2535 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
vromero@2535 | 13 | * accompanied this code). |
vromero@2535 | 14 | * |
vromero@2535 | 15 | * You should have received a copy of the GNU General Public License version |
vromero@2535 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
vromero@2535 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
vromero@2535 | 18 | * |
vromero@2535 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
vromero@2535 | 20 | * or visit www.oracle.com if you need additional information or have any |
vromero@2535 | 21 | * questions. |
vromero@2535 | 22 | */ |
vromero@2535 | 23 | |
vromero@2535 | 24 | /* |
vromero@2535 | 25 | * @test |
dlsmith@2788 | 26 | * @bug 8075520 |
dlsmith@2788 | 27 | * @summary Varargs access check mishandles capture variables |
dlsmith@2788 | 28 | * @compile VarargsAndWildcardParameterizedTypeTest2.java |
dlsmith@2788 | 29 | * @compile -source 8 VarargsAndWildcardParameterizedTypeTest2.java |
dlsmith@2788 | 30 | * @compile -source 7 VarargsAndWildcardParameterizedTypeTest2.java |
vromero@2535 | 31 | */ |
vromero@2535 | 32 | |
dlsmith@2788 | 33 | class VarargsAndWildcardParameterizedTypeTest2 { |
dlsmith@2788 | 34 | interface I { |
dlsmith@2788 | 35 | <T> void m(T... t); |
vromero@2535 | 36 | } |
vromero@2535 | 37 | |
dlsmith@2788 | 38 | interface Box<T> { |
dlsmith@2788 | 39 | T get(); |
dlsmith@2788 | 40 | } |
dlsmith@2788 | 41 | |
dlsmith@2788 | 42 | void m(I i, Box<? extends Number> b) { |
dlsmith@2788 | 43 | i.m(b.get()); |
vromero@2535 | 44 | } |
vromero@2535 | 45 | } |