8044080: .out files for unicode, implicitThis and importChecks tests in tools/javac dir

Reviewed-by: jjg
This commit is contained in:
Sonali Goel 2014-07-07 13:39:31 -07:00
parent 9c09973b5a
commit 5437ec7e74
20 changed files with 47 additions and 250 deletions

View file

@ -1,32 +1,9 @@
/* /*
* Copyright (c) 1999, 2002, 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 4249111 * @bug 4249111
* @summary 'new' of inner class should not be allowed unless outer is constructed * @summary 'new' of inner class should not be allowed unless outer is constructed
* *
* @compile/fail NewBeforeOuterConstructed.java * @compile/fail/ref=NewBeforeOuterConstructed.out -XDrawDiagnostics NewBeforeOuterConstructed.java
*/ */
import java.io.*; import java.io.*;

View file

@ -0,0 +1,2 @@
NewBeforeOuterConstructed.java:27:21: compiler.err.cant.ref.before.ctor.called: this
1 error

View file

@ -1,32 +1,9 @@
/* /*
* Copyright (c) 2002, 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 4689058 * @bug 4689058
* @summary unverifiable code for implicit outer in super constructor call * @summary unverifiable code for implicit outer in super constructor call
* *
* @compile/fail NewBeforeOuterConstructed2.java * @compile/fail/ref=NewBeforeOuterConstructed2.out -XDrawDiagnostics NewBeforeOuterConstructed2.java
*/ */
public class NewBeforeOuterConstructed2 { public class NewBeforeOuterConstructed2 {

View file

@ -0,0 +1,2 @@
NewBeforeOuterConstructed2.java:20:35: compiler.err.cant.ref.before.ctor.called: this
1 error

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2002, 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 4462745 * @bug 4462745
* @summary compiler permits to import class given by its non-canonical name * @summary compiler permits to import class given by its non-canonical name
* @author gafter * @author gafter
* *
* @compile/fail ImportCanonical1.java ImportCanonical2.java * @compile/fail/ref=ImportCanonical1.out -XDrawDiagnostics ImportCanonical1.java ImportCanonical2.java
*/ */
package p1; package p1;

View file

@ -0,0 +1,2 @@
ImportCanonical2.java:25:13: compiler.err.import.requires.canonical: p1.A1.I
1 error

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2000, 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 4335264 * @bug 4335264
* @summary Verify that import-on-demand must be fully qualified. * @summary Verify that import-on-demand must be fully qualified.
* @author maddox * @author maddox
* *
* @compile/fail ImportIsFullyQualified.java * @compile/fail/ref=ImportIsFullyQualified.out -XDrawDiagnostics ImportIsFullyQualified.java
*/ */
import java.awt.*; import java.awt.*;

View file

@ -0,0 +1,2 @@
ImportIsFullyQualified.java:11:1: compiler.err.doesnt.exist: JobAttributes
1 error

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 2000, 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 4312063 * @bug 4312063
* @summary Verify that nonexistent imports detected when no classes declared in compilation unit. * @summary Verify that nonexistent imports detected when no classes declared in compilation unit.
* @author maddox * @author maddox
* *
* @compile/fail InvalidImportsNoClasses.java * @compile/fail/ref=InvalidImportsNoClasses.out -XDrawDiagnostics InvalidImportsNoClasses.java
*/ */
import nonexistent.pack.cls; import nonexistent.pack.cls;

View file

@ -0,0 +1,2 @@
InvalidImportsNoClasses.java:10:24: compiler.err.doesnt.exist: nonexistent.pack
1 error

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 4707960 6183529 * @bug 4707960 6183529
* @summary javac accepts unicode digits - sometimes crashing * @summary javac accepts unicode digits - sometimes crashing
* @author gafter * @author gafter
* *
* @compile/fail NonasciiDigit.java * @compile/fail/ref=NonasciiDigit.out -XDrawDiagnostics NonasciiDigit.java
*/ */
public class NonasciiDigit { public class NonasciiDigit {
public static void main(String[] args) { public static void main(String[] args) {

View file

@ -0,0 +1,2 @@
NonasciiDigit.java:12:26: compiler.err.illegal.char: \uff11
1 error

View file

@ -1,33 +1,10 @@
/* /*
* Copyright (c) 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 4707960 6183529 * @bug 4707960 6183529
* @summary javac accepts unicode digits - sometimes crashing * @summary javac accepts unicode digits - sometimes crashing
* @author gafter * @author gafter
* *
* @compile/fail NonasciiDigit2.java * @compile/fail/ref=NonasciiDigit2.out -XDrawDiagnostics NonasciiDigit2.java
*/ */
public class NonasciiDigit2 { public class NonasciiDigit2 {
public static void main(String[] args) { public static void main(String[] args) {

View file

@ -0,0 +1,2 @@
NonasciiDigit2.java:12:18: compiler.err.illegal.nonascii.digit
1 error

View file

@ -1,34 +1,11 @@
/* /*
* Copyright (c) 2003, 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 4914724 * @bug 4914724
* @summary Ensure that the invalid surrogate sequence, as the start of an identifier, * @summary Ensure that the invalid surrogate sequence, as the start of an identifier,
* causes a compilation failure * causes a compilation failure
* @author Naoto Sato * @author Naoto Sato
* *
* @compile/fail SupplementaryJavaID2.java * @compile/fail/ref=SupplementaryJavaID2.out -XDrawDiagnostics SupplementaryJavaID2.java
*/ */
public class SupplementaryJavaID2 { public class SupplementaryJavaID2 {

View file

@ -0,0 +1,3 @@
SupplementaryJavaID2.java:12:14: compiler.err.illegal.char: \ud801
SupplementaryJavaID2.java:12:24: compiler.err.expected: token.identifier
2 errors

View file

@ -1,34 +1,11 @@
/* /*
* Copyright (c) 2003, 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 4914724 * @bug 4914724
* @summary Ensure that the invalid surrogate sequence, as the part of an identifier, * @summary Ensure that the invalid surrogate sequence, as the part of an identifier,
* causes a compilation failure * causes a compilation failure
* @author Naoto Sato * @author Naoto Sato
* *
* @compile/fail SupplementaryJavaID3.java * @compile/fail/ref=SupplementaryJavaID3.out -XDrawDiagnostics SupplementaryJavaID3.java
*/ */
public class SupplementaryJavaID3 { public class SupplementaryJavaID3 {

View file

@ -0,0 +1,2 @@
SupplementaryJavaID3.java:12:23: compiler.err.illegal.char: \ud801
1 error

View file

@ -1,36 +1,14 @@
/* /*
* Copyright (c) 1997, 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 1265387 * @bug 1265387
* @summary ''' and '\u0027' are not legal char literals. * @summary ''' and '\u0027' are not legal char literals.
* @author turnidge * @author turnidge
* *
* @compile/fail TripleQuote.java * @compile/fail/ref=TripleQuote.out -XDrawDiagnostics TripleQuote.java
*/ */
public public
class TripleQuote { class TripleQuote {
char c = '\u0027'; char c = '\u0027';
char d = ''';
} }

View file

@ -0,0 +1,7 @@
TripleQuote.java:12:14: compiler.err.empty.char.lit
TripleQuote.java:12:20: compiler.err.empty.char.lit
TripleQuote.java:12:21: compiler.err.unclosed.char.lit
TripleQuote.java:13:14: compiler.err.empty.char.lit
TripleQuote.java:13:15: compiler.err.empty.char.lit
TripleQuote.java:13:16: compiler.err.unclosed.char.lit
6 errors