langtools/test/tools/javac/6717241/T6717241a.java
author mcimadamore
Thu, 24 Jul 2008 19:06:57 +0100
changeset 939 38e24969c7e9
child 3766 7e2df99e9223
permissions -rw-r--r--
6717241: some diagnostic argument is prematurely converted into a String object Summary: removed early toString() conversions applied to diagnostic arguments Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
939
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     1
/*
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     2
 * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     4
 *
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     8
 *
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    14
 *
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    18
 *
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    21
 * have any questions.
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    22
 */
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    23
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    24
/**
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    25
 * @test
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    26
 * @bug     6717241
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    27
 * @summary some diagnostic argument is prematurely converted into a String object
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    28
 * @author  Maurizio Cimadamore
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    29
 * @compile/fail/ref=T6717241a.out -XDstdout -XDrawDiagnostics T6717241a.java
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    30
 */
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    31
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    32
class T6717241a<X extends Object & java.io.Serializable> {
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    33
    X x;
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    34
    void test() {
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    35
        //this will generate a 'cant.resolve'
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    36
        Object o = x.v;
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    37
        //this will generate a 'cant.resolve.args'
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    38
        x.m1(1, "");
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    39
        //this will generate a 'cant.resolve.args.params'
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    40
        x.<Integer,Double>m2(1, "");
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    41
    }
38e24969c7e9 6717241: some diagnostic argument is prematurely converted into a String object
mcimadamore
parents:
diff changeset
    42
}