changeset 3383:5eb7e8bb476b

8044072: Group 2: create .out files for OverrideChecks tests in tools/javac dir Reviewed-by: jjg
author sogoel
date Thu, 05 Jun 2014 10:57:10 -0700
parents fe32d75d4d4f
children 8ea3d41ba8f3
files test/tools/javac/OverrideChecks/InconsistentReturn.java test/tools/javac/OverrideChecks/InconsistentReturn.out test/tools/javac/OverrideChecks/Private.java test/tools/javac/OverrideChecks/Private.out test/tools/javac/OverrideChecks/StaticOverride.java test/tools/javac/OverrideChecks/StaticOverride.out test/tools/javac/OverrideChecks/T4720356a.java test/tools/javac/OverrideChecks/T4720356a.out test/tools/javac/OverrideChecks/T4720359a.java test/tools/javac/OverrideChecks/T4720359a.out test/tools/javac/OverrideChecks/T4721069.java test/tools/javac/OverrideChecks/T4721069.out test/tools/javac/OverrideChecks/ThrowsConflict.java test/tools/javac/OverrideChecks/ThrowsConflict.out
diffstat 14 files changed, 44 insertions(+), 191 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/javac/OverrideChecks/InconsistentReturn.java	Thu Jun 05 10:44:38 2014 -0700
+++ b/test/tools/javac/OverrideChecks/InconsistentReturn.java	Thu Jun 05 10:57:10 2014 -0700
@@ -1,34 +1,11 @@
 /*
- * Copyright (c) 1997, 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 4041948
+ * @test    /nodynamiccopyright/
+ * @bug     4041948
  * @summary javac previously allowed interfaces to inherit methods with
  *          inconsistent return types.
- * @author turnidge
+ * @author  turnidge
  *
- * @compile/fail InconsistentReturn.java
+ * @compile/fail/ref=InconsistentReturn.out -XDrawDiagnostics  InconsistentReturn.java
  */
 interface I1{
   int f();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/InconsistentReturn.out	Thu Jun 05 10:57:10 2014 -0700
@@ -0,0 +1,2 @@
+InconsistentReturn.java:17:1: compiler.err.types.incompatible.diff.ret: I2, I1, f()
+1 error
--- a/test/tools/javac/OverrideChecks/Private.java	Thu Jun 05 10:44:38 2014 -0700
+++ b/test/tools/javac/OverrideChecks/Private.java	Thu Jun 05 10:57:10 2014 -0700
@@ -1,32 +1,9 @@
 /*
- * 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
+ * @test    /nodynamiccopyright/
  * @bug     6399361
  * @summary java.lang.Override specification should be revised
  * @author  Peter von der Ah\u00e9
- * @compile/fail Private.java
+ * @compile/fail/ref=Private.out -XDrawDiagnostics  Private.java
  */
 
 public class Private {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/Private.out	Thu Jun 05 10:57:10 2014 -0700
@@ -0,0 +1,2 @@
+Private.java:14:5: compiler.err.method.does.not.override.superclass
+1 error
--- a/test/tools/javac/OverrideChecks/StaticOverride.java	Thu Jun 05 10:44:38 2014 -0700
+++ b/test/tools/javac/OverrideChecks/StaticOverride.java	Thu Jun 05 10:57:10 2014 -0700
@@ -1,34 +1,11 @@
 /*
- * Copyright (c) 1997, 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 4041948 4022450
+ * @test    /nodynamiccopyright/
+ * @bug     4041948 4022450
  * @summary javac previously allowed static methods to override non-static
  *          methods in some cases.
- * @author turnidge
+ * @author  turnidge
  *
- * @compile/fail StaticOverride.java
+ * @compile/fail/ref=StaticOverride.out -XDrawDiagnostics  StaticOverride.java
  */
 interface I{
   int f();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/StaticOverride.out	Thu Jun 05 10:57:10 2014 -0700
@@ -0,0 +1,2 @@
+StaticOverride.java:20:1: compiler.err.override.static: (compiler.misc.cant.implement: f(), C, f(), I)
+1 error
--- a/test/tools/javac/OverrideChecks/T4720356a.java	Thu Jun 05 10:44:38 2014 -0700
+++ b/test/tools/javac/OverrideChecks/T4720356a.java	Thu Jun 05 10:57:10 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * @test    /nodynamiccopyright/
+ * @bug     4720356
+ * @summary compiler fails to check cross-package overriding
+ * @author  gafter
  *
- * 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 4720356
- * @summary compiler fails to check cross-package overriding
- * @author gafter
- *
- * @compile/fail T4720356a.java T4720356b.java
+ * @compile/fail/ref=T4720356a.out -XDrawDiagnostics  T4720356a.java T4720356b.java
  */
 
 package p1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/T4720356a.out	Thu Jun 05 10:57:10 2014 -0700
@@ -0,0 +1,2 @@
+T4720356a.java:16:16: compiler.err.override.incompatible.ret: (compiler.misc.cant.override: m(), p1.T4720356c, m(), p1.T4720356a), int, void
+1 error
--- a/test/tools/javac/OverrideChecks/T4720359a.java	Thu Jun 05 10:44:38 2014 -0700
+++ b/test/tools/javac/OverrideChecks/T4720359a.java	Thu Jun 05 10:57:10 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * @test    /nodynamiccopyright/
+ * @bug     4720359
+ * @summary javac fails to check cross-package hiding
+ * @author  gafter
  *
- * 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 4720359
- * @summary javac fails to check cross-package hiding
- * @author gafter
- *
- * @compile/fail T4720359a.java T4720359b.java
+ * @compile/fail/ref=T4720359a.out -XDrawDiagnostics  T4720359a.java T4720359b.java
  */
 
 package p1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/T4720359a.out	Thu Jun 05 10:57:10 2014 -0700
@@ -0,0 +1,2 @@
+T4720359a.java:16:23: compiler.err.override.incompatible.ret: (compiler.misc.cant.override: m(), p1.T4720359c, m(), p1.T4720359a), int, void
+1 error
--- a/test/tools/javac/OverrideChecks/T4721069.java	Thu Jun 05 10:44:38 2014 -0700
+++ b/test/tools/javac/OverrideChecks/T4721069.java	Thu Jun 05 10:57:10 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * @test    /nodynamiccopyright/
+ * @bug     4721069
+ * @summary javac allows an interface to override a final method in Object
+ * @author  gafter
  *
- * 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 4721069
- * @summary javac allows an interface to override a final method in Object
- * @author gafter
- *
- * @compile/fail T4721069.java
+ * @compile/fail/ref=T4721069.out -XDrawDiagnostics  T4721069.java
  */
 
 interface I {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/T4721069.out	Thu Jun 05 10:57:10 2014 -0700
@@ -0,0 +1,2 @@
+T4721069.java:11:11: compiler.err.override.meth: (compiler.misc.cant.override: getClass(), I, getClass(), java.lang.Object), final
+1 error
--- a/test/tools/javac/OverrideChecks/ThrowsConflict.java	Thu Jun 05 10:44:38 2014 -0700
+++ b/test/tools/javac/OverrideChecks/ThrowsConflict.java	Thu Jun 05 10:57:10 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * @test    /nodynamiccopyright/
+ * @bug     4022674
+ * @summary Compiler should detect throws-clauses' conflict.
+ * @author  turnidge
  *
- * 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 4022674
- * @summary Compiler should detect throws-clauses' conflict.
- * @author turnidge
- *
- * @compile/fail ThrowsConflict.java
+ * @compile/fail/ref=ThrowsConflict.out -XDrawDiagnostics  ThrowsConflict.java
  */
 
 interface I {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/ThrowsConflict.out	Thu Jun 05 10:57:10 2014 -0700
@@ -0,0 +1,2 @@
+ThrowsConflict.java:20:1: compiler.err.override.meth.doesnt.throw: (compiler.misc.cant.implement: method(), A, method(), I), java.lang.Exception
+1 error