langtools/test/tools/javac/boxing/T6614974.java
author mcimadamore
Thu, 03 Feb 2011 09:38:19 +0000
changeset 8239 d2c934e951e2
parent 5520 86e4b9a9da40
permissions -rw-r--r--
7014715: javac returns different error code for certain failure(s) Summary: javac silently crashes when emitting certain kinds of resolution diagnostics Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
161
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 161
diff changeset
     2
 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
161
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     4
 *
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     8
 *
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    14
 *
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    18
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 161
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 161
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 161
diff changeset
    21
 * questions.
161
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    22
 */
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    23
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    24
/*
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    25
 * @test
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    26
 * @bug     6614974
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    27
 * @summary javac successfully compiles code that throws java.lang.VerifyError when run
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    28
 * @author  mcimadamore
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    29
 */
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    30
public class T6614974<T> {
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    31
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    32
    private T n;
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    33
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    34
    public void error() {
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    35
        T6614974<Integer> val = new T6614974<Integer>();
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    36
        val.n = 0;
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    37
        Integer.toString(val.n++);
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    38
    }
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    39
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    40
    public static void main(String[] args) {
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    41
        T6614974.class.getMethods();
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    42
    }
bfe63856332f 6614974: javac successfully compiles code that throws java.lang.VerifyError when run
mcimadamore
parents:
diff changeset
    43
}