langtools/test/tools/javac/capture/T6594284.java
author mcimadamore
Thu, 24 Jul 2008 11:12:41 +0100
changeset 938 13aae74ca013
child 5520 86e4b9a9da40
permissions -rw-r--r--
6594284: NPE thrown when calling a method on an intersection type Summary: javac should report an error when the capture of an actual type parameter does not exist Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
938
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     1
/*
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     2
 * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     4
 *
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     8
 *
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    14
 *
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    18
 *
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    21
 * have any questions.
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    22
 */
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    23
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    24
/*
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    25
 * @test
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    26
 * @bug 6594284
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    27
 * @summary NPE thrown when calling a method on an intersection type
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    28
 * @author Maurizio Cimadamore
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    29
 *
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    30
 * @compile/fail T6594284.java
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    31
 */
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    32
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    33
public class T6594284 {
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    34
    class A{ public void a(){}}
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    35
    class B extends A{ public void b(){}}
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    36
    interface I{ void i();}
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    37
    interface I1 { void i1(); }
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    38
    class E extends B implements I{ public void i(){};}
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    39
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    40
    class C<W extends B & I1, T extends W>{
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    41
        C<? extends I, ? extends E> arg;
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    42
    }
13aae74ca013 6594284: NPE thrown when calling a method on an intersection type
mcimadamore
parents:
diff changeset
    43
}