file_name stringlengths 6 86 | file_path stringlengths 45 249 | content stringlengths 47 6.26M | file_size int64 47 6.26M | language stringclasses 1 value | extension stringclasses 1 value | repo_name stringclasses 767 values | repo_stars int64 8 14.4k | repo_forks int64 0 1.17k | repo_open_issues int64 0 788 | repo_created_at stringclasses 767 values | repo_pushed_at stringclasses 767 values |
|---|---|---|---|---|---|---|---|---|---|---|---|
Neg1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/5060485/Neg1.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5060485
* @summary The scope of a class type parameter is too wide
* @author Peter von der Ah\u00e9
* @compile/fail Neg1.java
*/
public class Neg1<X extends Y> {
public static class Y {}
}
| 1,275 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T5060485.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/5060485/T5060485.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5060485
* @summary The scope of a class type parameter is too wide
* @compile T5060485.java
*/
public class T5060485<Y> {
static public class Y {}
static public class Y1 <T extends T5060485<Y>> {}
}
| 1,288 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Neg2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/5060485/Neg2.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5060485
* @summary The scope of a class type parameter is too wide
* @author Peter von der Ah\u00e9
* @compile/fail Neg2.java
*/
public class Neg2<X extends X> {
}
| 1,246 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Pos.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/5060485/Pos.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5060485
* @summary The scope of a class type parameter is too wide
* @author Peter von der Ah\u00e9
* @compile Pos.java
*/
public class Pos<X extends String, Y extends X> {
}
| 1,257 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Method.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/5060485/Method.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5060485
* @summary The scope of a class type parameter is too wide
* @author Peter von der Ah\u00e9
* @compile Method.java
*/
public class Method<T extends Number> {
static class Y {}
<Y extends Number> void test() {
Method<Y> m = null;
Number n = m.get();
}
T get() {
return null;
}
}
| 1,412 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Compatibility02.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/5060485/Compatibility02.java | /*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5060485 6977800
* @summary The scope of a class type parameter is too wide
* @author Maurizio Cimadamore
* @compile/fail/ref=Compatibility02.out -XDrawDiagnostics Compatibility.java
*/
class NumberList<T extends Number> {}
class Test {
<Y extends Number> void m() {
static class Y {}
class Y1<S extends NumberList<Y>> {}
}
}
| 1,438 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6199146.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/6199146/T6199146.java | /*
* Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6199146
* @summary Javac accepts ambiguous compound type
* @compile/fail T6199146.java
*/
public class T6199146 {
static class Test2 <T extends I1 & I2> { }
static interface I1 {
int getFoo();
}
static interface I2 {
float getFoo();
}
}
| 1,361 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6486430.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/6486430/T6486430.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6486430
* @summary Compiler fails to reject access to static member in parameterized type
* @author Peter von der Ah\u00e9
* @compile/fail T6486430.java
*/
class T6486430<T extends Number> {
T6486430<?>.Inner.InnerMost x = null;
static class Inner<S> {
static class InnerMost {
}
}
}
| 1,394 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6486430a.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typevars/6486430/T6486430a.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6486430
* @summary Compiler fails to reject access to static member in parameterized type
* @author Peter von der Ah\u00e9
* @compile/fail T6486430a.java
*/
class T6486430a<T extends Number> {
T6486430a<Inner.InnerMost>.Inner.InnerMost x = null;
static class Inner<S> {
static class InnerMost {
}
}
}
| 1,411 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6969184.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6969184/T6969184.java | /*
* @test /nodynamiccopyright/
* @bug 6969184
*
* @summary poor error recovery after symbol not found
* @author Maurizio Cimadamore
* @compile/fail/ref=T6969184.out -XDrawDiagnostics T6969184.java
*
*/
class T6969184 {
static class C1<X> {
void m1(C1<? extends NonExistentClass> n) {}
void m2(C1<? super NonExistentClass> n) {}
void m3(C1<?> n) {}
}
static class C2<X extends NonExistentBound> {
void m1(C2<? extends NonExistentClass> n) {}
void m2(C2<? super NonExistentClass> n) {}
void m3(C2<?> n) {}
}
static class C3<X extends NonExistentBound1 & NonExistentBound2> {
void m1(C3<? extends NonExistentClass> n) {}
void m2(C3<? super NonExistentClass> n) {}
void m3(C3<?> n) {}
}
}
| 794 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Scalar.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/Scalar.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface Scalar<S extends Scalar<S, P, V>,
P extends PlainForm<S, P, V>,
V extends VariableForm<S, P, V>>
extends Value<S, P, V>
{
}
| 1,245 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Ring.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/Ring.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface Ring<E extends Value>
extends AdditiveClosure<E>,
MultiplicationDefined<E>
{
}
| 1,164 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Vector.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/Vector.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface Vector<E extends Vector<E, P, V, S, T, U>,
P extends PlainForm<E, P, V>,
V extends VariableForm<E, P, V>,
S extends Scalar<S, T, U> & Ring<S>,
T extends PlainForm<S, T, U>,
U extends VariableForm<S, T, U>>
extends Value<E, P, V>
{
}
| 1,426 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AbstractPlanarVector.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/AbstractPlanarVector.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class AbstractPlanarVector<S extends Scalar<S, T, U> & Ring<S>,
T extends PlainForm<S, T, U>,
U extends VariableForm<S, T, U>>
extends AbstractVector<PlanarVector<S, T, U>,
PlainPlanarVector<S, T, U>,
PlanarVectorVariable<S, T, U>,
S,
T,
U>
implements PlanarVector<S, T, U>
{
}
| 1,527 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PlainForm.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/PlainForm.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface PlainForm<E extends Element<E, P, V>,
P extends PlainForm<E, P, V>,
V extends VariableForm<E, P, V>>
extends Element<E, P, V>
{
}
| 1,257 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
State.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/State.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class State {}
| 1,074 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AdditionDefined.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/AdditionDefined.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface AdditionDefined<E extends Value> {
}
| 1,106 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6372782.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/T6372782.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6372782 6292765
* @summary possibly invalid "abstract method not implemented" emitted by compiler
* @author Alex Lam S.L.
* @compile PlainPlanarVector.java
* PlanarVectorVariable.java
* PlainForm.java
* State.java
* VariableForm.java
* Ring.java
* Scalar.java
* AbstractPlanarVector.java
* AbstractVector.java
* AbstractElement.java
* Element.java
* Vector.java
* Value.java
* AdditiveClosure.java
* AdditionDefined.java
* MultiplicationDefined.java
* PlanarVector.java
*/
| 1,714 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AdditiveClosure.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/AdditiveClosure.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface AdditiveClosure<E extends Value>
extends AdditionDefined<E>
{
}
| 1,137 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PlanarVector.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/PlanarVector.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface PlanarVector<S extends Scalar<S, T, U> & Ring<S>,
T extends PlainForm<S, T, U>,
U extends VariableForm<S, T, U>>
extends Vector<PlanarVector<S, T, U>,
PlainPlanarVector<S, T, U>,
PlanarVectorVariable<S, T, U>, S, T, U>,
AdditiveClosure<PlanarVector<S, T, U>>
{
}
| 1,453 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
MultiplicationDefined.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/MultiplicationDefined.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface MultiplicationDefined<E extends Value> {
}
| 1,112 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PlainPlanarVector.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/PlainPlanarVector.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class PlainPlanarVector<S extends Scalar<S, T, U> & Ring<S>,
T extends PlainForm<S, T, U>,
U extends VariableForm<S, T, U>>
extends AbstractPlanarVector<S, T, U>
implements PlainForm<PlanarVector<S, T, U>,
PlainPlanarVector<S, T, U>,
PlanarVectorVariable<S, T, U>> {
@Override
public State getState() {
return null;
}
}
| 1,521 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
PlanarVectorVariable.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/PlanarVectorVariable.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class PlanarVectorVariable<S extends Scalar<S, T, U> & Ring<S>,
T extends PlainForm<S, T, U>,
U extends VariableForm<S, T, U>>
extends AbstractPlanarVector<S, T, U>
implements VariableForm<PlanarVector<S, T, U>,
PlainPlanarVector<S, T, U>,
PlanarVectorVariable<S, T, U>>
{
}
| 1,466 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Element.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/Element.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface Element<E extends Element<E, P, V>,
P extends PlainForm<E, P, V>,
V extends VariableForm<E, P, V>> {
State getState();
}
| 1,244 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Value.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/Value.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface Value<E extends Value<E, P, V>,
P extends PlainForm<E, P, V>,
V extends VariableForm<E, P, V>>
extends Element<E, P, V>
{
}
| 1,243 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
VariableForm.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/VariableForm.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public interface VariableForm<E extends Element<E, P, V>,
P extends PlainForm<E, P, V>,
V extends VariableForm<E, P, V>>
extends Element<E, P, V>
{
}
| 1,266 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AbstractVector.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/AbstractVector.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
abstract class AbstractVector<E extends Vector<E, P, V, S, T, U>,
P extends PlainForm<E, P, V>,
V extends VariableForm<E, P, V>,
S extends Scalar<S, T, U> & Ring<S>,
T extends PlainForm<S, T, U>,
U extends VariableForm<S, T, U>>
extends AbstractElement<E, P, V>
implements Vector<E, P, V, S, T, U>
{
}
| 1,512 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AbstractElement.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6372782/AbstractElement.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public abstract class AbstractElement<E extends Element<E, P, V>,
P extends PlainForm<E, P, V>,
V extends VariableForm<E, P, V>>
implements Element<E, P, V>
{
/**
*
* @return
*/
public State getState() {
throw new AssertionError();
}
}
| 1,403 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T5086027.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/5086027/T5086027.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5086027
* @summary Inner class of generic class cannot extend Throwable
* @author Peter von der Ah\u00e9
* @compile/fail T5086027.java
*/
public class T5086027<T> {
class X extends Exception {}
}
| 1,282 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T5086027pos.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/5086027/T5086027pos.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5086027
* @summary Inner class of generic class cannot extend Throwable
* @author Peter von der Ah\u00e9
* @compile T5086027pos.java
*/
public class T5086027pos<T> {
static class X extends Exception { }
}
| 1,291 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6729401.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6729401/T6729401.java | /*
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6729401
*
* @summary Compiler error when using F-bounded generics with free type variables
* @author Maurizio Cimadamore
* @compile T6729401.java
*
*/
class T6729401 {
interface I<U,W> {
<T extends I<U,T>> void m(I<U,T> x);
}
<X extends I<Object,X>,Y extends I<Object,Y>> void test(I<Object,X> x, I<Object,Y> y) {
x.<Y>m(y);
x.m(y);
y.<X>m(x);
y.m(x);
}
}
| 1,500 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6946618c.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6946618/T6946618c.java | /*
* @test /nodynamiccopyright/
* @bug 6946618 6968497
* @summary sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
* @author mcimadamore
* @compile/fail/ref=T6946618c.out -XDrawDiagnostics T6946618c.java
*/
class T6946618c {
static class C<T> { }
void test() {
C<?> c1 = new C<? extends String>();
C<?> c2 = new C<? super String>();
C<?> c3 = new C<?>();
}
}
| 439 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6946618a.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6946618/T6946618a.java | /*
* @test /nodynamiccopyright/
* @bug 6946618
* @summary sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
* @author mcimadamore
* @compile/fail/ref=T6946618a.out -XDrawDiagnostics T6946618a.java
*/
class T6946618a {
static class C<T> {
T makeT() {
return new T(); //error
}
}
static class D<S> {
C<S> makeC() {
return new C<S>(); //ok
}
}
}
| 442 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6946618b.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6946618/T6946618b.java | /*
* @test /nodynamiccopyright/
* @bug 6946618
* @summary sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
* @author mcimadamore
* @compile/fail/ref=T6946618b.out -XDrawDiagnostics T6946618b.java
*/
class T6946618b {
static class C<T> {
T makeT() {
return new T<>(); //error
}
}
static class D<S> {
C<S> makeC() {
return new C<>(); //ok
}
}
}
| 443 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6178365.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/T6178365.java | /*
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6178365
* @summary REGRESSION: Compile Error - Abstract error in LoginModule
* @author Peter von der Ah\u00e9
* @run main T6178365
*/
public class T6178365 {
interface Bar<X> {}
interface Foo {
void m(Bar<String> b);
}
abstract class AbstractFoo implements Foo {
public void m(Bar b) { /* ... */ } // fixed by 5073079
}
class ConcreteFoo extends AbstractFoo {
public void m(Bar b) {
super.m(b);
}
}
public static void main(String[] args) {
System.out.println("PASS");
}
}
| 1,643 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Fail1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/Fail1.java | /*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5073079
* @summary Allow unchecked override of generified methods in
* parameterless classes
* @author Peter von der Ah\u00e9
*
* @compile/fail Fail1.java
*/
interface MyList<T> {}
interface A {
void f(MyList l);
}
class B {
public void f(MyList<String> l) { }
}
class C extends B implements A { }
| 1,388 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Warn2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/Warn2.java | /*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5073079
* @summary Allow unchecked override of generified methods in
* parameterless classes
* @author Peter von der Ah\u00e9
*
* @compile Warn2.java
* @compile/fail -Xlint:unchecked -Werror Warn2.java
*/
interface I3 {
<T> T foo();
}
class C3 implements I3 {
public Object foo() { return null; }
}
| 1,388 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6846972.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/T6846972.java | /*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6846972
* @summary cannot access member of raw type when erasure change overriding into overloading
* @author mcimadamore
* @compile T6846972.java
*/
import java.util.EnumMap;
public class T6846972 {
enum Suit {
CLUBS, DIAMONDS;
}
static Object [] array = {
Suit.CLUBS, "value1",
Suit.DIAMONDS, "value2"
};
static void test() {
EnumMap map = new EnumMap(Suit.class);
map.put(array[0], array[1]);
}
}
| 1,545 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Warn1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/Warn1.java | /*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5073079
* @summary Allow unchecked override of generified methods in
* parameterless classes
* @author Peter von der Ah\u00e9
*
* @compile Warn1.java
* @compile/fail -Xlint:unchecked -Werror Warn1.java
*/
interface Attribute<T> { }
interface AttributeSet1 {
<T> Attribute<T> get(Class<T> category);
}
class AttributeSet1Impl implements AttributeSet1 {
public Attribute get(Class category) { return null; }
}
| 1,498 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
AttributeSet.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/AttributeSet.java | /*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5073079
* @summary Allow unchecked override of generified methods in
* parameterless classes
* @author Peter von der Ah\u00e9
*
* @compile -Xlint:unchecked -Werror AttributeSet.java
*/
interface Attribute<T> { }
interface AttributeSet2 {
<T> Attribute<?> get(Class<T> category);
}
class AttributeSet2Impl implements AttributeSet2 {
public Attribute get(Class category) { return null; }
}
interface AttributeSet3 {
Attribute<?> get(Class<?> category);
}
class AttributeSet3Impl implements AttributeSet3 {
public Attribute get(Class category) { return null; }
}
interface AttributeSet4 {
Attribute<?> get(Number category);
}
class AttributeSet4Impl implements AttributeSet4 {
public Attribute get(Number category) { return null; }
}
interface AttributeSet5 {
Attribute<?> get(Attribute<Number> category);
}
class AttributeSet5Impl implements AttributeSet5 {
public Attribute get(Attribute category) { return null; }
}
interface I1<T> {
void f(Attribute<T> l);
}
class C1 implements I1<String> {
public void f(Attribute l) { }
void test() {
Attribute<Number> n = null;
f(n);
}
}
interface A2 {
void f(Attribute<String> a);
}
class B2 {
public void f(Attribute a) { }
}
class C2 extends B2 implements A2 {
void test(Attribute<Number> a) {
f(a);
}
}
| 2,425 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7062745neg.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/7062745/T7062745neg.java | /*
* @test /nodynamiccopyright/
* @bug 7062745
* @summary Regression: difference in overload resolution when two methods are maximally specific
* @compile/fail/ref=T7062745neg.out -XDrawDiagnostics T7062745neg.java
*/
import java.util.*;
class T7062745neg {
interface A { List<Number> getList(); }
interface B { ArrayList getList(); }
interface AB extends A, B {}
void test(AB ab) {
Number n = ab.getList().get(1);
}
}
| 460 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7062745pos.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/7062745/T7062745pos.java | /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7062745
* @summary Regression: difference in overload resolution when two methods are maximally specific
*
* @compile T7062745pos.java
*/
import java.util.*;
class T7062745pos {
interface A { List<Number> getList(); }
interface B { List getList(); }
interface AB extends A, B {}
void test(AB ab) {
Number n = ab.getList().get(1);
}
}
| 1,442 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
GenericOverrideTest.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawOverride/7062745/GenericOverrideTest.java | /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7062745
* @summary Regression: difference in overload resolution when two methods are maximally specific
*/
import com.sun.source.util.JavacTask;
import java.net.URI;
import java.util.Arrays;
import javax.tools.Diagnostic;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.SimpleJavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
public class GenericOverrideTest {
static int checkCount = 0;
enum SignatureKind {
NON_GENERIC(""),
GENERIC("<X>");
String paramStr;
private SignatureKind(String paramStr) {
this.paramStr = paramStr;
}
}
enum ReturnTypeKind {
LIST("List"),
ARRAYLIST("ArrayList");
String retStr;
private ReturnTypeKind(String retStr) {
this.retStr = retStr;
}
boolean moreSpecificThan(ReturnTypeKind that) {
switch (this) {
case LIST:
return that == this;
case ARRAYLIST:
return that == LIST || that == ARRAYLIST;
default: throw new AssertionError("Unexpected ret kind: " + this);
}
}
}
enum TypeArgumentKind {
NONE(""),
UNBOUND("<?>"),
INTEGER("<Number>"),
NUMBER("<Integer>"),
TYPEVAR("<X>");
String typeargStr;
private TypeArgumentKind(String typeargStr) {
this.typeargStr = typeargStr;
}
boolean compatibleWith(SignatureKind sig) {
switch (this) {
case TYPEVAR: return sig != SignatureKind.NON_GENERIC;
default: return true;
}
}
boolean moreSpecificThan(TypeArgumentKind that, boolean strict) {
switch (this) {
case NONE:
return that == this || !strict;
case UNBOUND:
return that == this || that == NONE;
case INTEGER:
case NUMBER:
case TYPEVAR:
return that == this || that == NONE || that == UNBOUND;
default: throw new AssertionError("Unexpected typearg kind: " + this);
}
}
boolean assignableTo(TypeArgumentKind that, SignatureKind sig) {
switch (this) {
case NONE:
//this case needs to workaround to javac's impl of 15.12.2.8 being too strict
//ideally should be just 'return true' (see 7067746)
return sig == SignatureKind.NON_GENERIC || that == NONE;
case UNBOUND:
return that == this || that == NONE;
case INTEGER:
case NUMBER:
return that == this || that == NONE || that == UNBOUND;
case TYPEVAR:
return true;
default: throw new AssertionError("Unexpected typearg kind: " + this);
}
}
}
public static void main(String... args) throws Exception {
//create default shared JavaCompiler - reused across multiple compilations
JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
for (SignatureKind sig1 : SignatureKind.values()) {
for (ReturnTypeKind rt1 : ReturnTypeKind.values()) {
for (TypeArgumentKind ta1 : TypeArgumentKind.values()) {
if (!ta1.compatibleWith(sig1)) continue;
for (SignatureKind sig2 : SignatureKind.values()) {
for (ReturnTypeKind rt2 : ReturnTypeKind.values()) {
for (TypeArgumentKind ta2 : TypeArgumentKind.values()) {
if (!ta2.compatibleWith(sig2)) continue;
for (ReturnTypeKind rt3 : ReturnTypeKind.values()) {
for (TypeArgumentKind ta3 : TypeArgumentKind.values()) {
if (!ta3.compatibleWith(SignatureKind.NON_GENERIC)) continue;
new GenericOverrideTest(sig1, rt1, ta1, sig2, rt2, ta2, rt3, ta3).run(comp, fm);
}
}
}
}
}
}
}
}
System.out.println("Total check executed: " + checkCount);
}
SignatureKind sig1, sig2;
ReturnTypeKind rt1, rt2, rt3;
TypeArgumentKind ta1, ta2, ta3;
JavaSource source;
DiagnosticChecker diagChecker;
GenericOverrideTest(SignatureKind sig1, ReturnTypeKind rt1, TypeArgumentKind ta1,
SignatureKind sig2, ReturnTypeKind rt2, TypeArgumentKind ta2, ReturnTypeKind rt3, TypeArgumentKind ta3) {
this.sig1 = sig1;
this.sig2 = sig2;
this.rt1 = rt1;
this.rt2 = rt2;
this.rt3 = rt3;
this.ta1 = ta1;
this.ta2 = ta2;
this.ta3 = ta3;
this.source = new JavaSource();
this.diagChecker = new DiagnosticChecker();
}
class JavaSource extends SimpleJavaFileObject {
String template = "import java.util.*;\n" +
"interface A { #S1 #R1#TA1 m(); }\n" +
"interface B { #S2 #R2#TA2 m(); }\n" +
"interface AB extends A, B {}\n" +
"class Test {\n" +
" void test(AB ab) { #R3#TA3 n = ab.m(); }\n" +
"}";
String source;
public JavaSource() {
super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
source = template.replace("#S1", sig1.paramStr).
replace("#S2", sig2.paramStr).
replace("#R1", rt1.retStr).
replace("#R2", rt2.retStr).
replace("#R3", rt3.retStr).
replace("#TA1", ta1.typeargStr).
replace("#TA2", ta2.typeargStr).
replace("#TA3", ta3.typeargStr);
}
@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) {
return source;
}
}
void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
null, null, Arrays.asList(source));
try {
ct.analyze();
} catch (Throwable ex) {
throw new AssertionError("Error thron when compiling the following code:\n" + source.getCharContent(true));
}
check();
}
void check() {
checkCount++;
boolean errorExpected = false;
int mostSpecific = 0;
//first check that either |R1| <: |R2| or |R2| <: |R1|
if (rt1 != rt2) {
if (!rt1.moreSpecificThan(rt2) &&
!rt2.moreSpecificThan(rt1)) {
errorExpected = true;
} else {
mostSpecific = rt1.moreSpecificThan(rt2) ? 1 : 2;
}
}
//check that either TA1 <= TA2 or TA2 <= TA1 (unless most specific return found above is raw)
if (!errorExpected) {
if (ta1 != ta2) {
boolean useStrictCheck = ta1.moreSpecificThan(ta2, true) || ta2.moreSpecificThan(ta1, true);
if (!ta1.moreSpecificThan(ta2, useStrictCheck) &&
!ta2.moreSpecificThan(ta1, useStrictCheck)) {
errorExpected = true;
} else {
int mostSpecific2 = ta1.moreSpecificThan(ta2, useStrictCheck) ? 1 : 2;
if (mostSpecific != 0 && mostSpecific2 != mostSpecific) {
errorExpected = mostSpecific == 1 ? ta1 != TypeArgumentKind.NONE : ta2 != TypeArgumentKind.NONE;
} else {
mostSpecific = mostSpecific2;
}
}
} else if (mostSpecific == 0) {
//when no signature is better than the other, an arbitrary choice
//must be made - javac always picks the second signature
mostSpecific = 2;
}
}
//finally, check that most specific return type is compatible with expected type
if (!errorExpected) {
ReturnTypeKind msrt = mostSpecific == 1 ? rt1 : rt2;
TypeArgumentKind msta = mostSpecific == 1 ? ta1 : ta2;
SignatureKind mssig = mostSpecific == 1 ? sig1 : sig2;
if (!msrt.moreSpecificThan(rt3) ||
!msta.assignableTo(ta3, mssig)) {
errorExpected = true;
}
}
if (errorExpected != diagChecker.errorFound) {
throw new Error("invalid diagnostics for source:\n" +
source.getCharContent(true) +
"\nFound error: " + diagChecker.errorFound +
"\nExpected error: " + errorExpected);
}
}
static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
boolean errorFound;
public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
errorFound = true;
}
}
}
}
| 10,613 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
RetroLexer.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawSeparate/RetroLexer.java | /*
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4464233
* @summary raw types versus separate compilation causes type error
* @author gafter
*
* @compile Hashtable.java
* @compile CharScanner.java
* @compile RetroLexer.java
*/
package parser;
import util.Hashtable; // this is necessary to reproduce the bug!
public class RetroLexer extends antlr.CharScanner
{
public RetroLexer() {
literals.put("Foo", new Integer(5));
}
}
| 1,482 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Hashtable.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawSeparate/Hashtable.java | /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package util;
public class Hashtable<K,V> {
public synchronized V put(K key, V value) {
throw new Error();
}
}
| 1,179 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
CharScanner.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/rawSeparate/CharScanner.java | /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package antlr;
import util.Hashtable;
public class CharScanner {
protected Hashtable literals; // set by subclass
}
| 1,173 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6227936.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6227936/T6227936.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6227936
* @summary Wrong type of inherited method using specialized type parameter
* @author Peter von der Ah\u00e9
* @compile T6227936.java
*/
public class T6227936 {
static class A<T extends B<?>> {}
abstract static class B<T extends C> {
public abstract T getC();
}
static class C {}
abstract static class A1<T extends B1<?>> extends A<T> {
void test(T t) {
C1 c1 = t.getC();
}
}
abstract static class B1<T extends C1> extends B<T> {
}
abstract static class C1 extends C {
abstract void someMethod();
}
}
| 1,685 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Orig.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6227936/Orig.java | /*
* Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6227936
* @summary Wrong type of inherited method using specialized type parameter
* @compile/fail Orig.java
*/
class GenericTest {
static class A<T extends B> {
T myB;
A(T myB) {this.myB = myB;}
T getB() {return myB;}
}
static class B<T extends C> {
T myC;
B(T myB) {this.myC = myC;}
T getC() {return myC;}
}
static class C {
C() {}
}
static class A1<T extends B1> extends A<T> {
A1(T myB) {super(myB);}
public void testMethod() {
// This next line fails, but should work
getB().getC().someMethod();
((C1)getB().getC()).someMethod();
}
}
static class B1<T extends C1> extends B<T> {
B1(T myC) {super(myC);}
}
static class C1 extends C {
public void someMethod() {}
}
}
| 1,938 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6268476.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6268476/T6268476.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6268476
* @summary Arrays and super wildcards broken
* @compile T6268476.java
*/
import java.util.List;
public class T6268476 {
void foo(List<? super Object[]> l) {
l.add(new Object[0]);
}
}
| 1,294 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T5066774.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/5066774/T5066774.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5066774
* @summary Bad interaction between generics, instanceof, inner classes, and subclasses
* @compile T5066774.java
*/
public class T5066774<T> {
boolean DEBUG = this instanceof Special;
public static class Special extends T5066774<String> {}
}
| 1,344 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6487370.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6487370/T6487370.java | /*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6487370
* @author Maurizio Cimadamore
* @summary javac incorrectly gives ambiguity warning with override-equivalent abstract inherited methods
*/
public class T6487370 {
interface I1 {
String m(Number n);
}
interface I2 {
Object m(Number n);
}
static abstract class X implements I1, I2 {
String test() {
return m(0.0f);
}
}
static class W extends X {
public String m(Number n) {
return "Hello!";
}
}
public static void main(String args[]) {
System.out.println(new W().test());
}
}
| 1,686 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T5009937.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/5009937/T5009937.java | /*
* @test /nodynamiccopyright/
* @bug 5009937
* @summary hiding versus generics versus binary compatibility
* @author Maurizio Cimadamore
*
* @compile/fail/ref=T5009937.out -XDrawDiagnostics T5009937.java
*/
public class T5009937<X> {
static class A {
static void m(T5009937<String> l) {}
}
static class B extends A {
static void m(T5009937<Integer> l) {}
}
}
| 402 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7022054pos2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/7022054/T7022054pos2.java | /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7022054
*
* @summary Invalid compiler error on covariant overriding methods with the same erasure
* @compile T7022054pos2.java
*
*/
class T7022054pos2 {
static class A {
static A m(String s) { return null; }
}
static class B extends A {
static <X extends B> X m(String s) { return null; }
}
}
| 1,404 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7022054pos1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/7022054/T7022054pos1.java | /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7022054
*
* @summary Invalid compiler error on covariant overriding methods with the same erasure
* @compile T7022054pos1.java
*
*/
class T7022054pos1 {
static class A {
A m(String s) { return null; }
}
static class B extends A {
<X extends B> X m(String s) { return null; }
}
}
| 1,390 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7022054neg1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/7022054/T7022054neg1.java | /*
* @test /nodynamiccopyright/
* @bug 7022054
*
* @summary Invalid compiler error on covariant overriding methods with the same erasure
* @compile/fail/ref=T7022054neg1.out -XDrawDiagnostics T7022054neg1.java
*
*/
class T7022054neg1 {
static class A {
A m(String s) { return null; }
}
static class B extends A {
<X extends String> A m(X s) { return null; }
}
}
| 403 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7022054neg2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/7022054/T7022054neg2.java | /*
* @test /nodynamiccopyright/
* @bug 7022054
*
* @summary Invalid compiler error on covariant overriding methods with the same erasure
* @compile/fail/ref=T7022054neg2.out -XDrawDiagnostics T7022054neg2.java
*
*/
class T7022054neg2 {
static class A {
static A m(String s) { return null; }
}
static class B extends A {
static <X extends String> A m(X s) { return null; }
}
}
| 417 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6495506.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6495506/T6495506.java | /*
* Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6495506
* @summary Cast inserted by generics can cause IllegalAccessError
* @compile A.java
* @compile/fail T6495506.java
*/
public class T6495506 {
public static void main(String... args) {
a.A myA = new a.A();
myA.p = myA.vec.get(0);
}
}
| 1,351 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
A.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6495506/A.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package a;
import java.util.Vector;
public class A {
private class P {}
public P p;
public Vector<P> vec;
public A() {
vec = new Vector<P>();
vec.add(new P());
}
}
| 1,254 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7034511a.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/7034511/T7034511a.java | /*
* @test /nodynamiccopyright/
* @ignore backing out 7034511, see 7040883
* @bug 7034511 7040883
* @summary Loophole in typesafety
* @compile/fail/ref=T7034511a.out -XDrawDiagnostics T7034511a.java
*/
class T7034511a {
interface A<T> {
void foo(T x);
}
interface B<T> extends A<T[]> { }
static abstract class C implements B<Integer> {
<T extends B<?>> void test(T x, String[] ss) {
x.foo(ss);
}
}
}
| 470 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7034511b.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/7034511/T7034511b.java | /*
* @test /nodynamiccopyright/
* @ignore backing out 7034511, see 7040883
* @bug 7034511 7040883
* @summary Loophole in typesafety
* @compile/fail/ref=T7034511b.out -XDrawDiagnostics T7034511b.java
*/
class T7034511b {
static class MyList<E> {
E toArray(E[] e) { return null; }
}
void test(MyList<?> ml, Object o[]) {
ml.toArray(o);
}
}
| 382 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6213818.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6213818/T6213818.java | /*
* Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6213818
* @summary Compilercrash with NullPointerException at SubstFcn.subst(Types.java:2057)
* @compile T6213818.java
*/
public class T6213818 {
static interface Edge<N extends Node<? extends Edge<N>>> { }
static interface Node<E extends Edge<? extends Node<E>>> { }
static class BasicNode<E extends BasicEdge<N, E> & Edge<N>, N extends BasicNode<E, N> & Node<E>> implements Node<E> { }
static class BasicEdge<N extends BasicNode<E, N> & Node<E>, E extends BasicEdge<N, E> & Edge<N>> implements Edge<N> { }
}
| 1,612 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
A.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/genericAbstract/A.java | /*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4546513
* @summary generics: generic interface method not implemented in abstract class causes err
* @author gafter
*
* @compile A.java B.java
*/
interface A {
<D> D clone(D obj);
}
| 1,265 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
B.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/genericAbstract/B.java | /*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
abstract class B implements A {
public void foo() { // a function
}
}
| 1,130 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T7015430.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/7015430/T7015430.java | /*
* @test /nodynamiccopyright/
* @bug 7015430
*
* @summary Incorrect thrown type determined for unchecked invocations
* @author Daniel Smith
* @compile/fail/ref=T7015430.out -Xlint:unchecked -XDrawDiagnostics T7015430.java
*
*/
class T7015430 {
static <E extends Exception> Iterable<E> empty(Iterable<E> arg) throws E {
return null;
}
<E extends Exception> T7015430(Iterable<E> arg) throws E { }
static <E extends Exception> Iterable<E> empty2(Iterable x) throws E {
return null;
}
static class Foo<X extends Exception> {
Foo() throws X {}
}
/**
* Method invocation, no unchecked
* inferred: RuntimeException - should pass
*/
void m1() {
Iterable<RuntimeException> i = java.util.Collections.emptyList();
empty(i);
}
/**
* Method invocation, unchecked, inferred arguments
* inferred: Exception - should fail
*/
void m2() {
Iterable i = java.util.Collections.EMPTY_LIST;
empty(i);
}
/**
* Method invocation, unchecked, explicit arguments
* inferred: RuntimeException - should pass
*/
void m3() {
Iterable i = java.util.Collections.EMPTY_LIST;
T7015430.<RuntimeException>empty(i);
}
/**
* Constructor invocation, no unchecked
* inferred: RuntimeException - should pass
*/
void m4() {
Iterable<RuntimeException> i = java.util.Collections.emptyList();
new T7015430(i);
}
/**
* Constructor invocation, unchecked, inferred arguments
* inferred: Exception - should fail
*/
void m5() {
Iterable i = java.util.Collections.EMPTY_LIST;
new T7015430(i);
}
/**
* Constructor invocation, unchecked, explicit arguments
* inferred: RuntimeException - should pass
*/
void m6() {
Iterable i = java.util.Collections.EMPTY_LIST;
new <RuntimeException>T7015430(i);
}
/**
* Method invocation, no unchecked, inferred arguments
* inferred: RuntimeException - should pass
*/
void m7() {
Iterable i = java.util.Collections.EMPTY_LIST;
Iterable<RuntimeException> e = empty2(i);
}
/**
* Method invocation, no unchecked, inferred arguments
* inferred: Exception - should fail
*/
void m8() {
Iterable i = java.util.Collections.EMPTY_LIST;
empty2(i);
}
/**
* Constructor invocation, unchecked, explicit arguments
* inferred: RuntimeException - should pass
*/
void m9() {
Iterable i = java.util.Collections.EMPTY_LIST;
new <RuntimeException> T7015430(i);
}
/**
* Constructor invocation, unchecked, inferred arguments
* inferred: Exception - should fail
*/
void m10() {
Iterable i = java.util.Collections.EMPTY_LIST;
new T7015430(i);
}
/**
* Constructor invocation, no unchecked, inferred arguments (diamond)
* inferred: RuntimeException - should pass
*/
void m11() {
Foo<RuntimeException> o = new Foo<>();
}
/**
* Constructor invocation, no unchecked, inferred arguments (diamond)
* inferred: Exception - should fail
*/
void m12() {
new Foo<>();
}
}
| 3,260 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
OverrideBridge3.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/compat/OverrideBridge3.java | /*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class OverrideBridge3 {
static class C extends OverrideBridge2.B {
}
}
| 1,131 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
CovariantCompat1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/compat/CovariantCompat1.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4836051
* @summary generics: non-generic code should be able to call covariant method
* @author gafter
*
* @compile CovariantCompat1.java
* @compile -source 1.4 CovariantCompat2.java
*/
class CovariantCompat1 {
static class A {
public A foo() { return this; }
}
static class B extends A {
public B foo() { return this; }
}
}
| 1,437 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
OverrideBridge1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/compat/OverrideBridge1.java | /*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4836048 4868021 5030040 5052968 5056864
* @summary generics: compiler allows 1.4 code to override a bridge method
* @author gafter
*
* @compile OverrideBridge1.java
* @compile/fail -Werror -source 1.4 OverrideBridge2.java
* @compile -source 1.4 OverrideBridge2.java
* @compile OverrideBridge3.java
*/
// ALLOW users to override bridge methods.
// Note the long list of bug numbers on this regression test. They
// indicate the number of times we've flip-flopped on this issue.
// 5030040 shows why we must give a diagnostic. 5052968 shows why it
// must be a warning.
class OverrideBridge1 {
static class A<T> {
public void foo(T t) { }
}
static class B extends A<String> {
public void foo(String t) { }
}
}
| 1,833 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
CovariantCompat2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/compat/CovariantCompat2.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class CovariantCompat2 {
static {
CovariantCompat1.B x = new CovariantCompat1.B();
CovariantCompat1.B o = x.foo();
}
}
| 1,195 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
OverrideBridge2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/compat/OverrideBridge2.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class OverrideBridge2 {
static class B extends OverrideBridge1.B {
public void foo(Object o) { }
}
}
| 1,169 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
VisibleBridge.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/compat/VisibleBridge.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4830291
* @summary javac makes String non-backward compatible
* @author gafter
*
* @compile -source 1.4 VisibleBridge.java
*/
// Ensure that bridge methods are visible for maximum
// backward compatibility.
class VisibleBridge {
static {
Object o = "b";
if ("a".compareTo(o) > 0) {}
}
}
| 1,390 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Bar.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/syntax/6318240/Bar.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6318240
* @summary Creation of array of inner class of an enclosing wildcard type doesn't work
* @compile Bar.java
*/
class Bar<T> {
Bar<?>.Inner<?>.InnerMost[] array = new Bar<?>.Inner<?>.InnerMost[10];
class Inner<S> {
class InnerMost {
}
}
}
| 1,353 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
BarNeg1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/syntax/6318240/BarNeg1.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6318240
* @summary Creation of array of inner class of an enclosing wildcard type doesn't work
* @compile/fail BarNeg1.java
*/
class BarNeg1<T> {
BarNeg1<?>.Inner<?>.InnerMost[] array = new BarNeg1<?>.Inner<Object>.InnerMost[10];
class Inner<S> {
class InnerMost {
}
}
}
| 1,379 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
BarNeg1a.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/syntax/6318240/BarNeg1a.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6318240
* @summary Creation of array of inner class of an enclosing wildcard type doesn't work
* @compile/fail BarNeg1a.java
*/
class BarNeg1a<T> {
Object object = new BarNeg1a<?>.Inner.InnerMost();
static class Inner<S> {
static class InnerMost {
}
}
}
| 1,362 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
BarNeg2a.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/syntax/6318240/BarNeg2a.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6318240
* @summary Creation of array of inner class of an enclosing wildcard type doesn't work
* @compile/fail BarNeg2a.java
*/
class BarNeg2a<T> {
BarNeg2a.Inner.InnerMost object = new BarNeg2a.Inner<?>.InnerMost();
static class Inner<S> {
static class InnerMost {
}
}
}
| 1,380 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
BarNeg2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/syntax/6318240/BarNeg2.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6318240
* @summary Creation of array of inner class of an enclosing wildcard type doesn't work
* @compile/fail BarNeg2.java
*/
class BarNeg2<T> {
BarNeg2<?>.Inner<?>.InnerMost[] array = new BarNeg2<Object>.Inner<?>.InnerMost[10];
class Inner<S> {
class InnerMost {
}
}
}
| 1,379 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Foo.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/syntax/6318240/Foo.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6318240
* @summary Creation of array of inner class of an enclosing wildcard type doesn't work
* @author Scott Violet
* @compile Foo.java
*/
public class Foo<T> {
private T t;
private Foo<?>.Inner[] inner;
public Foo(T t) {
this.t = t;
inner = new Foo<?>.Inner[10];
}
private class Inner {}
}
| 1,417 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6723444.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6723444/T6723444.java | /*
* @test /nodynamiccopyright/
* @bug 6723444
*
* @summary javac fails to substitute type variables into a constructor's throws clause
* @author Mark Mahieu
* @compile/fail/ref=T6723444.out -XDrawDiagnostics T6723444.java
*
*/
public class T6723444 {
static class Foo<X extends Throwable> {
Foo() throws X {}
}
<X extends Throwable> T6723444()
throws X {}
<X extends Throwable> T6723444(Foo<X> foo)
throws X {}
<X1 extends Throwable, X2 extends Throwable> T6723444(Foo<X1> foo, int i)
throws X1, X2 {}
public static void main(String[] args) throws Exception {
// the following 8 statements should compile without error
Foo<Exception> exFoo = new Foo<Exception>();
exFoo = new Foo<Exception>() {};
new<Exception> T6723444();
new<Exception> T6723444() {};
new T6723444(exFoo);
new T6723444(exFoo) {};
new<Exception, Exception> T6723444(exFoo, 1);
new<Exception, Exception> T6723444(exFoo, 1) {};
// the remaining statements should all raise an
// unreported exception error
new T6723444(exFoo, 1);
new T6723444(exFoo, 1) {};
Foo<Throwable> thFoo = new Foo<Throwable>();
thFoo = new Foo<Throwable>() {};
new<Throwable> T6723444();
new<Throwable> T6723444() {};
new T6723444(thFoo);
new T6723444(thFoo) {};
new T6723444(thFoo, 1);
new T6723444(thFoo, 1) {};
new<Throwable, Throwable> T6723444(thFoo, 1);
new<Throwable, Throwable> T6723444(thFoo, 1) {};
}
}
| 1,618 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Superarg2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/Superarg2.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile/fail Superarg2.java
*/
// Test type mismatch on type argument for inner super constructor
class T<X> {
class U<Y> extends T<X> {
<B> U(B b) {
<Object>super();
}
U(int i) {
<Object>this("");
}
}
class V<Z> extends U<Z> {
<C> V(T<X> t) {
t.<Integer>super("");
}
}
<A> T() {
}
<K> void f() {
this.<Object>f();
}
public static void main(String[] args) {
T<Integer> x = new <Object>T<Integer>();
T<Integer>.U<Float> y = x.new <Object>U<Float>("");
x.<Object>f();
}
}
| 1,776 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
ThisArg.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/ThisArg.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile/fail ThisArg.java
*/
// Test type mismatch on type argument for this constructor
class T<X> {
class U<Y> extends T<X> {
<B> U(B b) {
<Object>super();
}
U(int i) {
<Integer>this("");
}
}
class V<Z> extends U<Z> {
<C> V(T<X> t) {
t.<Object>super("");
}
}
<A> T() {
}
<K> void f() {
this.<Object>f();
}
public static void main(String[] args) {
T<Integer> x = new <Object>T<Integer>();
T<Integer>.U<Float> y = x.new <Object>U<Float>("");
x.<Object>f();
}
}
| 1,767 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Basic.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/Basic.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile Basic.java
*/
// Test all of the basic forms for explicit type arguments
class T<X> {
class U<Y> extends T<X> {
<B> U() {
<Object>super();
}
U(int i) {
<Object>this();
}
}
class V<Z> extends U<Z> {
<C> V(T<X> t) {
t.<Object>super();
}
}
<A> T() {
}
<K> void f() {
this.<Object>f();
}
public static void main(String[] args) {
T<Integer> x = new <Object>T<Integer>();
T<Integer>.U<Float> y = x.new <Object>U<Float>();
x.<Object>f();
}
}
| 1,749 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Metharg1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/Metharg1.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile/fail Metharg1.java
*/
// Test type mismatch on type argument for method call
class T<X> {
class U<Y> extends T<X> {
<B> U() {
<Object>super();
}
U(int i) {
<Object>this();
}
}
class V<Z> extends U<Z> {
<C> V(T<X> t) {
t.<Object>super();
}
}
<A> T() {
}
<K> void f(K k) {
this.<Integer>f("");
}
public static void main(String[] args) {
T<Integer> x = new <Object>T<Integer>();
T<Integer>.U<Float> y = x.new <Object>U<Float>();
x.<Object>f("");
}
}
| 1,761 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Superarg1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/Superarg1.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile/fail Superarg1.java
*/
// Test type mismatch on type argument for super constructor
class T<X> {
class U<Y> extends T<X> {
<B> U() {
<Integer>super("");
}
U(int i) {
<Object>this();
}
}
class V<Z> extends U<Z> {
<C> V(T<X> t) {
t.<Object>super();
}
}
<A> T(A a) {
}
<K> void f() {
this.<Object>f();
}
public static void main(String[] args) {
T<Integer> x = new <Object>T<Integer>("");
T<Integer>.U<Float> y = x.new <Object>U<Float>();
x.<Object>f();
}
}
| 1,768 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Metharg2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/Metharg2.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile/fail Metharg2.java
*/
// Test type mismatch on type argument for qualified method call
class T<X> {
class U<Y> extends T<X> {
<B> U() {
<Object>super();
}
U(int i) {
<Object>this();
}
}
class V<Z> extends U<Z> {
<C> V(T<X> t) {
t.<Object>super();
}
}
<A> T() {
}
<K> void f(K k) {
this.<Object>f("");
}
public static void main(String[] args) {
T<Integer> x = new <Object>T<Integer>();
T<Integer>.U<Float> y = x.new <Object>U<Float>();
x.<Integer>f("");
}
}
| 1,771 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Newarg1.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/Newarg1.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile/fail Newarg1.java
*/
// Test type mismatch on type argument for constructor
class T<X> {
<K> T(K x) {
}
public static void main(String[] args) {
new <Integer>T<Float>("");
}
}
| 1,355 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Newarg2.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/typeargs/Newarg2.java | /*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4851039
* @summary explicit type arguments
* @author gafter
*
* @compile/fail Newarg2.java
*/
// Test type mismatch on type argument for inner constructor
class T {
class U<Y> extends T {
<B> U(B b) {}
}
public static void main(String[] args) {
new T().new <Integer>U<Integer>("");
}
}
| 1,400 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Test.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6207386/Test.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6207386
* @summary Undecidable type system leads to crash
* @author Peter von der Ah\u00e9
* @compile Test.java
*/
public class Test<T> {
<T extends Test<? super Number>> T m1(T t) {
return m2(t);
}
<T extends Test<? super Number>> T m2(T t) {
return null;
}
}
| 1,381 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6207386.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6207386/T6207386.java | /*
* @test /nodynamiccopyright/
* @bug 6207386
* @summary Undecidable type system leads to crash
* @author Martin Odersky
* @compile/fail/ref=T6207386.out -XDrawDiagnostics T6207386.java
*/
public class T6207386 {
static class F<T> {}
static class C<X extends F<F<? super X>>> {
C(X x) {
F<? super X> f = x;
}
}
}
| 367 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6245699a.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6245699/T6245699a.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6270396 6245699
* @summary Missing bridge for final method (gives AbstractMethodError at runtime)
*/
public class T6245699a {
public static void main(String[] args) {
IBar b = new Bar();
String x = b.doIt();
}
static class Foo<T> {
public final T doIt() { return null; }
}
static interface IBar {
String doIt();
}
static class Bar extends Foo<String> implements IBar {}
}
| 1,520 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6245699c.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6245699/T6245699c.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6245699
* @summary Missing bridge for final method (gives AbstractMethodError at runtime)
* @author Peter von der Ah\u00e9
*/
public class T6245699c {
public static void main(String[] args) {
Interface x = new Derived();
x.method("blah"); // throws AbstractMethodError
}
static interface Interface {
void method(String arg);
}
static class Base<T> {
public final void method(T arg) {}
}
static class Derived extends Base<String> implements Interface {}
}
| 1,605 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6245699b.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6245699/T6245699b.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6270396 6245699
* @summary Missing bridge for final method (gives AbstractMethodError at runtime)
* @compile/fail T6245699b.java
*/
public class T6245699b {
public static void main(String[] args) {
IBar b = new Bar();
String x = b.doIt();
}
static class Foo<T> {
public final T doIt() { return null; }
}
static interface IBar {
String doIt();
}
static class Bar extends Foo<String> implements IBar {
public String doIt() { // assert that a final method can't be overridden
return null;
}
}
}
| 1,673 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6245699.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6245699/T6245699.java | /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6245699
* @summary Missing bridge for final method (gives AbstractMethodError at runtime)
*/
public class T6245699 {
public static void main(String[] args) {
Interface x = new Derived();
x.method(); // throws AbstractMethodError
}
static interface Interface {
public Base method();
}
static class Base {
// Bug only occurs if method is declared final
public final Derived method() { return null; }
}
static class Derived extends Base implements Interface {}
}
| 1,616 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6359951.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6359951/T6359951.java | /**
* @test /nodynamiccopyright/
* @bug 6359951
* @summary Crash when using class field
*
*
* @compile/fail/ref=T6359951.out -XDrawDiagnostics T6359951.java
*/
public class T6359951 {
public static String x;
public static class C {}
class D<T> { }
class E<T> extends D<T.classOfT> {}
class F<T extends T6359951> extends D<T.x> {}
class G<T extends T6359951> extends D<T.C> {}
}
| 415 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6531075.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6531075/T6531075.java | /*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6531075
*
* @summary Missing synthetic casts when accessing fields/methods of intersection types including type variables
* @author Maurizio Cimadamore
*
*/
public class T6531075 {
static class A {
void a() {}
}
static interface I{
void i();
}
static class E extends A implements I{
public void i() {}
}
static class C<W extends A & I, T extends W>{
T t;
W w;
C(W w, T t) {
this.w = w;
this.t = t;
}
}
public static void main(String... args) {
C<E,E> c = new C<E,E>(new E(), new E());
testMemberMethods(c);
}
static void testMemberMethods(C<?, ?> arg) {
arg.t.a();
arg.t.i();
}
}
| 1,825 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T4717181c.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/abstract/T4717181c.java | /*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4717181
* @summary javac treats inherited abstract method as an overrider
* @author gafter
*
* @compile/fail T4717181c.java
*/
class T4717181c {
static abstract class A<T> {
abstract void f(T t);
abstract int f(Integer t);
}
static abstract class B extends A<Integer> {}
}
| 1,380 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6413682.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6413682/T6413682.java | /*
* Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6413682
* @summary Compiler confused about implicit type args and arrays
* @compile/fail T6413682.java
*/
public class T6413682 {
public static void main(String... args) {
Object[] text = new
<Wow,thanks.Mr<List>,and.thanks.Mr<Javac>.Vince>Object[5];
}
}
| 1,357 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
TestPos.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6413682/TestPos.java | /*
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6413682
* @summary Compiler confused about implicit type args and arrays
* @author Peter von der Ah\u00e9
*/
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.ErroneousTree;
import com.sun.source.tree.Tree;
import com.sun.source.util.JavacTask;
import com.sun.source.util.TreeScanner;
import com.sun.source.util.Trees;
import java.io.IOException;
import java.net.URI;
import java.util.Collections;
import java.util.List;
import javax.tools.Diagnostic;
import javax.tools.DiagnosticListener;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.SimpleJavaFileObject;
import static javax.tools.JavaFileObject.Kind.SOURCE;
import javax.tools.ToolProvider;
public class TestPos {
static final String errCode = "compiler.err.cannot.create.array.with.type.arguments";
static final String expected =
String.format("%s%n%s%n",
"compiler.err.cannot.create.array.with.type.arguments @ 33",
"begin=28, end=50 : new Object[0],T,e,s,t");
public static void main(String... args) throws IOException {
final boolean[] sawError = { false };
final StringBuilder log = new StringBuilder();
class MyFileObject extends SimpleJavaFileObject {
MyFileObject() {
super(URI.create("myfo:///Test.java"), SOURCE);
}
@Override
public String getCharContent(boolean ignoreEncodingErrors) {
// 0 1 2 3 4 5
// 0123456789012345678901234567890123456789012345678901234
return "class Test { { Object[] o = new <T,e,s,t>Object[0]; } }";
}
}
class Scanner extends TreeScanner<Void,Trees> {
CompilationUnitTree toplevel = null;
@Override
public Void visitCompilationUnit(CompilationUnitTree node, Trees trees) {
toplevel = node;
return super.visitCompilationUnit(node, trees);
}
@Override
public Void visitErroneous(ErroneousTree node, Trees trees) {
sawError[0] = true;
long startPos = trees.getSourcePositions().getStartPosition(toplevel, node);
long endPos = trees.getSourcePositions().getEndPosition(toplevel, node);
log.append(String.format("begin=%s, end=%s : %s%n",
startPos,
endPos,
node.getErrorTrees()));
if (startPos != 28)
error("Start pos for %s is incorrect (%s)!", node, startPos);
if (endPos != 50)
error("End pos for %s is incorrect (%s)!", node, endPos);
return null;
}
}
JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
List<JavaFileObject> compilationUnits =
Collections.<JavaFileObject>singletonList(new MyFileObject());
DiagnosticListener<JavaFileObject> dl = new DiagnosticListener<JavaFileObject>() {
public void report(Diagnostic<? extends JavaFileObject> diag) {
log.append(String.format("%s @ %s%n", diag.getCode(), diag.getPosition()));
if (!diag.getCode().equals(errCode))
error("unexpected error");
if (diag.getPosition() != 33)
error("Error pos for %s is incorrect (%s)!",
diag.getCode(), diag.getPosition());
sawError[0] = true;
}
};
JavacTask task = (JavacTask)javac.getTask(null, null, dl, null, null,
compilationUnits);
Trees trees = Trees.instance(task);
Iterable<? extends Tree> toplevels = task.parse();
if (!sawError[0])
error("No parse error detected");
sawError[0] = false;
new Scanner().scan(toplevels, trees);
if (!sawError[0])
error("No error tree detected");
if (!log.toString().equals(expected))
error("Unexpected log message: %n%s%n", log);
System.out.print(log);
System.out.flush();
}
static void error(String format, Object... args) {
throw new AssertionError(String.format(format, args));
}
}
| 5,523 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6476118c.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6476118/T6476118c.java | /**
* @test /nodynamiccopyright/
* @bug 6476118
* @summary compiler bug causes runtime ClassCastException for generics overloading
* @compile/fail/ref=T6476118c.out -XDrawDiagnostics T6476118c.java
*/
class T6476118c {
static class A<T> {
public void foo(T t) { }
}
static class B<T extends Number> extends A<T> {
public void foo(T t) { }
}
static class C extends B<Integer> {
public void foo(Object o) { }
public void foo(Number o) { }
}
static class D extends C {} //check that no spurious diags generated here!
}
| 586 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6476118b.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6476118/T6476118b.java | /**
* @test /nodynamiccopyright/
* @bug 6476118 6533652
* @summary compiler bug causes runtime ClassCastException for generics overloading
* @compile/fail/ref=T6476118b.out -XDrawDiagnostics T6476118b.java
*/
class T6476118b {
public final int compareTo(Object o) { return 0; }
static class B extends T6476118b implements Comparable<B> {
public int compareTo(B b){ return 0; }
}
}
| 409 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6476118d.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6476118/T6476118d.java | /*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6476118
* @summary compiler bug causes runtime ClassCastException for generics overloading
* @compile T6476118d.java
*/
class T6476118d {
int m = 3;
interface m { }
int m () {
return m;
}
}
| 1,292 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
T6476118a.java | /FileExtraction/Java_unseen/openjdk-mirror_jdk7u-langtools/test/tools/javac/generics/6476118/T6476118a.java | /**
* @test /nodynamiccopyright/
* @bug 6476118
* @summary compiler bug causes runtime ClassCastException for generics overloading
* @compile/fail/ref=T6476118a.out -XDrawDiagnostics T6476118a.java
*/
class T6476118a {
static class A {
public int compareTo(Object o) { return 0; }
}
static class B extends A implements Comparable<B>{
public int compareTo(B b){ return 0; }
}
}
| 417 | Java | .java | openjdk-mirror/jdk7u-langtools | 9 | 3 | 0 | 2012-05-07T19:45:34Z | 2012-05-08T17:47:06Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.