8068465: Group 10e: golden files for tests in tools/javac dir

Reviewed-by: jjg
This commit is contained in:
Sonali Goel 2015-05-15 01:28:43 -07:00
parent 64622d5d74
commit 190ba196a0
20 changed files with 70 additions and 264 deletions

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2003, 2004, 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 4821353 * @bug 4821353
* @summary new warning "finally cannot complete normally" should not be enabled by default * @summary new warning "finally cannot complete normally" should not be enabled by default
* @author gafter * @author gafter
* *
* @compile/fail -Xlint:finally -Werror FinallyWarn.java * @compile/fail/ref=FinallyWarn.out -XDrawDiagnostics -Xlint:finally -Werror FinallyWarn.java
* @compile -Werror FinallyWarn.java * @compile -Werror FinallyWarn.java
*/ */

View file

@ -0,0 +1,4 @@
FinallyWarn.java:16:9: compiler.warn.finally.cannot.complete
- compiler.err.warnings.and.werror
1 error
1 warning

View file

@ -1,35 +1,12 @@
/* /*
* Copyright (c) 2006, 2014, 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 6380059 * @bug 6380059
* @summary Emit warnings for proprietary packages in the boot class path * @summary Emit warnings for proprietary packages in the boot class path
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile WarnClass.java * @compile WarnClass.java
* @compile/fail -Werror WarnClass.java * @compile/fail/ref=WarnClass.out -XDrawDiagnostics -Werror WarnClass.java
* @compile/fail -Werror -nowarn WarnClass.java * @compile/fail/ref=WarnClass.out -XDrawDiagnostics -Werror -nowarn WarnClass.java
* @compile/fail -Werror -Xlint:none WarnClass.java * @compile/fail/ref=WarnClass.out -XDrawDiagnostics -Werror -Xlint:none WarnClass.java
*/ */
public class WarnClass extends sun.misc.Lock {} public class WarnClass extends sun.misc.Lock {}

View file

@ -0,0 +1,4 @@
WarnClass.java:12:40: compiler.warn.sun.proprietary: sun.misc.Lock
- compiler.err.warnings.and.werror
1 error
1 warning

View file

@ -1,35 +1,12 @@
/* /*
* Copyright (c) 2006, 2014, 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 6380059 * @bug 6380059
* @summary Emit warnings for proprietary packages in the boot class path * @summary Emit warnings for proprietary packages in the boot class path
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile WarnImport.java * @compile WarnImport.java
* @compile/fail -Werror WarnImport.java * @compile/fail/ref=WarnImport.out -XDrawDiagnostics -Werror WarnImport.java
* @compile/fail -Werror -nowarn WarnImport.java * @compile/fail/ref=WarnImport.out -XDrawDiagnostics -Werror -nowarn WarnImport.java
* @compile/fail -Werror -Xlint:none WarnImport.java * @compile/fail/ref=WarnImport.out -XDrawDiagnostics -Werror -Xlint:none WarnImport.java
*/ */
import sun.misc.VM; import sun.misc.VM;

View file

@ -0,0 +1,4 @@
WarnImport.java:12:16: compiler.warn.sun.proprietary: sun.misc.VM
- compiler.err.warnings.and.werror
1 error
1 warning

View file

@ -1,35 +1,12 @@
/* /*
* Copyright (c) 2006, 2014, 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 6380059 * @bug 6380059
* @summary Emit warnings for proprietary packages in the boot class path * @summary Emit warnings for proprietary packages in the boot class path
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile WarnMethod.java * @compile WarnMethod.java
* @compile/fail -Werror WarnMethod.java * @compile/fail/ref=WarnMethod.out -XDrawDiagnostics -Werror WarnMethod.java
* @compile/fail -Werror -nowarn WarnMethod.java * @compile/fail/ref=WarnMethod.out -XDrawDiagnostics -Werror -nowarn WarnMethod.java
* @compile/fail -Werror -Xlint:none WarnMethod.java * @compile/fail/ref=WarnMethod.out -XDrawDiagnostics -Werror -Xlint:none WarnMethod.java
*/ */
public class WarnMethod { public class WarnMethod {

View file

@ -0,0 +1,4 @@
WarnMethod.java:14:36: compiler.warn.sun.proprietary: sun.misc.VM
- compiler.err.warnings.and.werror
1 error
1 warning

View file

@ -1,35 +1,12 @@
/* /*
* Copyright (c) 2006, 2014, 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 6380059 * @bug 6380059
* @summary Emit warnings for proprietary packages in the boot class path * @summary Emit warnings for proprietary packages in the boot class path
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile WarnStaticImport.java * @compile WarnStaticImport.java
* @compile/fail -Werror WarnStaticImport.java * @compile/fail/ref=WarnStaticImport.out -XDrawDiagnostics -Werror WarnStaticImport.java
* @compile/fail -Werror -nowarn WarnStaticImport.java * @compile/fail/ref=WarnStaticImport.out -XDrawDiagnostics -Werror -nowarn WarnStaticImport.java
* @compile/fail -Werror -Xlint:none WarnStaticImport.java * @compile/fail/ref=WarnStaticImport.out -XDrawDiagnostics -Werror -Xlint:none WarnStaticImport.java
*/ */
import static sun.misc.VM.getFinalRefCount; import static sun.misc.VM.getFinalRefCount;

View file

@ -0,0 +1,4 @@
WarnStaticImport.java:12:23: compiler.warn.sun.proprietary: sun.misc.VM
- compiler.err.warnings.and.werror
1 error
1 warning

View file

@ -1,35 +1,12 @@
/* /*
* Copyright (c) 2006, 2014, 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 6380059 * @bug 6380059
* @summary Emit warnings for proprietary packages in the boot class path * @summary Emit warnings for proprietary packages in the boot class path
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile WarnVariable.java * @compile WarnVariable.java
* @compile/fail -Werror WarnVariable.java * @compile/fail/ref=WarnVariable.out -XDrawDiagnostics -Werror WarnVariable.java
* @compile/fail -Werror -nowarn WarnVariable.java * @compile/fail/ref=WarnVariable.out -XDrawDiagnostics -Werror -nowarn WarnVariable.java
* @compile/fail -Werror -Xlint:none WarnVariable.java * @compile/fail/ref=WarnVariable.out -XDrawDiagnostics -Werror -Xlint:none WarnVariable.java
*/ */
public class WarnVariable { public class WarnVariable {

View file

@ -0,0 +1,4 @@
WarnVariable.java:14:36: compiler.warn.sun.proprietary: sun.misc.FloatConsts
- compiler.err.warnings.and.werror
1 error
1 warning

View file

@ -1,35 +1,12 @@
/* /*
* Copyright (c) 2006, 2014, 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 6380059 * @bug 6380059
* @summary Emit warnings for proprietary packages in the boot class path * @summary Emit warnings for proprietary packages in the boot class path
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile WarnWildcard.java * @compile WarnWildcard.java
* @compile/fail -Werror WarnWildcard.java * @compile/fail/ref=WarnWildcard.out -XDrawDiagnostics -Werror WarnWildcard.java
* @compile/fail -Werror -nowarn WarnWildcard.java * @compile/fail/ref=WarnWildcard.out -XDrawDiagnostics -Werror -nowarn WarnWildcard.java
* @compile/fail -Werror -Xlint:none WarnWildcard.java * @compile/fail/ref=WarnWildcard.out -XDrawDiagnostics -Werror -Xlint:none WarnWildcard.java
*/ */
public class WarnWildcard { public class WarnWildcard {

View file

@ -0,0 +1,4 @@
WarnWildcard.java:13:44: compiler.warn.sun.proprietary: sun.misc.FloatConsts
- compiler.err.warnings.and.werror
1 error
1 warning

View file

@ -1,34 +1,11 @@
/* /*
* Copyright (c) 2004, 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 4984022 * @bug 4984022
* @summary overriding with method of different arity is prohibited * @summary overriding with method of different arity is prohibited
* @author gafter * @author gafter
* *
* @compile VarargsOverride.java * @compile VarargsOverride.java
* @compile/fail -Werror -Xlint VarargsOverride.java * @compile/ref=VarargsOverride.out -XDrawDiagnostics -Xlint VarargsOverride.java
*/ */
package varargs.override; package varargs.override;

View file

@ -0,0 +1,2 @@
VarargsOverride.java:18:10: compiler.warn.override.varargs.missing: (compiler.misc.varargs.override: f(java.lang.Object...), varargs.override.B, f(java.lang.Object[]), varargs.override.A)
1 warning

View file

@ -1,34 +1,11 @@
/* /*
* Copyright (c) 2004, 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 5024518 * @bug 5024518
* @summary need warning if varargs argument isn't boxed * @summary need warning if varargs argument isn't boxed
* @author gafter * @author gafter
* *
* @compile Warn1.java * @compile Warn1.java
* @compile/fail -Werror Warn1.java * @compile/ref=Warn1.out -XDrawDiagnostics Warn1.java
* @compile -Werror -Xlint:none Warn1.java * @compile -Werror -Xlint:none Warn1.java
*/ */

View file

@ -0,0 +1,2 @@
Warn1.java:18:18: compiler.warn.inexact.non-varargs.call: java.lang.Object, java.lang.Object[]
1 warning

View file

@ -1,34 +1,11 @@
/* /*
* Copyright (c) 2004, 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 5024518 * @bug 5024518
* @summary need warning if varargs argument isn't boxed * @summary need warning if varargs argument isn't boxed
* @author gafter * @author gafter
* *
* @compile Warn2.java * @compile Warn2.java
* @compile/fail -Werror Warn2.java * @compile/fail/ref=Warn2.out -XDrawDiagnostics -Werror Warn2.java
* @compile -Werror -Xlint:none Warn2.java * @compile -Werror -Xlint:none Warn2.java
*/ */

View file

@ -0,0 +1,4 @@
Warn2.java:18:18: compiler.warn.inexact.non-varargs.call: java.lang.Object, java.lang.Object[]
- compiler.err.warnings.and.werror
1 error
1 warning