langtools/test/tools/javac/T6326754.java
author katleman
Thu, 21 Aug 2014 14:16:14 -0700
changeset 25878 6d561031123e
parent 5520 86e4b9a9da40
permissions -rw-r--r--
Added tag jdk9-b27 for changeset 98ce0879ab4c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4699
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4699
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
4699
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     4
 *
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     8
 *
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    13
 * accompanied this code).
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    14
 *
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    18
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4699
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4699
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 4699
diff changeset
    21
 * questions.
4699
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    22
 */
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    23
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    24
/*
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    25
 * @test
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    26
 * @bug 6326754
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    27
 * @summary Compiler will fail to handle -Xmaxerrs with -ve numbers
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    28
 *
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    29
 * @compile/fail/ref=T6326754.out -XDrawDiagnostics -Xmaxerrs -1 T6326754.java
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    30
 * @compile/fail/ref=T6326754.out -XDrawDiagnostics -Xmaxerrs  0 T6326754.java
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    31
 * @compile/fail/ref=T6326754.out -XDrawDiagnostics -Xmaxerrs 10 T6326754.java
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    32
 * @compile/fail/ref=T6326754.out -XDrawDiagnostics              T6326754.java
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    33
 */
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    34
class TestConstructor<T,K>{
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    35
    T t;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    36
    K k;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    37
    public TestConstructor(T t,K k){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    38
        this.t =t;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    39
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    40
    public TestConstructor(K k){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    41
        this.k = k;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    42
        this.t = null;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    43
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    44
    public TestConstructor(T t){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    45
        this.t=t;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    46
        this.k=null;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    47
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    48
    public void setT(T t){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    49
        this.t=t;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    50
        this.k=null;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    51
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    52
    public void setT(K k){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    53
        this.k = k;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    54
        this.t = null;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    55
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    56
    public void setT(T t,K k){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    57
        this.t = t;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    58
        this.k = k;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    59
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    60
}
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    61
class TestC<T>{
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    62
    T t;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    63
    public <T>void setT(T t){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    64
        this.t = t;
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    65
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    66
}
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    67
public class T6326754{
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    68
    public static void main(String... arg){
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    69
        TestC tC =new TestC();
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    70
        tC.setT();
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    71
        TestConstructor tc = new TestConstructor("saaa");
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    72
        tc.setT("sasa");
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    73
        TestC<Integer> tC1 = new TestC();
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    74
        tC1.setT(545);
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    75
    }
e58edf3542b3 6326754: Compiler will fail to handle -Xmaxerrs with -ve numbers
jjg
parents:
diff changeset
    76
}