Thu, 03 Feb 2011 09:36:28 +0000
5017953: spurious cascaded diagnostics when name not found
Summary: when an operator is applied to one or more erroneous operands, spurious diagnostics are generated
Reviewed-by: jjg
mcimadamore@253 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
mcimadamore@253 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
mcimadamore@253 | 4 | * |
mcimadamore@253 | 5 | * This code is free software; you can redistribute it and/or modify it |
mcimadamore@253 | 6 | * under the terms of the GNU General Public License version 2 only, as |
mcimadamore@253 | 7 | * published by the Free Software Foundation. |
mcimadamore@253 | 8 | * |
mcimadamore@253 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
mcimadamore@253 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
mcimadamore@253 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
mcimadamore@253 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
mcimadamore@253 | 13 | * accompanied this code). |
mcimadamore@253 | 14 | * |
mcimadamore@253 | 15 | * You should have received a copy of the GNU General Public License version |
mcimadamore@253 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
mcimadamore@253 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
mcimadamore@253 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
mcimadamore@253 | 22 | */ |
mcimadamore@253 | 23 | |
mcimadamore@253 | 24 | /* |
mcimadamore@253 | 25 | * @test |
mcimadamore@253 | 26 | * @bug 6816548 |
mcimadamore@253 | 27 | * @summary Uninitialized register when performing casting + auto(un)boxing |
mcimadamore@253 | 28 | * @author mcimadamore |
mcimadamore@253 | 29 | */ |
mcimadamore@253 | 30 | public class T6816548 { |
mcimadamore@253 | 31 | |
mcimadamore@253 | 32 | public static void main(String[] args) { |
mcimadamore@253 | 33 | testInt(); |
mcimadamore@253 | 34 | testShort(); |
mcimadamore@253 | 35 | testByte(); |
mcimadamore@253 | 36 | testChar(); |
mcimadamore@253 | 37 | } |
mcimadamore@253 | 38 | |
mcimadamore@253 | 39 | public static void testInt() { |
mcimadamore@253 | 40 | final int fi = 0; |
mcimadamore@253 | 41 | Byte b = fi; |
mcimadamore@253 | 42 | Short s = fi; |
mcimadamore@253 | 43 | Character c = fi; |
mcimadamore@253 | 44 | } |
mcimadamore@253 | 45 | |
mcimadamore@253 | 46 | public static void testShort() { |
mcimadamore@253 | 47 | final short fs = 0; |
mcimadamore@253 | 48 | Byte b = fs; |
mcimadamore@253 | 49 | Short s = fs; |
mcimadamore@253 | 50 | Character c = fs; |
mcimadamore@253 | 51 | } |
mcimadamore@253 | 52 | |
mcimadamore@253 | 53 | public static void testByte() { |
mcimadamore@253 | 54 | final byte fb = 0; |
mcimadamore@253 | 55 | Byte b = fb; |
mcimadamore@253 | 56 | Short s = fb; |
mcimadamore@253 | 57 | Character c = fb; |
mcimadamore@253 | 58 | } |
mcimadamore@253 | 59 | |
mcimadamore@253 | 60 | public static void testChar() { |
mcimadamore@253 | 61 | final char fc = '0'; |
mcimadamore@253 | 62 | Byte b = fc; |
mcimadamore@253 | 63 | Short s = fc; |
mcimadamore@253 | 64 | Character c = fc; |
mcimadamore@253 | 65 | } |
mcimadamore@253 | 66 | } |