Merge jdk8-b21

Mon, 09 Jan 2012 19:13:08 -0800

author
lana
date
Mon, 09 Jan 2012 19:13:08 -0800
changeset 1174
bcb21abf1c41
parent 1168
020819eb56d2
parent 1173
4e8aa6eca726
child 1175
390a7828ae18

Merge

     1.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Thu Jan 05 08:42:49 2012 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Mon Jan 09 19:13:08 2012 -0800
     1.3 @@ -535,13 +535,14 @@
     1.4                          reader.putChar('.');
     1.5                          scanFractionAndSuffix(pos);
     1.6                      } else if (reader.ch == '.') {
     1.7 +                        int savePos = reader.bp;
     1.8                          reader.putChar('.'); reader.putChar('.', true);
     1.9                          if (reader.ch == '.') {
    1.10                              reader.scanChar();
    1.11                              reader.putChar('.');
    1.12                              tk = TokenKind.ELLIPSIS;
    1.13                          } else {
    1.14 -                            lexError(pos, "malformed.fp.lit");
    1.15 +                            lexError(savePos, "illegal.dot");
    1.16                          }
    1.17                      } else {
    1.18                          tk = TokenKind.DOT;
     2.1 --- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Jan 05 08:42:49 2012 -0800
     2.2 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Mon Jan 09 19:13:08 2012 -0800
     2.3 @@ -384,6 +384,9 @@
     2.4  compiler.err.illegal.underscore=\
     2.5      illegal underscore
     2.6  
     2.7 +compiler.err.illegal.dot=\
     2.8 +    illegal ''.''
     2.9 +
    2.10  # 0: symbol
    2.11  compiler.err.illegal.qual.not.icls=\
    2.12      illegal qualifier; {0} is not an inner class
     3.1 --- a/test/tools/javac/api/T6397104.java	Thu Jan 05 08:42:49 2012 -0800
     3.2 +++ b/test/tools/javac/api/T6397104.java	Mon Jan 09 19:13:08 2012 -0800
     3.3 @@ -26,10 +26,10 @@
     3.4   * @bug     6397104
     3.5   * @summary JSR 199: JavaFileManager.getFileForOutput should have sibling argument
     3.6   * @author  Peter von der Ah\u00e9
     3.7 - * @ignore  this test should be rewritten when fixing 6473901
     3.8   */
     3.9  
    3.10  import java.io.File;
    3.11 +import java.net.URI;
    3.12  import java.util.Arrays;
    3.13  import javax.tools.*;
    3.14  import javax.tools.JavaFileManager.Location;
    3.15 @@ -52,10 +52,14 @@
    3.16              : fm.getJavaFileObjectsFromFiles(Arrays.asList(siblingFile)).iterator().next();
    3.17          FileObject fileObject =
    3.18              fm.getFileForOutput(location, "java.lang", relName, sibling);
    3.19 -        if (!fileObject.toUri().getPath().equals(expectedPath))
    3.20 -            throw new AssertionError("Expected " + expectedPath +
    3.21 -                                     ", got " + fileObject.toUri().getPath());
    3.22 -        System.out.format("OK: (%s, %s) => %s%n", siblingFile, relName, fileObject.toUri());
    3.23 +
    3.24 +        File expectedFile = new File(expectedPath).getCanonicalFile();
    3.25 +        File fileObjectFile = new File(fileObject.toUri()).getCanonicalFile();
    3.26 +
    3.27 +        if (!fileObjectFile.equals(expectedFile))
    3.28 +            throw new AssertionError("Expected " + expectedFile +
    3.29 +                                     ", got " + fileObjectFile);
    3.30 +        System.out.format("OK: (%s, %s) => %s%n", siblingFile, relName, fileObjectFile);
    3.31      }
    3.32  
    3.33      void test(boolean hasLocation, File siblingFile, String relName, String expectedPath)
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/tools/javac/diags/examples/IllegalDot.java	Mon Jan 09 19:13:08 2012 -0800
     4.3 @@ -0,0 +1,30 @@
     4.4 +/*
     4.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 + *
     4.8 + * This code is free software; you can redistribute it and/or modify it
     4.9 + * under the terms of the GNU General Public License version 2 only, as
    4.10 + * published by the Free Software Foundation.
    4.11 + *
    4.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    4.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.15 + * version 2 for more details (a copy is included in the LICENSE file that
    4.16 + * accompanied this code).
    4.17 + *
    4.18 + * You should have received a copy of the GNU General Public License version
    4.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    4.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.21 + *
    4.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.23 + * or visit www.oracle.com if you need additional information or have any
    4.24 + * questions.
    4.25 + */
    4.26 +
    4.27 +// key: compiler.err.illegal.dot
    4.28 +// key: compiler.err.expected
    4.29 +// key: compiler.err.illegal.start.of.type
    4.30 +
    4.31 +class X {
    4.32 +    void m(Object.. args) { }
    4.33 +}
     5.1 --- a/test/tools/javac/generics/diamond/7046778/DiamondAndInnerClassTest.java	Thu Jan 05 08:42:49 2012 -0800
     5.2 +++ b/test/tools/javac/generics/diamond/7046778/DiamondAndInnerClassTest.java	Mon Jan 09 19:13:08 2012 -0800
     5.3 @@ -284,7 +284,7 @@
     5.4          try {
     5.5              ct.analyze();
     5.6          } catch (Throwable ex) {
     5.7 -            throw new AssertionError("Error thron when compiling the following code:\n" + source.getCharContent(true));
     5.8 +            throw new AssertionError("Error thrown when compiling the following code:\n" + source.getCharContent(true));
     5.9          }
    5.10          check();
    5.11      }
     6.1 --- a/test/tools/javac/generics/inference/7086601/T7086601b.java	Thu Jan 05 08:42:49 2012 -0800
     6.2 +++ b/test/tools/javac/generics/inference/7086601/T7086601b.java	Mon Jan 09 19:13:08 2012 -0800
     6.3 @@ -146,7 +146,7 @@
     6.4          try {
     6.5              ct.analyze();
     6.6          } catch (Throwable ex) {
     6.7 -            throw new AssertionError("Error thron when compiling the following code:\n" + source.getCharContent(true));
     6.8 +            throw new AssertionError("Error thrown when compiling the following code:\n" + source.getCharContent(true));
     6.9          }
    6.10          check();
    6.11      }
     7.1 --- a/test/tools/javac/generics/rawOverride/7062745/GenericOverrideTest.java	Thu Jan 05 08:42:49 2012 -0800
     7.2 +++ b/test/tools/javac/generics/rawOverride/7062745/GenericOverrideTest.java	Mon Jan 09 19:13:08 2012 -0800
     7.3 @@ -210,7 +210,7 @@
     7.4          try {
     7.5              ct.analyze();
     7.6          } catch (Throwable ex) {
     7.7 -            throw new AssertionError("Error thron when compiling the following code:\n" + source.getCharContent(true));
     7.8 +            throw new AssertionError("Error thrown when compiling the following code:\n" + source.getCharContent(true));
     7.9          }
    7.10          check();
    7.11      }
     8.1 --- a/test/tools/javac/lambda/LambdaParserTest.java	Thu Jan 05 08:42:49 2012 -0800
     8.2 +++ b/test/tools/javac/lambda/LambdaParserTest.java	Mon Jan 09 19:13:08 2012 -0800
     8.3 @@ -238,7 +238,7 @@
     8.4          try {
     8.5              ct.parse();
     8.6          } catch (Throwable ex) {
     8.7 -            throw new AssertionError("Error thron when parsing the following source:\n" + source.getCharContent(true));
     8.8 +            throw new AssertionError("Error thrown when parsing the following source:\n" + source.getCharContent(true));
     8.9          }
    8.10          check();
    8.11      }
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/test/tools/javac/parser/T4881269.java	Mon Jan 09 19:13:08 2012 -0800
     9.3 @@ -0,0 +1,35 @@
     9.4 +/*
     9.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     9.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9.7 + *
     9.8 + * This code is free software; you can redistribute it and/or modify it
     9.9 + * under the terms of the GNU General Public License version 2 only, as
    9.10 + * published by the Free Software Foundation.
    9.11 + *
    9.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    9.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    9.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    9.15 + * version 2 for more details (a copy is included in the LICENSE file that
    9.16 + * accompanied this code).
    9.17 + *
    9.18 + * You should have received a copy of the GNU General Public License version
    9.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    9.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    9.21 + *
    9.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    9.23 + * or visit www.oracle.com if you need additional information or have any
    9.24 + * questions.
    9.25 + */
    9.26 +
    9.27 +/*
    9.28 + * @test
    9.29 + * @bug 4881269
    9.30 + * @summary improve diagnostic for ill-formed tokens
    9.31 + * @compile/fail/ref=T4881269.out -XDrawDiagnostics T4881269.java
    9.32 + */
    9.33 +
    9.34 +public class T4881269 {
    9.35 +    java.io..PrintStream s;
    9.36 +    void m() { System.err..println(); }
    9.37 +    void m(Object.. o) { }
    9.38 +}
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/test/tools/javac/parser/T4881269.out	Mon Jan 09 19:13:08 2012 -0800
    10.3 @@ -0,0 +1,9 @@
    10.4 +T4881269.java:32:13: compiler.err.illegal.dot
    10.5 +T4881269.java:33:27: compiler.err.illegal.dot
    10.6 +T4881269.java:33:22: compiler.err.not.stmt
    10.7 +T4881269.java:34:19: compiler.err.illegal.dot
    10.8 +T4881269.java:34:20: compiler.err.expected: ';'
    10.9 +T4881269.java:34:22: compiler.err.illegal.start.of.type
   10.10 +T4881269.java:34:23: compiler.err.expected: token.identifier
   10.11 +T4881269.java:34:25: compiler.err.expected: ';'
   10.12 +8 errors

mercurial