8055080: Group 9d: golden files for tests in tools/javac dir
Reviewed-by: jjg, mcimadamore, jlahoda
This commit is contained in:
parent
8c15cc3983
commit
79efb2b9d8
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4391330
|
||||
* @summary compiler accepted (Integer).toString(123)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Parens1.java
|
||||
* @compile/fail/ref=Parens1.out -XDrawDiagnostics Parens1.java
|
||||
*/
|
||||
|
||||
class Parens1 {
|
||||
|
2
langtools/test/tools/javac/Parens1.out
Normal file
2
langtools/test/tools/javac/Parens1.out
Normal file
@ -0,0 +1,2 @@
|
||||
Parens1.java:12:20: compiler.err.illegal.start.of.type
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4408036
|
||||
* @summary Compiler accepted "(i=2);" as a valid expession statement.
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Parens2.java
|
||||
* @compile/fail/ref=Parens2.out -XDrawDiagnostics Parens2.java
|
||||
*/
|
||||
|
||||
class Parens2 {
|
||||
|
2
langtools/test/tools/javac/Parens2.out
Normal file
2
langtools/test/tools/javac/Parens2.out
Normal file
@ -0,0 +1,2 @@
|
||||
Parens2.java:13:9: compiler.err.not.stmt
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4394546
|
||||
* @summary get no err msg if label wrapped in parentheses
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Parens3.java
|
||||
* @compile/fail/ref=Parens3.out -XDrawDiagnostics Parens3.java
|
||||
*/
|
||||
|
||||
class Parens3 {
|
||||
|
3
langtools/test/tools/javac/Parens3.out
Normal file
3
langtools/test/tools/javac/Parens3.out
Normal file
@ -0,0 +1,3 @@
|
||||
Parens3.java:12:5: compiler.err.not.stmt
|
||||
Parens3.java:12:10: compiler.err.expected: ';'
|
||||
2 errors
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4933317
|
||||
* @summary javac accepts parens in package names
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Parens4.java
|
||||
* @compile/fail/ref=Parens4.out -XDrawDiagnostics Parens4.java
|
||||
*/
|
||||
|
||||
class Parens4 {
|
||||
|
2
langtools/test/tools/javac/Parens4.out
Normal file
2
langtools/test/tools/javac/Parens4.out
Normal file
@ -0,0 +1,2 @@
|
||||
Parens4.java:12:16: compiler.err.illegal.start.of.type
|
||||
1 error
|
@ -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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4092958
|
||||
* @summary The compiler was too permissive in its parsing of conditional
|
||||
* expressions.
|
||||
* @author turnidge
|
||||
*
|
||||
* @compile/fail ParseConditional.java
|
||||
* @compile/fail/ref=ParseConditional.out -XDrawDiagnostics ParseConditional.java
|
||||
*/
|
||||
|
||||
public class ParseConditional {
|
||||
@ -38,6 +15,11 @@ public class ParseConditional {
|
||||
int b = 2;
|
||||
int c = 3;
|
||||
int d = 4;
|
||||
a = condition ? b = c : c = d; // Should get a parse error.
|
||||
// The following line should give an error because the conditional ?: operator
|
||||
// is higher priority than the final assignment operator, between c and d.
|
||||
// As such, the correct parsing is:
|
||||
// a = (condition ? b = c : c) = d;
|
||||
// and it is illegal to try and assign to the value of the conditional expression.
|
||||
a = condition ? b = c : c = d;
|
||||
}
|
||||
}
|
||||
|
2
langtools/test/tools/javac/ParseConditional.out
Normal file
2
langtools/test/tools/javac/ParseConditional.out
Normal file
@ -0,0 +1,2 @@
|
||||
ParseConditional.java:23:23: compiler.err.unexpected.type: kindname.variable, kindname.value
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4350352
|
||||
* @summary InternalError: store unsupported: com.sun.tools.javac.v8.comp.Items
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail StoreClass.java
|
||||
* @compile/fail/ref=StoreClass.out -XDrawDiagnostics StoreClass.java
|
||||
*/
|
||||
|
||||
class StoreClass {
|
||||
|
3
langtools/test/tools/javac/StoreClass.out
Normal file
3
langtools/test/tools/javac/StoreClass.out
Normal file
@ -0,0 +1,3 @@
|
||||
StoreClass.java:12:19: compiler.err.cant.assign.val.to.final.var: class
|
||||
StoreClass.java:13:12: compiler.err.cant.assign.val.to.final.var: class
|
||||
2 errors
|
@ -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.
|
||||
*
|
||||
* 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 4725650
|
||||
* @summary Restrict scope of local classes in switch-block-group
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail SwitchScope.java
|
||||
* @compile/fail/ref=SwitchScope.out -XDrawDiagnostics SwitchScope.java
|
||||
*/
|
||||
|
||||
public class SwitchScope {
|
||||
|
2
langtools/test/tools/javac/SwitchScope.out
Normal file
2
langtools/test/tools/javac/SwitchScope.out
Normal file
@ -0,0 +1,2 @@
|
||||
SwitchScope.java:22:28: compiler.err.cant.resolve.location: kindname.class, Local, , , (compiler.misc.location: kindname.class, SwitchScope, null)
|
||||
1 error
|
@ -1,38 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4462714
|
||||
* @summary using of synthetic names in local class causes ClassFormatError
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail SynthName2.java
|
||||
* @compile/fail/ref=SynthName2.out -XDrawDiagnostics SynthName2.java
|
||||
*/
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
class SynthName1 {
|
||||
class SynthName2 {
|
||||
public static void main(String args[]) {
|
||||
run(args, System.out);
|
||||
}
|
||||
|
4
langtools/test/tools/javac/SynthName2.out
Normal file
4
langtools/test/tools/javac/SynthName2.out
Normal file
@ -0,0 +1,4 @@
|
||||
SynthName2.java:33:9: compiler.err.synthetic.name.conflict: val$zzz, InnClass
|
||||
SynthName2.java:34:17: compiler.err.synthetic.name.conflict: val$prm1, InnClass
|
||||
SynthName2.java:35:17: compiler.err.synthetic.name.conflict: val$zzz, InnClass
|
||||
3 errors
|
@ -1,30 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 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 /nodynamiccopyright/
|
||||
* @bug 6234077
|
||||
* @compile/fail/ref=T6234077.out -XDrawDiagnostics T6234077.java
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6234077
|
||||
* @compile/fail T6234077.java
|
||||
*/
|
||||
@Deprecated /** @deprecated */
|
||||
public class Foo { }
|
||||
|
2
langtools/test/tools/javac/T6234077.out
Normal file
2
langtools/test/tools/javac/T6234077.out
Normal file
@ -0,0 +1,2 @@
|
||||
T6234077.java:7:8: compiler.err.class.public.should.be.in.file: Foo
|
||||
1 error
|
Loading…
x
Reference in New Issue
Block a user