test/tools/javac/boxing/T6816548.java

Thu, 21 Feb 2013 15:26:46 +0000

author
mcimadamore
date
Thu, 21 Feb 2013 15:26:46 +0000
changeset 1599
9f0ec00514b6
parent 554
9d9f26857129
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8007461: Regression: bad overload resolution when inner class and outer class have method with same name
Summary: Fix regression in varargs method resolution introduced by bad refactoring
Reviewed-by: jjg

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

mercurial