8068464: Group 10d: golden files for tests in tools/javac dir

Reviewed-by: jjg
This commit is contained in:
Sonali Goel 2015-05-15 01:09:51 -07:00
parent ef28a587f7
commit 64622d5d74
25 changed files with 68 additions and 233 deletions

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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 4500240 * @bug 4500240
* @summary javac throws StackOverflowError for recursive inheritance * @summary javac throws StackOverflowError for recursive inheritance
* *
* @compile ClassCycle1a.java * @compile ClassCycle1a.java
* @compile/fail ClassCycle1b.java * @compile/fail/ref=ClassCycle1a.out -XDrawDiagnostics ClassCycle1b.java
*/ */
interface ClassCycle1b {} interface ClassCycle1b {}

View file

@ -0,0 +1,2 @@
ClassCycle1b.java:28:1: compiler.err.cyclic.inheritance: ClassCycle1b
1 error

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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 4500240 * @bug 4500240
* @summary javac throws StackOverflowError for recursive inheritance * @summary javac throws StackOverflowError for recursive inheritance
* *
* @compile ClassCycle2a.java * @compile ClassCycle2a.java
* @compile/fail ClassCycle2b.java * @compile/fail/ref=ClassCycle2a.out -XDrawDiagnostics ClassCycle2b.java
*/ */
class ClassCycle2b {} class ClassCycle2b {}

View file

@ -0,0 +1,2 @@
ClassCycle2b.java:28:1: compiler.err.cyclic.inheritance: ClassCycle2b
1 error

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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 4497044 * @bug 4497044
* @summary java.lang.StackOverflowError for cyclic inheritance * @summary java.lang.StackOverflowError for cyclic inheritance
* *
* @compile ClassCycle3a.java * @compile ClassCycle3a.java
* @compile/fail ClassCycle3b.java * @compile/fail/ref=ClassCycle3a.out -XDrawDiagnostics ClassCycle3b.java
*/ */
interface ClassCycle3b {} interface ClassCycle3b {}

View file

@ -0,0 +1,2 @@
ClassCycle3b.java:28:1: compiler.err.cyclic.inheritance: ClassCycle3b
1 error

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it

View file

@ -3,8 +3,7 @@
* @bug 5012028 6384539 * @bug 5012028 6384539
* @summary javac crash when declare an annotation type illegally * @summary javac crash when declare an annotation type illegally
* *
* @compile/fail IllegalAnnotation.java * @compile/fail/ref=IllegalAnnotation.out -XDrawDiagnostics IllegalAnnotation.java
* @compile/fail/ref=IllegalAnnotation.out -XDdev -XDrawDiagnostics IllegalAnnotation.java
*/ */
class IllegalAnnotation { class IllegalAnnotation {
{ {

View file

@ -1,2 +1,2 @@
IllegalAnnotation.java:11:10: compiler.err.intf.not.allowed.here IllegalAnnotation.java:10:10: compiler.err.intf.not.allowed.here
1 error 1 error

View file

@ -1,10 +1,33 @@
/*
* Copyright (c) 1998, 2015, 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 * @test
* @bug 4053724 * @bug 4053724
* @summary Certain non-ambiguous field references were reported by the * @summary Certain non-ambiguous field references were reported by the
* compiler as ambigous. * compiler as ambiguous.
* @author turnidge * @author turnidge
* *
* @compile one/Parent.java two/Child.java * @compile one/Parent.java two/Child.java
* @compile/fail one/Parent2.java two/Child2.java * @compile/fail/ref=Test.out -XDrawDiagnostics one/Parent2.java two/Child2.java
*/ */

View file

@ -0,0 +1,2 @@
Child2.java:11:28: compiler.err.ref.ambiguous: i, kindname.variable, i, one.Parent2, kindname.variable, i, two.I
1 error

View file

@ -1,25 +1,4 @@
/* /* /nodynamiccopyright/ */
* Copyright (c) 1998, 2013, 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 two; package two;

View file

@ -1,34 +1,11 @@
/* /*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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 6794959 * @bug 6794959
* @summary add new switch -XDexpectKeys=key,key,... * @summary add new switch -XDexpectKeys=key,key,...
* @compile T6794959.java * @compile T6794959.java
* @compile/fail -XDfailcomplete=java.lang.String T6794959.java * @compile/fail/ref=T6794959a.out -XDrawDiagnostics -XDfailcomplete=java.lang.String T6794959.java
* @compile -XDfailcomplete=java.lang.String -XDexpectKeys=compiler.err.cant.resolve.location T6794959.java * @compile -XDfailcomplete=java.lang.String -XDexpectKeys=compiler.err.cant.resolve.location T6794959.java
* @compile/fail -XDexpectKeys=compiler.err.cant.resolve.location T6794959.java * @compile/fail/ref=T6794959b.out -XDrawDiagnostics -XDexpectKeys=compiler.err.cant.resolve.location T6794959.java
*/ */
class T6794959 { class T6794959 {

View file

@ -0,0 +1,2 @@
T6794959.java:12:5: compiler.err.cant.resolve.location: kindname.class, String, , , (compiler.misc.location: kindname.class, T6794959, null)
1 error

View file

@ -0,0 +1 @@
expected diagnostic keys not found: [compiler.err.cant.resolve.location]

View file

@ -1,32 +1,9 @@
/* /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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 4916620 * @bug 4916620
* @summary legal cast is rejected * @summary legal cast is rejected
* @author Christian Plesner Hansen * @author Christian Plesner Hansen
* @compile/fail -Xlint:unchecked -Werror T4916620.java * @compile/ref=T4916620.out -XDrawDiagnostics -Xlint:unchecked T4916620.java
* @compile -Xlint:unchecked T4916620.java * @compile -Xlint:unchecked T4916620.java
*/ */

View file

@ -0,0 +1,2 @@
T4916620.java:17:33: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T4916620.BB<compiler.misc.type.captureof: 1, ? extends java.lang.Number,compiler.misc.type.captureof: 2, ? super java.lang.Integer>, T4916620.BD<java.lang.Number>
1 warning

View file

@ -1,34 +1,10 @@
/* /*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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 6295056 * @bug 6295056
* @summary Unchecked cast not reported as unsafe * @summary Unchecked cast not reported as unsafe
* @compile/fail -Xlint:unchecked -Werror T6295056.java * @compile/ref=T6295056.out -XDrawDiagnostics -Xlint:unchecked T6295056.java
* @compile T6295056.java * @compile T6295056.java
*/ */
public class T6295056 { public class T6295056 {
interface Foo {} interface Foo {}
interface Bar<X> {} interface Bar<X> {}

View file

@ -0,0 +1,2 @@
T6295056.java:13:29: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6295056.Foo, T6295056.Bar<java.lang.Object>
1 warning

View file

@ -1,32 +1,9 @@
/* /*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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
* @author mcimadamore * @author mcimadamore
* @bug 6467183 * @bug 6467183
* @summary * @summary unchecked warning on cast of parameterized generic subclass
* @compile/fail -Xlint:unchecked -Werror -XDrawDiagnostics T6467183b.java * @compile/ref=T6467183b.out -XDrawDiagnostics -Xlint:unchecked T6467183b.java
*/ */
class T6665356b<T> { class T6665356b<T> {

View file

@ -0,0 +1,2 @@
T6467183b.java:15:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6665356b<T>.A<compiler.misc.type.captureof: 1, ? extends java.lang.Number>, T6665356b<T>.B<? extends java.lang.Integer>
1 warning

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. * @test /nodynamiccopyright/
* 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 4767128 5048557 5048773 * @bug 4767128 5048557 5048773
* @summary diagnose encoding errors in Java source files * @summary diagnose encoding errors in Java source files
* @author gafter * @author gafter
* *
* @compile/fail -encoding ascii Unmappable.java * @compile/fail/ref=Unmappable.out -XDrawDiagnostics -encoding ascii Unmappable.java
*/ */
// example from 4766897 // example from 4766897

View file

@ -0,0 +1,2 @@
Unmappable.java:12:18: compiler.err.illegal.char.for.encoding: ascii
1 error