Mercurial > hg > release > icedtea7-forest-2.0 > langtools
changeset 1042:65d3a13c5475
Merge
author | andrew |
---|---|
date | Thu, 02 Jun 2011 19:00:16 +0100 |
parents | feffa2603b45 (current diff) 8eb952f43b11 (diff) |
children | 1316e51b3995 |
files | .hgtags make/build.xml src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java src/share/classes/com/sun/tools/javac/jvm/ClassReader.java src/share/classes/javax/lang/model/type/DisjunctiveType.java |
diffstat | 335 files changed, 8459 insertions(+), 1309 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Thu Jun 02 17:45:51 2011 +0100 +++ b/.hgignore Thu Jun 02 19:00:16 2011 +0100 @@ -1,3 +1,4 @@ ^build/ ^dist/ /nbproject/private/ +^.hgtip
--- a/.hgtags Thu Jun 02 17:45:51 2011 +0100 +++ b/.hgtags Thu Jun 02 19:00:16 2011 +0100 @@ -114,3 +114,10 @@ 9d0a61ac567b983da7cc8f4a7030f2245bb6dbab jdk7-b135 ed0f7f1f9511db4f9615b1426d22f8b961629275 jdk7-b136 8e26c4aee63c04ee129bf9068f5eea47cc385177 icedtea-1.14 +a15c9b058ae007d4ccb7e35ce44e4dfa977f090b jdk7-b137 +53f212bed4f4304dce7f0bf0fa01c998c65bacd6 jdk7-b138 +853b6bb99f9b58eb7cf8211c67d3b6e4f1228a3e jdk7-b139 +258e6654aba25aab91c9ba3b4c53d05bc895a86c jdk7-b140 +90adb5d6adc7d99d27c8b142a31ac8921070274f jdk7-b141 +7476b164194c1814704153e74d5ff7e965c6fdbf jdk7-b142 +5faa9eedc44e201f2b13ad837e9077668b823d28 jdk7-b143
--- a/make/build.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/make/build.properties Thu Jun 02 19:00:16 2011 +0100 @@ -71,9 +71,18 @@ javac.lint.opts = -Xlint:all,-deprecation -Werror # options for the <javadoc> task for javac -javadoc.jls3.url=http://java.sun.com/docs/books/jls/ -javadoc.jls3.cite=<a href="${javadoc.jls3.url}">The Java Language Specification, Third Edition</a> -javadoc.jls3.option=-tag "jls3:a:See <cite>${javadoc.jls3.cite}</cite>:" +#javadoc.jls3.url=http://java.sun.com/docs/books/jls/ +#javadoc.jls3.cite=<a href="${javadoc.jls3.url}">The Java Language Specification, Third Edition</a> +#javadoc.jls3.option=-tag "jls3:a:See <cite>${javadoc.jls3.cite}</cite>:" + + +javadoc.jls.cite=The Java™ Language Specification + +javadoc.jls.option=-tag "jls:a:See <cite>${javadoc.jls.cite}</cite>:" + + + + # jtreg, used to run the JDK regression tests # See http://openjdk.java.net/jtreg/
--- a/make/build.xml Thu Jun 02 17:45:51 2011 +0100 +++ b/make/build.xml Thu Jun 02 19:00:16 2011 +0100 @@ -464,7 +464,7 @@ </target> <target name="javadoc-javac" depends="build-javac,-def-javadoc-tool"> - <javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls3.option}"/> + <javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls.option}"/> </target> <target name="jtreg-javac" depends="build-javac,build-javap,-def-jtreg"> @@ -806,6 +806,9 @@ <exclude name="**/*.java"/> <exclude name="**/*.properties"/> <exclude name="**/*-template"/> + <exclude name="**/*.rej"/> + <exclude name="**/*.orig"/> + <exclude name="**/overview.html"/> <exclude name="**/package.html"/> </fileset> </copy>
--- a/make/netbeans/langtools/build.xml Thu Jun 02 17:45:51 2011 +0100 +++ b/make/netbeans/langtools/build.xml Thu Jun 02 19:00:16 2011 +0100 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions
--- a/make/tools/GenStubs/GenStubs.java Thu Jun 02 17:45:51 2011 +0100 +++ b/make/tools/GenStubs/GenStubs.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2010, 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
--- a/src/share/bin/launcher.sh-template Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/bin/launcher.sh-template Thu Jun 02 19:00:16 2011 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2011, 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
--- a/src/share/classes/com/sun/javadoc/ClassDoc.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/javadoc/ClassDoc.java Thu Jun 02 19:00:16 2011 +0100 @@ -311,8 +311,8 @@ /** * Get the list of classes and interfaces declared as imported. - * These are called "single-type-import declarations" in the - * Java Language Specification. + * These are called "single-type-import declarations" in + * <cite>The Java™ Language Specification</cite>. * * @return an array of ClassDoc representing the imported classes. * @@ -325,8 +325,8 @@ /** * Get the list of packages declared as imported. - * These are called "type-import-on-demand declarations" in the - * Java Language Specification. + * These are called "type-import-on-demand declarations" in + * <cite>The Java™ Language Specification</cite>. * * @return an array of PackageDoc representing the imported packages. *
--- a/src/share/classes/com/sun/source/tree/AnnotationTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/AnnotationTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -36,7 +36,7 @@ * {@code @}<em>annotationType</em> ( <em>arguments</em> ) * </pre> * - * @see "The Java Language Specification, 3rd ed, section 9.7" + * @jls section 9.7 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ArrayAccessTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ArrayAccessTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * <em>expression</em> [ <em>index</em> ] * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.13" + * @jls section 15.13 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ArrayTypeTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ArrayTypeTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * <em>type</em> [] * </pre> * - * @see "The Java Language Specification, 3rd ed, section 10.1" + * @jls section 10.1 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/AssertTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/AssertTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * assert <em>condition</em> : <em>detail</em> ; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.10" + * @jls section 14.10 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/AssignmentTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/AssignmentTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * <em>variable</em> = <em>expression</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.26.1" + * @jls section 15.26.1 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/BinaryTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/BinaryTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,7 +34,7 @@ * <em>leftOperand</em> <em>operator</em> <em>rightOperand</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, sections 15.17 to 15.24" + * @jls sections 15.17 to 15.24 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/BlockTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/BlockTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -39,7 +39,7 @@ * static { <em>statements</em> } * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.2" + * @jls section 14.2 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/BreakTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/BreakTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -37,7 +37,7 @@ * break <em>label</em> ; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.15" + * @jls section 14.15 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/CaseTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/CaseTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -39,7 +39,7 @@ * <em>statements</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.11" + * @jls section 14.11 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/CatchTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/CatchTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,7 +34,7 @@ * <em>block</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.20" + * @jls section 14.20 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ClassTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ClassTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -42,8 +42,7 @@ * } * </pre> * - * @see "The Java Language Specification, 3rd ed, - * sections 8.1, 8.9, 9.1, and 9.6" + * @jls sections 8.1, 8.9, 9.1, and 9.6 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/CompilationUnitTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/CompilationUnitTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * Represents the abstract syntax tree for compilation units (source * files) and package declarations (package-info.java). * - * @see "The Java Language Specification, 3rd ed, sections 7.3, and 7.4" + * @jls sections 7.3, and 7.4 * * @author Peter von der Ahé * @since 1.6
--- a/src/share/classes/com/sun/source/tree/CompoundAssignmentTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/CompoundAssignmentTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,7 +34,7 @@ * <em>variable</em> <em>operator</em> <em>expression</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.26.2" + * @jls section 15.26.2 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ConditionalExpressionTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ConditionalExpressionTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * <em>condition</em> ? <em>trueExpression</em> : <em>falseExpression</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.25" + * @jls section 15.25 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ContinueTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ContinueTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -36,7 +36,7 @@ * continue <em>label</em> ; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.16" + * @jls section 14.16 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/DisjunctiveTypeTree.java Thu Jun 02 17:45:51 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -package com.sun.source.tree; - -import java.util.List; - -/** - * A tree node for a disjunctive type expression in a multicatch var declaration. - * - * - * @author Maurizio Cimadamore - * - * @since 1.7 - */ -public interface DisjunctiveTypeTree extends Tree { - List<? extends Tree> getTypeAlternatives(); -}
--- a/src/share/classes/com/sun/source/tree/DoWhileLoopTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/DoWhileLoopTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * while ( <em>expression</em> ); * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.13" + * @jls section 14.13 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/EmptyStatementTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/EmptyStatementTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * ; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.6" + * @jls section 14.6 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/EnhancedForLoopTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/EnhancedForLoopTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,7 +34,7 @@ * <em>statement</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.14.2" + * @jls section 14.14.2 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ExpressionStatementTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ExpressionStatementTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * <em>expression</em> ; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.8" + * @jls section 14.8 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ExpressionTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ExpressionTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -29,7 +29,7 @@ * A tree node used as the base class for the different types of * expressions. * - * @see "The Java Language Specification, 3rd ed, chapter 15" + * @jls chapter 15 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ForLoopTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ForLoopTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -36,7 +36,7 @@ * <em>statement</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.14.1" + * @jls section 14.14.1 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/IdentifierTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/IdentifierTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * <em>name</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 6.5.6.1" + * @jls section 6.5.6.1 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/IfTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/IfTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -39,7 +39,7 @@ * <em>elseStatement</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.9" + * @jls section 14.9 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ImportTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ImportTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * static import <em>qualifiedIdentifier</em> ; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 7.5" + * @jls section 7.5 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/InstanceOfTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/InstanceOfTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * <em>expression</em> instanceof <em>type</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.20.2" + * @jls section 15.20.2 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/LabeledStatementTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/LabeledStatementTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * <em>label</em> : <em>statement</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.7" + * @jls section 14.7 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/LiteralTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/LiteralTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,7 +34,7 @@ * <em>value</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.28" + * @jls section 15.28 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/MemberSelectTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/MemberSelectTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,8 +35,7 @@ * <em>expression</em> . <em>identifier</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, sections 6.5, - * 15.11, and 15.12" + * @jls sections 6.5, 15.11,and 15.12 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/MethodInvocationTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/MethodInvocationTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -37,7 +37,7 @@ * this . <em>typeArguments</em> <em>identifier</em> ( <em>arguments</em> ) * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.12" + * @jls section 15.12 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/MethodTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/MethodTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -40,8 +40,7 @@ * <em>modifiers</em> <em>type</em> <em>name</em> () default <em>defaultValue</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, sections 8.4, 8.6, 8.7, - * 9.4, and 9.6" + * @jls sections 8.4, 8.6, 8.7, 9.4, and 9.6 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ModifiersTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ModifiersTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -39,8 +39,7 @@ * <em>flags</em> <em>annotations</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, sections - * 8.1.1, 8.3.1, 8.4.3, 8.5.1, 8.8.3, 9.1.1, and 9.7" + * @jls sections 8.1.1, 8.3.1, 8.4.3, 8.5.1, 8.8.3, 9.1.1, and 9.7 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/NewArrayTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/NewArrayTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -37,7 +37,7 @@ * new <em>type</em> <em>dimensions</em> [ ] <em>initializers</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.10" + * @jls section 15.10 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/NewClassTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/NewClassTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -42,7 +42,7 @@ * <em>enclosingExpression</em>.new <em>identifier</em> ( <em>arguments</em> ) * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.9" + * @jls section 15.9 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ParameterizedTypeTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ParameterizedTypeTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * <em>type</em> < <em>typeArguments</em> > * </pre> * - * @see "The Java Language Specification, 3rd ed, section 4.5.1" + * @jls section 4.5.1 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ParenthesizedTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ParenthesizedTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,7 +34,7 @@ * ( <em>expression</em> ) * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.8.5" + * @jls section 15.8.5 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/PrimitiveTypeTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/PrimitiveTypeTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * <em>primitiveTypeKind</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 4.2" + * @jls section 4.2 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ReturnTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ReturnTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,7 +34,7 @@ * return <em>expression</em>; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.17" + * @jls section 14.17 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/StatementTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/StatementTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -29,7 +29,7 @@ * A tree node used as the base class for the different kinds of * statements. * - * @see "The Java Language Specification, 3rd ed, chapter 14" + * @jls chapter 14 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/SwitchTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/SwitchTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -37,7 +37,7 @@ * } * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.11" + * @jls section 14.11 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/SynchronizedTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/SynchronizedTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -31,10 +31,10 @@ * For example: * <pre> * synchronized ( <em>expression</em> ) - * </em>block</em> + * <em>block</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.19" + * @jls section 14.19 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/ThrowTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/ThrowTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * throw <em>expression</em>; * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.18" + * @jls section 14.18 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/Tree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/Tree.java Thu Jun 02 19:00:16 2011 +0100 @@ -232,9 +232,9 @@ PARAMETERIZED_TYPE(ParameterizedTypeTree.class), /** - * Used for instances of {@link DisjunctiveTypeTree}. + * Used for instances of {@link UnionTypeTree}. */ - DISJUNCTIVE_TYPE(DisjunctiveTypeTree.class), + UNION_TYPE(UnionTypeTree.class), /** * Used for instances of {@link TypeCastTree}.
--- a/src/share/classes/com/sun/source/tree/TreeVisitor.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/TreeVisitor.java Thu Jun 02 19:00:16 2011 +0100 @@ -95,7 +95,7 @@ R visitCompilationUnit(CompilationUnitTree node, P p); R visitTry(TryTree node, P p); R visitParameterizedType(ParameterizedTypeTree node, P p); - R visitDisjunctiveType(DisjunctiveTypeTree node, P p); + R visitUnionType(UnionTypeTree node, P p); R visitArrayType(ArrayTypeTree node, P p); R visitTypeCast(TypeCastTree node, P p); R visitPrimitiveType(PrimitiveTypeTree node, P p);
--- a/src/share/classes/com/sun/source/tree/TryTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/TryTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -39,7 +39,7 @@ * <em>finallyBlock</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 14.20" + * @jls section 14.20 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/TypeCastTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/TypeCastTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ * ( <em>type</em> ) <em>expression</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 15.16" + * @jls section 15.16 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/TypeParameterTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/TypeParameterTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -38,7 +38,7 @@ * <em>name</em> extends <em>bounds</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 4.4" + * @jls section 4.4 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/UnaryTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/UnaryTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -36,7 +36,7 @@ * <em>expression</em> <em>operator</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, sections 15.14 and 15.15" + * @jls sections 15.14 and 15.15 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/com/sun/source/tree/UnionTypeTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010, 2011, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a union type expression in a multicatch var declaration. + * + * @author Maurizio Cimadamore + * + * @since 1.7 + */ +public interface UnionTypeTree extends Tree { + List<? extends Tree> getTypeAlternatives(); +}
--- a/src/share/classes/com/sun/source/tree/VariableTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/VariableTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * <em>modifiers</em> <em>type</em> <em>name</em> <em>initializer</em> ; * </pre> * - * @see "The Java Language Specification, 3rd ed, sections 8.3 and 14.4" + * @jls sections 8.3 and 14.4 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/WhileLoopTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/WhileLoopTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -35,7 +35,7 @@ * </pre> * * - * @see "The Java Language Specification, 3rd ed, section 14.12" + * @jls section 14.12 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/tree/WildcardTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/tree/WildcardTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -38,7 +38,7 @@ * ? super <em>bound</em> * </pre> * - * @see "The Java Language Specification, 3rd ed, section 4.5.1" + * @jls section 4.5.1 * * @author Peter von der Ahé * @author Jonathan Gibbons
--- a/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java Thu Jun 02 19:00:16 2011 +0100 @@ -228,7 +228,7 @@ return defaultAction(node, p); } - public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) { + public R visitUnionType(UnionTypeTree node, P p) { return defaultAction(node, p); }
--- a/src/share/classes/com/sun/source/util/TreeScanner.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/util/TreeScanner.java Thu Jun 02 19:00:16 2011 +0100 @@ -355,7 +355,7 @@ return r; } - public R visitDisjunctiveType(DisjunctiveTypeTree node, P p) { + public R visitUnionType(UnionTypeTree node, P p) { return scan(node.getTypeAlternatives(), p); }
--- a/src/share/classes/com/sun/source/util/Trees.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/source/util/Trees.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -38,6 +38,7 @@ import javax.tools.Diagnostic; import javax.tools.JavaCompiler.CompilationTask; +import com.sun.source.tree.CatchTree; import com.sun.source.tree.ClassTree; import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.MethodTree; @@ -207,4 +208,11 @@ public abstract void printMessage(Diagnostic.Kind kind, CharSequence msg, com.sun.source.tree.Tree t, com.sun.source.tree.CompilationUnitTree root); + + /** + * Gets the lub of an exception parameter declared in a catch clause. + * @param tree the tree for the catch clause + * @return The lub of the exception parameter + */ + public abstract TypeMirror getLub(CatchTree tree); }
--- a/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -67,7 +67,8 @@ /** * {@inheritDoc} - * See JLS 2 sections 8.3 and 8.4.6. + * See sections 8.3 and 8.4.6 of + * <cite>The Java™ Language Specification</cite> */ public boolean hides(MemberDeclaration sub, MemberDeclaration sup) { Symbol hider = ((DeclarationImpl) sub).sym; @@ -107,7 +108,8 @@ /** * {@inheritDoc} - * See JLS 2 section 8.4.6.1. + * See section 8.4.6.1 of + * <cite>The Java™ Language Specification</cite> */ public boolean overrides(MethodDeclaration sub, MethodDeclaration sup) { MethodSymbol overrider = ((MethodDeclarationImpl) sub).sym;
--- a/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2011, 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
--- a/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2011, 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
--- a/src/share/classes/com/sun/tools/classfile/AccessFlags.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/AccessFlags.java Thu Jun 02 19:00:16 2011 +0100 @@ -30,7 +30,7 @@ import java.util.Set; /** - * See JVMS3, sections 4.2, 4.6, 4.7. + * See JVMS, sections 4.2, 4.6, 4.7. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Annotation.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Annotation.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.16. + * See JVMS, section 4.8.16. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. @@ -71,7 +71,7 @@ public final element_value_pair element_value_pairs[]; /** - * See JVMS3, section 4.8.16.1. + * See JVMS, section 4.8.16.1. */ public static abstract class element_value { public static element_value read(ClassReader cr)
--- a/src/share/classes/com/sun/tools/classfile/AnnotationDefault_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/AnnotationDefault_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.15. + * See JVMS, section 4.8.15. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/BootstrapMethods_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/BootstrapMethods_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3 <TBD> + * See JVMS <TBD> * http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-mlvm/ * * <p><b>This is NOT part of any supported API.
--- a/src/share/classes/com/sun/tools/classfile/ClassFile.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/ClassFile.java Thu Jun 02 19:00:16 2011 +0100 @@ -33,7 +33,7 @@ import static com.sun.tools.classfile.AccessFlags.*; /** - * See JVMS3, section 4.2. + * See JVMS, section 4.2. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/ClassTranslator.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/ClassTranslator.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2011, 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
--- a/src/share/classes/com/sun/tools/classfile/Code_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Code_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -30,7 +30,7 @@ import java.util.NoSuchElementException; /** - * See JVMS3, section 4.8.3. + * See JVMS, section 4.8.3. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/ConstantPool.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/ConstantPool.java Thu Jun 02 19:00:16 2011 +0100 @@ -31,7 +31,7 @@ import java.util.Iterator; /** - * See JVMS3, section 4.5. + * See JVMS, section 4.5. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/ConstantValue_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/ConstantValue_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.2. + * See JVMS, section 4.8.2. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Dependencies.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Dependencies.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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
--- a/src/share/classes/com/sun/tools/classfile/Deprecated_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Deprecated_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.15. + * See JVMS, section 4.8.15. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Descriptor.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Descriptor.java Thu Jun 02 19:00:16 2011 +0100 @@ -29,7 +29,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.4. + * See JVMS, section 4.4. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/EnclosingMethod_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/EnclosingMethod_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -29,7 +29,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.7. + * See JVMS, section 4.8.7. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Exceptions_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Exceptions_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.5. + * See JVMS, section 4.8.5. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/InnerClasses_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/InnerClasses_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -30,7 +30,7 @@ import com.sun.tools.classfile.ConstantPool.*; /** - * See JVMS3, section 4.8.6. + * See JVMS, section 4.8.6. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Instruction.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Instruction.java Thu Jun 02 19:00:16 2011 +0100 @@ -26,7 +26,7 @@ package com.sun.tools.classfile; /** - * See JVMS3, chapter 6. + * See JVMS, chapter 6. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/LineNumberTable_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/LineNumberTable_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.12. + * See JVMS, section 4.8.12. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/LocalVariableTable_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/LocalVariableTable_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.13. + * See JVMS, section 4.8.13. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/LocalVariableTypeTable_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/LocalVariableTypeTable_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.14. + * See JVMS, section 4.8.14. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Opcode.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Opcode.java Thu Jun 02 19:00:16 2011 +0100 @@ -29,7 +29,7 @@ import static com.sun.tools.classfile.Opcode.Set.*; /** - * See JVMS3, chapter 6. + * See JVMS, chapter 6. * * <p>In addition to providing all the standard opcodes defined in JVMS, * this class also provides legacy support for the PicoJava extensions.
--- a/src/share/classes/com/sun/tools/classfile/RuntimeAnnotations_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/RuntimeAnnotations_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.16 and 4.8.17. + * See JVMS, section 4.8.16 and 4.8.17. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleAnnotations_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleAnnotations_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.17. + * See JVMS, section 4.8.17. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleParameterAnnotations_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleParameterAnnotations_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.18. + * See JVMS, section 4.8.18. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/RuntimeParameterAnnotations_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/RuntimeParameterAnnotations_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.18 and 4.8.19. + * See JVMS, section 4.8.18 and 4.8.19. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/RuntimeVisibleAnnotations_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/RuntimeVisibleAnnotations_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.16. + * See JVMS, section 4.8.16. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/RuntimeVisibleParameterAnnotations_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/RuntimeVisibleParameterAnnotations_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.18. + * See JVMS, section 4.8.18. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Signature.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Signature.java Thu Jun 02 19:00:16 2011 +0100 @@ -30,7 +30,7 @@ import com.sun.tools.classfile.Type.*; /** - * See JVMS3 4.4.4. + * See JVMS 4.4.4. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Signature_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Signature_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.9. + * See JVMS, section 4.8.9. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -30,7 +30,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.15. + * See JVMS, section 4.8.15. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/SourceFile_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/SourceFile_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.10. + * See JVMS, section 4.8.10. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.4. + * See JVMS, section 4.8.4. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Synthetic_attribute.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Synthetic_attribute.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,7 +28,7 @@ import java.io.IOException; /** - * See JVMS3, section 4.8.8. + * See JVMS, section 4.8.8. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk.
--- a/src/share/classes/com/sun/tools/classfile/Type.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/Type.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2011, 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 @@ -41,6 +41,11 @@ */ public abstract class Type { protected Type() { } + + public boolean isObject() { + return false; + } + public abstract <R,D> R accept(Visitor<R,D> visitor, D data); protected static void append(StringBuilder sb, String prefix, List<? extends Type> types, String suffix) { @@ -262,6 +267,13 @@ return sb.toString(); } + @Override + public boolean isObject() { + return (outerType == null) + && name.equals("java/lang/Object") + && (typeArgs == null || typeArgs.isEmpty()); + } + public final ClassType outerType; public final String name; public final List<Type> typeArgs;
--- a/src/share/classes/com/sun/tools/classfile/package.html Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/classfile/package.html Thu Jun 02 19:00:16 2011 +0100 @@ -6,7 +6,7 @@ </head> <body> A minimalist library to read and write class files into objects closely - based on the corresponding definitions in the Java Virtual Machine - Specification (JVMS). + based on the corresponding definitions in + <cite>The Java™ Virtual Machine Specification</cite> (JVMS). </body> </html>
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -154,8 +154,8 @@ div.addStyle(HtmlStyle.header); if (pkgname.length() > 0) { Content pkgNameContent = new StringContent(pkgname); - Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent); - div.addContent(pkgNamePara); + Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); + div.addContent(pkgNameDiv); } LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false); @@ -216,12 +216,15 @@ pre.addContent(modifiers); LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false); - Content name = new RawHtml (annotationType.name() + - getTypeParameterLinks(linkInfo)); + Content annotationName = new StringContent(annotationType.name()); + Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo)); if (configuration().linksource) { - addSrcLink(annotationType, name, pre); + addSrcLink(annotationType, annotationName, pre); + pre.addContent(parameterLinks); } else { - pre.addContent(HtmlTree.STRONG(name)); + Content span = HtmlTree.SPAN(HtmlStyle.strong, annotationName); + span.addContent(parameterLinks); + pre.addContent(span); } annotationInfoTree.addContent(pre); }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -149,11 +149,20 @@ ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree); ClassDoc[] classes = configuration.root.classes(); for (int i = 0; i < classes.length; i++) { - ClassUseWriter.generate(configuration, mapper, classes[i]); + // If -nodeprecated option is set and the containing package is marked + // as deprecated, do not generate the class-use page. We will still generate + // the class-use page if the class is marked as deprecated but the containing + // package is not since it could still be linked from that package-use page. + if (!(configuration.nodeprecated && + Util.isDeprecated(classes[i].containingPackage()))) + ClassUseWriter.generate(configuration, mapper, classes[i]); } PackageDoc[] pkgs = configuration.packages; for (int i = 0; i < pkgs.length; i++) { - PackageUseWriter.generate(configuration, mapper, pkgs[i]); + // If -nodeprecated option is set and the package is marked + // as deprecated, do not generate the package-use page. + if (!(configuration.nodeprecated && Util.isDeprecated(pkgs[i]))) + PackageUseWriter.generate(configuration, mapper, pkgs[i]); } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -161,8 +161,8 @@ div.addStyle(HtmlStyle.header); if (pkgname.length() > 0) { Content pkgNameContent = new StringContent(pkgname); - Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent); - div.addContent(pkgNamePara); + Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); + div.addContent(pkgNameDiv); } LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, classDoc, false); @@ -228,12 +228,15 @@ LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false); //Let's not link to ourselves in the signature. linkInfo.linkToSelf = false; - Content name = new RawHtml (classDoc.name() + - getTypeParameterLinks(linkInfo)); + Content className = new StringContent(classDoc.name()); + Content parameterLinks = new RawHtml(getTypeParameterLinks(linkInfo)); if (configuration().linksource) { - addSrcLink(classDoc, name, pre); + addSrcLink(classDoc, className, pre); + pre.addContent(parameterLinks); } else { - pre.addContent(HtmlTree.STRONG(name)); + Content span = HtmlTree.SPAN(HtmlStyle.strong, className); + span.addContent(parameterLinks); + pre.addContent(span); } if (!isInterface) { Type superclass = Util.getFirstVisibleSuperClass(classDoc,
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -31,6 +31,7 @@ import com.sun.javadoc.*; import java.util.*; import java.io.*; +import java.net.*; /** * Configure the output based on the command line options. @@ -48,6 +49,7 @@ * @author Robert Field. * @author Atul Dambalkar. * @author Jamie Ho + * @author Bhavesh Patel (Modified) */ public class ConfigurationImpl extends Configuration { @@ -110,6 +112,11 @@ public String stylesheetfile = ""; /** + * Argument for command line option "-Xdocrootparent". + */ + public String docrootparent = ""; + + /** * True if command line option "-nohelp" is used. Default value is false. */ public boolean nohelp = false; @@ -239,6 +246,8 @@ stylesheetfile = os[1]; } else if (opt.equals("-charset")) { charset = os[1]; + } else if (opt.equals("-xdocrootparent")) { + docrootparent = os[1]; } else if (opt.equals("-nohelp")) { nohelp = true; } else if (opt.equals("-splitindex")) { @@ -322,7 +331,8 @@ option.equals("-helpfile") || option.equals("-stylesheetfile") || option.equals("-charset") || - option.equals("-overview")) { + option.equals("-overview") || + option.equals("-xdocrootparent")) { return 2; } else { return 0; @@ -372,6 +382,13 @@ return false; } nohelp = true; + } else if (opt.equals("-xdocrootparent")) { + try { + new URL(os[1]); + } catch (MalformedURLException e) { + reporter.printError(getText("doclet.MalformedURL", os[1])); + return false; + } } else if (opt.equals("-overview")) { if (nooverview == true) { reporter.printError(getText("doclet.Option_conflict",
--- a/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -42,15 +42,15 @@ public class DeprecatedListWriter extends SubWriterHolderWriter { private static final String[] ANCHORS = new String[] { - "interface", "class", "enum", "exception", "error", "annotation_type", - "field", "method", "constructor", "enum_constant", + "package", "interface", "class", "enum", "exception", "error", + "annotation_type", "field", "method", "constructor", "enum_constant", "annotation_type_member" }; private static final String[] HEADING_KEYS = new String[] { - "doclet.Deprecated_Interfaces", "doclet.Deprecated_Classes", - "doclet.Deprecated_Enums", "doclet.Deprecated_Exceptions", - "doclet.Deprecated_Errors", + "doclet.Deprecated_Packages", "doclet.Deprecated_Interfaces", + "doclet.Deprecated_Classes", "doclet.Deprecated_Enums", + "doclet.Deprecated_Exceptions", "doclet.Deprecated_Errors", "doclet.Deprecated_Annotation_Types", "doclet.Deprecated_Fields", "doclet.Deprecated_Methods", "doclet.Deprecated_Constructors", @@ -59,9 +59,9 @@ }; private static final String[] SUMMARY_KEYS = new String[] { - "doclet.deprecated_interfaces", "doclet.deprecated_classes", - "doclet.deprecated_enums", "doclet.deprecated_exceptions", - "doclet.deprecated_errors", + "doclet.deprecated_packages", "doclet.deprecated_interfaces", + "doclet.deprecated_classes", "doclet.deprecated_enums", + "doclet.deprecated_exceptions", "doclet.deprecated_errors", "doclet.deprecated_annotation_types", "doclet.deprecated_fields", "doclet.deprecated_methods", "doclet.deprecated_constructors", @@ -70,7 +70,7 @@ }; private static final String[] HEADER_KEYS = new String[] { - "doclet.Interface", "doclet.Class", + "doclet.Package", "doclet.Interface", "doclet.Class", "doclet.Enum", "doclet.Exceptions", "doclet.Errors", "doclet.AnnotationType", @@ -116,7 +116,7 @@ DeprecatedListWriter depr = new DeprecatedListWriter(configuration, filename); depr.generateDeprecatedListFile( - new DeprecatedAPIListBuilder(configuration.root)); + new DeprecatedAPIListBuilder(configuration)); depr.close(); } catch (IOException exc) { configuration.standardmessage.error( @@ -149,8 +149,14 @@ memberTableHeader[0] = configuration.getText("doclet.0_and_1", configuration.getText(HEADER_KEYS[i]), configuration.getText("doclet.Description")); - writers[i].addDeprecatedAPI(deprapi.getList(i), - HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); + // DeprecatedAPIListBuilder.PACKAGE == 0, so if i == 0, it is + // a PackageDoc. + if (i == DeprecatedAPIListBuilder.PACKAGE) + addPackageDeprecatedAPI(deprapi.getList(i), + HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); + else + writers[i - 1].addDeprecatedAPI(deprapi.getList(i), + HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); } } body.addContent(div);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -114,13 +114,10 @@ Content noframesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, getResource("doclet.Frame_Alert")); noframes.addContent(noframesHead); - Content p = HtmlTree.P(getResource("doclet.Frame_Warning_Message")); + Content p = HtmlTree.P(getResource("doclet.Frame_Warning_Message", + getHyperLinkString(configuration.topFile, + configuration.getText("doclet.Non_Frame_Version")))); noframes.addContent(p); - noframes.addContent(new HtmlTree(HtmlTag.BR)); - noframes.addContent(getResource("doclet.Link_To")); - Content link = getHyperLink(configuration.topFile, - getResource("doclet.Non_Frame_Version")); - noframes.addContent(link); contentTree.addContent(noframes); }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -96,7 +96,7 @@ Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title, getResource("doclet.Help_line_1")); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - Content line2 = HtmlTree.P(HtmlStyle.subTitle, + Content line2 = HtmlTree.DIV(HtmlStyle.subTitle, getResource("doclet.Help_line_2")); div.addContent(line2); contentTree.addContent(div);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -198,23 +198,27 @@ PackageIndexFrameWriter.generate(configuration); } PackageDoc prev = null, next; - for(int i = 0; i < packages.length; i++) { - PackageFrameWriter.generate(configuration, packages[i]); - next = (i + 1 < packages.length && packages[i+1].name().length() > 0) ? - packages[i+1] : null; - //If the next package is unnamed package, skip 2 ahead if possible - next = (i + 2 < packages.length && next == null) ? - packages[i+2]: next; - AbstractBuilder packageSummaryBuilder = configuration. - getBuilderFactory().getPackageSummaryBuilder( - packages[i], prev, next); - packageSummaryBuilder.build(); - if (configuration.createtree) { - PackageTreeWriter.generate(configuration, - packages[i], prev, next, - configuration.nodeprecated); + for (int i = 0; i < packages.length; i++) { + // if -nodeprecated option is set and the package is marked as + // deprecated, do not generate the package-summary.html, package-frame.html + // and package-tree.html pages for that package. + if (!(configuration.nodeprecated && Util.isDeprecated(packages[i]))) { + PackageFrameWriter.generate(configuration, packages[i]); + next = (i + 1 < packages.length && + packages[i + 1].name().length() > 0) ? packages[i + 1] : null; + //If the next package is unnamed package, skip 2 ahead if possible + next = (i + 2 < packages.length && next == null) ? packages[i + 2] : next; + AbstractBuilder packageSummaryBuilder = + configuration.getBuilderFactory().getPackageSummaryBuilder( + packages[i], prev, next); + packageSummaryBuilder.build(); + if (configuration.createtree) { + PackageTreeWriter.generate(configuration, + packages[i], prev, next, + configuration.nodeprecated); + } + prev = packages[i]; } - prev = packages[i]; } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -159,22 +159,42 @@ StringBuilder buf = new StringBuilder(); int previndex = 0; while (true) { - // Search for lowercase version of {@docRoot} - index = lowerHtml.indexOf("{@docroot}", previndex); - // If next {@docRoot} tag not found, append rest of htmlstr and exit loop - if (index < 0) { - buf.append(htmlstr.substring(previndex)); - break; - } - // If next {@docroot} tag found, append htmlstr up to start of tag - buf.append(htmlstr.substring(previndex, index)); - previndex = index + 10; // length for {@docroot} string - // Insert relative path where {@docRoot} was located - buf.append(relativepathNoSlash); - // Append slash if next character is not a slash - if (relativepathNoSlash.length() > 0 && previndex < htmlstr.length() - && htmlstr.charAt(previndex) != '/') { - buf.append(DirectoryManager.URL_FILE_SEPARATOR); + if (configuration.docrootparent.length() > 0) { + // Search for lowercase version of {@docRoot}/.. + index = lowerHtml.indexOf("{@docroot}/..", previndex); + // If next {@docRoot}/.. pattern not found, append rest of htmlstr and exit loop + if (index < 0) { + buf.append(htmlstr.substring(previndex)); + break; + } + // If next {@docroot}/.. pattern found, append htmlstr up to start of tag + buf.append(htmlstr.substring(previndex, index)); + previndex = index + 13; // length for {@docroot}/.. string + // Insert docrootparent absolute path where {@docRoot}/.. was located + + buf.append(configuration.docrootparent); + // Append slash if next character is not a slash + if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') { + buf.append(DirectoryManager.URL_FILE_SEPARATOR); + } + } else { + // Search for lowercase version of {@docRoot} + index = lowerHtml.indexOf("{@docroot}", previndex); + // If next {@docRoot} tag not found, append rest of htmlstr and exit loop + if (index < 0) { + buf.append(htmlstr.substring(previndex)); + break; + } + // If next {@docroot} tag found, append htmlstr up to start of tag + buf.append(htmlstr.substring(previndex, index)); + previndex = index + 10; // length for {@docroot} string + // Insert relative path where {@docRoot} was located + buf.append(relativepathNoSlash); + // Append slash if next character is not a slash + if (relativepathNoSlash.length() > 0 && previndex < htmlstr.length() && + htmlstr.charAt(previndex) != '/') { + buf.append(DirectoryManager.URL_FILE_SEPARATOR); + } } } return buf.toString(); @@ -1395,6 +1415,44 @@ } /** + * Add package deprecation information to the documentation tree + * + * @param deprPkgs list of deprecated packages + * @param headingKey the caption for the deprecated package table + * @param tableSummary the summary for the deprecated package table + * @param tableHeader table headers for the deprecated package table + * @param contentTree the content tree to which the deprecated package table will be added + */ + protected void addPackageDeprecatedAPI(List<Doc> deprPkgs, String headingKey, + String tableSummary, String[] tableHeader, Content contentTree) { + if (deprPkgs.size() > 0) { + Content table = HtmlTree.TABLE(0, 3, 0, tableSummary, + getTableCaption(configuration().getText(headingKey))); + table.addContent(getSummaryTableHeader(tableHeader, "col")); + Content tbody = new HtmlTree(HtmlTag.TBODY); + for (int i = 0; i < deprPkgs.size(); i++) { + PackageDoc pkg = (PackageDoc) deprPkgs.get(i); + HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, + getPackageLink(pkg, getPackageName(pkg))); + if (pkg.tags("deprecated").length > 0) { + addInlineDeprecatedComment(pkg, pkg.tags("deprecated")[0], td); + } + HtmlTree tr = HtmlTree.TR(td); + if (i % 2 == 0) { + tr.addStyle(HtmlStyle.altColor); + } else { + tr.addStyle(HtmlStyle.rowColor); + } + tbody.addContent(tr); + } + table.addContent(tbody); + Content li = HtmlTree.LI(HtmlStyle.blockList, table); + Content ul = HtmlTree.UL(HtmlStyle.blockList, li); + contentTree.addContent(ul); + } + } + + /** * Prine table header information about color, column span and the font. * * @param color Background color. @@ -2120,7 +2178,7 @@ } } text = (isplaintext) ? - refMemName : getCode() + refMemName + getCodeEnd(); + refMemName : getCode() + Util.escapeHtmlChars(refMemName) + getCodeEnd(); result.append(getDocLink(LinkInfoImpl.CONTEXT_SEE_TAG, containing, refMem, (label.length() == 0)? text: label, false)); @@ -2280,6 +2338,7 @@ public String commentTagsToString(Tag holderTag, Doc doc, Tag[] tags, boolean isFirstSentence) { StringBuilder result = new StringBuilder(); + boolean textTagChange = false; // Array of all possible inline tags for this javadoc run configuration.tagletManager.checkTags(doc, tags, true); for (int i = 0; i < tags.length; i++) { @@ -2295,13 +2354,26 @@ result.append(output == null ? "" : output.toString()); if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) { break; + } else if (configuration.docrootparent.length() > 0 && + tagelem.name().equals("@docRoot") && + ((tags[i + 1]).text()).startsWith("/..")) { + //If Xdocrootparent switch ON, set the flag to remove the /.. occurance after + //{@docRoot} tag in the very next Text tag. + textTagChange = true; + continue; } else { - continue; + continue; } } else { + String text = tagelem.text(); + //If Xdocrootparent switch ON, remove the /.. occurance after {@docRoot} tag. + if (textTagChange) { + text = text.replaceFirst("/..", ""); + textTagChange = false; + } //This is just a regular text tag. The text may contain html links (<a>) //or inline tag {@docRoot}, which will be handled as special cases. - String text = redirectRelativeLinks(tagelem.holder(), tagelem.text()); + text = redirectRelativeLinks(tagelem.holder(), text); // Replace @docRoot only if not represented by an instance of DocRootTaglet, // that is, only if it was not present in a source file doc comment. @@ -2523,8 +2595,9 @@ } /** - * According to the Java Language Specifications, all the outer classes - * and static nested classes are core classes. + * According to + * <cite>The Java™ Language Specification</cite>, + * all the outer classes and static nested classes are core classes. */ public boolean isCoreClass(ClassDoc cd) { return cd.containingClass() == null || cd.isStatic();
--- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -69,9 +69,6 @@ StringBuffer label = new StringBuffer( classLinkInfo.getClassLinkLabel(m_writer.configuration)); classLinkInfo.displayLength += label.length(); - if (noLabel && classLinkInfo.excludeTypeParameterLinks) { - label.append(getTypeParameterLinks(linkInfo).toString()); - } Configuration configuration = ConfigurationImpl.getInstance(); LinkOutputImpl linkOutput = new LinkOutputImpl(); if (classDoc.isIncluded()) {
--- a/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -408,10 +408,6 @@ case CONTEXT_PACKAGE: case CONTEXT_CLASS_USE: - excludeTypeBoundsLinks = true; - excludeTypeParameterLinks = true; - break; - case CONTEXT_CLASS_HEADER: case CONTEXT_CLASS_SIGNATURE: excludeTypeParameterLinks = true;
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -93,7 +93,7 @@ packgen = new PackageFrameWriter(configuration, packageDoc); String pkgName = Util.getPackageName(packageDoc); Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName)); - Content pkgNameContent = new StringContent(pkgName); + Content pkgNameContent = new RawHtml(pkgName); Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent)); body.addContent(heading);
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -80,7 +80,10 @@ HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.addAttr(HtmlAttr.TITLE, packagesLabel.toString()); for(int i = 0; i < packages.length; i++) { - if (packages[i] != null) { + // Do not list the package if -nodeprecated option is set and the + // package is marked as deprecated. + if (packages[i] != null && + (!(configuration.nodeprecated && Util.isDeprecated(packages[i])))) { ul.addContent(getPackage(packages[i])); } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -137,6 +137,8 @@ protected void addPackagesList(PackageDoc[] packages, Content tbody) { for (int i = 0; i < packages.length; i++) { if (packages[i] != null && packages[i].name().length() > 0) { + if (configuration.nodeprecated && Util.isDeprecated(packages[i])) + continue; Content packageLinkContent = getPackageLink(packages[i], getPackageName(packages[i])); Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent); @@ -163,10 +165,10 @@ */ protected void addOverviewHeader(Content body) { if (root.inlineTags().length > 0) { - HtmlTree p = new HtmlTree(HtmlTag.P); - p.addStyle(HtmlStyle.subTitle); - addSummaryComment(root, p); - Content div = HtmlTree.DIV(HtmlStyle.header, p); + HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV); + subTitleDiv.addStyle(HtmlStyle.subTitle); + addSummaryComment(root, subTitleDiv); + Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv); Content see = seeLabel; see.addContent(" "); Content descPara = HtmlTree.P(see); @@ -188,10 +190,10 @@ protected void addOverviewComment(Content htmltree) { if (root.inlineTags().length > 0) { htmltree.addContent(getMarkerAnchor("overview_description")); - HtmlTree p = new HtmlTree(HtmlTag.P); - p.addStyle(HtmlStyle.subTitle); - addInlineComment(root, p); - htmltree.addContent(p); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.subTitle); + addInlineComment(root, div); + htmltree.addContent(div); } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -242,11 +242,16 @@ */ protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, - getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg)))); + getHyperLink("", Util.getPackageName(pkg), + new RawHtml(Util.getPackageName(pkg)))); contentTree.addContent(tdFirst); HtmlTree tdLast = new HtmlTree(HtmlTag.TD); tdLast.addStyle(HtmlStyle.colLast); - addSummaryComment(pkg, tdLast); + if (pkg != null && pkg.name().length() != 0) { + addSummaryComment(pkg, tdLast); + } else { + tdLast.addContent(getSpace()); + } contentTree.addContent(tdLast); }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -114,11 +114,12 @@ Content packageHead = new RawHtml(heading); tHeading.addContent(packageHead); div.addContent(tHeading); + addDeprecationInfo(div); if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) { - HtmlTree p = new HtmlTree(HtmlTag.P); - p.addStyle(HtmlStyle.subTitle); - addSummaryComment(packageDoc, p); - div.addContent(p); + HtmlTree docSummaryDiv = new HtmlTree(HtmlTag.DIV); + docSummaryDiv.addStyle(HtmlStyle.docSummary); + addSummaryComment(packageDoc, docSummaryDiv); + div.addContent(docSummaryDiv); Content space = getSpace(); Content descLink = getHyperLink("", "package_description", descriptionLabel, "", ""); @@ -139,6 +140,28 @@ } /** + * Add the package deprecation information to the documentation tree. + * + * @param div the content tree to which the deprecation information will be added + */ + public void addDeprecationInfo(Content div) { + Tag[] deprs = packageDoc.tags("deprecated"); + if (Util.isDeprecated(packageDoc)) { + HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); + deprDiv.addStyle(HtmlStyle.deprecatedContent); + Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase); + deprDiv.addContent(deprPhrase); + if (deprs.length > 0) { + Tag[] commentTags = deprs[0].inlineTags(); + if (commentTags.length > 0) { + addInlineDeprecatedComment(packageDoc, deprs[0], deprDiv); + } + } + div.addContent(deprDiv); + } + } + + /** * {@inheritDoc} */ public Content getSummaryHeader() {
--- a/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java Thu Jun 02 19:00:16 2011 +0100 @@ -82,12 +82,20 @@ } PackageDoc[] pds = rd.specifiedPackages(); for (int i = 0; i < pds.length; i++) { - convertPackage(configuration, pds[i], outputdir); + // If -nodeprecated option is set and the package is marked as deprecated, + // do not convert the package files to HTML. + if (!(configuration.nodeprecated && Util.isDeprecated(pds[i]))) + convertPackage(configuration, pds[i], outputdir); } ClassDoc[] cds = rd.specifiedClasses(); for (int i = 0; i < cds.length; i++) { - convertClass(configuration, cds[i], - getPackageOutputDir(outputdir, cds[i].containingPackage())); + // If -nodeprecated option is set and the class is marked as deprecated + // or the containing package is deprecated, do not convert the + // package files to HTML. + if (!(configuration.nodeprecated && + (Util.isDeprecated(cds[i]) || Util.isDeprecated(cds[i].containingPackage())))) + convertClass(configuration, cds[i], + getPackageOutputDir(outputdir, cds[i].containingPackage())); } } @@ -106,7 +114,12 @@ String classOutputdir = getPackageOutputDir(outputdir, pd); ClassDoc[] cds = pd.allClasses(); for (int i = 0; i < cds.length; i++) { - convertClass(configuration, cds[i], classOutputdir); + // If -nodeprecated option is set and the class is marked as deprecated, + // do not convert the package files to HTML. We do not check for + // containing package deprecation since it is already check in + // the calling method above. + if (!(configuration.nodeprecated && Util.isDeprecated(cds[i]))) + convertClass(configuration, cds[i], classOutputdir); } }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -59,7 +59,10 @@ * {@inheritDoc} */ public TagletOutput getDocRootOutput() { - return new TagletOutputImpl(htmlWriter.relativepathNoSlash); + if (htmlWriter.configuration.docrootparent.length() > 0) + return new TagletOutputImpl(htmlWriter.configuration.docrootparent); + else + return new TagletOutputImpl(htmlWriter.relativepathNoSlash); } /**
--- a/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -132,7 +132,11 @@ HtmlTree ul = new HtmlTree(HtmlTag.UL); ul.addStyle(HtmlStyle.horizontal); for (int i = 0; i < packages.length; i++) { - if (packages[i].name().length() == 0) { + // If the package name length is 0 or if -nodeprecated option + // is set and the package is marked as deprecated, do not include + // the page in the list of package hierarchies. + if (packages[i].name().length() == 0 || + (configuration.nodeprecated && Util.isDeprecated(packages[i]))) { continue; } String link = pathString(packages[i], "package-tree.html");
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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 @@ -46,6 +46,7 @@ contentContainer, description, details, + docSummary, header, horizontal, footer, @@ -67,6 +68,7 @@ subNavList, subTitle, summary, + deprecatedContent, tabEnd, title, topNav;
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -188,8 +188,8 @@ nextclassLabel = getResource("doclet.Next_Class"); summaryLabel = getResource("doclet.Summary"); detailLabel = getResource("doclet.Detail"); - framesLabel = getResource("doclet.FRAMES"); - noframesLabel = getResource("doclet.NO_FRAMES"); + framesLabel = getResource("doclet.Frames"); + noframesLabel = getResource("doclet.No_Frames"); treeLabel = getResource("doclet.Tree"); classLabel = getResource("doclet.Class"); deprecatedLabel = getResource("doclet.navDeprecated");
--- a/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Thu Jun 02 19:00:16 2011 +0100 @@ -11,54 +11,30 @@ doclet.Interface_Hierarchy=Interface Hierarchy doclet.Enum_Hierarchy=Enum Hierarchy doclet.Annotation_Type_Hierarchy=Annotation Type Hierarchy -# The following ALL CAPS words should be translated. It is used as "Previous" link on javadoc. -doclet.Prev=PREV -# The following ALL CAPS words should be translated. It is used as "Next" link on javadoc. -doclet.Next=NEXT -# The following ALL CAPS words should be translated. It is used as "Previous Class" link on javadoc. -doclet.Prev_Class=PREV CLASS -# The following ALL CAPS words should be translated. It is used as "Next Class" link on javadoc. -doclet.Next_Class=NEXT CLASS -# The following ALL CAPS words should be translated. It is used as "Previous Package" link on javadoc. -doclet.Prev_Package=PREV PACKAGE -# The following ALL CAPS words should be translated. It is used as "Next Package" link on javadoc. -doclet.Next_Package=NEXT PACKAGE -# The following ALL CAPS words should be translated. It is used as "Previous Letter" link on javadoc alphabetical index. -doclet.Prev_Letter=PREV LETTER -# The following ALL CAPS words should be translated. It is used as "Next Letter" link on javadoc alphabetical index. -doclet.Next_Letter=NEXT LETTER -# The following ALL CAPS words should be translated. It is used as "Show List" link on javadoc. -doclet.Show_Lists=SHOW LISTS -# The following ALL CAPS words should be translated. It is used as "Hide List" link on javadoc. -doclet.Hide_Lists=HIDE LISTS +doclet.Prev=Prev +doclet.Next=Next +doclet.Prev_Class=Prev Class +doclet.Next_Class=Next Class +doclet.Prev_Package=Prev Package +doclet.Next_Package=Next Package +doclet.Prev_Letter=Prev Letter +doclet.Next_Letter=Next Letter doclet.Href_Class_Title=class in {0} doclet.Href_Interface_Title=interface in {0} doclet.Href_Annotation_Title=annotation in {0} doclet.Href_Enum_Title=enum in {0} doclet.Href_Type_Param_Title=type parameter in {0} doclet.Href_Class_Or_Interface_Title=class or interface in {0} -# The following ALL CAPS words should be translated. It's used as SUMMARY: NESTED | FIELD | CONSTR | METHOD, meaning Nested Class Summary, Field Summary, Constructor Summary, or Method Summary. -doclet.Summary=SUMMARY: -# The following ALL CAPS words should be translated. It is used as DETAIL: FIELD | CONSTR | METHOD, meaning Field Detail, Constructor Detail, or Method Detail. -doclet.Detail=DETAIL: -# The following ALL CAPS words should be translated. It is used as "Nested" (Nested Class Summary) link on javadoc. -doclet.navNested=NESTED -# The following ALL CAPS words should be translated. It is used as "Optional" (Optional Element Summary) link on javadoc. -doclet.navAnnotationTypeOptionalMember=OPTIONAL -# The following ALL CAPS words should be translated. It is used as "Required" (Required Element Summary) link on javadoc. -doclet.navAnnotationTypeRequiredMember=REQUIRED -# The following ALL CAPS words should be translated. It is used as "Element" (Required Element Summary) link on javadoc. -doclet.navAnnotationTypeMember=ELEMENT -# The following ALL CAPS words should be translated. It is used as "Field" (Field Detail) link on javadoc. -doclet.navField=FIELD -# The following ALL CAPS words should be translated. It is used as "Enum Constants" link on javadoc. -doclet.navEnum=ENUM CONSTANTS -# The following ALL CAPS words should be translated. It is used as "Constructor" (Constructor Detail) link on javadoc. -doclet.navConstructor=CONSTR -# The following ALL CAPS words should be translated. It is used as "Method" (Method Detail) link on javadoc. -doclet.navMethod=METHOD -# The following resource does not seem to be used anymore. -doclet.navFactoryMethod=FACTORY +doclet.Summary=Summary: +doclet.Detail=Detail: +doclet.navNested=Nested +doclet.navAnnotationTypeOptionalMember=Optional +doclet.navAnnotationTypeRequiredMember=Required +doclet.navAnnotationTypeMember=Element +doclet.navField=Field +doclet.navEnum=Enum Constants +doclet.navConstructor=Constr +doclet.navMethod=Method doclet.Index=Index doclet.Window_Single_Index=Index doclet.Window_Split_Index={0}-Index @@ -66,12 +42,6 @@ doclet.Skip_navigation_links=Skip navigation links doclet.New_Page=NewPage doclet.None=None -# The following resource does not seem to be used anymore -doclet.CLASSES=CLASSES -# The following resource does not seem to be used anymore -doclet.MEMBERS=MEMBERS -# The following resource does not seem to be used anymore -doclet.NONE=NONE doclet.Factory_Method_Detail=Static Factory Method Detail doclet.navDeprecated=Deprecated doclet.Deprecated_List=Deprecated List @@ -98,6 +68,7 @@ doclet.see.malformed_tag=Tag {0}: Malformed: {1} doclet.Inherited_API_Summary=Inherited API Summary doclet.Deprecated_API=Deprecated API +doclet.Deprecated_Packages=Deprecated Packages doclet.Deprecated_Classes=Deprecated Classes doclet.Deprecated_Enums=Deprecated Enums doclet.Deprecated_Interfaces=Deprecated Interfaces @@ -109,6 +80,7 @@ doclet.Deprecated_Methods=Deprecated Methods doclet.Deprecated_Enum_Constants=Deprecated Enum Constants doclet.Deprecated_Annotation_Type_Members=Deprecated Annotation Type Elements +doclet.deprecated_packages=deprecated packages doclet.deprecated_classes=deprecated classes doclet.deprecated_enums=deprecated enums doclet.deprecated_interfaces=deprecated interfaces @@ -136,10 +108,7 @@ doclet.Option=Option doclet.Or=Or doclet.Frames=Frames -# The following ALL CAPS words should be translated. It is used as "FRAMES" javadoc navigation link to indicate displaying the page with HTML frames. -doclet.FRAMES=FRAMES -# The following ALL CAPS words should be translated. It is used as "NO FRAMES" javadoc navigation link to indicate displaying the page without HTML frames. -doclet.NO_FRAMES=NO FRAMES +doclet.No_Frames=No Frames doclet.Package_Hierarchies=Package Hierarchies: doclet.Hierarchy_For_Package=Hierarchy For Package {0} doclet.Source_Code=Source Code: @@ -147,11 +116,10 @@ doclet.Cannot_handle_no_packages=Cannot handle no packages. doclet.Frame_Alert=Frame Alert doclet.Overview-Member-Frame=Overview Member Frame -doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to {0}. doclet.No_Script_Message=JavaScript is disabled on your browser. -doclet.Non_Frame_Version=Non-frame version. +doclet.Non_Frame_Version=Non-frame version doclet.Frame_Version=Frame version -doclet.Link_To=Link to doclet.Following_From_Class=Following copied from class: {0} doclet.Following_From_Interface=Following copied from interface: {0} doclet.Description_From_Interface=Description copied from interface: @@ -200,7 +168,6 @@ doclet.Help_annotation_type_line_1=Each annotation type has its own separate page with the following sections: doclet.Help_annotation_type_line_2=Annotation Type declaration doclet.Help_annotation_type_line_3=Annotation Type description -doclet.The=The doclet.Style_line_1=Javadoc style sheet doclet.Style_line_2=Define colors, fonts and other style attributes here to override the defaults doclet.Style_line_3=Page background color @@ -280,6 +247,7 @@ -tag <name>:<locations>:<header> Specify single argument custom tags\n\ -taglet The fully qualified name of Taglet to register\n\ -tagletpath The path to Taglets\n\ + -Xdocrootparent <url> Replaces all appearances of @docRoot followed by /.. in doc comments with <url>\n\ -charset <charset> Charset for cross-platform viewing of generated documentation.\n\ -helpfile <file> Include file that help link links to\n\ -linksource Generate source in HTML\n\
--- a/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties Thu Jun 02 19:00:16 2011 +0100 @@ -13,47 +13,42 @@ doclet.Annotation_Type_Hierarchy=\u6CE8\u91C8\u578B\u968E\u5C64 doclet.Prev=\u524D doclet.Next=\u6B21 -doclet.Prev_Class=PREV CLASS -doclet.Next_Class=NEXT CLASS -doclet.Prev_Package=PREV PACKAGE -doclet.Next_Package=NEXT PACKAGE -doclet.Prev_Letter=PREV LETTER -doclet.Next_Letter=NEXT LETTER -doclet.Show_Lists=SHOW LISTS -doclet.Hide_Lists=HIDE LISTS +doclet.Prev_Class=\u524D\u306E\u30AF\u30E9\u30B9 +doclet.Next_Class=\u6B21\u306E\u30AF\u30E9\u30B9 +doclet.Prev_Package=\u524D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 +doclet.Next_Package=\u6B21\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 +doclet.Prev_Letter=\u524D\u306E\u6587\u5B57 +doclet.Next_Letter=\u6B21\u306E\u6587\u5B57 doclet.Href_Class_Title={0}\u5185\u306E\u30AF\u30E9\u30B9 doclet.Href_Interface_Title={0}\u5185\u306E\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.Href_Annotation_Title={0}\u5185\u306E\u6CE8\u91C8 doclet.Href_Enum_Title={0}\u5185\u306E\u5217\u6319\u578B doclet.Href_Type_Param_Title={0}\u5185\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF doclet.Href_Class_Or_Interface_Title={0}\u5185\u306E\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Summary=SUMMARY: -doclet.Detail=DETAIL: -doclet.navNested=NESTED -doclet.navAnnotationTypeOptionalMember=OPTIONAL -doclet.navAnnotationTypeRequiredMember=REQUIRED -doclet.navAnnotationTypeMember=ELEMENT -doclet.navField=FIELD -doclet.navEnum=ENUM CONSTANTS -doclet.navConstructor=CONSTR -doclet.navMethod=METHOD -doclet.navFactoryMethod=FACTORY +doclet.Summary=\u6982\u8981: +doclet.Detail=\u8A73\u7D30: +doclet.navNested=\u30CD\u30B9\u30C8 +doclet.navAnnotationTypeOptionalMember=\u30AA\u30D7\u30B7\u30E7\u30F3 +doclet.navAnnotationTypeRequiredMember=\u5FC5\u9808 +doclet.navAnnotationTypeMember=\u8981\u7D20 +doclet.navField=\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.navEnum=\u5217\u6319\u5B9A\u6570 +doclet.navConstructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF +doclet.navMethod=\u30E1\u30BD\u30C3\u30C9 doclet.Index=\u7D22\u5F15 doclet.Window_Single_Index=\u7D22\u5F15 doclet.Window_Split_Index={0}\u306E\u7D22\u5F15 doclet.Help=\u30D8\u30EB\u30D7 doclet.Skip_navigation_links=\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30F3\u30AF\u3092\u30B9\u30AD\u30C3\u30D7 +doclet.New_Page=NewPage doclet.None=\u306A\u3057 -doclet.CLASSES=CLASSES -doclet.MEMBERS=MEMBERS -doclet.NONE=\u306A\u3057 doclet.Factory_Method_Detail=static\u30D5\u30A1\u30AF\u30C8\u30EA\u30FB\u30E1\u30BD\u30C3\u30C9\u306E\u8A73\u7D30 doclet.navDeprecated=\u975E\u63A8\u5968 doclet.Deprecated_List=\u975E\u63A8\u5968API\u306E\u30EA\u30B9\u30C8 doclet.Window_Deprecated_List=\u975E\u63A8\u5968API\u306E\u30EA\u30B9\u30C8 doclet.Note_0_is_deprecated=\u6CE8\u610F: {0}\u306F\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 doclet.Overrides=\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9: -doclet.in_class=\u30AF\u30E9\u30B9{1}\u5185\u306E{0} +doclet.in_class=\u30AF\u30E9\u30B9\u5185 doclet.0_Fields_and_Methods="{0}"\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9 doclet.Index_of_Fields_and_Methods=\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u7D22\u5F15 doclet.Static_variable_in={0}\u306Estatic\u5909\u6570 @@ -103,7 +98,7 @@ doclet.Package_Description=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u8AAC\u660E doclet.Description=\u8AAC\u660E doclet.Specified_By=\u5B9A\u7FA9: -doclet.in_interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{1}\u5185\u306E{0} +doclet.in_interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5185 doclet.Subclasses=\u76F4\u7CFB\u306E\u65E2\u77E5\u306E\u30B5\u30D6\u30AF\u30E9\u30B9: doclet.Subinterfaces=\u65E2\u77E5\u306E\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8: doclet.Implementing_Classes=\u65E2\u77E5\u306E\u5B9F\u88C5\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8: @@ -111,8 +106,7 @@ doclet.Option=\u30AA\u30D7\u30B7\u30E7\u30F3 doclet.Or=\u307E\u305F\u306F doclet.Frames=\u30D5\u30EC\u30FC\u30E0 -doclet.FRAMES=FRAMES -doclet.NO_FRAMES=NO FRAMES +doclet.No_Frames=\u30D5\u30EC\u30FC\u30E0\u306A\u3057 doclet.Package_Hierarchies=\u30D1\u30C3\u30B1\u30FC\u30B8\u968E\u5C64: doclet.Hierarchy_For_Package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u968E\u5C64 doclet.Source_Code=\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9: @@ -120,25 +114,26 @@ doclet.Cannot_handle_no_packages=\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u51E6\u7406\u3067\u304D\u307E\u305B\u3093\u3002 doclet.Frame_Alert=\u30D5\u30EC\u30FC\u30E0\u95A2\u9023\u306E\u30A2\u30E9\u30FC\u30C8 doclet.Overview-Member-Frame=\u6982\u8981\u30E1\u30F3\u30D0\u30FC\u30FB\u30D5\u30EC\u30FC\u30E0 -doclet.Frame_Warning_Message=\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306F\u30D5\u30EC\u30FC\u30E0\u6A5F\u80FD\u3092\u4F7F\u7528\u3057\u3066\u8868\u793A\u3059\u308B\u3088\u3046\u306B\u4F5C\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30D5\u30EC\u30FC\u30E0\u3092\u8868\u793A\u3067\u304D\u306A\u3044Web\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u306E\u5834\u5408\u306B\u3053\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002 -doclet.Non_Frame_Version=\u30D5\u30EC\u30FC\u30E0\u306A\u3057\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3002 +doclet.Frame_Warning_Message=\u3053\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306F\u30D5\u30EC\u30FC\u30E0\u6A5F\u80FD\u3092\u4F7F\u7528\u3057\u3066\u8868\u793A\u3059\u308B\u3088\u3046\u306B\u4F5C\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30D5\u30EC\u30FC\u30E0\u3092\u8868\u793A\u3067\u304D\u306A\u3044Web\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u306E\u5834\u5408\u306B\u3053\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002{0}\u306B\u30EA\u30F3\u30AF\u3057\u307E\u3059\u3002 +doclet.No_Script_Message=\u30D6\u30E9\u30A6\u30B6\u306EJavaScript\u304C\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002 +doclet.Non_Frame_Version=\u30D5\u30EC\u30FC\u30E0\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u306A\u3044\u30D0\u30FC\u30B8\u30E7\u30F3 doclet.Frame_Version=\u30D5\u30EC\u30FC\u30E0\u3042\u308A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3 -doclet.Link_To=\u30EA\u30F3\u30AF\u5148 doclet.Following_From_Class=\u30AF\u30E9\u30B9{0}\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u30BF\u30B0: doclet.Following_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u30BF\u30B0: -doclet.Description_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E: -doclet.Description_From_Class=\u30AF\u30E9\u30B9{0}\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E: +doclet.Description_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E: +doclet.Description_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E: doclet.Standard_doclet_invoked=\u6A19\u6E96\u306Edoclet\u304C\u8D77\u52D5\u3055\u308C\u307E\u3057\u305F... doclet.No_Non_Deprecated_Classes_To_Document=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308B\u975E\u63A8\u5968\u4EE5\u5916\u306E\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 doclet.Interfaces_Italic=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u30A4\u30BF\u30EA\u30C3\u30AF) doclet.Enclosing_Class=\u542B\u307E\u308C\u3066\u3044\u308B\u30AF\u30E9\u30B9: doclet.Enclosing_Interface=\u542B\u307E\u308C\u3066\u3044\u308B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: +doclet.Window_Source_title=\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9 doclet.Help_title=API\u30D8\u30EB\u30D7 doclet.Window_Help_title=API\u30D8\u30EB\u30D7 doclet.Help_line_1=API\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u69CB\u6210 doclet.Help_line_2=\u3053\u306EAPI(Application Programming Interface)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u3001\u6B21\u306B\u8AAC\u660E\u3059\u308B\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u3042\u308B\u9805\u76EE\u306B\u5BFE\u5FDC\u3059\u308B\u30DA\u30FC\u30B8\u304C\u542B\u307E\u308C\u307E\u3059\u3002 doclet.Help_line_3={0}\u30DA\u30FC\u30B8\u306FAPI\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D5\u30ED\u30F3\u30C8\u30FB\u30DA\u30FC\u30B8\u3067\u3001\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6982\u8981\u3092\u542B\u3080\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30EA\u30B9\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4E00\u9023\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6982\u8981\u8AAC\u660E\u3082\u8868\u793A\u3055\u308C\u307E\u3059\u3002 -doclet.Help_line_4=\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u306F\u3001\u305D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8\u3068\u3001\u305D\u308C\u305E\u308C\u306E\u6982\u8981\u3092\u542B\u3080\u30DA\u30FC\u30B8\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u30DA\u30FC\u30B8\u306F4\u3064\u306E\u30AB\u30C6\u30B4\u30EA\u3067\u69CB\u6210\u3055\u308C\u307E\u3059\u3002 +doclet.Help_line_4=\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u306F\u3001\u305D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8\u3068\u3001\u305D\u308C\u305E\u308C\u306E\u6982\u8981\u3092\u542B\u3080\u30DA\u30FC\u30B8\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u30DA\u30FC\u30B8\u306F6\u3064\u306E\u30AB\u30C6\u30B4\u30EA\u3067\u69CB\u6210\u3055\u308C\u307E\u3059\u3002 doclet.Help_line_5=\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.Help_line_6=\u5404\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3001\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u306F\u500B\u5225\u306E\u30DA\u30FC\u30B8\u304C\u3042\u308A\u307E\u3059\u3002\u5404\u30DA\u30FC\u30B8\u306B\u306F\u6B21\u306E\u3088\u3046\u306B\u3001\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u8AAC\u660E\u3068\u3001\u6982\u8981\u8868\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u8A73\u7D30\u8AAC\u660E\u304C\u542B\u307E\u308C\u307E\u3059\u3002 doclet.Help_line_7=\u30AF\u30E9\u30B9\u968E\u5C64\u8868\u793A @@ -161,16 +156,16 @@ doclet.Help_line_24=\u3053\u308C\u3089\u306E\u30EA\u30F3\u30AF\u306B\u3088\u308A\u3001\u524D\u307E\u305F\u306F\u6B21\u306E\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u307E\u305F\u306F\u95A2\u9023\u30DA\u30FC\u30B8\u3078\u79FB\u52D5\u3067\u304D\u307E\u3059\u3002 doclet.Help_line_25=\u30D5\u30EC\u30FC\u30E0/\u30D5\u30EC\u30FC\u30E0\u306A\u3057 doclet.Help_line_26=\u3053\u308C\u3089\u306E\u30EA\u30F3\u30AF\u306FHTML\u30D5\u30EC\u30FC\u30E0\u306E\u8868\u793A\u3068\u975E\u8868\u793A\u3092\u5207\u308A\u66FF\u3048\u307E\u3059\u3002\u3059\u3079\u3066\u306E\u30DA\u30FC\u30B8\u306F\u30D5\u30EC\u30FC\u30E0\u3042\u308A\u3067\u3082\u3001\u30D5\u30EC\u30FC\u30E0\u306A\u3057\u3067\u3082\u8868\u793A\u3067\u304D\u307E\u3059\u3002 -doclet.Help_line_27=\u76F4\u5217\u5316\u53EF\u80FD\u307E\u305F\u306F\u5916\u90E8\u5316\u53EF\u80FD\u306A\u5404\u30AF\u30E9\u30B9\u306F\u3001\u76F4\u5217\u5316\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u8AAC\u660E\u3092\u542B\u307F\u307E\u3059\u3002\u3053\u306E\u60C5\u5831\u306F\u3001API\u3092\u4F7F\u7528\u3059\u308B\u958B\u767A\u8005\u3067\u306F\u306A\u304F\u3001\u518D\u5B9F\u88C5\u3092\u884C\u3046\u62C5\u5F53\u8005\u306B\u5F79\u7ACB\u3061\u307E\u3059\u3002\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u30EA\u30F3\u30AF\u304C\u306A\u3044\u5834\u5408\u3001\u76F4\u5217\u5316\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306B\u79FB\u52D5\u3057\u3066\u3001\u30AF\u30E9\u30B9\u8A18\u8FF0\u306E\u300C\u95A2\u9023\u9805\u76EE\u300D\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u3042\u308B\u300C\u76F4\u5217\u5316\u3055\u308C\u305F\u5F62\u5F0F\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u3053\u306E\u60C5\u5831\u3092\u8868\u793A\u3067\u304D\u307E\u3059\u3002 -doclet.Help_line_28=<a href="constant-values.html">\u300C\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u5024\u300D</a> \u30DA\u30FC\u30B8\u306B\u306F\u3001static final\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u305D\u306E\u5024\u306E\u30EA\u30B9\u30C8\u304C\u3042\u308A\u307E\u3059\u3002 -doclet.Help_line_29=\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u6A19\u6E96doclet\u3092\u4F7F\u7528\u3057\u3066\u751F\u6210\u3055\u308C\u305FAPI\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002 +doclet.Help_line_27={0}\u30EA\u30F3\u30AF\u306B\u306F\u3001\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u578B\u3092\u9664\u304F)\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002 +doclet.Help_line_28=\u76F4\u5217\u5316\u53EF\u80FD\u307E\u305F\u306F\u5916\u90E8\u5316\u53EF\u80FD\u306A\u5404\u30AF\u30E9\u30B9\u306F\u3001\u76F4\u5217\u5316\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u8AAC\u660E\u3092\u542B\u307F\u307E\u3059\u3002\u3053\u306E\u60C5\u5831\u306F\u3001API\u3092\u4F7F\u7528\u3059\u308B\u958B\u767A\u8005\u3067\u306F\u306A\u304F\u3001\u518D\u5B9F\u88C5\u3092\u884C\u3046\u62C5\u5F53\u8005\u306B\u5F79\u7ACB\u3061\u307E\u3059\u3002\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u30EA\u30F3\u30AF\u304C\u306A\u3044\u5834\u5408\u3001\u76F4\u5217\u5316\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306B\u79FB\u52D5\u3057\u3066\u3001\u30AF\u30E9\u30B9\u8A18\u8FF0\u306E\u300C\u95A2\u9023\u9805\u76EE\u300D\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u3042\u308B\u300C\u76F4\u5217\u5316\u3055\u308C\u305F\u5F62\u5F0F\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u3053\u306E\u60C5\u5831\u3092\u8868\u793A\u3067\u304D\u307E\u3059\u3002 +doclet.Help_line_29=<a href="constant-values.html">\u300C\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u5024\u300D</a> \u30DA\u30FC\u30B8\u306B\u306F\u3001static final\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u305D\u306E\u5024\u306E\u30EA\u30B9\u30C8\u304C\u3042\u308A\u307E\u3059\u3002 +doclet.Help_line_30=\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u6A19\u6E96doclet\u3092\u4F7F\u7528\u3057\u3066\u751F\u6210\u3055\u308C\u305FAPI\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002 doclet.Help_enum_line_1=\u5404\u5217\u6319\u578B\u306B\u306F\u3001\u305D\u308C\u81EA\u8EAB\u306E\u500B\u5225\u306E\u30DA\u30FC\u30B8\u3068\u6B21\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059: doclet.Help_enum_line_2=\u5217\u6319\u578B\u306E\u5BA3\u8A00 doclet.Help_enum_line_3=\u5217\u6319\u578B\u306E\u8AAC\u660E doclet.Help_annotation_type_line_1=\u5404\u6CE8\u91C8\u578B\u306B\u306F\u3001\u305D\u308C\u81EA\u8EAB\u306E\u500B\u5225\u306E\u30DA\u30FC\u30B8\u3068\u6B21\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059: doclet.Help_annotation_type_line_2=\u6CE8\u91C8\u578B\u306E\u5BA3\u8A00 doclet.Help_annotation_type_line_3=\u6CE8\u91C8\u578B\u306E\u8AAC\u660E -doclet.The=The doclet.Style_line_1=javadoc\u30B9\u30BF\u30A4\u30EB\u30FB\u30B7\u30FC\u30C8 doclet.Style_line_2=\u8272\u3084\u30D5\u30A9\u30F3\u30C8\u306A\u3069\u306E\u30B9\u30BF\u30A4\u30EB\u5C5E\u6027\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\u306B\u306F\u3001\u3053\u3053\u3067\u5B9A\u7FA9\u3057\u307E\u3059 doclet.Style_line_3=\u30DA\u30FC\u30B8\u306E\u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u8272
--- a/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties Thu Jun 02 19:00:16 2011 +0100 @@ -13,47 +13,42 @@ doclet.Annotation_Type_Hierarchy=\u6CE8\u91CA\u7C7B\u578B\u5206\u5C42\u7ED3\u6784 doclet.Prev=\u4E0A\u4E00\u4E2A doclet.Next=\u4E0B\u4E00\u4E2A -doclet.Prev_Class=PREV CLASS -doclet.Next_Class=NEXT CLASS -doclet.Prev_Package=PREV PACKAGE -doclet.Next_Package=NEXT PACKAGE -doclet.Prev_Letter=PREV LETTER -doclet.Next_Letter=NEXT LETTER -doclet.Show_Lists=SHOW LISTS -doclet.Hide_Lists=HIDE LISTS +doclet.Prev_Class=\u4E0A\u4E00\u4E2A\u7C7B +doclet.Next_Class=\u4E0B\u4E00\u4E2A\u7C7B +doclet.Prev_Package=\u4E0A\u4E00\u4E2A\u7A0B\u5E8F\u5305 +doclet.Next_Package=\u4E0B\u4E00\u4E2A\u7A0B\u5E8F\u5305 +doclet.Prev_Letter=\u4E0A\u4E00\u4E2A\u5B57\u6BCD +doclet.Next_Letter=\u4E0B\u4E00\u4E2A\u5B57\u6BCD doclet.Href_Class_Title={0}\u4E2D\u7684\u7C7B doclet.Href_Interface_Title={0}\u4E2D\u7684\u63A5\u53E3 doclet.Href_Annotation_Title={0}\u4E2D\u7684\u6CE8\u91CA doclet.Href_Enum_Title={0}\u4E2D\u7684\u679A\u4E3E doclet.Href_Type_Param_Title={0}\u4E2D\u7684\u7C7B\u578B\u53C2\u6570 doclet.Href_Class_Or_Interface_Title={0}\u4E2D\u7684\u7C7B\u6216\u63A5\u53E3 -doclet.Summary=SUMMARY: -doclet.Detail=DETAIL: -doclet.navNested=NESTED -doclet.navAnnotationTypeOptionalMember=OPTIONAL -doclet.navAnnotationTypeRequiredMember=REQUIRED -doclet.navAnnotationTypeMember=ELEMENT -doclet.navField=FIELD -doclet.navEnum=ENUM CONSTANTS -doclet.navConstructor=CONSTR -doclet.navMethod=METHOD -doclet.navFactoryMethod=FACTORY +doclet.Summary=\u6982\u8981: +doclet.Detail=\u8BE6\u7EC6\u8D44\u6599: +doclet.navNested=\u5D4C\u5957 +doclet.navAnnotationTypeOptionalMember=\u53EF\u9009 +doclet.navAnnotationTypeRequiredMember=\u5FC5\u9700 +doclet.navAnnotationTypeMember=\u5143\u7D20 +doclet.navField=\u5B57\u6BB5 +doclet.navEnum=\u679A\u4E3E\u5E38\u91CF +doclet.navConstructor=\u6784\u9020\u5668 +doclet.navMethod=\u65B9\u6CD5 doclet.Index=\u7D22\u5F15 doclet.Window_Single_Index=\u7D22\u5F15 doclet.Window_Split_Index={0} - \u7D22\u5F15 doclet.Help=\u5E2E\u52A9 doclet.Skip_navigation_links=\u8DF3\u8FC7\u5BFC\u822A\u94FE\u63A5 +doclet.New_Page=NewPage doclet.None=\u65E0 -doclet.CLASSES=CLASSES -doclet.MEMBERS=MEMBERS -doclet.NONE=\u65E0 doclet.Factory_Method_Detail=\u9759\u6001\u5DE5\u5382\u65B9\u6CD5\u8BE6\u7EC6\u8D44\u6599 doclet.navDeprecated=\u5DF2\u8FC7\u65F6 doclet.Deprecated_List=\u5DF2\u8FC7\u65F6\u7684\u5217\u8868 doclet.Window_Deprecated_List=\u5DF2\u8FC7\u65F6\u7684\u5217\u8868 doclet.Note_0_is_deprecated=\u6CE8: {0}\u5DF2\u8FC7\u65F6\u3002 doclet.Overrides=\u8986\u76D6: -doclet.in_class=\u7C7B{1}\u4E2D\u7684{0} +doclet.in_class=\u5728\u7C7B\u4E2D doclet.0_Fields_and_Methods="{0}" \u5B57\u6BB5\u548C\u65B9\u6CD5 doclet.Index_of_Fields_and_Methods=\u5B57\u6BB5\u548C\u65B9\u6CD5\u7684\u7D22\u5F15 doclet.Static_variable_in={0}\u4E2D\u7684\u9759\u6001\u53D8\u91CF @@ -103,7 +98,7 @@ doclet.Package_Description=\u7A0B\u5E8F\u5305{0}\u7684\u8BF4\u660E doclet.Description=\u8BF4\u660E doclet.Specified_By=\u6307\u5B9A\u8005: -doclet.in_interface=\u63A5\u53E3{1}\u4E2D\u7684{0} +doclet.in_interface=\u5728\u63A5\u53E3\u4E2D doclet.Subclasses=\u76F4\u63A5\u5DF2\u77E5\u5B50\u7C7B: doclet.Subinterfaces=\u6240\u6709\u5DF2\u77E5\u5B50\u63A5\u53E3: doclet.Implementing_Classes=\u6240\u6709\u5DF2\u77E5\u5B9E\u73B0\u7C7B: @@ -111,8 +106,7 @@ doclet.Option=\u9009\u9879 doclet.Or=\u6216 doclet.Frames=\u6846\u67B6 -doclet.FRAMES=FRAMES -doclet.NO_FRAMES=NO FRAMES +doclet.No_Frames=\u65E0\u6846\u67B6 doclet.Package_Hierarchies=\u7A0B\u5E8F\u5305\u5206\u5C42\u7ED3\u6784: doclet.Hierarchy_For_Package=\u7A0B\u5E8F\u5305{0}\u7684\u5206\u5C42\u7ED3\u6784 doclet.Source_Code=\u6E90\u4EE3\u7801: @@ -120,25 +114,26 @@ doclet.Cannot_handle_no_packages=\u65E0\u6CD5\u5904\u7406\u6CA1\u6709\u7A0B\u5E8F\u5305\u7684\u60C5\u51B5\u3002 doclet.Frame_Alert=\u6846\u67B6\u9884\u8B66 doclet.Overview-Member-Frame=\u6210\u5458\u6846\u67B6\u6982\u89C8 -doclet.Frame_Warning_Message=\u8BF7\u4F7F\u7528\u6846\u67B6\u529F\u80FD\u67E5\u770B\u6B64\u6587\u6863\u3002\u5982\u679C\u770B\u5230\u6B64\u6D88\u606F, \u5219\u8868\u660E\u60A8\u4F7F\u7528\u7684\u662F\u4E0D\u652F\u6301\u6846\u67B6\u7684 Web \u5BA2\u6237\u673A\u3002 -doclet.Non_Frame_Version=\u975E\u6846\u67B6\u7248\u672C\u3002 +doclet.Frame_Warning_Message=\u8BF7\u4F7F\u7528\u6846\u67B6\u529F\u80FD\u67E5\u770B\u6B64\u6587\u6863\u3002\u5982\u679C\u770B\u5230\u6B64\u6D88\u606F, \u5219\u8868\u660E\u60A8\u4F7F\u7528\u7684\u662F\u4E0D\u652F\u6301\u6846\u67B6\u7684 Web \u5BA2\u6237\u673A\u3002\u94FE\u63A5\u5230{0}\u3002 +doclet.No_Script_Message=\u60A8\u7684\u6D4F\u89C8\u5668\u5DF2\u7981\u7528 JavaScript\u3002 +doclet.Non_Frame_Version=\u975E\u6846\u67B6\u7248\u672C doclet.Frame_Version=\u6846\u67B6\u7248\u672C -doclet.Link_To=\u94FE\u63A5\u5230 doclet.Following_From_Class=\u4EE5\u4E0B\u5185\u5BB9\u662F\u4ECE\u7C7B{0}\u590D\u5236\u7684 doclet.Following_From_Interface=\u4EE5\u4E0B\u5185\u5BB9\u662F\u4ECE\u63A5\u53E3{0}\u590D\u5236\u7684 -doclet.Description_From_Interface=\u4ECE\u63A5\u53E3{0}\u590D\u5236\u7684\u8BF4\u660E -doclet.Description_From_Class=\u4ECE\u7C7B{0}\u590D\u5236\u7684\u8BF4\u660E +doclet.Description_From_Interface=\u4ECE\u63A5\u53E3\u590D\u5236\u7684\u8BF4\u660E: +doclet.Description_From_Class=\u4ECE\u7C7B\u590D\u5236\u7684\u8BF4\u660E: doclet.Standard_doclet_invoked=\u5DF2\u8C03\u7528\u7684\u6807\u51C6 doclet... doclet.No_Non_Deprecated_Classes_To_Document=\u627E\u4E0D\u5230\u53EF\u4EE5\u6587\u6863\u5316\u7684\u672A\u8FC7\u65F6\u7684\u7C7B\u3002 doclet.Interfaces_Italic=\u63A5\u53E3 (\u659C\u4F53) doclet.Enclosing_Class=\u5C01\u95ED\u7C7B: doclet.Enclosing_Interface=\u5C01\u95ED\u63A5\u53E3: +doclet.Window_Source_title=\u6E90\u4EE3\u7801 doclet.Help_title=API \u5E2E\u52A9 doclet.Window_Help_title=API \u5E2E\u52A9 doclet.Help_line_1=\u6B64 API \u6587\u6863\u7684\u7EC4\u7EC7\u65B9\u5F0F doclet.Help_line_2=\u6B64 API (\u5E94\u7528\u7A0B\u5E8F\u7F16\u7A0B\u63A5\u53E3) \u6587\u6863\u5305\u542B\u5BF9\u5E94\u4E8E\u5BFC\u822A\u680F\u4E2D\u7684\u9879\u76EE\u7684\u9875\u9762, \u5982\u4E0B\u6240\u8FF0\u3002 doclet.Help_line_3={0} \u9875\u9762\u662F\u6B64 API \u6587\u6863\u7684\u9996\u9875, \u63D0\u4F9B\u4E86\u6240\u6709\u7A0B\u5E8F\u5305\u7684\u5217\u8868\u53CA\u5176\u6982\u8981\u3002\u6B64\u9875\u9762\u4E5F\u53EF\u80FD\u5305\u542B\u8FD9\u4E9B\u7A0B\u5E8F\u5305\u7684\u603B\u4F53\u8BF4\u660E\u3002 -doclet.Help_line_4=\u6BCF\u4E2A\u7A0B\u5E8F\u5305\u90FD\u6709\u4E00\u4E2A\u9875\u9762, \u5176\u4E2D\u5305\u542B\u5B83\u7684\u7C7B\u548C\u63A5\u53E3\u7684\u5217\u8868\u53CA\u5176\u6982\u8981\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5305\u542B\u56DB\u4E2A\u7C7B\u522B: +doclet.Help_line_4=\u6BCF\u4E2A\u7A0B\u5E8F\u5305\u90FD\u6709\u4E00\u4E2A\u9875\u9762, \u5176\u4E2D\u5305\u542B\u5B83\u7684\u7C7B\u548C\u63A5\u53E3\u7684\u5217\u8868\u53CA\u5176\u6982\u8981\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5305\u542B\u516D\u4E2A\u7C7B\u522B: doclet.Help_line_5=\u7C7B/\u63A5\u53E3 doclet.Help_line_6=\u6BCF\u4E2A\u7C7B, \u63A5\u53E3, \u5D4C\u5957\u7C7B\u548C\u5D4C\u5957\u63A5\u53E3\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762\u3002\u5176\u4E2D\u6BCF\u4E2A\u9875\u9762\u90FD\u7531\u4E09\u90E8\u5206 (\u7C7B/\u63A5\u53E3\u8BF4\u660E, \u6982\u8981\u8868, \u4EE5\u53CA\u8BE6\u7EC6\u7684\u6210\u5458\u8BF4\u660E) \u7EC4\u6210: doclet.Help_line_7=\u7C7B\u7EE7\u627F\u56FE @@ -161,16 +156,16 @@ doclet.Help_line_24=\u8FD9\u4E9B\u94FE\u63A5\u4F7F\u60A8\u53EF\u4EE5\u8F6C\u81F3\u4E0B\u4E00\u4E2A\u6216\u4E0A\u4E00\u4E2A\u7C7B, \u63A5\u53E3, \u7A0B\u5E8F\u5305\u6216\u76F8\u5173\u9875\u9762\u3002 doclet.Help_line_25=\u6846\u67B6/\u65E0\u6846\u67B6 doclet.Help_line_26=\u8FD9\u4E9B\u94FE\u63A5\u7528\u4E8E\u663E\u793A\u548C\u9690\u85CF HTML \u6846\u67B6\u3002\u6240\u6709\u9875\u9762\u5747\u5177\u6709\u6709\u6846\u67B6\u548C\u65E0\u6846\u67B6\u4E24\u79CD\u663E\u793A\u65B9\u5F0F\u3002 -doclet.Help_line_27=\u6BCF\u4E2A\u53EF\u5E8F\u5217\u5316\u6216\u53EF\u5916\u90E8\u5316\u7684\u7C7B\u90FD\u6709\u5176\u5E8F\u5217\u5316\u5B57\u6BB5\u548C\u65B9\u6CD5\u7684\u8BF4\u660E\u3002\u6B64\u4FE1\u606F\u5BF9\u91CD\u65B0\u5B9E\u73B0\u8005\u6709\u7528, \u800C\u5BF9\u4F7F\u7528 API \u7684\u5F00\u53D1\u8005\u5219\u6CA1\u6709\u4EC0\u4E48\u7528\u5904\u3002\u5C3D\u7BA1\u5BFC\u822A\u680F\u4E2D\u6CA1\u6709\u94FE\u63A5, \u4F46\u60A8\u53EF\u4EE5\u901A\u8FC7\u4E0B\u5217\u65B9\u5F0F\u83B7\u53D6\u6B64\u4FE1\u606F: \u8F6C\u81F3\u4EFB\u4F55\u5E8F\u5217\u5316\u7C7B, \u7136\u540E\u5355\u51FB\u7C7B\u8BF4\u660E\u7684 "\u53E6\u8BF7\u53C2\u9605" \u90E8\u5206\u4E2D\u7684 "\u5E8F\u5217\u5316\u8868\u683C"\u3002 -doclet.Help_line_28=<a href="constant-values.html">\u5E38\u91CF\u5B57\u6BB5\u503C</a>\u9875\u9762\u5217\u51FA\u4E86\u9759\u6001\u6700\u7EC8\u5B57\u6BB5\u53CA\u5176\u503C\u3002 -doclet.Help_line_29=\u6B64\u5E2E\u52A9\u6587\u4EF6\u9002\u7528\u4E8E\u4F7F\u7528\u6807\u51C6 doclet \u751F\u6210\u7684 API \u6587\u6863\u3002 +doclet.Help_line_27={0}\u94FE\u63A5\u663E\u793A\u6240\u6709\u7C7B\u548C\u63A5\u53E3 (\u9664\u4E86\u975E\u9759\u6001\u5D4C\u5957\u7C7B\u578B)\u3002 +doclet.Help_line_28=\u6BCF\u4E2A\u53EF\u5E8F\u5217\u5316\u6216\u53EF\u5916\u90E8\u5316\u7684\u7C7B\u90FD\u6709\u5176\u5E8F\u5217\u5316\u5B57\u6BB5\u548C\u65B9\u6CD5\u7684\u8BF4\u660E\u3002\u6B64\u4FE1\u606F\u5BF9\u91CD\u65B0\u5B9E\u73B0\u8005\u6709\u7528, \u800C\u5BF9\u4F7F\u7528 API \u7684\u5F00\u53D1\u8005\u5219\u6CA1\u6709\u4EC0\u4E48\u7528\u5904\u3002\u5C3D\u7BA1\u5BFC\u822A\u680F\u4E2D\u6CA1\u6709\u94FE\u63A5, \u4F46\u60A8\u53EF\u4EE5\u901A\u8FC7\u4E0B\u5217\u65B9\u5F0F\u83B7\u53D6\u6B64\u4FE1\u606F: \u8F6C\u81F3\u4EFB\u4F55\u5E8F\u5217\u5316\u7C7B, \u7136\u540E\u5355\u51FB\u7C7B\u8BF4\u660E\u7684 "\u53E6\u8BF7\u53C2\u9605" \u90E8\u5206\u4E2D\u7684 "\u5E8F\u5217\u5316\u8868\u683C"\u3002 +doclet.Help_line_29=<a href="constant-values.html">\u5E38\u91CF\u5B57\u6BB5\u503C</a>\u9875\u9762\u5217\u51FA\u4E86\u9759\u6001\u6700\u7EC8\u5B57\u6BB5\u53CA\u5176\u503C\u3002 +doclet.Help_line_30=\u6B64\u5E2E\u52A9\u6587\u4EF6\u9002\u7528\u4E8E\u4F7F\u7528\u6807\u51C6 doclet \u751F\u6210\u7684 API \u6587\u6863\u3002 doclet.Help_enum_line_1=\u6BCF\u4E2A\u679A\u4E3E\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762, \u5176\u4E2D\u5305\u542B\u4EE5\u4E0B\u90E8\u5206: doclet.Help_enum_line_2=\u679A\u4E3E\u58F0\u660E doclet.Help_enum_line_3=\u679A\u4E3E\u8BF4\u660E doclet.Help_annotation_type_line_1=\u6BCF\u4E2A\u6CE8\u91CA\u7C7B\u578B\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762, \u5176\u4E2D\u5305\u542B\u4EE5\u4E0B\u90E8\u5206: doclet.Help_annotation_type_line_2=\u6CE8\u91CA\u7C7B\u578B\u58F0\u660E doclet.Help_annotation_type_line_3=\u6CE8\u91CA\u7C7B\u578B\u8BF4\u660E -doclet.The=\u8BE5 doclet.Style_line_1=Javadoc \u6837\u5F0F\u8868 doclet.Style_line_2=\u5728\u6B64\u5904\u5B9A\u4E49\u989C\u8272, \u5B57\u4F53\u548C\u5176\u4ED6\u6837\u5F0F\u5C5E\u6027\u4EE5\u8986\u76D6\u9ED8\u8BA4\u503C doclet.Style_line_3=\u9875\u9762\u80CC\u666F\u989C\u8272
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, 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 @@ -419,7 +419,7 @@ docencoding = encoding; } - classDocCatalog = new ClassDocCatalog(root.specifiedClasses()); + classDocCatalog = new ClassDocCatalog(root.specifiedClasses(), this); initTagletManager(customTagStrs); } @@ -677,15 +677,18 @@ } /** - * Return true if the doc element is getting documented, depending upon - * -nodeprecated option and @deprecated tag used. Return true if - * -nodeprecated is not used or @deprecated tag is not used. + * Return true if the ClassDoc element is getting documented, depending upon + * -nodeprecated option and the deprecation information. Return true if + * -nodeprecated is not used. Return false if -nodeprecated is used and if + * either ClassDoc element is deprecated or the containing package is deprecated. + * + * @param cd the ClassDoc for which the page generation is checked */ - public boolean isGeneratedDoc(Doc doc) { + public boolean isGeneratedDoc(ClassDoc cd) { if (!nodeprecated) { return true; } - return (doc.tags("deprecated")).length == 0; + return !(Util.isDeprecated(cd) || Util.isDeprecated(cd.containingPackage())); } /**
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties Thu Jun 02 19:00:16 2011 +0100 @@ -65,7 +65,7 @@ doclet.Exception_Summary=\u4F8B\u5916\u306E\u6982\u8981 doclet.Error_Summary=\u30A8\u30E9\u30FC\u306E\u6982\u8981 doclet.Class_Summary=\u30AF\u30E9\u30B9\u306E\u6982\u8981 -doclet.Nested_Class_Summary=\u5165\u308C\u5B50\u306E\u30AF\u30E9\u30B9\u306E\u6982\u8981 +doclet.Nested_Class_Summary=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306E\u6982\u8981 doclet.Annotation_Type_Optional_Member_Summary=\u4EFB\u610F\u8981\u7D20\u306E\u6982\u8981 doclet.Annotation_Type_Required_Member_Summary=\u5FC5\u9808\u8981\u7D20\u306E\u6982\u8981 doclet.Field_Summary=\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u6982\u8981 @@ -84,7 +84,7 @@ doclet.All_Classes=\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9 doclet.All_Superinterfaces=\u3059\u3079\u3066\u306E\u30B9\u30FC\u30D1\u30FC\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: doclet.All_Implemented_Interfaces=\u3059\u3079\u3066\u306E\u5B9F\u88C5\u3055\u308C\u305F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: -doclet.All_classes_and_interfaces=\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u5165\u308C\u5B50\u306B\u306A\u3063\u305F\u578B\u3092\u9664\u304F) +doclet.All_classes_and_interfaces=\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u578B\u3092\u9664\u304F) doclet.Package_class_and_interface_descriptions=\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u8AAC\u660E doclet.Members=\u30E1\u30F3\u30D0\u30FC doclet.Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 @@ -109,12 +109,12 @@ doclet.extends=extends doclet.Package_private=(package private) doclet.implements=implementsdoclet.Same_package_name_used=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u5F62\u5F0F\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} -doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u30AF\u30E9\u30B9{0}\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u5165\u308C\u5B50\u306E\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Nested_Classes_Interface_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u5165\u308C\u5B50\u306E\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Methods_Inherited_From_Class=\u30AF\u30E9\u30B9{0}\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9 -doclet.Methods_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9 -doclet.Fields_Inherited_From_Class=\u30AF\u30E9\u30B9{0}\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Fields_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{0}\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 +doclet.Nested_Classes_Interface_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 +doclet.Methods_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9 +doclet.Methods_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9 +doclet.Fields_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.Fields_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 doclet.Serializable=\u76F4\u5217\u5316\u53EF\u80FD doclet.Externalizable=\u5916\u90E8\u5316\u53EF\u80FD doclet.Annotation_Type_Member_Detail=\u8981\u7D20\u306E\u8A73\u7D30 @@ -134,12 +134,19 @@ doclet.Constants_Table_Summary={0}\u8868\u3001\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u5024 doclet.Member_Table_Summary={0}\u8868\u3001{1}\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u8AAC\u660E doclet.fields=\u30D5\u30A3\u30FC\u30EB\u30C9 +doclet.Fields=\u30D5\u30A3\u30FC\u30EB\u30C9 doclet.constructors=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF +doclet.Constructors=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF doclet.methods=\u30E1\u30BD\u30C3\u30C9 +doclet.Methods=\u30E1\u30BD\u30C3\u30C9 doclet.annotation_type_optional_members=\u4EFB\u610F\u8981\u7D20 +doclet.Annotation_Type_Optional_Members=\u4EFB\u610F\u8981\u7D20 doclet.annotation_type_required_members=\u5FC5\u9808\u8981\u7D20 +doclet.Annotation_Type_Required_Members=\u5FC5\u9808\u8981\u7D20 doclet.enum_constants=\u5217\u6319\u578B\u5B9A\u6570 -doclet.nested_classes=\u5165\u308C\u5B50\u306E\u30AF\u30E9\u30B9 +doclet.Enum_Constants=\u5217\u6319\u5B9A\u6570 +doclet.nested_classes=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9 +doclet.Nested_Classes=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9 doclet.subclasses=\u30B5\u30D6\u30AF\u30E9\u30B9 doclet.subinterfaces=\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 doclet.Modifier=\u4FEE\u98FE\u5B50
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties Thu Jun 02 19:00:16 2011 +0100 @@ -109,12 +109,12 @@ doclet.extends=\u6269\u5C55 doclet.Package_private=(\u4E13\u7528\u7A0B\u5E8F\u5305) doclet.implements=implementsdoclet.Same_package_name_used=\u7A0B\u5E8F\u5305\u540D\u79F0\u5F62\u5F0F\u4F7F\u7528\u4E86\u4E24\u6B21: {0} -doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u4ECE\u7C7B{0}\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3 -doclet.Nested_Classes_Interface_Inherited_From_Interface=\u4ECE\u63A5\u53E3{0}\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3 -doclet.Methods_Inherited_From_Class=\u4ECE\u7C7B{0}\u7EE7\u627F\u7684\u65B9\u6CD5 -doclet.Methods_Inherited_From_Interface=\u4ECE\u63A5\u53E3{0}\u7EE7\u627F\u7684\u65B9\u6CD5 -doclet.Fields_Inherited_From_Class=\u4ECE\u7C7B{0}\u7EE7\u627F\u7684\u5B57\u6BB5 -doclet.Fields_Inherited_From_Interface=\u4ECE\u63A5\u53E3{0}\u7EE7\u627F\u7684\u5B57\u6BB5 +doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3 +doclet.Nested_Classes_Interface_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3 +doclet.Methods_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u65B9\u6CD5 +doclet.Methods_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u65B9\u6CD5 +doclet.Fields_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5B57\u6BB5 +doclet.Fields_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5B57\u6BB5 doclet.Serializable=\u53EF\u5E8F\u5217\u5316 doclet.Externalizable=\u53EF\u5916\u90E8\u5316 doclet.Annotation_Type_Member_Detail=\u5143\u7D20\u8BE6\u7EC6\u8D44\u6599 @@ -134,12 +134,19 @@ doclet.Constants_Table_Summary={0}\u8868, \u5217\u8868\u5E38\u91CF\u5B57\u6BB5\u548C\u503C doclet.Member_Table_Summary={0}\u8868, \u5217\u8868{1}\u548C\u89E3\u91CA doclet.fields=\u5B57\u6BB5 +doclet.Fields=\u5B57\u6BB5 doclet.constructors=\u6784\u9020\u5668 +doclet.Constructors=\u6784\u9020\u5668 doclet.methods=\u65B9\u6CD5 +doclet.Methods=\u65B9\u6CD5 doclet.annotation_type_optional_members=\u53EF\u9009\u5143\u7D20 +doclet.Annotation_Type_Optional_Members=\u53EF\u9009\u5143\u7D20 doclet.annotation_type_required_members=\u5FC5\u9700\u7684\u5143\u7D20 +doclet.Annotation_Type_Required_Members=\u6240\u9700\u5143\u7D20 doclet.enum_constants=\u679A\u4E3E\u5E38\u91CF +doclet.Enum_Constants=\u679A\u4E3E\u5E38\u91CF doclet.nested_classes=\u5D4C\u5957\u7C7B +doclet.Nested_Classes=\u5D4C\u5957\u7C7B doclet.subclasses=\u5B50\u7C7B doclet.subinterfaces=\u5B50\u63A5\u53E3 doclet.Modifier=\u9650\u5B9A\u7B26 @@ -160,4 +167,4 @@ #Documentation for Enums doclet.enum_values_doc=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n<pre>\nfor ({0} c : {0}.values())\n System.out.println(c);\n</pre>\n@\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4 -doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26<I>\u5B8C\u5168</I>\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@return \u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@throws \u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@throws \u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException\u3002 +doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26<i>\u5B8C\u5168</i>\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@return \u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@throws \u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@throws \u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Thu Jun 02 19:00:16 2011 +0100 @@ -2,17 +2,10 @@ /* Overall document style */ -* { - margin:0; - padding:0; -} body { font-family:Helvetica, Arial, sans-serif; color:#000000; } -p { - margin:20px 0; -} pre { font-size:1.0em; } @@ -30,35 +23,18 @@ } ul { margin:10px 0 10px 20px; -} -li { - list-style:disc; -} -dl dt { - font-size:0.95em; - font-weight:bold; - margin:10px 0 0 0; -} -dl dd { - margin:10px 0 10px 20px; -} -dl dd ul { - margin-left:0; -} -dl dd ul li { - list-style:none; - margin:10px 0 10px 0; + list-style-type:disc; } caption { background: #CCCCFF; color:#000000; - text-align: left; - font-size: 150%; - font-weight: bold; - border-left: 2px ridge; - border-right: 2px ridge; - border-top: 2px ridge; - padding-left: 5px; + text-align:left; + font-size:150%; + font-weight:bold; + border-left:2px ridge; + border-right:2px ridge; + border-top:2px ridge; + padding-left:5px; width:auto; } /* @@ -70,11 +46,11 @@ color:#000000; } .legalCopy { - margin:7px; + margin:7px 0; } .bar { font-size:1em; - margin:10px 0 0 10px; + margin:10px 0 0 2px; } .bar a { font-weight:normal; @@ -84,24 +60,21 @@ */ .topNav { border-top:2px solid #C0C0C0; - margin:7px; padding:7px 0; height:2.8em; - width:99%; + width:100%; min-width:600px; } .bottomNav { border-top:2px solid #C0C0C0; - margin:7px; padding:7px 0; height:2.8em; - width:99%; + width:100%; } .subNav { border-bottom:2px solid #C0C0C0; float:left; - width:99%; - margin:7px; + width:100%; min-width:600px; } .subNav div { @@ -120,7 +93,7 @@ /* Navigation bar list styles */ .topNav ul.navList, .bottomNav ul.navList { background-color:#EEEEFF; - padding:7px 5px; + padding:4px 4px; margin:0; float:left; width:80%; @@ -128,7 +101,7 @@ ul.navList li{ list-style:none; float:left; - padding:3px 4px; + padding:0 4px; color:#000000; font-size:0.98em; } @@ -142,35 +115,37 @@ .subNav ul.navList { float:left; margin:0; - font-size:0.7em; + padding:0; + font-size:0.8em; width:350px; } ul.subNavList { float:left; + font-size:0.8em; + width:350px; margin:0; - font-size:0.7em; - width:350px; + padding:0; } ul.subNavList li{ list-style:none; float:left; - font-size:90%; + font-size:98%; } /* Page header and footer styles */ .header, .footer { clear:both; - margin:0 7px; + padding:10px 0; } .indexHeader { font-size:0.9em; - margin:10px 0 7px 10px; + margin:10px 0 0 2px; } .header ul { padding-left:20px; } -/* Header and footer title styles */ +/* Header and footer title styles */ .header h1.title { font-size:1.4em; text-align:center; @@ -181,10 +156,17 @@ margin:0; } .subTitle { - margin:0; padding-top:10px; - font-size:0.75em; - font-weight:bold; +} +/* +Content styles +*/ +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding-top:10px; } /* Page layout container styles @@ -192,11 +174,11 @@ .contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { clear:both; - padding:10px 10px; position:relative; + padding-bottom:20px; } .indexContainer { - padding:0 0 10px 10px; + padding:0 0 0 2px; font-size:0.9em; } /* @@ -223,7 +205,8 @@ .indexContainer h2 { font-weight:normal; font-size:1.0em; - padding:10px 0 0 0; + padding:5px 0 0 0; + margin:10px 0 0 0; } .contentContainer h2 { margin:10px 0; @@ -265,7 +248,7 @@ background:#CCCCFF; border:0; border:2px ridge; - padding-left:5px; + margin:0; } div.summary ul.blockList ul.blockList ul.blockList li.blockList h3 { background:#EEEEFF; @@ -276,23 +259,22 @@ div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { font-size:1.15em; font-weight:bold; - padding:0 0 10px 0; + padding:0 0 5px 0; + margin:0; } /* Table styles */ .contentContainer table { - border-collapse: collapse ; + border-collapse:collapse ; width:100%; } .contentContainer table td, .contentContainer table th { border:2px ridge; - padding:3px; } /* Constant values page table styles */ .constantValuesContainer table { - border-collapse: collapse ; - margin:0 0 10px 0; + border-collapse:collapse; } .constantValuesContainer table caption{ font-size:0.95em; @@ -305,12 +287,9 @@ } /* Class-use/Package-use page table styles */ .classUseContainer table { - border-collapse: collapse ; + border-collapse:collapse ; width:100%; - margin:0 0 15px 0; -} -.classUseContainer ul li ul li table { - margin-bottom:30px; + margin:0 0 10px 0; } .classUseContainer ul li ul li table caption{ font-size:0.95em; @@ -367,6 +346,7 @@ /* Container specific list styles */ .indexContainer ul { margin:0; + padding:0; } .indexContainer ul li { list-style:none; @@ -378,6 +358,7 @@ list-style:none; border:0; border-bottom:2px ridge; + height:1%; } .serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockListLast { list-style:none; @@ -397,6 +378,7 @@ div.details ul.blockList ul.blockList ul.blockList li.blockList { border:0; border-bottom:2px ridge; + height:1%; } /* Definition list styles */ ul.blockList li.blockList dl{ @@ -415,9 +397,17 @@ ul.blockList li.blockList pre{ margin:0 0 15px 0; } +.description dl dt { + font-size:0.95em; + font-weight:bold; + margin:5px 0 0 0; +} +.description dl dd { + margin:10px 0 10px 20px; +} /* List content styles */ ul.blockList li.blockList ul.blockList li.blockList pre{ - margin:10px 0 15px 0; + margin:10px 0 10px 0; } ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList pre, ul.blockList li.blockList ul.blockList li.blockList ul.blockListLast li.blockList pre{
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/DeprecatedTaglet.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/DeprecatedTaglet.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -47,13 +47,6 @@ /** * {@inheritDoc} */ - public boolean inPackage() { - return false; - } - - /** - * {@inheritDoc} - */ public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) { return writer.deprecatedTagOutput(holder); }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, 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 @@ -25,8 +25,9 @@ package com.sun.tools.doclets.internal.toolkit.util; +import java.util.*; import com.sun.javadoc.*; -import java.util.*; +import com.sun.tools.doclets.internal.toolkit.Configuration; /** * This class acts as an artificial PackageDoc for classes specified @@ -88,13 +89,16 @@ */ private Map<String,Set<ClassDoc>> interfaces; + private Configuration configuration; + /** * Construct a new ClassDocCatalog. * * @param classdocs the array of ClassDocs to catalog */ - public ClassDocCatalog (ClassDoc[] classdocs) { + public ClassDocCatalog (ClassDoc[] classdocs, Configuration config) { init(); + this.configuration = config; for (int i = 0; i < classdocs.length; i++) { addClassDoc(classdocs[i]); } @@ -151,9 +155,10 @@ private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) { PackageDoc pkg = classdoc.containingPackage(); - if (pkg.isIncluded()) { - //No need to catalog this class since it's package is - //included on the command line + if (pkg.isIncluded() || (configuration.nodeprecated && Util.isDeprecated(pkg))) { + //No need to catalog this class if it's package is + //included on the command line or if -nodeprecated option is set + // and the containing package is marked as deprecated. return; } String key = Util.getPackageName(pkg);
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -122,8 +122,12 @@ */ private void buildTree(ClassDoc[] classes, Configuration configuration) { for (int i = 0; i < classes.length; i++) { + // In the tree page (e.g overview-tree.html) do not include + // information of classes which are deprecated or are a part of a + // deprecated package. if (configuration.nodeprecated && - classes[i].tags("deprecated").length > 0) { + (Util.isDeprecated(classes[i]) || + Util.isDeprecated(classes[i].containingPackage()))) { continue; } if (classes[i].isEnum()) {
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -27,27 +27,29 @@ import com.sun.javadoc.*; import java.util.*; +import com.sun.tools.doclets.internal.toolkit.Configuration; /** - * Build list of all the deprecated classes, constructors, fields and methods. + * Build list of all the deprecated packages, classes, constructors, fields and methods. * * @author Atul M Dambalkar */ public class DeprecatedAPIListBuilder { - public static final int NUM_TYPES = 11; + public static final int NUM_TYPES = 12; - public static final int INTERFACE = 0; - public static final int CLASS = 1; - public static final int ENUM = 2; - public static final int EXCEPTION = 3; - public static final int ERROR = 4; - public static final int ANNOTATION_TYPE = 5; - public static final int FIELD = 6; - public static final int METHOD = 7; - public static final int CONSTRUCTOR = 8; - public static final int ENUM_CONSTANT = 9; - public static final int ANNOTATION_TYPE_MEMBER = 10; + public static final int PACKAGE = 0; + public static final int INTERFACE = 1; + public static final int CLASS = 2; + public static final int ENUM = 3; + public static final int EXCEPTION = 4; + public static final int ERROR = 5; + public static final int ANNOTATION_TYPE = 6; + public static final int FIELD = 7; + public static final int METHOD = 8; + public static final int CONSTRUCTOR = 9; + public static final int ENUM_CONSTANT = 10; + public static final int ANNOTATION_TYPE_MEMBER = 11; /** * List of deprecated type Lists. @@ -58,25 +60,33 @@ /** * Constructor. * - * @param root Root of the tree. + * @param configuration the current configuration of the doclet */ - public DeprecatedAPIListBuilder(RootDoc root) { + public DeprecatedAPIListBuilder(Configuration configuration) { deprecatedLists = new ArrayList<List<Doc>>(); for (int i = 0; i < NUM_TYPES; i++) { deprecatedLists.add(i, new ArrayList<Doc>()); } - buildDeprecatedAPIInfo(root); + buildDeprecatedAPIInfo(configuration); } /** * Build the sorted list of all the deprecated APIs in this run. - * Build separate lists for deprecated classes, constructors, methods and - * fields. + * Build separate lists for deprecated packages, classes, constructors, + * methods and fields. * - * @param root Root of the tree. + * @param configuration the current configuration of the doclet. */ - private void buildDeprecatedAPIInfo(RootDoc root) { - ClassDoc[] classes = root.classes(); + private void buildDeprecatedAPIInfo(Configuration configuration) { + PackageDoc[] packages = configuration.packages; + PackageDoc pkg; + for (int c = 0; c < packages.length; c++) { + pkg = packages[c]; + if (Util.isDeprecated(pkg)) { + getList(PACKAGE).add(pkg); + } + } + ClassDoc[] classes = configuration.root.classes(); for (int i = 0; i < classes.length; i++) { ClassDoc cd = classes[i]; if (Util.isDeprecated(cd)) { @@ -90,7 +100,7 @@ getList(ENUM).add(cd); } else if (cd.isError()) { getList(ERROR).add(cd); - }else if (cd.isAnnotationType()) { + } else if (cd.isAnnotationType()) { getList(ANNOTATION_TYPE).add(cd); } } @@ -102,7 +112,7 @@ } if (cd.isAnnotationType()) { composeDeprecatedList(getList(ANNOTATION_TYPE_MEMBER), - ((AnnotationTypeDoc) cd).elements()); + ((AnnotationTypeDoc) cd).elements()); } } sortDeprecatedLists();
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -207,7 +207,17 @@ * Should this doc element be added to the index map? */ protected boolean shouldAddToIndexMap(Doc element) { - return !(noDeprecated && element.tags("deprecated").length > 0); + if (element instanceof PackageDoc) + // Do not add to index map if -nodeprecated option is set and the + // package is marked as deprecated. + return !(noDeprecated && Util.isDeprecated(element)); + else + // Do not add to index map if -nodeprecated option is set and if the + // Doc is marked as deprecated or the containing package is marked as + // deprecated. + return !(noDeprecated && + (Util.isDeprecated(element) || + Util.isDeprecated(((ProgramElementDoc)element).containingPackage()))); } /**
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, 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 @@ -76,13 +76,16 @@ protected void generatePackageListFile(RootDoc root) { PackageDoc[] packages = configuration.packages; - String[] names = new String[packages.length]; + ArrayList<String> names = new ArrayList<String>(); for (int i = 0; i < packages.length; i++) { - names[i] = packages[i].name(); + // if the -nodeprecated option is set and the package is marked as + // deprecated, do not include it in the packages list. + if (!(configuration.nodeprecated && Util.isDeprecated(packages[i]))) + names.add(packages[i].name()); } - Arrays.sort(names); - for (int i = 0; i < packages.length; i++) { - println(names[i]); + Collections.sort(names); + for (int i = 0; i < names.size(); i++) { + println(names.get(i)); } } }
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java Thu Jun 02 19:00:16 2011 +0100 @@ -175,8 +175,9 @@ } /** - * According to the Java Language Specifications, all the outer classes - * and static inner classes are core classes. + * According to + * <cite>The Java™ Language Specification</cite>, + * all the outer classes and static inner classes are core classes. */ public static boolean isCoreClass(ClassDoc cd) { return cd.containingClass() == null || cd.isStatic(); @@ -860,11 +861,15 @@ * @param doc the Doc to check. * @return true if the given Doc is deprecated. */ - public static boolean isDeprecated(ProgramElementDoc doc) { + public static boolean isDeprecated(Doc doc) { if (doc.tags("deprecated").length > 0) { return true; } - AnnotationDesc[] annotationDescList = doc.annotations(); + AnnotationDesc[] annotationDescList; + if (doc instanceof PackageDoc) + annotationDescList = ((PackageDoc)doc).annotations(); + else + annotationDescList = ((ProgramElementDoc)doc).annotations(); for (int i = 0; i < annotationDescList.length; i++) { if (annotationDescList[i].annotationType().qualifiedName().equals( java.lang.Deprecated.class.getName())){
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,593 @@ +/* + * Copyright (c) 2011, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ + + +package com.sun.tools.javac.api; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.lang.model.element.NestingKind; +import javax.tools.Diagnostic; +import javax.tools.FileObject; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileManager.Location; +import javax.tools.JavaFileObject; + +import com.sun.source.util.TaskEvent; +import com.sun.source.util.TaskListener; +import com.sun.tools.javac.util.ClientCodeException; +import com.sun.tools.javac.util.Context; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import javax.lang.model.element.Modifier; +import javax.tools.DiagnosticListener; +import javax.tools.JavaFileObject.Kind; + +/** + * Wrap objects to enable unchecked exceptions to be caught and handled. + * + * For each method, exceptions are handled as follows: + * <ul> + * <li>Checked exceptions are left alone and propogate upwards in the + * obvious way, since they are an expected aspect of the method's + * specification. + * <li>Unchecked exceptions which have already been caught and wrapped in + * ClientCodeException are left alone to continue propogating upwards. + * <li>All other unchecked exceptions (i.e. subtypes of RuntimeException + * and Error) and caught, and rethrown as a ClientCodeException with + * its cause set to the original exception. + * </ul> + * + * The intent is that ClientCodeException can be caught at an appropriate point + * in the program and can be distinguished from any unanticipated unchecked + * exceptions arising in the main body of the code (i.e. bugs.) When the + * ClientCodeException has been caught, either a suitable message can be + * generated, or if appropriate, the original cause can be rethrown. + * + * <p><b>This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice.</b> + */ +public class ClientCodeWrapper { + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface Trusted { } + + public static ClientCodeWrapper instance(Context context) { + ClientCodeWrapper instance = context.get(ClientCodeWrapper.class); + if (instance == null) + instance = new ClientCodeWrapper(context); + return instance; + } + + /** + * A map to cache the results of whether or not a specific classes can + * be "trusted", and thus does not need to be wrapped. + */ + Map<Class<?>, Boolean> trustedClasses; + + protected ClientCodeWrapper(Context context) { + trustedClasses = new HashMap<Class<?>, Boolean>(); + } + + public JavaFileManager wrap(JavaFileManager fm) { + if (isTrusted(fm)) + return fm; + return new WrappedJavaFileManager(fm); + } + + public FileObject wrap(FileObject fo) { + if (isTrusted(fo)) + return fo; + return new WrappedFileObject(fo); + } + + FileObject unwrap(FileObject fo) { + if (fo instanceof WrappedFileObject) + return ((WrappedFileObject) fo).clientFileObject; + else + return fo; + } + + public JavaFileObject wrap(JavaFileObject fo) { + if (isTrusted(fo)) + return fo; + return new WrappedJavaFileObject(fo); + } + + public Iterable<JavaFileObject> wrapJavaFileObjects(Iterable<? extends JavaFileObject> list) { + List<JavaFileObject> wrapped = new ArrayList<JavaFileObject>(); + for (JavaFileObject fo : list) + wrapped.add(wrap(fo)); + return Collections.unmodifiableList(wrapped); + } + + JavaFileObject unwrap(JavaFileObject fo) { + if (fo instanceof WrappedJavaFileObject) + return ((JavaFileObject) ((WrappedJavaFileObject) fo).clientFileObject); + else + return fo; + } + + <T> DiagnosticListener<T> wrap(DiagnosticListener<T> dl) { + if (isTrusted(dl)) + return dl; + return new WrappedDiagnosticListener<T>(dl); + } + + TaskListener wrap(TaskListener tl) { + if (isTrusted(tl)) + return tl; + return new WrappedTaskListener(tl); + } + + protected boolean isTrusted(Object o) { + Class<?> c = o.getClass(); + Boolean trusted = trustedClasses.get(c); + if (trusted == null) { + trusted = c.getName().startsWith("com.sun.tools.javac.") + || c.isAnnotationPresent(Trusted.class); + trustedClasses.put(c, trusted); + } + return trusted; + } + + // <editor-fold defaultstate="collapsed" desc="Wrapper classes"> + + // FIXME: all these classes should be converted to use multi-catch when + // that is available in the bootstrap compiler. + + protected class WrappedJavaFileManager implements JavaFileManager { + protected JavaFileManager clientJavaFileManager; + WrappedJavaFileManager(JavaFileManager clientJavaFileManager) { + clientJavaFileManager.getClass(); // null check + this.clientJavaFileManager = clientJavaFileManager; + } + + @Override + public ClassLoader getClassLoader(Location location) { + try { + return clientJavaFileManager.getClassLoader(location); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException { + try { + return wrapJavaFileObjects(clientJavaFileManager.list(location, packageName, kinds, recurse)); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public String inferBinaryName(Location location, JavaFileObject file) { + try { + return clientJavaFileManager.inferBinaryName(location, unwrap(file)); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public boolean isSameFile(FileObject a, FileObject b) { + try { + return clientJavaFileManager.isSameFile(unwrap(a), unwrap(b)); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public boolean handleOption(String current, Iterator<String> remaining) { + try { + return clientJavaFileManager.handleOption(current, remaining); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public boolean hasLocation(Location location) { + try { + return clientJavaFileManager.hasLocation(location); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException { + try { + return wrap(clientJavaFileManager.getJavaFileForInput(location, className, kind)); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException { + try { + return wrap(clientJavaFileManager.getJavaFileForOutput(location, className, kind, unwrap(sibling))); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException { + try { + return wrap(clientJavaFileManager.getFileForInput(location, packageName, relativeName)); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + try { + return wrap(clientJavaFileManager.getFileForOutput(location, packageName, relativeName, unwrap(sibling))); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public void flush() throws IOException { + try { + clientJavaFileManager.flush(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public void close() throws IOException { + try { + clientJavaFileManager.close(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public int isSupportedOption(String option) { + try { + return clientJavaFileManager.isSupportedOption(option); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + } + + protected class WrappedFileObject implements FileObject { + protected FileObject clientFileObject; + WrappedFileObject(FileObject clientFileObject) { + clientFileObject.getClass(); // null check + this.clientFileObject = clientFileObject; + } + + @Override + public URI toUri() { + try { + return clientFileObject.toUri(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public String getName() { + try { + return clientFileObject.getName(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public InputStream openInputStream() throws IOException { + try { + return clientFileObject.openInputStream(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public OutputStream openOutputStream() throws IOException { + try { + return clientFileObject.openOutputStream(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public Reader openReader(boolean ignoreEncodingErrors) throws IOException { + try { + return clientFileObject.openReader(ignoreEncodingErrors); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { + try { + return clientFileObject.getCharContent(ignoreEncodingErrors); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public Writer openWriter() throws IOException { + try { + return clientFileObject.openWriter(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public long getLastModified() { + try { + return clientFileObject.getLastModified(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public boolean delete() { + try { + return clientFileObject.delete(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + } + + protected class WrappedJavaFileObject extends WrappedFileObject implements JavaFileObject { + WrappedJavaFileObject(JavaFileObject clientJavaFileObject) { + super(clientJavaFileObject); + } + + @Override + public Kind getKind() { + try { + return ((JavaFileObject)clientFileObject).getKind(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public boolean isNameCompatible(String simpleName, Kind kind) { + try { + return ((JavaFileObject)clientFileObject).isNameCompatible(simpleName, kind); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public NestingKind getNestingKind() { + try { + return ((JavaFileObject)clientFileObject).getNestingKind(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public Modifier getAccessLevel() { + try { + return ((JavaFileObject)clientFileObject).getAccessLevel(); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + } + + protected class WrappedDiagnosticListener<T> implements DiagnosticListener<T> { + protected DiagnosticListener<T> clientDiagnosticListener; + WrappedDiagnosticListener(DiagnosticListener<T> clientDiagnosticListener) { + clientDiagnosticListener.getClass(); // null check + this.clientDiagnosticListener = clientDiagnosticListener; + } + + @Override + public void report(Diagnostic<? extends T> diagnostic) { + try { + clientDiagnosticListener.report(diagnostic); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + } + + protected class WrappedTaskListener implements TaskListener { + protected TaskListener clientTaskListener; + WrappedTaskListener(TaskListener clientTaskListener) { + clientTaskListener.getClass(); // null check + this.clientTaskListener = clientTaskListener; + } + + @Override + public void started(TaskEvent ev) { + try { + clientTaskListener.started(ev); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + + @Override + public void finished(TaskEvent ev) { + try { + clientTaskListener.finished(ev); + } catch (ClientCodeException e) { + throw e; + } catch (RuntimeException e) { + throw new ClientCodeException(e); + } catch (Error e) { + throw new ClientCodeException(e); + } + } + } + + // </editor-fold> +}
--- a/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Thu Jun 02 19:00:16 2011 +0100 @@ -65,7 +65,7 @@ * @author Jonathan Gibbons */ public class JavacTaskImpl extends JavacTask { - private JavacTool tool; + private ClientCodeWrapper ccw; private Main compilerMain; private JavaCompiler compiler; private Locale locale; @@ -80,12 +80,11 @@ private Integer result = null; - JavacTaskImpl(JavacTool tool, - Main compilerMain, + JavacTaskImpl(Main compilerMain, String[] args, Context context, List<JavaFileObject> fileObjects) { - this.tool = tool; + this.ccw = ClientCodeWrapper.instance(context); this.compilerMain = compilerMain; this.args = args; this.context = context; @@ -94,17 +93,15 @@ // null checks compilerMain.getClass(); args.getClass(); - context.getClass(); fileObjects.getClass(); } - JavacTaskImpl(JavacTool tool, - Main compilerMain, + JavacTaskImpl(Main compilerMain, Iterable<String> flags, Context context, Iterable<String> classes, Iterable<? extends JavaFileObject> fileObjects) { - this(tool, compilerMain, toArray(flags, classes), context, toList(fileObjects)); + this(compilerMain, toArray(flags, classes), context, toList(fileObjects)); } static private String[] toArray(Iterable<String> flags, Iterable<String> classes) { @@ -131,7 +128,7 @@ if (!used.getAndSet(true)) { initContext(); notYetEntered = new HashMap<JavaFileObject, JCCompilationUnit>(); - compilerMain.setFatalErrors(true); + compilerMain.setAPIMode(true); result = compilerMain.compile(args, context, fileObjects, processors); cleanup(); return result == 0; @@ -185,31 +182,9 @@ if (context.get(TaskListener.class) != null) context.put(TaskListener.class, (TaskListener)null); if (taskListener != null) - context.put(TaskListener.class, wrap(taskListener)); + context.put(TaskListener.class, ccw.wrap(taskListener)); //initialize compiler's default locale - JavacMessages.instance(context).setCurrentLocale(locale); - } - // where - private TaskListener wrap(final TaskListener tl) { - tl.getClass(); // null check - return new TaskListener() { - public void started(TaskEvent e) { - try { - tl.started(e); - } catch (Throwable t) { - throw new ClientCodeException(t); - } - } - - public void finished(TaskEvent e) { - try { - tl.finished(e); - } catch (Throwable t) { - throw new ClientCodeException(t); - } - } - - }; + context.put(Locale.class, locale); } void cleanup() {
--- a/src/share/classes/com/sun/tools/javac/api/JavacTool.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTool.java Thu Jun 02 19:00:16 2011 +0100 @@ -28,8 +28,10 @@ import java.io.File; import java.io.InputStream; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.EnumSet; @@ -47,12 +49,11 @@ import com.sun.tools.javac.main.Main; import com.sun.tools.javac.main.RecognizedOptions.GrumpyHelper; import com.sun.tools.javac.main.RecognizedOptions; +import com.sun.tools.javac.util.ClientCodeException; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Log; -import com.sun.tools.javac.util.JavacMessages; import com.sun.tools.javac.util.Options; import com.sun.tools.javac.util.Pair; -import java.nio.charset.Charset; /** * TODO: describe com.sun.tools.javac.api.Tool @@ -145,10 +146,13 @@ Locale locale, Charset charset) { Context context = new Context(); - JavacMessages.instance(context).setCurrentLocale(locale); + context.put(Locale.class, locale); if (diagnosticListener != null) context.put(DiagnosticListener.class, diagnosticListener); - context.put(Log.outKey, new PrintWriter(System.err, true)); // FIXME + PrintWriter pw = (charset == null) + ? new PrintWriter(System.err, true) + : new PrintWriter(new OutputStreamWriter(System.err, charset), true); + context.put(Log.outKey, pw); return new JavacFileManager(context, true, charset); } @@ -159,38 +163,45 @@ Iterable<String> classes, Iterable<? extends JavaFileObject> compilationUnits) { - final String kindMsg = "All compilation units must be of SOURCE kind"; - if (options != null) - for (String option : options) - option.getClass(); // null check - if (classes != null) { - for (String cls : classes) - if (!SourceVersion.isName(cls)) // implicit null check - throw new IllegalArgumentException("Not a valid class name: " + cls); - } - if (compilationUnits != null) { - for (JavaFileObject cu : compilationUnits) { - if (cu.getKind() != JavaFileObject.Kind.SOURCE) // implicit null check - throw new IllegalArgumentException(kindMsg); - } - } + try { + Context context = new Context(); + ClientCodeWrapper ccw = ClientCodeWrapper.instance(context); - Context context = new Context(); - - if (diagnosticListener != null) - context.put(DiagnosticListener.class, diagnosticListener); + final String kindMsg = "All compilation units must be of SOURCE kind"; + if (options != null) + for (String option : options) + option.getClass(); // null check + if (classes != null) { + for (String cls : classes) + if (!SourceVersion.isName(cls)) // implicit null check + throw new IllegalArgumentException("Not a valid class name: " + cls); + } + if (compilationUnits != null) { + compilationUnits = ccw.wrapJavaFileObjects(compilationUnits); // implicit null check + for (JavaFileObject cu : compilationUnits) { + if (cu.getKind() != JavaFileObject.Kind.SOURCE) + throw new IllegalArgumentException(kindMsg); + } + } - if (out == null) - context.put(Log.outKey, new PrintWriter(System.err, true)); - else - context.put(Log.outKey, new PrintWriter(out, true)); + if (diagnosticListener != null) + context.put(DiagnosticListener.class, ccw.wrap(diagnosticListener)); + + if (out == null) + context.put(Log.outKey, new PrintWriter(System.err, true)); + else + context.put(Log.outKey, new PrintWriter(out, true)); - if (fileManager == null) - fileManager = getStandardFileManager(diagnosticListener, null, null); - context.put(JavaFileManager.class, fileManager); - processOptions(context, fileManager, options); - Main compiler = new Main("javacTask", context.get(Log.outKey)); - return new JavacTaskImpl(this, compiler, options, context, classes, compilationUnits); + if (fileManager == null) + fileManager = getStandardFileManager(diagnosticListener, null, null); + fileManager = ccw.wrap(fileManager); + context.put(JavaFileManager.class, fileManager); + processOptions(context, fileManager, options); + Main compiler = new Main("javacTask", context.get(Log.outKey)); + return new JavacTaskImpl(compiler, options, context, classes, compilationUnits); + } catch (ClientCodeException ex) { + throw new RuntimeException(ex.getCause()); + } } private static void processOptions(Context context,
--- a/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -34,11 +34,13 @@ import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.tools.Diagnostic; import javax.tools.JavaCompiler; import javax.tools.JavaFileObject; +import com.sun.source.tree.CatchTree; import com.sun.source.tree.CompilationUnitTree; import com.sun.source.tree.Scope; import com.sun.source.tree.Tree; @@ -49,7 +51,7 @@ import com.sun.tools.javac.code.Symbol.ClassSymbol; import com.sun.tools.javac.code.Symbol.TypeSymbol; import com.sun.tools.javac.code.Symbol; -import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Type.UnionClassType; import com.sun.tools.javac.comp.Attr; import com.sun.tools.javac.comp.AttrContext; import com.sun.tools.javac.comp.Enter; @@ -430,4 +432,16 @@ log.useSource(oldSource); } } + + @Override + public TypeMirror getLub(CatchTree tree) { + JCCatch ct = (JCCatch) tree; + JCVariableDecl v = ct.param; + if (v.type != null && v.type.getKind() == TypeKind.UNION) { + UnionClassType ut = (UnionClassType) v.type; + return ut.getLub(); + } else { + return v.type; + } + } }
--- a/src/share/classes/com/sun/tools/javac/code/Flags.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Flags.java Thu Jun 02 19:00:16 2011 +0100 @@ -231,9 +231,9 @@ public static final long PROPRIETARY = 1L<<38; /** - * Flag that marks a disjunction var in a multi-catch clause + * Flag that marks a a multi-catch parameter */ - public static final long DISJUNCTION = 1L<<39; + public static final long UNION = 1L<<39; /** * Flag that marks a signature-polymorphic invoke method.
--- a/src/share/classes/com/sun/tools/javac/code/Scope.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Scope.java Thu Jun 02 19:00:16 2011 +0100 @@ -649,7 +649,7 @@ public Iterator<Symbol> iterator() { return new CompoundScopeIterator(subScopes) { Iterator<Symbol> nextIterator(Scope s) { - return s.getElements().iterator(); + return s.getElements(sf).iterator(); } }; }
--- a/src/share/classes/com/sun/tools/javac/code/Source.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Source.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, 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 @@ -186,6 +186,9 @@ public boolean allowSimplifiedVarargs() { return compareTo(JDK1_7) >= 0; } + public boolean allowObjectToPrimitiveCast() { + return compareTo(JDK1_7) >= 0; + } public static SourceVersion toSourceVersion(Source source) { switch(source) { case JDK1_2:
--- a/src/share/classes/com/sun/tools/javac/code/Symbol.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java Thu Jun 02 19:00:16 2011 +0100 @@ -1006,7 +1006,6 @@ try { data = eval.call(); } catch (Exception ex) { - ex.printStackTrace(); throw new AssertionError(ex); } } @@ -1193,7 +1192,7 @@ } private boolean isOverridableIn(TypeSymbol origin) { - // JLS3 8.4.6.1 + // JLS 8.4.6.1 switch ((int)(flags_field & Flags.AccessFlags)) { case Flags.PRIVATE: return false;
--- a/src/share/classes/com/sun/tools/javac/code/Symtab.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java Thu Jun 02 19:00:16 2011 +0100 @@ -125,12 +125,11 @@ public final Type stringBuilderType; public final Type cloneableType; public final Type serializableType; - public final Type transientMethodHandleType; // transient - 292 public final Type methodHandleType; - public final Type transientPolymorphicSignatureType; // transient - 292 public final Type polymorphicSignatureType; public final Type throwableType; public final Type errorType; + public final Type interruptedExceptionType; public final Type illegalArgumentExceptionType; public final Type exceptionType; public final Type runtimeExceptionType; @@ -435,12 +434,11 @@ cloneableType = enterClass("java.lang.Cloneable"); throwableType = enterClass("java.lang.Throwable"); serializableType = enterClass("java.io.Serializable"); - transientMethodHandleType = enterClass("java.dyn.MethodHandle"); // transient - 292 methodHandleType = enterClass("java.lang.invoke.MethodHandle"); - transientPolymorphicSignatureType = enterClass("java.dyn.MethodHandle$PolymorphicSignature"); // transient - 292 polymorphicSignatureType = enterClass("java.lang.invoke.MethodHandle$PolymorphicSignature"); errorType = enterClass("java.lang.Error"); illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException"); + interruptedExceptionType = enterClass("java.lang.InterruptedException"); exceptionType = enterClass("java.lang.Exception"); runtimeExceptionType = enterClass("java.lang.RuntimeException"); classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException"); @@ -480,9 +478,9 @@ autoCloseableType.tsym); trustMeType = enterClass("java.lang.SafeVarargs"); + synthesizeEmptyInterfaceIfMissing(autoCloseableType); synthesizeEmptyInterfaceIfMissing(cloneableType); synthesizeEmptyInterfaceIfMissing(serializableType); - synthesizeEmptyInterfaceIfMissing(transientPolymorphicSignatureType); // transient - 292 synthesizeEmptyInterfaceIfMissing(polymorphicSignatureType); synthesizeBoxTypeIfMissing(doubleType); synthesizeBoxTypeIfMissing(floatType);
--- a/src/share/classes/com/sun/tools/javac/code/Type.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Type.java Thu Jun 02 19:00:16 2011 +0100 @@ -25,6 +25,8 @@ package com.sun.tools.javac.code; +import java.util.Collections; + import com.sun.tools.javac.util.*; import com.sun.tools.javac.code.Symbol.*; @@ -741,6 +743,38 @@ } } + // a clone of a ClassType that knows about the alternatives of a union type. + public static class UnionClassType extends ClassType implements UnionType { + final List<? extends Type> alternatives_field; + + public UnionClassType(ClassType ct, List<? extends Type> alternatives) { + super(ct.outer_field, ct.typarams_field, ct.tsym); + allparams_field = ct.allparams_field; + supertype_field = ct.supertype_field; + interfaces_field = ct.interfaces_field; + all_interfaces_field = ct.interfaces_field; + alternatives_field = alternatives; + } + + public Type getLub() { + return tsym.type; + } + + public java.util.List<? extends TypeMirror> getAlternatives() { + return Collections.unmodifiableList(alternatives_field); + } + + @Override + public TypeKind getKind() { + return TypeKind.UNION; + } + + @Override + public <R, P> R accept(TypeVisitor<R, P> v, P p) { + return v.visitUnion(this, p); + } + } + public static class ArrayType extends Type implements javax.lang.model.type.ArrayType {
--- a/src/share/classes/com/sun/tools/javac/code/Types.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java Thu Jun 02 19:00:16 2011 +0100 @@ -74,8 +74,9 @@ final JavacMessages messages; final Names names; final boolean allowBoxing; + final boolean allowCovariantReturns; + final boolean allowObjectToPrimitiveCast; final ClassReader reader; - final Source source; final Check chk; List<Warner> warnStack = List.nil(); final Name capturedName; @@ -92,9 +93,11 @@ context.put(typesKey, this); syms = Symtab.instance(context); names = Names.instance(context); - allowBoxing = Source.instance(context).allowBoxing(); + Source source = Source.instance(context); + allowBoxing = source.allowBoxing(); + allowCovariantReturns = source.allowCovariantReturns(); + allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast(); reader = ClassReader.instance(context); - source = Source.instance(context); chk = Check.instance(context); capturedName = names.fromString("<captured wildcard>"); messages = JavacMessages.instance(context); @@ -409,6 +412,7 @@ return s.tag == BOT || s.tag == CLASS || s.tag == ARRAY || s.tag == TYPEVAR; + case WILDCARD: //we shouldn't be here - avoids crash (see 7034495) case NONE: return false; default: @@ -949,8 +953,11 @@ return true; if (t.isPrimitive() != s.isPrimitive()) - return allowBoxing && (isConvertible(t, s, warn) || isConvertible(s, t, warn)); - + return allowBoxing && ( + isConvertible(t, s, warn) + || (allowObjectToPrimitiveCast && + s.isPrimitive() && + isSubtype(boxedClass(s).type, t))); if (warn != warnStack.head) { try { warnStack = warnStack.prepend(warn); @@ -1985,7 +1992,7 @@ * signature</em> of the other. This is <b>not</b> an equivalence * relation. * - * @see "The Java Language Specification, Third Ed. (8.4.2)." + * @jls section 8.4.2. * @see #overrideEquivalent(Type t, Type s) * @param t first signature (possibly raw). * @param s second signature (could be subjected to erasure). @@ -2004,7 +2011,7 @@ * equivalence</em>. This is the natural extension of * isSubSignature to an equivalence relation. * - * @see "The Java Language Specification, Third Ed. (8.4.2)." + * @jls section 8.4.2. * @see #isSubSignature(Type t, Type s) * @param t a signature (possible raw, could be subjected to * erasure). @@ -2461,6 +2468,22 @@ } }; + public Type createMethodTypeWithReturn(Type original, Type newReturn) { + return original.accept(methodWithReturn, newReturn); + } + // where + private final MapVisitor<Type> methodWithReturn = new MapVisitor<Type>() { + public Type visitType(Type t, Type newReturn) { + throw new IllegalArgumentException("Not a method type: " + t); + } + public Type visitMethodType(MethodType t, Type newReturn) { + return new MethodType(t.argtypes, newReturn, t.thrown, t.tsym); + } + public Type visitForAll(ForAll t, Type newReturn) { + return new ForAll(t.tvars, t.qtype.accept(this, newReturn)); + } + }; + // <editor-fold defaultstate="collapsed" desc="createErrorType"> public Type createErrorType(Type originalType) { return new ErrorType(originalType, syms.errSymbol); @@ -3033,8 +3056,7 @@ /** * Return-Type-Substitutable. - * @see <a href="http://java.sun.com/docs/books/jls/">The Java - * Language Specification, Third Ed. (8.4.5)</a> + * @jls section 8.4.5 */ public boolean returnTypeSubstitutable(Type r1, Type r2) { if (hasSameArgs(r1, r2)) @@ -3055,7 +3077,7 @@ if (hasSameArgs(r1, r2)) return covariantReturnType(r1.getReturnType(), r2res, warner); - if (!source.allowCovariantReturns()) + if (!allowCovariantReturns) return false; if (isSubtypeUnchecked(r1.getReturnType(), r2res, warner)) return true; @@ -3072,7 +3094,7 @@ public boolean covariantReturnType(Type t, Type s, Warner warner) { return isSameType(t, s) || - source.allowCovariantReturns() && + allowCovariantReturns && !t.isPrimitive() && !s.isPrimitive() && isAssignable(t, s, warner); @@ -3114,7 +3136,7 @@ // <editor-fold defaultstate="collapsed" desc="Capture conversion"> /* - * JLS 3rd Ed. 5.1.10 Capture Conversion: + * JLS 5.1.10 Capture Conversion: * * Let G name a generic type declaration with n formal type * parameters A1 ... An with corresponding bounds U1 ... Un. There @@ -3147,7 +3169,7 @@ * Capture conversion is not applied recursively. */ /** - * Capture conversion as specified by JLS 3rd Ed. + * Capture conversion as specified by the JLS. */ public List<Type> capture(List<Type> ts) { @@ -3278,7 +3300,7 @@ } if (giveWarning && !isReifiable(reverse ? from : to)) warn.warn(LintCategory.UNCHECKED); - if (!source.allowCovariantReturns()) + if (!allowCovariantReturns) // reject if there is a common method signature with // incompatible return types. chk.checkCompatibleAbstracts(warn.pos(), from, to); @@ -3305,7 +3327,7 @@ Type t2 = to; if (disjointTypes(t1.getTypeArguments(), t2.getTypeArguments())) return false; - if (!source.allowCovariantReturns()) + if (!allowCovariantReturns) // reject if there is a common method signature with // incompatible return types. chk.checkCompatibleAbstracts(warn.pos(), from, to);
--- a/src/share/classes/com/sun/tools/javac/comp/Annotate.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Annotate.java Thu Jun 02 19:00:16 2011 +0100 @@ -168,11 +168,11 @@ } JCIdent left = (JCIdent)assign.lhs; Symbol method = rs.resolveQualifiedMethod(left.pos(), - env, - a.type, - left.name, - List.<Type>nil(), - null); + env, + a.type, + left.name, + List.<Type>nil(), + null); left.sym = method; left.type = method.type; if (method.owner != a.type.tsym) @@ -190,6 +190,15 @@ Attribute enterAttributeValue(Type expected, JCExpression tree, Env<AttrContext> env) { + //first, try completing the attribution value sym - if a completion + //error is thrown, we should recover gracefully, and display an + //ordinary resolution diagnostic. + try { + expected.tsym.complete(); + } catch(CompletionFailure e) { + log.error(tree.pos(), "cant.resolve", Kinds.kindName(e.sym), e.sym); + return new Attribute.Error(expected); + } if (expected.isPrimitive() || types.isSameType(expected, syms.stringType)) { Type result = attr.attribExpr(tree, env, expected); if (result.isErroneous())
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Jun 02 19:00:16 2011 +0100 @@ -1089,6 +1089,10 @@ if (resource.getTag() == JCTree.VARDEF) { attribStat(resource, tryEnv); chk.checkType(resource, resource.type, syms.autoCloseableType, "try.not.applicable.to.type"); + + //check that resource type cannot throw InterruptedException + checkAutoCloseable(resource.pos(), localEnv, resource.type); + VarSymbol var = (VarSymbol)TreeInfo.symbolFor(resource); var.setData(ElementKind.RESOURCE_VARIABLE); } else { @@ -1108,7 +1112,7 @@ Type ctype = attribStat(c.param, catchEnv); if (TreeInfo.isMultiCatch(c)) { //multi-catch parameter is implicitly marked as final - c.param.sym.flags_field |= FINAL | DISJUNCTION; + c.param.sym.flags_field |= FINAL | UNION; } if (c.param.sym.kind == Kinds.VAR) { c.param.sym.setData(ElementKind.EXCEPTION_PARAMETER); @@ -1127,6 +1131,35 @@ result = null; } + void checkAutoCloseable(DiagnosticPosition pos, Env<AttrContext> env, Type resource) { + if (!resource.isErroneous() && + types.asSuper(resource, syms.autoCloseableType.tsym) != null) { + Symbol close = syms.noSymbol; + boolean prevDeferDiags = log.deferDiagnostics; + Queue<JCDiagnostic> prevDeferredDiags = log.deferredDiagnostics; + try { + log.deferDiagnostics = true; + log.deferredDiagnostics = ListBuffer.lb(); + close = rs.resolveQualifiedMethod(pos, + env, + resource, + names.close, + List.<Type>nil(), + List.<Type>nil()); + } + finally { + log.deferDiagnostics = prevDeferDiags; + log.deferredDiagnostics = prevDeferredDiags; + } + if (close.kind == MTH && + close.overrides(syms.autoCloseableClose, resource.tsym, types, true) && + chk.isHandled(syms.interruptedExceptionType, types.memberType(resource, close).getThrownTypes()) && + env.info.lint.isEnabled(LintCategory.TRY)) { + log.warning(LintCategory.TRY, pos, "try.resource.throws.interrupted.exc", resource); + } + } + } + public void visitConditional(JCConditional tree) { attribExpr(tree.cond, env, syms.booleanType); attribExpr(tree.truepart, env); @@ -1580,7 +1613,7 @@ // Attribute clazz expression and store // symbol + type back into the attributed tree. Type clazztype = attribType(clazz, env); - Pair<Scope,Scope> mapping = getSyntheticScopeMapping(clazztype, cdef != null); + Pair<Scope,Scope> mapping = getSyntheticScopeMapping(clazztype); clazztype = chk.checkDiamond(tree, clazztype); chk.validate(clazz, localEnv); if (tree.encl != null) { @@ -1675,20 +1708,24 @@ // that we are referring to a superclass instance of the // current instance (JLS ???). else { - localEnv.info.selectSuper = cdef != null; - localEnv.info.varArgs = false; + //the following code alters some of the fields in the current + //AttrContext - hence, the current context must be dup'ed in + //order to avoid downstream failures + Env<AttrContext> rsEnv = localEnv.dup(tree); + rsEnv.info.selectSuper = cdef != null; + rsEnv.info.varArgs = false; tree.constructor = rs.resolveConstructor( - tree.pos(), localEnv, clazztype, argtypes, typeargtypes); + tree.pos(), rsEnv, clazztype, argtypes, typeargtypes); tree.constructorType = tree.constructor.type.isErroneous() ? syms.errType : checkMethod(clazztype, tree.constructor, - localEnv, + rsEnv, tree.args, argtypes, typeargtypes, - localEnv.info.varArgs); - if (localEnv.info.varArgs) + rsEnv.info.varArgs); + if (rsEnv.info.varArgs) Assert.check(tree.constructorType.isErroneous() || tree.varargsElement != null); } @@ -1746,9 +1783,10 @@ // Reassign clazztype and recompute constructor. clazztype = cdef.sym.type; + boolean useVarargs = tree.varargsElement != null; Symbol sym = rs.resolveConstructor( tree.pos(), localEnv, clazztype, argtypes, - typeargtypes, true, tree.varargsElement != null); + typeargtypes, true, useVarargs); Assert.check(sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous()); tree.constructor = sym; if (tree.constructor.kind > ERRONEOUS) { @@ -1761,7 +1799,7 @@ tree.args, argtypes, typeargtypes, - localEnv.info.varArgs); + useVarargs); } } @@ -1778,62 +1816,48 @@ Pair<Scope, Scope> mapping, List<Type> argtypes, List<Type> typeargtypes) { - if (clazztype.isErroneous() || mapping == erroneousMapping) { + if (clazztype.isErroneous() || + clazztype.isInterface() || + mapping == erroneousMapping) { //if the type of the instance creation expression is erroneous, - //or something prevented us to form a valid mapping, return the - //(possibly erroneous) type unchanged + //or if it's an interface, or if something prevented us to form a valid + //mapping, return the (possibly erroneous) type unchanged return clazztype; } - else if (clazztype.isInterface()) { - //if the type of the instance creation expression is an interface - //skip the method resolution step (JLS 15.12.2.7). The type to be - //inferred is of the kind <X1,X2, ... Xn>C<X1,X2, ... Xn> - clazztype = new ForAll(clazztype.tsym.type.allparams(), clazztype.tsym.type) { - @Override - public List<Type> getConstraints(TypeVar tv, ConstraintKind ck) { - switch (ck) { - case EXTENDS: return types.getBounds(tv); - default: return List.nil(); - } - } - @Override - public Type inst(List<Type> inferred, Types types) throws Infer.NoInstanceException { - // check that inferred bounds conform to their bounds - infer.checkWithinBounds(tvars, - types.subst(tvars, tvars, inferred), Warner.noWarnings); - return super.inst(inferred, types); - } - }; + + //dup attribution environment and augment the set of inference variables + Env<AttrContext> localEnv = env.dup(tree); + localEnv.info.tvars = clazztype.tsym.type.getTypeArguments(); + + //if the type of the instance creation expression is a class type + //apply method resolution inference (JLS 15.12.2.7). The return type + //of the resolved constructor will be a partially instantiated type + ((ClassSymbol) clazztype.tsym).members_field = mapping.snd; + Symbol constructor; + try { + constructor = rs.resolveDiamond(tree.pos(), + localEnv, + clazztype.tsym.type, + argtypes, + typeargtypes); + } finally { + ((ClassSymbol) clazztype.tsym).members_field = mapping.fst; + } + if (constructor.kind == MTH) { + ClassType ct = new ClassType(clazztype.getEnclosingType(), + clazztype.tsym.type.getTypeArguments(), + clazztype.tsym); + clazztype = checkMethod(ct, + constructor, + localEnv, + tree.args, + argtypes, + typeargtypes, + localEnv.info.varArgs).getReturnType(); } else { - //if the type of the instance creation expression is a class type - //apply method resolution inference (JLS 15.12.2.7). The return type - //of the resolved constructor will be a partially instantiated type - ((ClassSymbol) clazztype.tsym).members_field = mapping.snd; - Symbol constructor; - try { - constructor = rs.resolveDiamond(tree.pos(), - env, - clazztype.tsym.type, - argtypes, - typeargtypes); - } finally { - ((ClassSymbol) clazztype.tsym).members_field = mapping.fst; - } - if (constructor.kind == MTH) { - ClassType ct = new ClassType(clazztype.getEnclosingType(), - clazztype.tsym.type.getTypeArguments(), - clazztype.tsym); - clazztype = checkMethod(ct, - constructor, - env, - tree.args, - argtypes, - typeargtypes, - env.info.varArgs).getReturnType(); - } else { - clazztype = syms.errType; - } + clazztype = syms.errType; } + if (clazztype.tag == FORALL && !pt.isErroneous()) { //if the resolved constructor's return type has some uninferred //type-variables, infer them using the expected type and declared @@ -1863,34 +1887,28 @@ * inference. The inferred return type of the synthetic constructor IS * the inferred type for the diamond operator. */ - private Pair<Scope, Scope> getSyntheticScopeMapping(Type ctype, boolean overrideProtectedAccess) { + private Pair<Scope, Scope> getSyntheticScopeMapping(Type ctype) { if (ctype.tag != CLASS) { return erroneousMapping; } + Pair<Scope, Scope> mapping = new Pair<Scope, Scope>(ctype.tsym.members(), new Scope(ctype.tsym)); - List<Type> typevars = ctype.tsym.type.getTypeArguments(); + + //for each constructor in the original scope, create a synthetic constructor + //whose return type is the type of the class in which the constructor is + //declared, and insert it into the new scope. for (Scope.Entry e = mapping.fst.lookup(names.init); e.scope != null; e = e.next()) { - MethodSymbol newConstr = (MethodSymbol) e.sym.clone(ctype.tsym); - if (overrideProtectedAccess && (newConstr.flags() & PROTECTED) != 0) { - //make protected constructor public (this is required for - //anonymous inner class creation expressions using diamond) - newConstr.flags_field |= PUBLIC; - newConstr.flags_field &= ~PROTECTED; - } - newConstr.name = names.init; - List<Type> oldTypeargs = List.nil(); - if (newConstr.type.tag == FORALL) { - oldTypeargs = ((ForAll) newConstr.type).tvars; - } - newConstr.type = new MethodType(newConstr.type.getParameterTypes(), - new ClassType(ctype.getEnclosingType(), ctype.tsym.type.getTypeArguments(), ctype.tsym), - newConstr.type.getThrownTypes(), - syms.methodClass); - newConstr.type = new ForAll(typevars.prependList(oldTypeargs), newConstr.type); - mapping.snd.enter(newConstr); + Type synthRestype = new ClassType(ctype.getEnclosingType(), + ctype.tsym.type.getTypeArguments(), + ctype.tsym); + MethodSymbol synhConstr = new MethodSymbol(e.sym.flags(), + names.init, + types.createMethodTypeWithReturn(e.sym.type, synthRestype), + e.sym.owner); + mapping.snd.enter(synhConstr); } return mapping; } @@ -2276,6 +2294,7 @@ sitesym.kind == VAR && ((VarSymbol)sitesym).isResourceVariable() && sym.kind == MTH && + sym.name.equals(names.close) && sym.overrides(syms.autoCloseableClose, sitesym.type.tsym, types, true) && env.info.lint.isEnabled(LintCategory.TRY)) { log.warning(LintCategory.TRY, tree, "try.explicit.close.call"); @@ -2618,10 +2637,10 @@ * @param tree The tree making up the variable reference. * @param env The current environment. * @param v The variable's symbol. - * @see JLS 3rd Ed. (8.9 Enums) + * @jls section 8.9 Enums */ private void checkEnumInitializer(JCTree tree, Env<AttrContext> env, VarSymbol v) { - // JLS 3rd Ed.: + // JLS: // // "It is a compile-time error to reference a static field // of an enum type that is not a compile-time constant @@ -2894,16 +2913,47 @@ result = check(tree, owntype, TYP, pkind, pt); } - public void visitTypeDisjunction(JCTypeDisjunction tree) { + public void visitTypeUnion(JCTypeUnion tree) { ListBuffer<Type> multicatchTypes = ListBuffer.lb(); + ListBuffer<Type> all_multicatchTypes = null; // lazy, only if needed for (JCExpression typeTree : tree.alternatives) { Type ctype = attribType(typeTree, env); ctype = chk.checkType(typeTree.pos(), chk.checkClassType(typeTree.pos(), ctype), syms.throwableType); - multicatchTypes.append(ctype); + if (!ctype.isErroneous()) { + //check that alternatives of a union type are pairwise + //unrelated w.r.t. subtyping + if (chk.intersects(ctype, multicatchTypes.toList())) { + for (Type t : multicatchTypes) { + boolean sub = types.isSubtype(ctype, t); + boolean sup = types.isSubtype(t, ctype); + if (sub || sup) { + //assume 'a' <: 'b' + Type a = sub ? ctype : t; + Type b = sub ? t : ctype; + log.error(typeTree.pos(), "multicatch.types.must.be.disjoint", a, b); + } + } + } + multicatchTypes.append(ctype); + if (all_multicatchTypes != null) + all_multicatchTypes.append(ctype); + } else { + if (all_multicatchTypes == null) { + all_multicatchTypes = ListBuffer.lb(); + all_multicatchTypes.appendList(multicatchTypes); + } + all_multicatchTypes.append(ctype); + } } - tree.type = result = check(tree, types.lub(multicatchTypes.toList()), TYP, pkind, pt); + Type t = check(tree, types.lub(multicatchTypes.toList()), TYP, pkind, pt); + if (t.tag == CLASS) { + List<Type> alternatives = + ((all_multicatchTypes == null) ? multicatchTypes : all_multicatchTypes).toList(); + t = new UnionClassType((ClassType) t, alternatives); + } + tree.type = result = t; } public void visitTypeParameter(JCTypeParameter tree) { @@ -3173,6 +3223,9 @@ // method conform to the method they implement. chk.checkImplementations(tree); + //check that a resource implementing AutoCloseable cannot throw InterruptedException + checkAutoCloseable(tree.pos(), env, c.type); + for (List<JCTree> l = tree.defs; l.nonEmpty(); l = l.tail) { // Attribute declaration attribStat(l.head, env);
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Jun 02 19:00:16 2011 +0100 @@ -676,11 +676,17 @@ "cant.apply.diamond.1", t, diags.fragment("diamond.and.anon.class", t)); return types.createErrorType(t); - } else if (!t.tsym.type.isParameterized()) { + } else if (t.tsym.type.getTypeArguments().isEmpty()) { log.error(tree.clazz.pos(), "cant.apply.diamond.1", t, diags.fragment("diamond.non.generic", t)); return types.createErrorType(t); + } else if (tree.typeargs != null && + tree.typeargs.nonEmpty()) { + log.error(tree.clazz.pos(), + "cant.apply.diamond.1", + t, diags.fragment("diamond.and.explicit.params", t)); + return types.createErrorType(t); } else { return t; } @@ -2271,7 +2277,7 @@ * that of any public or protected method declared in class Object * or in the interface annotation.Annotation." * - * @jls3 9.6 Annotation Types + * @jls 9.6 Annotation Types */ void validateAnnotationMethod(DiagnosticPosition pos, MethodSymbol m) { for (Type sup = syms.annotationType; sup.tag == CLASS; sup = types.supertype(sup)) {
--- a/src/share/classes/com/sun/tools/javac/comp/Enter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Enter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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
--- a/src/share/classes/com/sun/tools/javac/comp/Flow.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java Thu Jun 02 19:00:16 2011 +0100 @@ -51,7 +51,7 @@ * unassignment analysis ensures that no final variable is assigned * more than once. * - * <p>The second edition of the JLS has a number of problems in the + * <p>The JLS has a number of problems in the * specification of these flow analysis problems. This implementation * attempts to address those issues. * @@ -126,7 +126,7 @@ * don't have to worry about the return expression because this * concept is only used for construcrors. * - * <p>There is no spec in JLS2 for when a variable is definitely + * <p>There is no spec in the JLS for when a variable is definitely * assigned at the end of a constructor, which is needed for final * fields (8.3.1.2). We implement the rule that V is DA at the end * of the constructor iff it is DA and the end of the body of the @@ -381,7 +381,7 @@ if (sym.adr >= firstadr && trackable(sym)) { if ((sym.flags() & FINAL) != 0) { if ((sym.flags() & PARAMETER) != 0) { - if ((sym.flags() & DISJUNCTION) != 0) { //multi-catch parameter + if ((sym.flags() & UNION) != 0) { //multi-catch parameter log.error(pos, "multicatch.parameter.may.not.be.assigned", sym); } @@ -1003,7 +1003,7 @@ thrown = List.nil(); for (List<JCCatch> l = tree.catchers; l.nonEmpty(); l = l.tail) { List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ? - ((JCTypeDisjunction)l.head.param.vartype).alternatives : + ((JCTypeUnion)l.head.param.vartype).alternatives : List.of(l.head.param.vartype); for (JCExpression ct : subClauses) { caught = chk.incl(ct.type, caught); @@ -1075,7 +1075,7 @@ alive = true; JCVariableDecl param = l.head.param; List<JCExpression> subClauses = TreeInfo.isMultiCatch(l.head) ? - ((JCTypeDisjunction)l.head.param.vartype).alternatives : + ((JCTypeUnion)l.head.param.vartype).alternatives : List.of(l.head.param.vartype); List<Type> ctypes = List.nil(); List<Type> rethrownTypes = chk.diff(thrownInTry, caughtInTry); @@ -1153,8 +1153,7 @@ if (chk.subset(exc, caughtInTry)) { log.error(pos, "except.already.caught", exc); } else if (!chk.isUnchecked(pos, exc) && - exc.tsym != syms.throwableType.tsym && - exc.tsym != syms.exceptionType.tsym && + !isExceptionOrThrowable(exc) && !chk.intersects(exc, thrownInTry)) { log.error(pos, "except.never.thrown.in.try", exc); } else if (allowImprovedCatchAnalysis) { @@ -1163,7 +1162,8 @@ // unchecked exception, the result list would not be empty, as the augmented // thrown set includes { RuntimeException, Error }; if 'exc' was a checked // exception, that would have been covered in the branch above - if (chk.diff(catchableThrownTypes, caughtInTry).isEmpty()) { + if (chk.diff(catchableThrownTypes, caughtInTry).isEmpty() && + !isExceptionOrThrowable(exc)) { String key = catchableThrownTypes.length() == 1 ? "unreachable.catch" : "unreachable.catch.1"; @@ -1171,6 +1171,12 @@ } } } + //where + private boolean isExceptionOrThrowable(Type exc) { + return exc.tsym == syms.throwableType.tsym || + exc.tsym == syms.exceptionType.tsym; + } + public void visitConditional(JCConditional tree) { scanCond(tree.cond);
--- a/src/share/classes/com/sun/tools/javac/comp/Infer.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java Thu Jun 02 19:00:16 2011 +0100 @@ -407,9 +407,7 @@ // for varargs arguments as well if (useVarargs) { - //note: if applicability check is triggered by most specific test, - //the last argument of a varargs is _not_ an array type (see JLS 15.12.2.5) - Type elemType = types.elemtypeOrType(varargsFormal); + Type elemType = types.elemtype(varargsFormal); Type elemUndet = types.subst(elemType, tvars, undetvars); while (actuals.nonEmpty()) { Type actual = actuals.head.baseType();
--- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Thu Jun 02 19:00:16 2011 +0100 @@ -788,8 +788,7 @@ // Internally to java.lang.invoke, a @PolymorphicSignature annotation // acts like a classfile attribute. if (!c.type.isErroneous() && - (types.isSameType(c.type, syms.polymorphicSignatureType) || - types.isSameType(c.type, syms.transientPolymorphicSignatureType))) { + types.isSameType(c.type, syms.polymorphicSignatureType)) { if (!target.hasMethodHandles()) { // Somebody is compiling JDK7 source code to a JDK6 target. // Make it an error, since it is unlikely but important.
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Jun 02 19:00:16 2011 +0100 @@ -338,11 +338,15 @@ // tvars is the list of formal type variables for which type arguments // need to inferred. - List<Type> tvars = env.info.tvars; + List<Type> tvars = null; + if (env.info.tvars != null) { + tvars = types.newInstances(env.info.tvars); + mt = types.subst(mt, env.info.tvars, tvars); + } if (typeargtypes == null) typeargtypes = List.nil(); if (mt.tag != FORALL && typeargtypes.nonEmpty()) { // This is not a polymorphic method, but typeargs are supplied - // which is fine, see JLS3 15.12.2.1 + // which is fine, see JLS 15.12.2.1 } else if (mt.tag == FORALL && typeargtypes.nonEmpty()) { ForAll pmt = (ForAll) mt; if (typeargtypes.length() != pmt.tvars.length()) @@ -454,9 +458,7 @@ throw inapplicableMethodException.setMessage("arg.length.mismatch"); // not enough args if (useVarargs) { - //note: if applicability check is triggered by most specific test, - //the last argument of a varargs is _not_ an array type (see JLS 15.12.2.5) - Type elt = types.elemtypeOrType(varargsFormal); + Type elt = types.elemtype(varargsFormal); while (argtypes.nonEmpty()) { if (!types.isConvertible(argtypes.head, elt, warn)) throw inapplicableMethodException.setMessage("varargs.argument.mismatch", @@ -766,12 +768,9 @@ return ambiguityError(m1, m2); // both abstract, neither overridden; merge throws clause and result type Symbol mostSpecific; - Type result2 = mt2.getReturnType(); - if (mt2.tag == FORALL) - result2 = types.subst(result2, ((ForAll)mt2).tvars, ((ForAll)mt1).tvars); - if (types.isSubtype(mt1.getReturnType(), result2)) + if (types.returnTypeSubstitutable(mt1, mt2)) mostSpecific = m1; - else if (types.isSubtype(result2, mt1.getReturnType())) + else if (types.returnTypeSubstitutable(mt2, mt1)) mostSpecific = m2; else { // Theoretically, this can't happen, but it is possible @@ -818,10 +817,10 @@ private boolean signatureMoreSpecific(Env<AttrContext> env, Type site, Symbol m1, Symbol m2, boolean allowBoxing, boolean useVarargs) { noteWarner.clear(); Type mtype1 = types.memberType(site, adjustVarargs(m1, m2, useVarargs)); - return (instantiate(env, site, adjustVarargs(m2, m1, useVarargs), types.lowerBoundArgtypes(mtype1), null, - allowBoxing, false, noteWarner) != null || - useVarargs && instantiate(env, site, adjustVarargs(m2, m1, useVarargs), types.lowerBoundArgtypes(mtype1), null, - allowBoxing, true, noteWarner) != null) && + Type mtype2 = instantiate(env, site, adjustVarargs(m2, m1, useVarargs), + types.lowerBoundArgtypes(mtype1), null, + allowBoxing, false, noteWarner); + return mtype2 != null && !noteWarner.hasLint(Lint.LintCategory.UNCHECKED); } //where @@ -854,7 +853,7 @@ //append varargs element type as last synthetic formal args.append(types.elemtype(varargsTypeTo)); Type mtype = types.createMethodTypeWithParameters(to.type, args.toList()); - return new MethodSymbol(to.flags_field, to.name, mtype, to.owner); + return new MethodSymbol(to.flags_field & ~VARARGS, to.name, mtype, to.owner); } else { return to; } @@ -1768,7 +1767,7 @@ /** * Resolve an appropriate implicit this instance for t's container. - * JLS2 8.8.5.1 and 15.9.2 + * JLS 8.8.5.1 and 15.9.2 */ Type resolveImplicitThis(DiagnosticPosition pos, Env<AttrContext> env, Type t) { return resolveImplicitThis(pos, env, t, false);
--- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Thu Jun 02 19:00:16 2011 +0100 @@ -1162,6 +1162,9 @@ ClassSymbol c = readClassSymbol(nextChar()); NameAndType nt = (NameAndType)readPool(nextChar()); + if (c.members_field == null) + throw badClassFile("bad.enclosing.class", self, c); + MethodSymbol m = findMethod(nt, c.members_field, self.flags()); if (nt != null && m == null) throw badClassFile("bad.enclosing.method", self); @@ -1318,8 +1321,7 @@ else proxies.append(proxy); if (majorVersion >= V51.major && - (proxy.type.tsym == syms.polymorphicSignatureType.tsym || - proxy.type.tsym == syms.transientPolymorphicSignatureType.tsym)) { + proxy.type.tsym == syms.polymorphicSignatureType.tsym) { sym.flags_field |= POLYMORPHIC_SIGNATURE; } } @@ -1607,18 +1609,31 @@ // type.tsym.flatName() should == proxy.enumFlatName TypeSymbol enumTypeSym = proxy.enumType.tsym; VarSymbol enumerator = null; - for (Scope.Entry e = enumTypeSym.members().lookup(proxy.enumerator); - e.scope != null; - e = e.next()) { - if (e.sym.kind == VAR) { - enumerator = (VarSymbol)e.sym; - break; + CompletionFailure failure = null; + try { + for (Scope.Entry e = enumTypeSym.members().lookup(proxy.enumerator); + e.scope != null; + e = e.next()) { + if (e.sym.kind == VAR) { + enumerator = (VarSymbol)e.sym; + break; + } } } + catch (CompletionFailure ex) { + failure = ex; + } if (enumerator == null) { - log.error("unknown.enum.constant", - currentClassFile, enumTypeSym, proxy.enumerator); - result = new Attribute.Error(enumTypeSym.type); + if (failure != null) { + log.warning("unknown.enum.constant.reason", + currentClassFile, enumTypeSym, proxy.enumerator, + failure.getDiagnostic()); + } else { + log.warning("unknown.enum.constant", + currentClassFile, enumTypeSym, proxy.enumerator); + } + result = new Attribute.Enum(enumTypeSym.type, + new VarSymbol(0, proxy.enumerator, syms.botType, enumTypeSym)); } else { result = new Attribute.Enum(enumTypeSym.type, enumerator); }
--- a/src/share/classes/com/sun/tools/javac/jvm/Code.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java Thu Jun 02 19:00:16 2011 +0100 @@ -479,7 +479,12 @@ state.pop(1);// index Type a = state.stack[state.stacksize-1]; state.pop(1); - state.push(types.erasure(types.elemtype(a))); } + //sometimes 'null type' is treated as a one-dimensional array type + //see Gen.visitLiteral - we should handle this case accordingly + Type stackType = a.tag == BOT ? + syms.objectType : + types.erasure(types.elemtype(a)); + state.push(stackType); } break; case goto_: markDead();
--- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java Thu Jun 02 19:00:16 2011 +0100 @@ -283,7 +283,7 @@ } // leave alone methods inherited from Object - // JLS2 13.1. + // JLS 13.1. if (sym.owner == syms.objectType.tsym) return sym; @@ -1456,7 +1456,7 @@ List<Integer> gaps) { if (startpc != endpc) { List<JCExpression> subClauses = TreeInfo.isMultiCatch(tree) ? - ((JCTypeDisjunction)tree.param.vartype).alternatives : + ((JCTypeUnion)tree.param.vartype).alternatives : List.of(tree.param.vartype); while (gaps.nonEmpty()) { for (JCExpression subCatch : subClauses) {
--- a/src/share/classes/com/sun/tools/javac/main/Main.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/main/Main.java Thu Jun 02 19:00:16 2011 +0100 @@ -65,9 +65,11 @@ PrintWriter out; /** - * If true, any command line arg errors will cause an exception. + * If true, certain errors will cause an exception, such as command line + * arg errors, or exceptions in user provided code. */ - boolean fatalErrors; + boolean apiMode; + /** Result codes. */ @@ -163,7 +165,7 @@ /** Report a usage error. */ void error(String key, Object... args) { - if (fatalErrors) { + if (apiMode) { String msg = getLocalizedString(key, args); throw new PropagatedException(new IllegalStateException(msg)); } @@ -192,8 +194,8 @@ this.options = options; } - public void setFatalErrors(boolean fatalErrors) { - this.fatalErrors = fatalErrors; + public void setAPIMode(boolean apiMode) { + this.apiMode = apiMode; } /** Process command line arguments: store all command line options @@ -440,7 +442,9 @@ } catch (FatalError ex) { feMessage(ex); return EXIT_SYSERR; - } catch(AnnotationProcessingError ex) { + } catch (AnnotationProcessingError ex) { + if (apiMode) + throw new RuntimeException(ex.getCause()); apMessage(ex); return EXIT_SYSERR; } catch (ClientCodeException ex) { @@ -458,7 +462,13 @@ bugMessage(ex); return EXIT_ABNORMAL; } finally { - if (comp != null) comp.close(); + if (comp != null) { + try { + comp.close(); + } catch (ClientCodeException ex) { + throw new RuntimeException(ex.getCause()); + } + } filenames = null; options = null; }
--- a/src/share/classes/com/sun/tools/javac/main/OptionName.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/main/OptionName.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2011, 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
--- a/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2011, 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
--- a/src/share/classes/com/sun/tools/javac/model/JavacTypes.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/model/JavacTypes.java Thu Jun 02 19:00:16 2011 +0100 @@ -72,11 +72,11 @@ } public Element asElement(TypeMirror t) { - Type type = cast(Type.class, t); - switch (type.tag) { - case TypeTags.CLASS: - case TypeTags.ERROR: - case TypeTags.TYPEVAR: + switch (t.getKind()) { + case DECLARED: + case ERROR: + case TYPEVAR: + Type type = cast(Type.class, t); return type.asElement(); default: return null;
--- a/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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
--- a/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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 @@ -37,6 +37,7 @@ import java.nio.CharBuffer; import java.nio.charset.CharsetDecoder; import java.nio.file.Files; +import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; import javax.lang.model.element.Modifier; @@ -170,7 +171,7 @@ if (pn.equalsIgnoreCase(sn)) { try { // allow for Windows - return path.toRealPath(false).getFileName().toString().equals(sn); + return path.toRealPath(LinkOption.NOFOLLOW_LINKS).getFileName().toString().equals(sn); } catch (IOException e) { } }
--- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Thu Jun 02 19:00:16 2011 +0100 @@ -971,7 +971,7 @@ if ((mode & EXPR) != 0) { mode = EXPR; S.nextToken(); - if (S.token() == LT) typeArgs = typeArguments(); + if (S.token() == LT) typeArgs = typeArguments(false); t = creator(pos, typeArgs); typeArgs = null; } else return illegal(); @@ -1036,7 +1036,7 @@ mode = EXPR; int pos1 = S.pos(); S.nextToken(); - if (S.token() == LT) typeArgs = typeArguments(); + if (S.token() == LT) typeArgs = typeArguments(false); t = innerCreator(pos1, typeArgs, t); typeArgs = null; break loop; @@ -1116,7 +1116,7 @@ mode = EXPR; int pos2 = S.pos(); S.nextToken(); - if (S.token() == LT) typeArgs = typeArguments(); + if (S.token() == LT) typeArgs = typeArguments(false); t = innerCreator(pos2, typeArgs, t); typeArgs = null; } else { @@ -1146,7 +1146,7 @@ } else { int pos = S.pos(); accept(DOT); - typeArgs = (S.token() == LT) ? typeArguments() : null; + typeArgs = (S.token() == LT) ? typeArguments(false) : null; t = toP(F.at(pos).Select(t, ident())); t = argumentsOpt(typeArgs, t); } @@ -1206,7 +1206,7 @@ (mode & NOPARAMS) == 0) { mode = TYPE; checkGenerics(); - return typeArguments(t); + return typeArguments(t, false); } else { return t; } @@ -1223,51 +1223,54 @@ illegal(); } mode = useMode; - return typeArguments(); + return typeArguments(false); } return null; } /** TypeArguments = "<" TypeArgument {"," TypeArgument} ">" */ - List<JCExpression> typeArguments() { - ListBuffer<JCExpression> args = lb(); + List<JCExpression> typeArguments(boolean diamondAllowed) { if (S.token() == LT) { S.nextToken(); - if (S.token() == GT && (mode & DIAMOND) != 0) { + if (S.token() == GT && diamondAllowed) { checkDiamond(); + mode |= DIAMOND; S.nextToken(); return List.nil(); - } - args.append(((mode & EXPR) == 0) ? typeArgument() : parseType()); - while (S.token() == COMMA) { - S.nextToken(); + } else { + ListBuffer<JCExpression> args = ListBuffer.lb(); args.append(((mode & EXPR) == 0) ? typeArgument() : parseType()); - } - switch (S.token()) { - case GTGTGTEQ: - S.token(GTGTEQ); - break; - case GTGTEQ: - S.token(GTEQ); - break; - case GTEQ: - S.token(EQ); - break; - case GTGTGT: - S.token(GTGT); - break; - case GTGT: - S.token(GT); - break; - default: - accept(GT); - break; + while (S.token() == COMMA) { + S.nextToken(); + args.append(((mode & EXPR) == 0) ? typeArgument() : parseType()); + } + switch (S.token()) { + case GTGTGTEQ: + S.token(GTGTEQ); + break; + case GTGTEQ: + S.token(GTEQ); + break; + case GTEQ: + S.token(EQ); + break; + case GTGTGT: + S.token(GTGT); + break; + case GTGT: + S.token(GT); + break; + default: + accept(GT); + break; + } + return args.toList(); } } else { syntaxError(S.pos(), "expected", LT); + return List.nil(); } - return args.toList(); } /** TypeArgument = Type @@ -1303,9 +1306,9 @@ } } - JCTypeApply typeArguments(JCExpression t) { + JCTypeApply typeArguments(JCExpression t, boolean diamondAllowed) { int pos = S.pos(); - List<JCExpression> args = typeArguments(); + List<JCExpression> args = typeArguments(diamondAllowed); return toP(F.at(pos).TypeApply(t, args)); } @@ -1370,18 +1373,25 @@ } JCExpression t = qualident(); int oldmode = mode; - mode = TYPE | DIAMOND; + mode = TYPE; + boolean diamondFound = false; if (S.token() == LT) { checkGenerics(); - t = typeArguments(t); + t = typeArguments(t, true); + diamondFound = (mode & DIAMOND) != 0; } while (S.token() == DOT) { + if (diamondFound) { + //cannot select after a diamond + illegal(S.pos()); + } int pos = S.pos(); S.nextToken(); t = toP(F.at(pos).Select(t, ident())); if (S.token() == LT) { checkGenerics(); - t = typeArguments(t); + t = typeArguments(t, true); + diamondFound = (mode & DIAMOND) != 0; } } mode = oldmode; @@ -1416,9 +1426,8 @@ JCExpression t = toP(F.at(S.pos()).Ident(ident())); if (S.token() == LT) { int oldmode = mode; - mode |= DIAMOND; checkGenerics(); - t = typeArguments(t); + t = typeArguments(t, true); mode = oldmode; } return classCreatorRest(newpos, encl, typeArgs, t); @@ -1828,7 +1837,7 @@ JCModifiers mods = optFinal(Flags.PARAMETER); List<JCExpression> catchTypes = catchTypes(); JCExpression paramType = catchTypes.size() > 1 ? - toP(F.at(catchTypes.head.getStartPosition()).TypeDisjunction(catchTypes)) : + toP(F.at(catchTypes.head.getStartPosition()).TypeUnion(catchTypes)) : catchTypes.head; JCVariableDecl formal = variableDeclaratorId(mods, paramType); accept(RPAREN);
--- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Jun 02 19:00:16 2011 +0100 @@ -34,8 +34,8 @@ import java.io.File; import java.io.PrintWriter; import java.io.IOException; +import java.io.StringWriter; import java.net.MalformedURLException; -import java.io.StringWriter; import javax.annotation.processing.*; import javax.lang.model.SourceVersion; @@ -58,6 +58,7 @@ import com.sun.tools.javac.file.FSInfo; import com.sun.tools.javac.file.JavacFileManager; import com.sun.tools.javac.jvm.*; +import com.sun.tools.javac.jvm.ClassReader.BadClassFile; import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.main.JavaCompiler.CompileState; import com.sun.tools.javac.model.JavacElements; @@ -67,6 +68,7 @@ import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.Abort; import com.sun.tools.javac.util.Assert; +import com.sun.tools.javac.util.ClientCodeException; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Convert; import com.sun.tools.javac.util.FatalError; @@ -432,6 +434,8 @@ log.error("proc.processor.cant.instantiate", processorName); return false; } + } catch(ClientCodeException e) { + throw e; } catch(Throwable t) { throw new AnnotationProcessingError(t); } @@ -527,6 +531,8 @@ supportedOptionNames.add(optionName); } + } catch (ClientCodeException e) { + throw e; } catch (Throwable t) { throw new AnnotationProcessingError(t); } @@ -785,11 +791,16 @@ RoundEnvironment renv) { try { return proc.process(tes, renv); + } catch (BadClassFile ex) { + log.error("proc.cant.access.1", ex.sym, ex.getDetailValue()); + return false; } catch (CompletionFailure ex) { StringWriter out = new StringWriter(); ex.printStackTrace(new PrintWriter(out)); log.error("proc.cant.access", ex.sym, ex.getDetailValue(), out.toString()); return false; + } catch (ClientCodeException e) { + throw e; } catch (Throwable t) { throw new AnnotationProcessingError(t); } @@ -1061,6 +1072,11 @@ PrintWriter out = context.get(Log.outKey); Assert.checkNonNull(out); next.put(Log.outKey, out); + Locale locale = context.get(Locale.class); + if (locale != null) + next.put(Locale.class, locale); + Assert.checkNonNull(messages); + next.put(JavacMessages.messagesKey, messages); final boolean shareNames = true; if (shareNames) {
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Jun 02 19:00:16 2011 +0100 @@ -302,6 +302,11 @@ compiler.err.multicatch.parameter.may.not.be.assigned=\ multi-catch parameter {0} may not be assigned +# 0: type, 1: type +compiler.err.multicatch.types.must.be.disjoint=\ + Alternatives in a multi-catch statement cannot be related by subclassing\n\ + Alternative {0} is a subclass of alternative {1} + compiler.err.finally.without.try=\ ''finally'' without ''try'' @@ -606,12 +611,18 @@ # Errors related to annotation processing +# 0: symbol, 1: string, 2: stack-trace compiler.err.proc.cant.access=\ cannot access {0}\n\ {1}\n\ Consult the following stack trace for details.\n\ {2} +# 0: symbol, 1: string +compiler.err.proc.cant.access.1=\ + cannot access {0}\n\ + {1} + # 0: string compiler.err.proc.cant.find.class=\ Could not find class file for ''{0}''. @@ -751,9 +762,6 @@ compiler.err.unclosed.str.lit=\ unclosed string literal -compiler.err.unknown.enum.constant=\ - in class file {0}: unknown enum constant {1}.{2} - # 0: name compiler.err.unsupported.encoding=\ unsupported encoding: {0} @@ -1239,6 +1247,10 @@ compiler.warn.try.resource.not.referenced=\ auto-closeable resource {0} is never referenced in body of corresponding try statement +# 0: type +compiler.warn.try.resource.throws.interrupted.exc=\ + auto-closeable resource {0} has a member method close() that could throw InterruptedException + compiler.warn.unchecked.assign=\ unchecked assignment: {0} to {1} @@ -1292,6 +1304,15 @@ compiler.warn.annotation.method.not.found.reason=\ Cannot find annotation method ''{1}()'' in type ''{0}'': {2} +# 0: symbol, 1: name +compiler.warn.unknown.enum.constant=\ + unknown enum constant {1}.{2} + +# 0: symbol, 1: name, 2: message segment +compiler.warn.unknown.enum.constant.reason=\ + unknown enum constant {1}.{2}\n\ + reason: {3} + # 0: type, 1: type compiler.warn.raw.class.use=\ found raw type: {0}\n\ @@ -1415,8 +1436,13 @@ compiler.misc.bad.class.signature=\ bad class signature: {0} +#0: symbol, 1: symbol +compiler.misc.bad.enclosing.class=\ + bad enclosing class for {0}: {1} + +# 0: symbol compiler.misc.bad.enclosing.method=\ - bad enclosing method attribute: {0} + bad enclosing method attribute for class {0} compiler.misc.bad.runtime.invisible.param.annotations=\ bad RuntimeInvisibleParameterAnnotations attribute: {0} @@ -1598,6 +1624,9 @@ compiler.misc.diamond.non.generic=\ cannot use ''<>'' with non-generic class {0} +compiler.misc.diamond.and.explicit.params=\ + cannot use ''<>'' with explicit type parameters for constructor + # 0: type, 1: list of type compiler.misc.explicit.param.do.not.conform.to.bounds=\ explicit type argument {0} does not conform to declared bound(s) {1}
--- a/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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 @@ -23,137 +23,318 @@ # questions. # +# Messages in this file which use "placeholders" for values (e.g. {0}, {1}) +# are preceded by a stylized comment describing the type of the corresponding +# values. +# The types currently in use are +# +# boolean true or false +# file name the name of an input file; e.g. MyFile.java +# message segment a sub-message; see compiler.misc.* +# modifier a Java modifier; e.g. public, private, protected +# name a name, typically a Java identifier +# number an integer +# option name the name of a command line option +# source version a source version number, such as 1.5, 1.6, 1.7 +# string a general string +# symbol the name of a declared type +# symbol kind a description of the kind of a declaration; see compiler.misc.kindname.* +# token the name of a non-terminal in source code; see compiler.misc.token.* +# type a Java type; e.g. int, X, X<T> +# unused the value is not used in this message +# +# list of X a comma-separated list of items; e.g. list of type +# X or Y alternation; e.g. message segment or type +# set of X a comma-separated collection of items; e.g. set of modifier +# +# These may be composed: e.g. list of type or message segment +# +# These comments are verified by the jtreg test test/tools/javac/diags/MessageInfo, +# using info derived from the collected set of examples in test/tools/javac/diags/examples. +# MessageInfo can also be run as a standalone utility providing more facilities +# for manipulating this file. For more details, see MessageInfo.java. + ## ## errors ## +# 0: symbol compiler.err.abstract.cant.be.instantiated={0}\u306Fabstract\u3067\u3059\u3002\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u751F\u6210\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.abstract.meth.cant.have.body=abstract\u30E1\u30BD\u30C3\u30C9\u304C\u672C\u4F53\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.already.annotated={0} {1}\u306F\u6CE8\u91C8\u304C\u4ED8\u3044\u3066\u3044\u307E\u3059 + +# 0: symbol, 1: symbol compiler.err.already.defined={0}\u306F{1}\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: string compiler.err.already.defined.single.import={0}\u306F\u5358\u4E00\u306E\u578B\u30A4\u30F3\u30DD\u30FC\u30C8\u5BA3\u8A00\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: string compiler.err.already.defined.static.single.import={0}\u306Fstatic\u306E\u5358\u4E00\u306E\u578B\u30A4\u30F3\u30DD\u30FC\u30C8\u5BA3\u8A00\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 + compiler.err.already.defined.this.unit={0}\u306F\u30B3\u30F3\u30D1\u30A4\u30EB\u5358\u4F4D\u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: type, 1: list of name compiler.err.annotation.missing.default.value=\u6CE8\u91C8{0}\u306B\u306F\u5C5E\u6027{1}\u306E\u5024\u304C\u3042\u308A\u307E\u305B\u3093 + +# 0: type, 1: list of name compiler.err.annotation.missing.default.value.1=\u6CE8\u91C8{0}\u306B\u306F\u5C5E\u6027{1}\u306E\u5024\u304C\u3042\u308A\u307E\u305B\u3093 + +# 0: type compiler.err.annotation.not.valid.for.type=\u6CE8\u91C8\u306F\u578B{0}\u306E\u5024\u306B\u6709\u52B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093 + compiler.err.annotation.type.not.applicable=\u6CE8\u91C8\u578B\u306F\u3053\u306E\u7A2E\u985E\u306E\u5BA3\u8A00\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + compiler.err.annotation.value.must.be.annotation=\u6CE8\u91C8\u306E\u5024\u306F\u6CE8\u91C8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.annotation.value.must.be.class.literal=\u6CE8\u91C8\u306E\u5024\u306F\u30AF\u30E9\u30B9\u30FB\u30EA\u30C6\u30E9\u30EB\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.annotation.value.must.be.name.value=\u6CE8\u91C8\u306E\u5024\u306F''name=value''\u3068\u3044\u3046\u5F62\u5F0F\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.annotation.value.not.allowable.type=\u4F7F\u7528\u3067\u304D\u306A\u3044\u578B\u306E\u6CE8\u91C8\u306E\u5024\u3067\u3059 + compiler.err.anon.class.impl.intf.no.args=\u540D\u524D\u306E\u306A\u3044\u30AF\u30E9\u30B9\u304C\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u5B9F\u88C5\u3057\u3066\u3044\u307E\u3059\u3002\u5F15\u6570\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.anon.class.impl.intf.no.typeargs=\u540D\u524D\u306E\u306A\u3044\u30AF\u30E9\u30B9\u304C\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u5B9F\u88C5\u3057\u3066\u3044\u307E\u3059\u3002\u578B\u5F15\u6570\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.anon.class.impl.intf.no.qual.for.new=\u540D\u524D\u306E\u306A\u3044\u30AF\u30E9\u30B9\u304C\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u5B9F\u88C5\u3057\u3066\u3044\u307E\u3059\u3002new\u306B\u4FEE\u98FE\u5B50\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002 + +# 0: symbol, 1: symbol, 2: symbol compiler.err.array.and.varargs={2}\u3067{0}\u3068{1}\u306E\u4E21\u65B9\u3092\u5BA3\u8A00\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.array.dimension.missing=\u914D\u5217\u306E\u5927\u304D\u3055\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 + +# 0: type compiler.err.array.req.but.found=\u914D\u5217\u304C\u8981\u6C42\u3055\u308C\u307E\u3057\u305F\u304C\u3001{0}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F compiler.err.assignment.from.super-bound=\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9{0}\u304B\u3089\u4EE3\u5165\u3057\u3066\u3044\u307E\u3059 + compiler.err.assignment.to.extends-bound=\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9{0}\u3078\u4EE3\u5165\u3057\u3066\u3044\u307E\u3059 + compiler.err.attribute.value.must.be.constant=\u5C5E\u6027\u306E\u5024\u306F\u5B9A\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 compiler.err.break.outside.switch.loop=break\u304Cswitch\u6587\u307E\u305F\u306F\u30EB\u30FC\u30D7\u306E\u5916\u306B\u3042\u308A\u307E\u3059 +# 0: name compiler.err.call.must.be.first.stmt.in.ctor={0}\u306E\u547C\u51FA\u3057\u306F\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u5148\u982D\u6587\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.cant.apply.symbol={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3} + +# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment compiler.err.cant.apply.symbol.1={4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093\u3002\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3}\n\u7406\u7531: {6} + +# 0: symbol kind, 1: name, 2: list of type compiler.err.cant.apply.symbols={1}\u306B\u9069\u5207\u306A{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093({2}) + +# 0: symbol compiler.err.cant.assign.val.to.final.var=final\u5909\u6570{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: type compiler.err.cant.deref={0}\u306F\u9593\u63A5\u53C2\u7167\u3067\u304D\u307E\u305B\u3093 + compiler.err.cant.extend.intf.annotation=@interfaces\u3067\u306F''extends''\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 + +# 0: symbol compiler.err.cant.inherit.from.final=final {0}\u304B\u3089\u306F\u7D99\u627F\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol compiler.err.cant.ref.before.ctor.called=\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u547C\u51FA\u3057\u524D\u306F{0}\u3092\u53C2\u7167\u3067\u304D\u307E\u305B\u3093 + compiler.err.cant.ret.val.from.meth.decl.void=\u623B\u308A\u5024\u306E\u578B\u304Cvoid\u306E\u30E1\u30BD\u30C3\u30C9\u304B\u3089\u306F\u5024\u3092\u8FD4\u305B\u307E\u305B\u3093 + compiler.err.cant.select.static.class.from.param.type=\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3055\u308C\u305F\u578B\u304B\u3089static\u30AF\u30E9\u30B9\u3092\u9078\u629E\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol, 1: string, 2: string compiler.err.cant.inherit.diff.arg={0}\u3092\u7570\u306A\u308B\u5F15\u6570<{1}>\u3068<{2}>\u3067\u7D99\u627F\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.catch.without.try=''catch''\u3078\u306E''try''\u304C\u3042\u308A\u307E\u305B\u3093 -compiler.err.clash.with.pkg.of.same.name={0}\u306F\u540C\u540D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u7AF6\u5408\u3057\u307E\u3059 + +# 0: symbol kind, 1: symbol +compiler.err.clash.with.pkg.of.same.name={0} {1}\u306F\u540C\u540D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u7AF6\u5408\u3057\u307E\u3059 + compiler.err.const.expr.req=\u5B9A\u6570\u5F0F\u304C\u5FC5\u8981\u3067\u3059 -compiler.err.enum.const.req=\u4FEE\u98FE\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B\u5B9A\u6570\u306E\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059 + compiler.err.cont.outside.loop=continue\u304C\u30EB\u30FC\u30D7\u306E\u5916\u306B\u3042\u308A\u307E\u3059 + +# 0: symbol compiler.err.cyclic.inheritance={0}\u3092\u542B\u3080\u7D99\u627F\u304C\u30EB\u30FC\u30D7\u3057\u3066\u3044\u307E\u3059 + compiler.err.cyclic.annotation.element=\u6CE8\u91C8\u306E\u8981\u7D20\u30BF\u30A4\u30D7\u304C\u30EB\u30FC\u30D7\u3057\u3066\u3044\u307E\u3059 + +# 0: unused compiler.err.call.to.super.not.allowed.in.enum.ctor=\u5217\u6319\u578B\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3067\u306F\u3001\u30B9\u30FC\u30D1\u30FC\u30AF\u30E9\u30B9\u306E\u547C\u51FA\u3057\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: type compiler.err.no.superclass={0}\u306B\u306F\u30B9\u30FC\u30D1\u30FC\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u305B\u3093 -compiler.warn.type.parameter.on.polymorphic.signature=MethodHandle\u547C\u51FA\u3057\u306E\u53E4\u3044\u8868\u8A18\u6CD5\u3092x.<T>invoke(y)\u304B\u3089(T)x.invoke(y)\u306B\u5909\u66F4\u3057\u3066\u304F\u3060\u3055\u3044 -compiler.warn.wrong.target.for.polymorphic.signature.definition=MethodHandle API\u306E\u4F5C\u6210\u306B\u306F-target 7\u30E9\u30F3\u30BF\u30A4\u30E0\u4EE5\u4E0A\u304C\u5FC5\u8981\u3067\u3059\u3002\u73FE\u5728\u306F-target {0}\u3067\u3059 +compiler.err.wrong.target.for.polymorphic.signature.definition=MethodHandle API\u306E\u4F5C\u6210\u306B\u306F-target 7\u30E9\u30F3\u30BF\u30A4\u30E0\u4EE5\u4E0A\u304C\u5FC5\u8981\u3067\u3059\u3002\u73FE\u5728\u306F-target {0}\u3067\u3059 +# 0: symbol, 1: type, 2: symbol, 3: type, 4: unused compiler.err.concrete.inheritance.conflict={1}\u306E\u30E1\u30BD\u30C3\u30C9{0}\u3068{3}\u306E{2}\u306F\u540C\u3058\u30B7\u30B0\u30CB\u30C1\u30E3\u304B\u3089\u7D99\u627F\u3055\u308C\u3066\u3044\u307E\u3059 compiler.err.default.allowed.in.intf.annotation.member=\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306F@interface\u30E1\u30F3\u30D0\u30FC\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059 + +# 0: symbol compiler.err.doesnt.exist=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 + compiler.err.duplicate.annotation=\u6CE8\u91C8\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 + +# 0: name, 1: type compiler.err.duplicate.annotation.member.value={1}\u306E\u6CE8\u91C8\u30E1\u30F3\u30D0\u30FC\u306E\u5024{0}\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 + +# 0: name compiler.err.duplicate.class=\u30AF\u30E9\u30B9{0}\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 + compiler.err.duplicate.case.label=case\u30E9\u30D9\u30EB\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 + compiler.err.duplicate.default.label=default\u30E9\u30D9\u30EB\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059 compiler.err.else.without.if=''else''\u3078\u306E''if''\u304C\u3042\u308A\u307E\u305B\u3093 + compiler.err.empty.char.lit=\u7A7A\u306E\u6587\u5B57\u30EA\u30C6\u30E9\u30EB\u3067\u3059 + +# 0: symbol compiler.err.encl.class.required={0}\u3092\u542B\u3080\u56F2\u3046\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5FC5\u8981\u3067\u3059 + compiler.err.enum.annotation.must.be.enum.constant=\u5217\u6319\u578B\u6CE8\u91C8\u5024\u306F\u3001\u5217\u6319\u578B\u5B9A\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 compiler.err.enum.cant.be.instantiated=\u5217\u6319\u578B\u306F\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093 + compiler.err.enum.label.must.be.unqualified.enum=\u5217\u6319\u578B\u306Eswitch case\u30E9\u30D9\u30EB\u306F\u5217\u6319\u578B\u5B9A\u6570\u306E\u975E\u4FEE\u98FE\u540D\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.enum.no.subclassing=\u30AF\u30E9\u30B9\u306F\u76F4\u63A5java.lang.Enum\u3092\u62E1\u5F35\u3067\u304D\u307E\u305B\u3093 + compiler.err.enum.types.not.extensible=\u5217\u6319\u578B\u306F\u62E1\u5F35\u53EF\u80FD\u3067\u306F\u3042\u308A\u307E\u305B\u3093 + compiler.err.enum.no.finalize=\u5217\u6319\u578B\u306Ffinalize\u30E1\u30BD\u30C3\u30C9\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: file name, 1: string compiler.err.error.reading.file={0}\u306E\u8AAD\u8FBC\u307F\u30A8\u30E9\u30FC\u3067\u3059\u3002{1} + +# 0: type compiler.err.except.already.caught=\u4F8B\u5916{0}\u306F\u3059\u3067\u306B\u6355\u6349\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: type compiler.err.except.never.thrown.in.try=\u4F8B\u5916{0}\u306F\u5BFE\u5FDC\u3059\u308Btry\u6587\u306E\u672C\u4F53\u3067\u306F\u30B9\u30ED\u30FC\u3055\u308C\u307E\u305B\u3093 +# 0: symbol compiler.err.final.parameter.may.not.be.assigned=final\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol compiler.err.try.resource.may.not.be.assigned=\u81EA\u52D5\u30AF\u30ED\u30FC\u30BA\u53EF\u80FD\u306A\u30EA\u30BD\u30FC\u30B9{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol compiler.err.multicatch.parameter.may.not.be.assigned=\u8907\u6570catch\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306B\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: type +compiler.err.multicatch.types.must.be.disjoint=\u8907\u6570catch\u6587\u306E\u4EE3\u66FF\u3092\u30B5\u30D6\u30AF\u30E9\u30B9\u5316\u306B\u3088\u3063\u3066\u95A2\u9023\u4ED8\u3051\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n\u4EE3\u66FF{0}\u306F\u4EE3\u66FF{1}\u306E\u30B5\u30D6\u30AF\u30E9\u30B9\u3067\u3059 + compiler.err.finally.without.try=''finally''\u3078\u306E''try''\u304C\u3042\u308A\u307E\u305B\u3093 -compiler.err.foreach.not.applicable.to.type=foreach\u306F\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: message segment +compiler.err.foreach.not.applicable.to.type=for-each\u306F\u5F0F\u306E\u30BF\u30A4\u30D7\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\n\u671F\u5F85\u5024: {1}\n\u691C\u51FA\u5024: {0} + compiler.err.fp.number.too.large=\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u304C\u5927\u304D\u3059\u304E\u307E\u3059 + compiler.err.fp.number.too.small=\u6D6E\u52D5\u5C0F\u6570\u70B9\u6570\u304C\u5C0F\u3055\u3059\u304E\u307E\u3059 compiler.err.generic.array.creation=\u6C4E\u7528\u914D\u5217\u3092\u4F5C\u6210\u3057\u307E\u3059 + compiler.err.generic.throwable=\u6C4E\u7528\u30AF\u30E9\u30B9\u306Fjava.lang.Throwable\u3092\u62E1\u5F35\u3067\u304D\u307E\u305B\u3093 -compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u30AF\u30E9\u30B9\u304Cstatic\u5BA3\u8A00\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +# 0: symbol +compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u30AF\u30E9\u30B9{0}\u306E\u9759\u7684\u5BA3\u8A00\u304C\u4E0D\u6B63\u3067\u3059\n\u4FEE\u98FE\u5B50\''static\''\u306F\u5B9A\u6570\u304A\u3088\u3073\u5909\u6570\u306E\u5BA3\u8A00\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059 + +# 0: string compiler.err.illegal.char=\\{0}\u306F\u4E0D\u6B63\u306A\u6587\u5B57\u3067\u3059 + compiler.err.illegal.char.for.encoding=\u3053\u306E\u6587\u5B57\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306B\u30DE\u30C3\u30D7\u3067\u304D\u307E\u305B\u3093 + +# 0: set of modifier, 1: set of modifier compiler.err.illegal.combination.of.modifiers=\u4FEE\u98FE\u5B50{0}\u3068{1}\u306E\u7D44\u5408\u305B\u306F\u4E0D\u6B63\u3067\u3059 + compiler.err.illegal.enum.static.ref=\u521D\u671F\u5316\u5B50\u304B\u3089static\u30D5\u30A3\u30FC\u30EB\u30C9\u3078\u306E\u53C2\u7167\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.illegal.esc.char=\u30A8\u30B9\u30B1\u30FC\u30D7\u6587\u5B57\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.illegal.forward.ref=\u524D\u65B9\u53C2\u7167\u304C\u4E0D\u6B63\u3067\u3059 + +# 0: symbol compiler.warn.forward.ref=\u521D\u671F\u5316\u3055\u308C\u308B\u524D\u306E\u5909\u6570''{0}''\u3092\u53C2\u7167\u3057\u3088\u3046\u3068\u3057\u307E\u3057\u305F + compiler.err.illegal.self.ref=\u521D\u671F\u5316\u5B50\u5185\u306E\u81EA\u5DF1\u53C2\u7167 + +# 0: symbol compiler.warn.self.ref=\u521D\u671F\u5316\u5B50\u5185\u306E\u5909\u6570''{0}''\u306E\u81EA\u5DF1\u53C2\u7167 + compiler.err.illegal.generic.type.for.instof=instanceof\u306E\u7DCF\u79F0\u578B\u304C\u4E0D\u6B63\u3067\u3059 + +# 0: type compiler.err.illegal.initializer.for.type={0}\u306E\u521D\u671F\u5316\u5B50\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.illegal.line.end.in.char.lit=\u6587\u5B57\u30EA\u30C6\u30E9\u30EB\u306E\u884C\u672B\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.illegal.nonascii.digit=\u4E0D\u6B63\u306A\u975EASCII\u6570\u5B57\u3067\u3059 + compiler.err.illegal.underscore=\u4E0D\u6B63\u306A\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u3067\u3059 + +# 0: symbol compiler.err.illegal.qual.not.icls=\u4FEE\u98FE\u5B50\u304C\u4E0D\u6B63\u3067\u3059\u3002{0}\u306F\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093 + compiler.err.illegal.start.of.expr=\u5F0F\u306E\u958B\u59CB\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.illegal.start.of.type=\u578B\u306E\u958B\u59CB\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.illegal.unicode.esc=Unicode\u30A8\u30B9\u30B1\u30FC\u30D7\u304C\u4E0D\u6B63\u3067\u3059 + +# 0: symbol compiler.err.import.requires.canonical=\u30A4\u30F3\u30DD\u30FC\u30C8\u306B\u306F{0}\u306E\u6A19\u6E96\u540D\u304C\u5FC5\u8981\u3067\u3059 + compiler.err.improperly.formed.type.param.missing=\u578B\u306E\u5F62\u5F0F\u304C\u4E0D\u9069\u5207\u3067\u3059\u3002\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059 -compiler.err.improperly.formed.type.inner.raw.param=\u578B\u306E\u5F62\u5F0F\u304C\u4E0D\u9069\u5207\u3067\u3059\u3002raw\u578B\u306B\u6307\u5B9A\u3055\u308C\u305F\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u3059 + +compiler.err.improperly.formed.type.inner.raw.param=\u578B\u306E\u5F62\u5F0F\u304C\u4E0D\u9069\u5207\u3067\u3059\u3002raw\u578B\u306B\u6307\u5B9A\u3055\u308C\u305F\u578B\u5F15\u6570\u3067\u3059 + +# 0: type, 1: type compiler.err.incomparable.types=\u578B{0}\u3068{1}\u306F\u6BD4\u8F03\u3067\u304D\u307E\u305B\u3093 + +# 0: number compiler.err.int.number.too.large=\u6574\u6570{0}\u304C\u5927\u304D\u3059\u304E\u307E\u3059 + compiler.err.internal.error.cant.instantiate=\u5185\u90E8\u30A8\u30E9\u30FC\u3067\u3059\u3002{0}\u3092{1}\u3067({2})\u306B\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u751F\u6210\u3067\u304D\u307E\u305B\u3093 + compiler.err.intf.annotation.members.cant.have.params=@interface\u30E1\u30F3\u30D0\u30FC\u304C\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.intf.annotation.cant.have.type.params=@interface\u304C\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.intf.annotation.members.cant.have.type.params=@interface\u30E1\u30F3\u30D0\u30FC\u304C\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol, 1: type compiler.err.intf.annotation.member.clash=@interface\u30E1\u30F3\u30D0\u30FC\u306F{1}\u306E\u30E1\u30BD\u30C3\u30C9''{0}''\u3068\u7AF6\u5408\u3057\u307E\u3059 + compiler.err.intf.expected.here=\u3053\u3053\u306B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304C\u5FC5\u8981\u3067\u3059 + compiler.err.intf.meth.cant.have.body=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u672C\u4F53\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.invalid.annotation.member.type=\u6CE8\u91C8\u30E1\u30F3\u30D0\u30FC\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.invalid.binary.number=2\u9032\u6570\u5B57\u306F\u5C11\u306A\u304F\u3068\u30821\u6841\u306E2\u9032\u6570\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.invalid.hex.number=16\u9032\u6570\u5B57\u306F\u5C11\u306A\u304F\u3068\u30821\u6841\u306E16\u9032\u6570\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.invalid.meth.decl.ret.type.req=\u7121\u52B9\u306A\u30E1\u30BD\u30C3\u30C9\u5BA3\u8A00\u3067\u3059\u3002\u623B\u308A\u5024\u306E\u578B\u304C\u5FC5\u8981\u3067\u3059\u3002 +compiler.err.varargs.and.old.array.syntax=\u65E7\u5F0F\u306E\u914D\u5217\u8868\u8A18\u6CD5\u306F\u53EF\u5909\u5F15\u6570\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + +# 0: name compiler.err.label.already.in.use=\u30E9\u30D9\u30EB{0}\u306F\u3059\u3067\u306B\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: symbol compiler.err.local.var.accessed.from.icls.needs.final=\u30ED\u30FC\u30AB\u30EB\u5909\u6570{0}\u306F\u5185\u90E8\u30AF\u30E9\u30B9\u304B\u3089\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u307E\u3059\u3002final\u3067\u5BA3\u8A00\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + compiler.err.local.enum=\u5217\u6319\u578B\u306F\u30ED\u30FC\u30AB\u30EB\u306B\u3067\u304D\u307E\u305B\u3093 + compiler.err.cannot.create.array.with.type.arguments=\u578B\u5F15\u6570\u3092\u6301\u3064\u914D\u5217\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093 # @@ -162,70 +343,131 @@ # detected during code generation. # compiler.err.limit.code=\u30B3\u30FC\u30C9\u304C\u5927\u304D\u3059\u304E\u307E\u3059 + compiler.err.limit.code.too.large.for.try.stmt=try\u6587\u306E\u30B3\u30FC\u30C9\u304C\u5927\u304D\u3059\u304E\u307E\u3059 + compiler.err.limit.dimensions=\u914D\u5217\u578B\u306E\u6B21\u5143\u304C\u591A\u3059\u304E\u307E\u3059 + compiler.err.limit.locals=\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u304C\u591A\u3059\u304E\u307E\u3059 + compiler.err.limit.parameters=\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u591A\u3059\u304E\u307E\u3059 + compiler.err.limit.pool=\u5B9A\u6570\u304C\u591A\u3059\u304E\u307E\u3059 + compiler.err.limit.pool.in.class=\u30AF\u30E9\u30B9{0}\u5185\u306E\u5B9A\u6570\u304C\u591A\u3059\u304E\u307E\u3059 + compiler.err.limit.stack=\u30B3\u30FC\u30C9\u304C\u8981\u6C42\u3059\u308B\u30B9\u30BF\u30C3\u30AF\u304C\u591A\u3059\u304E\u307E\u3059 + compiler.err.limit.string=\u5B9A\u6570\u6587\u5B57\u5217\u304C\u9577\u3059\u304E\u307E\u3059 + compiler.err.limit.string.overflow=\u6587\u5B57\u5217\"{0}...\"\u306EUTF8\u8868\u73FE\u304C\u3001\u5B9A\u6570\u30D7\u30FC\u30EB\u306B\u5BFE\u3057\u3066\u9577\u3059\u304E\u307E\u3059 compiler.err.malformed.fp.lit=\u6D6E\u52D5\u5C0F\u6570\u70B9\u30EA\u30C6\u30E9\u30EB\u304C\u4E0D\u6B63\u3067\u3059 + compiler.err.method.does.not.override.superclass=\u30E1\u30BD\u30C3\u30C9\u306F\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u5B9F\u88C5\u3057\u307E\u305B\u3093 + compiler.err.missing.meth.body.or.decl.abstract=\u30E1\u30BD\u30C3\u30C9\u672C\u4F53\u304C\u306A\u3044\u304B\u3001abstract\u3068\u3057\u3066\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u3059 + compiler.err.missing.ret.stmt=return\u6587\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.err.missing.ret.val=\u623B\u308A\u5024\u304C\u3042\u308A\u307E\u305B\u3093 + +# 0: set of modifier compiler.err.mod.not.allowed.here=\u4FEE\u98FE\u5B50{0}\u3092\u3053\u3053\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.intf.not.allowed.here=\u3053\u3053\u3067\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 + compiler.err.enums.must.be.static=\u5217\u6319\u578B\u306E\u5BA3\u8A00\u306Fstatic\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059 +# 0: symbol, 1: symbol compiler.err.name.clash.same.erasure=\u540D\u524D\u304C\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002{0}\u3068{1}\u306F\u524A\u9664\u5F8C\u306E\u540D\u524D\u304C\u540C\u3058\u3067\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol, 4: unused, 5: unused compiler.err.name.clash.same.erasure.no.override=\u540D\u524D\u304C\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002{1}\u306E{0}\u3068{3}\u306E{2}\u306F\u307E\u3060\u4ED6\u65B9\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u305B\u3093\u304C\u3001\u524A\u9664\u5F8C\u306E\u540D\u524D\u304C\u540C\u3058\u3067\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol, 4: symbol, 5: symbol +compiler.err.name.clash.same.erasure.no.override.1=\u540D\u524D\u304C\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002{1}\u306E{0}\u306E\u3069\u3061\u3089\u3082\u3001\u4ED6\u65B9\u306E\u6700\u521D\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u307E\u3060\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u305B\u3093\u304C\u3001\u524A\u9664\u5F8C\u306E\u540D\u524D\u304C\u5225\u306E\u30E1\u30BD\u30C3\u30C9\u3068\u540C\u3058\u30E1\u30BD\u30C3\u30C9\u3092\n\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059\u3002\u6700\u521D\u306E\u30E1\u30BD\u30C3\u30C9: {3}\u306E{2}\n2\u756A\u76EE\u306E\u30E1\u30BD\u30C3\u30C9: {5}\u306E{4} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol +compiler.err.name.clash.same.erasure.no.hide=\u540D\u524D\u304C\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059\u3002{1}\u306E{0}\u3068{3}\u306E{2}\u306F\u307E\u3060\u4ED6\u65B9\u3092\u975E\u8868\u793A\u306B\u3057\u3066\u3044\u307E\u305B\u3093\u304C\u3001\u524A\u9664\u5F8C\u306E\u540D\u524D\u304C\u540C\u3058\u3067\u3059 + compiler.err.name.reserved.for.internal.use={0}\u306F\u5185\u90E8\u3067\u306E\u4F7F\u7528\u306E\u305F\u3081\u4E88\u7D04\u3055\u308C\u3066\u3044\u307E\u3059 + compiler.err.native.meth.cant.have.body=native\u30E1\u30BD\u30C3\u30C9\u304C\u672C\u4F53\u3092\u6301\u3064\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: type compiler.err.neither.conditional.subtype=?\u306B\u5BFE\u3059\u308B\u4E92\u63DB\u6027\u306E\u306A\u3044\u578B : \u3069\u3061\u3089\u3082\u4ED6\u65B9\u306E\u30B5\u30D6\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\n2\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {0}\n3\u756A\u76EE\u306E\u30AA\u30DA\u30E9\u30F3\u30C9 : {1} + compiler.err.new.not.allowed.in.annotation=''new''\u306F\u6CE8\u91C8\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + compiler.err.no.annotation.member={1}\u306E\u6CE8\u91C8\u30E1\u30F3\u30D0\u30FC{0}\u304C\u3042\u308A\u307E\u305B\u3093 + compiler.err.no.encl.instance.of.type.in.scope=\u578B{0}\u306E\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u56F2\u3080\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u30B9\u30B3\u30FC\u30D7\u5185\u306B\u3042\u308A\u307E\u305B\u3093 + compiler.err.no.intf.expected.here=\u3053\u3053\u306B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093 + compiler.err.no.match.entry={0}\u306F{1}\u306E\u30A8\u30F3\u30C8\u30EA\u306B\u9069\u5408\u3057\u307E\u305B\u3093\u3002{2}\u304C\u5FC5\u8981\u3067\u3059 + compiler.err.not.annotation.type={0}\u306F\u6CE8\u91C8\u578B\u3067\u306F\u3042\u308A\u307E\u305B\u3093 + +# 0: symbol, 1: symbol compiler.err.not.def.access.class.intf.cant.access={1}\u306E{0}\u304C\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: symbol, 1: symbol compiler.err.not.def.public.cant.access={1}\u306E{0}\u306Fpublic\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u5916\u304B\u3089\u306F\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093 + +# 0: name compiler.err.not.loop.label={0}\u306F\u30EB\u30FC\u30D7\u30FB\u30E9\u30D9\u30EB\u3067\u306F\u3042\u308A\u307E\u305B\u3093 + compiler.err.not.stmt=\u6587\u3067\u306F\u3042\u308A\u307E\u305B\u3093 + +# 0: symbol compiler.err.not.encl.class={0}\u306F\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u56F2\u307F\u307E\u305B\u3093 -compiler.err.operator.cant.be.applied=\u6F14\u7B97\u5B50{0}\u306F{1}\u306B\u9069\u7528\u3067\u304D\u307E\u305B\u3093 +# 0: name, 1: type, 2: unused +compiler.err.operator.cant.be.applied=\u5358\u9805\u6F14\u7B97\u5B50''{0}''\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u578B{1}\u304C\u4E0D\u6B63\u3067\u3059 + +# 0: name, 1: type, 2: type +compiler.err.operator.cant.be.applied.1=\u4E8C\u9805\u6F14\u7B97\u5B50''{0}''\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u578B\u304C\u4E0D\u6B63\u3067\u3059\n\u6700\u521D\u306E\u578B: {1}\n2\u756A\u76EE\u306E\u578B: {2} compiler.err.pkg.annotations.sb.in.package-info.java=\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6CE8\u91C8\u306F\u30D5\u30A1\u30A4\u30EBpackage-info.java\u5185\u306B\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + +# 0: symbol compiler.err.pkg.clashes.with.class.of.same.name=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u540C\u540D\u306E\u30AF\u30E9\u30B9\u3068\u7AF6\u5408\u3057\u3066\u3044\u307E\u3059 compiler.err.warnings.and.werror=\u8B66\u544A\u304C\u898B\u3064\u304B\u308A-Werror\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F # Errors related to annotation processing +# 0: symbol, 1: string, 2: stack-trace compiler.err.proc.cant.access={0}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n{1}\n\u8A73\u7D30\u306F\u6B21\u306E\u30B9\u30BF\u30C3\u30AF\u30C8\u30EC\u30FC\u30B9\u3067\u8ABF\u67FB\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n{2} +# 0: symbol, 1: string +compiler.err.proc.cant.access.1={0}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n{1} + +# 0: string compiler.err.proc.cant.find.class=''{0}''\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002 # Print a client-generated error message; assumed to be localized, no translation required +# 0: string compiler.err.proc.messager={0} +# 0: list of string compiler.err.proc.no.explicit.annotation.processing.requested=\u30AF\u30E9\u30B9\u540D''{0}''\u304C\u53D7\u3051\u5165\u308C\u3089\u308C\u308B\u306E\u306F\u3001\u6CE8\u91C8\u51E6\u7406\u304C\u660E\u793A\u7684\u306B\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u305F\u5834\u5408\u306E\u307F\u3067\u3059 compiler.err.proc.no.service=\u30B5\u30FC\u30D3\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u30FB\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\njava.util.ServiceLoader\u304Bsun.misc.Service\u304C\u4F7F\u7528\u3067\u304D\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 compiler.err.proc.processor.bad.option.name=\u30D7\u30ED\u30BB\u30C3\u30B5''{1}''\u306B\u3088\u3063\u3066\u6307\u5B9A\u3055\u308C\u305F\u30AA\u30D7\u30B7\u30E7\u30F3\u540D''{0}''\u304C\u4E0D\u6B63\u3067\u3059 +# 0: string compiler.err.proc.processor.cant.instantiate=\u30D7\u30ED\u30BB\u30C3\u30B5''{0}''\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F compiler.err.proc.processor.constructor.error=\u30D7\u30ED\u30BB\u30C3\u30B5\u30FB\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u69CB\u7BC9\u4E2D\u306B\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F: {0} +# 0: string compiler.err.proc.processor.not.found=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5''{0}''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +# 0: string compiler.err.proc.processor.wrong.type=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5''{0}''\u304Cjavax.annotation.processing.Processor\u3092\u5B9F\u88C5\u3057\u3066\u3044\u307E\u305B\u3093 compiler.err.proc.service.problem=\u30D7\u30ED\u30BB\u30C3\u30B5\u3092\u30ED\u30FC\u30C9\u3059\u308B\u305F\u3081\u306E\u30B5\u30FC\u30D3\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u3092\u4F5C\u6210\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002 @@ -234,67 +476,146 @@ compiler.err.proc.cant.create.loader=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u306E\u30AF\u30E9\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: {0} +# 0: unused compiler.err.qualified.new.of.static.class=static\u30AF\u30E9\u30B9\u306Enew\u304C\u4FEE\u98FE\u3055\u308C\u3066\u3044\u307E\u3059 compiler.err.recursive.ctor.invocation=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u547C\u51FA\u3057\u304C\u518D\u5E30\u7684\u3067\u3059 + +# 0: name, 1: symbol kind, 2: symbol, 3: symbol, 4: symbol kind, 5: symbol, 6: symbol compiler.err.ref.ambiguous={0}\u306E\u53C2\u7167\u306F\u3042\u3044\u307E\u3044\u3067\u3059\u3002{3}\u306E{1} {2}\u3068{6}\u306E{4} {5}\u304C\u4E21\u65B9\u9069\u5408\u3057\u307E\u3059 + compiler.err.repeated.annotation.target=\u6CE8\u91C8\u30BF\u30FC\u30B2\u30C3\u30C8\u304C\u7E70\u308A\u8FD4\u3055\u308C\u3066\u3044\u307E\u3059 + compiler.err.repeated.interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304C\u7E70\u308A\u8FD4\u3055\u308C\u3066\u3044\u307E\u3059 + compiler.err.repeated.modifier=\u4FEE\u98FE\u5B50\u304C\u7E70\u308A\u8FD4\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: symbol, 1: set of modifier, 2: symbol compiler.err.report.access={0}\u306F{2}\u3067{1}\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u307E\u3059 + compiler.err.ret.outside.meth=\u30E1\u30BD\u30C3\u30C9\u306E\u5916\u306Ereturn\u6587\u3067\u3059 compiler.err.signature.doesnt.match.supertype=\u30B7\u30B0\u30CB\u30C1\u30E3\u304C{0}\u306B\u9069\u5408\u3057\u307E\u305B\u3093\u3002\u4E92\u63DB\u6027\u306E\u306A\u3044\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7\u3067\u3059 + compiler.err.signature.doesnt.match.intf=\u30B7\u30B0\u30CB\u30C1\u30E3\u304C{0}\u306B\u9069\u5408\u3057\u307E\u305B\u3093\u3002\u4E92\u63DB\u6027\u306E\u306A\u3044\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u3059 + +# 0: symbol, 1: symbol, 2: symbol compiler.err.does.not.override.abstract={0}\u306Fabstract\u3067\u306A\u304F\u3001{2}\u5185\u306Eabstract\u30E1\u30BD\u30C3\u30C9{1}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u305B\u3093 + compiler.err.source.cant.overwrite.input.file=\u30BD\u30FC\u30B9\u306E\u66F8\u8FBC\u307F\u30A8\u30E9\u30FC\u3067\u3059\u3002\u5165\u529B\u30D5\u30A1\u30A4\u30EB{0}\u3092\u4E0A\u66F8\u304D\u3067\u304D\u307E\u305B\u3093 + compiler.err.stack.sim.error=\u5185\u90E8\u30A8\u30E9\u30FC: {0}\u3067\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30B7\u30DF\u30E5\u30EC\u30FC\u30B7\u30E7\u30F3\u30FB\u30A8\u30E9\u30FC + compiler.err.static.imp.only.classes.and.interfaces=static import\u306F\u30AF\u30E9\u30B9\u3068\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u306E\u307F\u3068\u306A\u308A\u307E\u3059 + compiler.err.string.const.req=\u5B9A\u6570\u306E\u6587\u5B57\u5217\u5F0F\u304C\u5FC5\u8981\u3067\u3059 + +# 0: symbol, 1: symbol compiler.err.synthetic.name.conflict=\u30B7\u30F3\u30DC\u30EB{0}\u304C\u3001{1}\u3067\u30B3\u30F3\u30D1\u30A4\u30E9\u304C\u5408\u6210\u3057\u305F\u30B7\u30F3\u30DC\u30EB\u3068\u7AF6\u5408\u3057\u307E\u3059 + +# 0: symbol, 1: symbol compiler.warn.synthetic.name.conflict=\u30B7\u30F3\u30DC\u30EB{0}\u304C\u3001{1}\u3067\u30B3\u30F3\u30D1\u30A4\u30E9\u304C\u5408\u6210\u3057\u305F\u30B7\u30F3\u30DC\u30EB\u3068\u7AF6\u5408\u3057\u307E\u3059 compiler.err.throws.not.allowed.in.intf.annotation=throws\u7BC0\u3092@interface\u30E1\u30F3\u30D0\u30FC\u3067\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.try.without.catch.or.finally=''try''\u3078\u306E''catch''\u307E\u305F\u306F''finally''\u304C\u3042\u308A\u307E\u305B\u3093 + compiler.err.try.without.catch.finally.or.resource.decls=''try''\u3078\u306E''catch''\u3001''finally''\u307E\u305F\u306F\u30EA\u30BD\u30FC\u30B9\u5BA3\u8A00\u304C\u3042\u308A\u307E\u305B\u3093 + +# 0: symbol compiler.err.type.doesnt.take.params=\u578B{0}\u306F\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u3068\u308A\u307E\u305B\u3093 + compiler.err.type.var.cant.be.deref=\u578B\u5909\u6570\u304B\u3089\u9078\u629E\u3067\u304D\u307E\u305B\u3093 + compiler.err.type.var.may.not.be.followed.by.other.bounds=\u3053\u306E\u578B\u5909\u6570\u306E\u5F8C\u308D\u306B\u4ED6\u306E\u5883\u754C\u3092\u914D\u7F6E\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.type.var.more.than.once=\u578B\u5909\u6570{0}\u306F{1}\u306E\u623B\u308A\u5024\u306E\u578B\u30672\u56DE\u4EE5\u4E0A\u51FA\u73FE\u3057\u307E\u3059\u3002\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u751F\u6210\u3055\u308C\u306A\u3044\u307E\u307E\u306B\u306F\u3067\u304D\u307E\u305B\u3093 + compiler.err.type.var.more.than.once.in.result=\u578B\u5909\u6570{0}\u306F{1}\u306E\u578B\u30672\u56DE\u4EE5\u4E0A\u51FA\u73FE\u3057\u307E\u3059\u3002\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u751F\u6210\u3055\u308C\u306A\u3044\u307E\u307E\u306B\u306F\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: type, 2: string compiler.err.types.incompatible.diff.ret=\u578B{0}\u3068\u578B{1}\u306E\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u4E21\u65B9\u3068\u3082{2}\u3092\u5B9A\u7FA9\u3057\u3066\u3044\u307E\u3059\u304C\u3001\u623B\u308A\u5024\u306E\u578B\u304C\u7121\u95A2\u4FC2\u3067\u3059 compiler.err.unclosed.char.lit=\u6587\u5B57\u30EA\u30C6\u30E9\u30EB\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.err.unclosed.comment=\u30B3\u30E1\u30F3\u30C8\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.err.unclosed.str.lit=\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093 -compiler.err.unknown.enum.constant=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u5185: \u4E0D\u660E\u306A\u5217\u6319\u578B\u5B9A\u6570\u3067\u3059{1}.{2} + +# 0: name compiler.err.unsupported.encoding=\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3067\u3059: {0} + compiler.err.io.exception=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u53D6\u308A\u30A8\u30E9\u30FC\u3067\u3059: {0} + +# 0: name compiler.err.undef.label=\u30E9\u30D9\u30EB{0}\u306F\u672A\u5B9A\u7FA9\u3067\u3059 -compiler.err.undetermined.type={0}\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u5224\u5225\u3067\u304D\u307E\u305B\u3093 -compiler.err.undetermined.type.1=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u3092\u5224\u5225\u3067\u304D\u307E\u305B\u3093\u3002{1} + +compiler.err.undetermined.type={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: message segment +compiler.err.undetermined.type.1={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\n\u7406\u7531: {1} + +# 0: list of type, 1: message segment compiler.err.invalid.inferred.types={0}\u306E\u63A8\u5B9A\u578B\u304C\u7121\u52B9\u3067\u3059\u3002{1} + +# 0: message segment, 1: unused compiler.err.cant.apply.diamond={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093 + +# 0: message segment, 1: message segment compiler.err.cant.apply.diamond.1={0}\u306E\u578B\u5F15\u6570\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002\n\u7406\u7531: {1} + compiler.err.unreachable.stmt=\u3053\u306E\u6587\u306B\u5236\u5FA1\u304C\u79FB\u308B\u3053\u3068\u306F\u3042\u308A\u307E\u305B\u3093 + compiler.err.initializer.must.be.able.to.complete.normally=\u521D\u671F\u5316\u5B50\u306F\u6B63\u5E38\u306B\u5B8C\u4E86\u3067\u304D\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + +# 0: type compiler.err.unreported.exception.need.to.catch.or.throw=\u4F8B\u5916{0}\u306F\u5831\u544A\u3055\u308C\u307E\u305B\u3093\u3002\u30B9\u30ED\u30FC\u3059\u308B\u306B\u306F\u3001\u6355\u6349\u307E\u305F\u306F\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 + +# 0: type compiler.err.unreported.exception.default.constructor=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u5185\u306B\u5831\u544A\u3055\u308C\u306A\u3044\u4F8B\u5916{0}\u304C\u5B58\u5728\u3057\u307E\u3059 + +# 0: type, 1: name +compiler.err.unreported.exception.implicit.close=\u5831\u544A\u3055\u308C\u306A\u3044\u4F8B\u5916{0}\u306F\u3001\u30B9\u30ED\u30FC\u3059\u308B\u306B\u306F\u6355\u6349\u307E\u305F\u306F\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\n\u30EA\u30BD\u30FC\u30B9\u5909\u6570''{1}''\u3067\u306Eclose()\u306E\u6697\u9ED9\u7684\u306A\u30B3\u30FC\u30EB\u304B\u3089\u4F8B\u5916\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F + compiler.err.unsupported.cross.fp.lit=16\u9032\u6D6E\u52D5\u5C0F\u6570\u70B9\u30EA\u30C6\u30E9\u30EB\u306F\u3053\u306EVM\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.err.void.not.allowed.here=\u3053\u3053\u3067''void''\u578B\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +# 0: string compiler.err.wrong.number.type.args=\u578B\u5F15\u6570\u306E\u6570\u304C\u4E0D\u6B63\u3067\u3059\u3002{0}\u500B\u5FC5\u8981\u3067\u3059 +# 0: symbol compiler.err.var.might.already.be.assigned=\u5909\u6570{0}\u306F\u3059\u3067\u306B\u4EE3\u5165\u3055\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 + +# 0: symbol compiler.err.var.might.not.have.been.initialized=\u5909\u6570{0}\u306F\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 + +# 0: symbol compiler.err.var.might.be.assigned.in.loop=\u5909\u6570{0}\u306F\u30EB\u30FC\u30D7\u5185\u3067\u4EE3\u5165\u3055\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 +# 0: symbol, 1: message segment +compiler.err.varargs.invalid.trustme.anno={0}\u6CE8\u91C8\u304C\u7121\u52B9\u3067\u3059\u3002{1} + +# 0: type +compiler.misc.varargs.trustme.on.reifiable.varargs=\u53EF\u5909\u5F15\u6570\u8981\u7D20\u578B{0}\u306Freifiable\u578B\u3067\u3059\u3002 + +# 0: symbol +compiler.misc.varargs.trustme.on.non.varargs.meth=\u30E1\u30BD\u30C3\u30C9{0}\u306F\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 + +# 0: symbol +compiler.misc.varargs.trustme.on.virtual.varargs=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9{0}\u306Ffinal\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 + +# 0: type, 1: kind, 2: symbol +compiler.misc.inaccessible.varargs.type=\u4EEE\u53EF\u5909\u5F15\u6570\u8981\u7D20\u578B{0}\u306F{1} {2}\u304B\u3089\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093 + # In the following string, {1} will always be the detail message from # java.io.IOException. +# 0: symbol, 1: string compiler.err.class.cant.write={0}\u306E\u66F8\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {1} # In the following string, {0} is the name of the class in the Java source. # It really should be used two times.. +# 0: name compiler.err.class.public.should.be.in.file=\u30AF\u30E9\u30B9{0}\u306Fpublic\u3067\u3042\u308A\u3001\u30D5\u30A1\u30A4\u30EB{0}.java\u3067\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 ## All errors which do not refer to a particular line in the source code are @@ -309,9 +630,13 @@ # Fatal Errors compiler.misc.fatal.err.no.java.lang=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: \u30AF\u30E9\u30B9\u30D1\u30B9\u307E\u305F\u306F\u30D6\u30FC\u30C8\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9\u3067\u30D1\u30C3\u30B1\u30FC\u30B8java.lang\u3092\u691C\u51FA\u3067\u304D\u307E\u305B\u3093 + compiler.misc.fatal.err.cant.locate.meth=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: \u30E1\u30BD\u30C3\u30C9{0}\u3092\u691C\u51FA\u3067\u304D\u307E\u305B\u3093 + compiler.misc.fatal.err.cant.locate.field=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: \u30D5\u30A3\u30FC\u30EB\u30C9{0}\u3092\u691C\u51FA\u3067\u304D\u307E\u305B\u3093 + compiler.misc.fatal.err.cant.locate.ctor=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: {0}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3092\u691C\u51FA\u3067\u304D\u307E\u305B\u3093 + compiler.misc.fatal.err.cant.close.loader=\u81F4\u547D\u7684\u30A8\u30E9\u30FC: \u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u306E\u30AF\u30E9\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u3092\u9589\u3058\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 ##### @@ -321,8 +646,13 @@ ## compiler.misc.source.unavailable=(\u30BD\u30FC\u30B9\u304C\u5229\u7528\u4E0D\u53EF) + compiler.misc.base.membership=\u3059\u3079\u3066\u306E\u30D9\u30FC\u30B9\u30FB\u30AF\u30E9\u30B9\u304C\u30E1\u30F3\u30D0\u30FC\u3067\u3059 + +# 0: string, 1: string, 2: boolean compiler.misc.x.print.processor.info=\u30D7\u30ED\u30BB\u30C3\u30B5{0}\u306F{1}\u306B\u4E00\u81F4\u3057\u3001{2}\u3092\u8FD4\u3057\u307E\u3059\u3002 + +# 0: number, 1: string, 2: set of symbol, 3: boolean compiler.misc.x.print.rounds=\u5F80\u5FA9{0}:\n\t\u5165\u529B\u30D5\u30A1\u30A4\u30EB: {1}\n\t\u6CE8\u91C8: {2}\n\t\u6700\u5F8C\u306E\u5F80\u5FA9: {3} ##### @@ -331,77 +661,106 @@ ## "compiler.note". compiler.note.note=\u6CE8\u610F: +# 0: file name compiler.note.deprecated.filename={0}\u306F\u63A8\u5968\u3055\u308C\u306A\u3044API\u3092\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002 + compiler.note.deprecated.plural=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u63A8\u5968\u3055\u308C\u306A\u3044API\u3092\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002 + # The following string may appear after one of the above deprecation # messages. compiler.note.deprecated.recompile=\u8A73\u7D30\u306F\u3001-Xlint:deprecation\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u518D\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +# 0: file name compiler.note.deprecated.filename.additional={0}\u306B\u63A8\u5968\u3055\u308C\u306A\u3044API\u306E\u8FFD\u52A0\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u304C\u3042\u308A\u307E\u3059\u3002 + compiler.note.deprecated.plural.additional=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u63A8\u5968\u3055\u308C\u306A\u3044API\u3092\u8FFD\u52A0\u4F7F\u7528\u307E\u305F\u306F\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u307E\u3059\u3002 +# 0: file name compiler.note.unchecked.filename={0}\u306E\u64CD\u4F5C\u306F\u3001\u672A\u30C1\u30A7\u30C3\u30AF\u307E\u305F\u306F\u5B89\u5168\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 + compiler.note.unchecked.plural=\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u64CD\u4F5C\u306E\u3046\u3061\u3001\u672A\u30C1\u30A7\u30C3\u30AF\u307E\u305F\u306F\u5B89\u5168\u3067\u306F\u306A\u3044\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002 + # The following string may appear after one of the above deprecation # messages. compiler.note.unchecked.recompile=\u8A73\u7D30\u306F\u3001-Xlint:unchecked\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u518D\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +# 0: file name compiler.note.unchecked.filename.additional={0}\u306B\u672A\u30C1\u30A7\u30C3\u30AF\u307E\u305F\u306F\u5B89\u5168\u3067\u306F\u306A\u3044\u64CD\u4F5C\u304C\u3055\u3089\u306B\u3042\u308A\u307E\u3059\u3002 + compiler.note.unchecked.plural.additional=\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u64CD\u4F5C\u306E\u3046\u3061\u3001\u672A\u30C1\u30A7\u30C3\u30AF\u307E\u305F\u306F\u5B89\u5168\u3067\u306F\u306A\u3044\u3082\u306E\u304C\u3055\u3089\u306B\u3042\u308A\u307E\u3059\u3002 -compiler.note.varargs.filename={0}\u306F\u3001\u5B89\u5168\u3067\u306F\u306A\u3044\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u3092\u5BA3\u8A00\u3057\u3066\u3044\u307E\u3059\u3002 -compiler.note.varargs.plural=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u5B89\u5168\u3067\u306F\u306A\u3044\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u3092\u5BA3\u8A00\u3057\u3066\u3044\u307E\u3059\u3002 -# The following string may appear after one of the above unsafe varargs -# messages. -compiler.note.varargs.recompile=\u8A73\u7D30\u306F\u3001-Xlint:varargs\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u518D\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +# 0: file name +compiler.note.sunapi.filename={0}\u306F\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u5185\u90E8\u6240\u6709\u306EAPI\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u3002 -compiler.note.varargs.filename.additional={0}\u306F\u3001\u5B89\u5168\u3067\u306F\u306A\u3044\u8FFD\u52A0\u306E\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u3092\u5BA3\u8A00\u3057\u3066\u3044\u307E\u3059\u3002 -compiler.note.varargs.plural.additional=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u5B89\u5168\u3067\u306F\u306A\u3044\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u3092\u8FFD\u52A0\u3067\u5BA3\u8A00\u3057\u3066\u3044\u307E\u3059\u3002 +compiler.note.sunapi.plural=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u5185\u90E8\u6240\u6709\u306EAPI\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u3002 -compiler.note.sunapi.filename={0}\u306F\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u5185\u90E8\u6240\u6709\u306EAPI\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u3002 -compiler.note.sunapi.plural=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u5185\u90E8\u6240\u6709\u306EAPI\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u3002 # The following string may appear after one of the above sunapi messages. compiler.note.sunapi.recompile=\u8A73\u7D30\u306F\u3001-Xlint:sunapi\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6307\u5B9A\u3057\u3066\u518D\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +# 0: file name compiler.note.sunapi.filename.additional={0}\u306F\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u8FFD\u52A0\u306E\u5185\u90E8\u6240\u6709\u306EAPI\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u3002 + compiler.note.sunapi.plural.additional=\u4E00\u90E8\u306E\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u5185\u90E8\u6240\u6709\u306EAPI\u3092\u8FFD\u52A0\u3067\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u3002 # Notes related to annotation processing # Print a client-generated note; assumed to be localized, no translation required +# 0: string compiler.note.proc.messager={0} ##### +# 0: number compiler.misc.count.error=\u30A8\u30E9\u30FC{0}\u500B + +# 0: number compiler.misc.count.error.plural=\u30A8\u30E9\u30FC{0}\u500B + +# 0: number compiler.misc.count.warn=\u8B66\u544A{0}\u500B + +# 0: number compiler.misc.count.warn.plural=\u8B66\u544A{0}\u500B compiler.misc.version.not.available=(\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093) ## extra output when using -verbose (JavaCompiler) +# 0: symbol compiler.misc.verbose.checking.attribution=[{0}\u3092\u78BA\u8A8D\u4E2D] + +# 0: string compiler.misc.verbose.parsing.done=[{0}\u30DF\u30EA\u79D2\u3067\u69CB\u6587\u89E3\u6790\u5B8C\u4E86] + +# 0: file name compiler.misc.verbose.parsing.started=[{0}\u3092\u69CB\u6587\u89E3\u6790\u958B\u59CB] + +# 0: string compiler.misc.verbose.total=[\u5408\u8A08{0}\u30DF\u30EA\u79D2] + +# 0: file name compiler.misc.verbose.wrote.file=[{0}\u3092\u66F8\u8FBC\u307F\u5B8C\u4E86] ## extra output when using -verbose (Retro) compiler.misc.verbose.retro=[{0}\u3092\u7D44\u66FF\u3048\u4E2D] + compiler.misc.verbose.retro.with=\t{0}\u3092{1}\u3067\u7D44\u66FF\u3048\u4E2D\u3067\u3059 + compiler.misc.verbose.retro.with.list=\t{0}\u3092\u578B\u30D1\u30E9\u30E1\u30FC\u30BF{1}\u3001\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7{2}\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9{3}\u3067\u7D44\u66FF\u3048\u4E2D\u3067\u3059 ## extra output when using -verbose (code/ClassReader) +# 0: string compiler.misc.verbose.loading=[{0}\u3092\u8AAD\u8FBC\u307F\u4E2D] +# 0: string compiler.misc.verbose.sourcepath=[\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u691C\u7D22\u30D1\u30B9: {0}] +# 0: string compiler.misc.verbose.classpath=[\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u691C\u7D22\u30D1\u30B9: {0}] ## extra output when using -checkclassfile (code/ClassReader) compiler.misc.ccf.found.later.version=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E88\u60F3\u5916\u306E\u65B0\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059 + compiler.misc.ccf.unrecognized.attribute={0}\u306F\u8A8D\u8B58\u3055\u308C\u306A\u3044\u5C5E\u6027\u3067\u3059 ## extra output when using -prompt (util/Log) @@ -418,66 +777,106 @@ ## Warning messages may also include the following prefix to identify a ## lint option +# 0: option name compiler.warn.lintOption=[{0}]\u0020 +# 0: symbol compiler.warn.constant.SVUID=serialVersionUID\u306F\u30AF\u30E9\u30B9{0}\u306E\u5B9A\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +# 0: file name compiler.warn.dir.path.element.not.found=\u4E0D\u6B63\u306A\u30D1\u30B9\u8981\u7D20"{0}": \u305D\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 compiler.warn.finally.cannot.complete=finally\u7BC0\u304C\u6B63\u5E38\u306B\u5B8C\u4E86\u3067\u304D\u307E\u305B\u3093 +# 0: symbol, 1: symbol compiler.warn.has.been.deprecated={1}\u306E{0}\u306F\u63A8\u5968\u3055\u308C\u307E\u305B\u3093 +# 0: symbol compiler.warn.sun.proprietary={0}\u306F\u5185\u90E8\u6240\u6709\u306EAPI\u3067\u3042\u308A\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 compiler.warn.illegal.char.for.encoding=\u3053\u306E\u6587\u5B57\u306F\u3001\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306B\u30DE\u30C3\u30D7\u3067\u304D\u307E\u305B\u3093 +# 0: symbol compiler.warn.improper.SVUID=serialVersionUID\u306F\u3001\u30AF\u30E9\u30B9{0}\u306Bstatic final\u3092\u5BA3\u8A00\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +# 0: type, 1: type compiler.warn.inexact.non-varargs.call=\u6700\u7D42\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u4E0D\u6B63\u78BA\u306A\u5F15\u6570\u578B\u3092\u6301\u3063\u305F\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u306E\u975E\u53EF\u5909\u5F15\u6570\u547C\u51FA\u3057\u3002\n\u53EF\u5909\u5F15\u6570\u547C\u51FA\u3057\u306B\u95A2\u3057\u3066\u306F{0}\u306B\u30AD\u30E3\u30B9\u30C8\u3057\u307E\u3059\u3002\n\u975E\u53EF\u5909\u5F15\u6570\u547C\u51FA\u3057\u306B\u95A2\u3057\u3066\u306F{1}\u306B\u30AD\u30E3\u30B9\u30C8\u3057\u3066\u3053\u306E\u8B66\u544A\u3092\u51FA\u3055\u306A\u3044\u3088\u3046\u306B\u3057\u307E\u3059 +# 0: list of type +compiler.warn.unreachable.catch=catch\u53E5\u306B\u79FB\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\n\u30B9\u30ED\u30FC\u3055\u308C\u305F\u30BF\u30A4\u30D7{0}\u306F\u3059\u3067\u306B\u6355\u6349\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: list of type +compiler.warn.unreachable.catch.1=catch\u53E5\u306B\u79FB\u3059\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\n\u30B9\u30ED\u30FC\u3055\u308C\u305F\u30BF\u30A4\u30D7{0}\u306F\u3059\u3067\u306B\u6355\u6349\u3055\u308C\u3066\u3044\u307E\u3059 + +# 0: symbol compiler.warn.long.SVUID=serialVersionUID\u306F\u3001\u30AF\u30E9\u30B9{0}\u306Elong\u578B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +# 0: symbol compiler.warn.missing.SVUID=\u76F4\u5217\u5316\u53EF\u80FD\u306A\u30AF\u30E9\u30B9{0}\u306B\u306F\u3001serialVersionUID\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +# 0: message segment compiler.warn.override.varargs.missing={0}\u3002\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u306B\u306F''...''\u304C\u3042\u308A\u307E\u305B\u3093 + +# 0: message segment compiler.warn.override.varargs.extra={0}\u3002\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u3066\u3044\u308B\u30E1\u30BD\u30C3\u30C9\u306B\u306F''...''\u304C\u3042\u308A\u307E\u305B\u3093 + compiler.warn.override.bridge={0}\u3002\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u306F\u30D6\u30EA\u30C3\u30B8\u30FB\u30E1\u30BD\u30C3\u30C9\u3067\u3059 +# 0: symbol compiler.warn.pkg-info.already.seen=package-info.java\u30D5\u30A1\u30A4\u30EB\u304C\u3059\u3067\u306B\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u7528\u306B\u8868\u793A\u3055\u308C\u3066\u3044\u307E\u3059 +# 0: file name compiler.warn.path.element.not.found=\u4E0D\u6B63\u306A\u30D1\u30B9\u8981\u7D20"{0}": \u305D\u306E\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u3042\u308A\u307E\u305B\u3093 compiler.warn.possible.fall-through.into.case=case\u306Bfall-through\u3059\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 +# 0: type compiler.warn.redundant.cast={0}\u3078\u306E\u5197\u9577\u306A\u30AD\u30E3\u30B9\u30C8\u3067\u3059 +# 0: number compiler.warn.position.overflow=\u4F4D\u7F6E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u304C\u884C{0}\u3067\u30AA\u30FC\u30D0\u30FC\u30D5\u30ED\u30FC\u3057\u307E\u3059 +# 0: file name, 1: number, 2: number compiler.warn.big.major.version={0}: \u30E1\u30B8\u30E3\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3{1}\u306F\u3001\u3053\u306E\u30B3\u30F3\u30D1\u30A4\u30E9\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u308B\u6700\u65B0\u306E\u30E1\u30B8\u30E3\u30FC\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3{2}\u3088\u308A\u65B0\u3057\u3044\u3067\u3059\u3002\n\u30B3\u30F3\u30D1\u30A4\u30E9\u306E\u30A2\u30C3\u30D7\u30B0\u30EC\u30FC\u30C9\u3092\u304A\u85A6\u3081\u3057\u307E\u3059\u3002 +# 0: symbol kind, 1: symbol compiler.warn.static.not.qualified.by.type=static {0}\u306F\u5F0F\u3067\u306F\u306A\u304F\u578B\u540D{1}\u3067\u4FEE\u98FE\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +# 0: string compiler.warn.source.no.bootclasspath=\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9\u304C-source {0}\u3068\u4E00\u7DD2\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +# 0: name, 1: number, 2: number, 3: number, 4: number +compiler.warn.future.attr=\u30D0\u30FC\u30B8\u30E7\u30F3{1}.{2}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3067\u5C0E\u5165\u3055\u308C\u305F{0}\u5C5E\u6027\u306F\u3001\u30D0\u30FC\u30B8\u30E7\u30F3{3}.{4}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u7121\u8996\u3055\u308C\u307E\u3059 + # Warnings related to annotation processing +# 0: name compiler.warn.proc.package.does.not.exist=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 + +# 0: name compiler.warn.proc.file.reopening=''{0}''\u7528\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8907\u6570\u56DE\u4F5C\u6210\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307E\u3059 +# 0: name compiler.warn.proc.type.already.exists=\u30BF\u30A4\u30D7''{0}''\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u30BD\u30FC\u30B9\u30FB\u30D1\u30B9\u307E\u305F\u306F\u30AF\u30E9\u30B9\u30D1\u30B9\u306B\u5B58\u5728\u3057\u307E\u3059 +# 0: name compiler.warn.proc.type.recreate=\u30BF\u30A4\u30D7''{0}''\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8907\u6570\u56DE\u4F5C\u6210\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307E\u3059 +# 0: string compiler.warn.proc.illegal.file.name=\u7121\u52B9\u306A\u540D\u524D''{0}''\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002 +# 0: string, 1: string compiler.warn.proc.suspicious.class.name=\u540D\u524D\u304C{1}\u3067\u7D42\u308F\u308B\u578B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059: ''{0}'' +# 0: name compiler.warn.proc.file.create.last.round=\u6700\u5F8C\u306B\u4F5C\u6210\u3055\u308C\u305F\u30BF\u30A4\u30D7''{0}''\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u6CE8\u91C8\u51E6\u7406\u306B\u6E21\u3055\u308C\u307E\u305B\u3093\u3002 +# 0: string, 1: string compiler.warn.proc.malformed.supported.string=\u30D7\u30ED\u30BB\u30C3\u30B5''{1}''\u304C\u8FD4\u3057\u305F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u308B\u6CE8\u91C8\u578B\u306E\u6587\u5B57\u5217''{0}''\u304C\u4E0D\u6B63\u3067\u3059 +# 0: set of string compiler.warn.proc.annotations.without.processors=\u3053\u308C\u3089\u306E\u6CE8\u91C8\u3092\u8981\u6C42\u3059\u308B\u30D7\u30ED\u30BB\u30C3\u30B5\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F: {0} +# 0: source version, 1: string, 2: string compiler.warn.proc.processor.incompatible.source.version=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5''{1}''\u304B\u3089-source ''{2}''\u3088\u308A\u5C0F\u3055\u3044\u30BD\u30FC\u30B9\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3''{0}''\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u3059 compiler.warn.proc.proc-only.requested.no.procs=\u30B3\u30F3\u30D1\u30A4\u30EB\u306A\u3057\u306E\u6CE8\u91C8\u51E6\u7406\u304C\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u307E\u3057\u305F\u304C\u3001\u30D7\u30ED\u30BB\u30C3\u30B5\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002 @@ -487,23 +886,44 @@ compiler.warn.proc.use.proc.or.implicit=\u6697\u9ED9\u7684\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u306F\u6CE8\u91C8\u51E6\u7406\u306B\u6E21\u3055\u308C\u307E\u305B\u3093\u3002\n-proc:none\u3092\u4F7F\u7528\u3057\u6CE8\u91C8\u51E6\u7406\u3092\u7121\u52B9\u306B\u3059\u308B\u304B -implicit\u3092\u4F7F\u7528\u3057\u6697\u9ED9\u7684\u30B3\u30F3\u30D1\u30A4\u30EB\u306E\u30DD\u30EA\u30B7\u30FC\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 # Print a client-generated warning; assumed to be localized, no translation required +# 0: string compiler.warn.proc.messager={0} +# 0: set of name compiler.warn.proc.unclosed.type.files=\u30BF\u30A4\u30D7''{0}''\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u3053\u308C\u3089\u306E\u30BF\u30A4\u30D7\u306F\u6CE8\u91C8\u51E6\u7406\u3055\u308C\u307E\u305B\u3093 +# 0: string compiler.warn.proc.unmatched.processor.options=\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u3069\u306E\u30D7\u30ED\u30BB\u30C3\u30B5\u3067\u3082\u8A8D\u8B58\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F: ''{0}'' compiler.warn.try.explicit.close.call=\u81EA\u52D5\u30AF\u30ED\u30FC\u30BA\u53EF\u80FD\u306A\u30EA\u30BD\u30FC\u30B9\u306B\u304A\u3051\u308Bclose()\u306E\u660E\u793A\u7684\u547C\u51FA\u3057 + +# 0: symbol compiler.warn.try.resource.not.referenced=\u81EA\u52D5\u30AF\u30ED\u30FC\u30BA\u53EF\u80FD\u306A\u30EA\u30BD\u30FC\u30B9{0}\u306F\u5BFE\u5FDC\u3059\u308Btry\u6587\u306E\u672C\u4F53\u3067\u306F\u53C2\u7167\u3055\u308C\u307E\u305B\u3093 + +# 0: type +compiler.warn.try.resource.throws.interrupted.exc=\u81EA\u52D5\u30AF\u30ED\u30FC\u30BA\u53EF\u80FD\u306A\u30EA\u30BD\u30FC\u30B9{0}\u306B\u3001InterruptedException\u3092\u30B9\u30ED\u30FC\u3059\u308B\u53EF\u80FD\u6027\u304C\u3042\u308B\u30E1\u30F3\u30D0\u30FC\u30FB\u30E1\u30BD\u30C3\u30C9close()\u304C\u3042\u308A\u307E\u3059 + compiler.warn.unchecked.assign={0}\u304B\u3089{1}\u3078\u306E\u7121\u691C\u67FB\u4EE3\u5165\u3067\u3059 + +# 0: symbol, 1: type compiler.warn.unchecked.assign.to.var=raw\u578B{1}\u306E\u30E1\u30F3\u30D0\u30FC\u3068\u3057\u3066\u5909\u6570{0}\u3078\u306E\u7121\u691C\u67FB\u4EE3\u5165\u3067\u3059 + +# 0: symbol, 1: type compiler.warn.unchecked.call.mbr.of.raw.type=raw\u578B{1}\u306E\u30E1\u30F3\u30D0\u30FC\u3068\u3057\u3066\u306E{0}\u3078\u306E\u7121\u691C\u67FB\u547C\u51FA\u3057\u3067\u3059 + compiler.warn.unchecked.cast.to.type=\u578B{0}\u3078\u306E\u7121\u691C\u67FB\u30AD\u30E3\u30B9\u30C8\u3067\u3059 + +# 0: symbol kind, 1: name, 2: list of type, 3: list of type, 4: symbol kind, 5: symbol compiler.warn.unchecked.meth.invocation.applied=\u7121\u691C\u67FB\u30E1\u30BD\u30C3\u30C9\u547C\u51FA\u3057: {4} {5}\u306E{0} {1}\u306F\u6307\u5B9A\u3055\u308C\u305F\u578B\u306B\u9069\u7528\u3055\u308C\u307E\u3059\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {3} +# 0: type compiler.warn.unchecked.generic.array.creation=\u578B{0}\u306E\u53EF\u5909\u5F15\u6570\u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u5BFE\u3059\u308B\u7DCF\u79F0\u578B\u914D\u5217\u306E\u7121\u691C\u67FB\u4F5C\u6210\u3067\u3059 -compiler.warn.varargs.non.reifiable.type=\u30D1\u30E9\u30E1\u30FC\u30BF\u5316\u3055\u308C\u305F\u53EF\u5909\u5F15\u6570\u578B{0}\u304B\u3089\u306E\u30D2\u30FC\u30D7\u6C5A\u67D3\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 +# 0: type +compiler.warn.unchecked.varargs.non.reifiable.type=\u30D1\u30E9\u30E1\u30FC\u30BF\u5316\u3055\u308C\u305F\u53EF\u5909\u5F15\u6570\u578B{0}\u304B\u3089\u306E\u30D2\u30FC\u30D7\u6C5A\u67D3\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 + +# 0: symbol +compiler.warn.varargs.unsafe.use.varargs.param=\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u306F\u3001\u578B\u60C5\u5831\u4FDD\u6301\u53EF\u80FD\u3067\u306A\u3044\u53EF\u5909\u5F15\u6570\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u304B\u3089\u306E\u30D2\u30FC\u30D7\u6C5A\u67D3\u306E\u539F\u56E0\u3068\u306A\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 compiler.warn.missing.deprecated.annotation=\u63A8\u5968\u3055\u308C\u306A\u3044\u9805\u76EE\u306F@Deprecated\u3067\u6CE8\u91C8\u304C\u4ED8\u3051\u3089\u308C\u3066\u3044\u307E\u305B\u3093 @@ -519,23 +939,44 @@ compiler.warn.annotation.method.not.found.reason=\u30BF\u30A4\u30D7''{0}''\u5185\u306B\u6CE8\u91C8\u30E1\u30BD\u30C3\u30C9''{1}()''\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {2} -compiler.warn.raw.class.use=raw\u578B\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: {0}\n\u6C4E\u7528\u30AF\u30E9\u30B9{1}\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093 +# 0: symbol, 1: name +compiler.warn.unknown.enum.constant=\u4E0D\u660E\u306A\u5217\u6319\u578B\u5B9A\u6570\u3067\u3059{1}.{2} + +# 0: symbol, 1: name, 2: message segment +compiler.warn.unknown.enum.constant.reason=\u4E0D\u660E\u306A\u5217\u6319\u578B\u5B9A\u6570\u3067\u3059{1}.{2}\n\u7406\u7531: {3} + +# 0: type, 1: type +compiler.warn.raw.class.use=raw\u578B\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F: {0}\n\u6C4E\u7528\u30AF\u30E9\u30B9{1}\u306E\u578B\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093 +# 0: unused, 1: unused compiler.warn.diamond.redundant.args=\u65B0\u3057\u3044\u5F0F\u306E\u578B\u5F15\u6570\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059(\u304B\u308F\u308A\u306B\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50\u3092\u4F7F\u7528\u3057\u307E\u3059)\u3002 + +# 0: type, 1: type compiler.warn.diamond.redundant.args.1=\u65B0\u3057\u3044\u5F0F\u306E\u578B\u5F15\u6570\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059(\u304B\u308F\u308A\u306B\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50\u3092\u4F7F\u7528\u3057\u307E\u3059)\u3002\n\u660E\u793A\u7684: {0}\n\u63A8\u5B9A: {1} +# 0: symbol, 1: message segment +compiler.warn.varargs.redundant.trustme.anno={0}\u6CE8\u91C8\u304C\u5197\u9577\u3067\u3059\u3002{1} + ##### ## The following are tokens which are non-terminals in the language. They should ## be named as JLS3 calls them when translated to the appropriate language. compiler.misc.token.identifier=<identifier> + compiler.misc.token.character=<character> + compiler.misc.token.string=<string> + compiler.misc.token.integer=<integer> + compiler.misc.token.long-integer=<long integer> + compiler.misc.token.float=<float> + compiler.misc.token.double=<double> + compiler.misc.token.bad-symbol=<bad symbol> + compiler.misc.token.end-of-input=<end of input> ## The argument to the following string will always be one of the following: @@ -547,8 +988,13 @@ ## 6. an operator (JLS3.12) ## ## This is the only place these tokens will be used. +# 0: token compiler.err.expected={0}\u304C\u3042\u308A\u307E\u305B\u3093 + +# 0: token, 1: token compiler.err.expected2={0}\u307E\u305F\u306F{1}\u304C\u3042\u308A\u307E\u305B\u3093 + +# 0: token, 1: token, 2: token compiler.err.expected3={0}\u3001{1}\u307E\u305F\u306F{2}\u304C\u3042\u308A\u307E\u305B\u3093 compiler.err.premature.eof=\u69CB\u6587\u89E3\u6790\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u306E\u7D42\u308F\u308A\u306B\u79FB\u308A\u307E\u3057\u305F @@ -557,10 +1003,13 @@ compiler.err.dot.class.expected=''.class''\u304C\u3042\u308A\u307E\u305B\u3093 ## The argument to this string will always be either 'case' or 'default'. +# 0: token compiler.err.orphaned={0}\u306B\u306F\u89AA\u304C\u3042\u308A\u307E\u305B\u3093 +# 0: name compiler.misc.anonymous.class=<anonymous {0}> +# 0: name, 1: type compiler.misc.type.captureof={1}\u306E\u30AD\u30E3\u30D7\u30C1\u30E3#{0} compiler.misc.type.captureof.1=\u30AD\u30E3\u30D7\u30C1\u30E3#{0} @@ -571,35 +1020,55 @@ ##### +# 0: symbol, 1: message segment compiler.err.cant.access={0}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\n{1} compiler.misc.bad.class.file.header=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306F\u4E0D\u6B63\u3067\u3059\n{1}\n\u524A\u9664\u3059\u308B\u304B\u3001\u30AF\u30E9\u30B9\u30D1\u30B9\u306E\u6B63\u3057\u3044\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3042\u308B\u304B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 + +# 0: file name, 1: message segment compiler.misc.bad.source.file.header=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306F\u4E0D\u6B63\u3067\u3059\n{1}\n\u524A\u9664\u3059\u308B\u304B\u3001\u30BD\u30FC\u30B9\u30FB\u30D1\u30B9\u306E\u6B63\u3057\u3044\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306B\u3042\u308B\u304B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002 ## The following are all possible strings for the second argument ({1}) of the ## above strings. compiler.misc.bad.class.signature=\u30AF\u30E9\u30B9{0}\u306E\u30B7\u30B0\u30CB\u30C1\u30E3\u304C\u4E0D\u6B63\u3067\u3059 -compiler.misc.bad.enclosing.method=\u56F2\u3093\u3067\u3044\u308B\u30E1\u30BD\u30C3\u30C9\u5C5E\u6027\u304C\u4E0D\u6B63\u3067\u3059: {0} + +#0: symbol, 1: symbol +compiler.misc.bad.enclosing.class={0}\u306E\u5185\u90E8\u30AF\u30E9\u30B9\u304C\u4E0D\u6B63\u3067\u3059: {1} + +# 0: symbol +compiler.misc.bad.enclosing.method=\u30AF\u30E9\u30B9{0}\u306E\u56F2\u3093\u3067\u3044\u308B\u30E1\u30BD\u30C3\u30C9\u5C5E\u6027\u304C\u4E0D\u6B63\u3067\u3059 + compiler.misc.bad.runtime.invisible.param.annotations=RuntimeInvisibleParameterAnnotations\u5C5E\u6027\u304C\u4E0D\u6B63\u3067\u3059: {0} + compiler.misc.bad.const.pool.tag=\u5B9A\u6570\u30D7\u30FC\u30EB\u30FB\u30BF\u30B0{0}\u304C\u4E0D\u6B63\u3067\u3059 + compiler.misc.bad.const.pool.tag.at=\u5B9A\u6570\u30D7\u30FC\u30EB\u30FB\u30BF\u30B0{1}\u3067\u306E{0}\u304C\u4E0D\u6B63\u3067\u3059 + compiler.misc.bad.signature=\u30B7\u30B0\u30CB\u30C1\u30E3{0}\u304C\u4E0D\u6B63\u3067\u3059 -compiler.misc.bad.type.annotation.value=\u6CE8\u91C8\u30BF\u30FC\u30B2\u30C3\u30C8\u578B\u306E\u5024\u306E\u578B\u304C\u4E0D\u6B63\u3067\u3059: {0} + compiler.misc.class.file.wrong.class=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4E0D\u6B63\u306A\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u3059 + compiler.misc.class.file.not.found={0}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 + +# 0: name compiler.misc.file.doesnt.contain.class=\u30D5\u30A1\u30A4\u30EB\u306B\u30AF\u30E9\u30B9{0}\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.misc.file.does.not.contain.package=\u30D5\u30A1\u30A4\u30EB\u306B\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.misc.illegal.start.of.class.file=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u958B\u59CB\u304C\u4E0D\u6B63\u3067\u3059 + compiler.misc.unable.to.access.file=\u30D5\u30A1\u30A4\u30EB{0}\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093 + compiler.misc.unicode.str.not.supported=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u5185\u306EUnicode\u6587\u5B57\u5217\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.misc.undecl.type.var=\u578B\u5909\u6570{0}\u306F\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093 + compiler.misc.wrong.version=\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30D0\u30FC\u30B8\u30E7\u30F3{0}.{1}\u306F\u4E0D\u6B63\u3067\u3059\u3002{2}.{3}\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 ##### -compiler.err.not.within.bounds=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306F\u305D\u306E\u5883\u754C\u3092\u8D85\u3048\u3066\u3044\u307E\u3059 - -compiler.err.not.within.bounds.explain=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF{0}\u306F\u305D\u306E\u5883\u754C\u3092\u8D85\u3048\u3066\u3044\u307E\u3059\u3002{1} +# 0: type, 1: type or symbol +compiler.err.not.within.bounds=\u578B\u5F15\u6570{0}\u306F\u578B\u5909\u6570{1}\u306E\u5883\u754C\u5185\u306B\u3042\u308A\u307E\u305B\u3093 ## The following are all possible strings for the second argument ({1}) of the ## above string. @@ -608,18 +1077,27 @@ ##### +# 0: message segment, 1: type, 2: type compiler.err.prob.found.req={0}\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {1} + +# 0: message segment, 1: type, 2: type compiler.warn.prob.found.req={0}\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {1} + compiler.err.prob.found.req.1={0} {3}\n\u671F\u5F85\u5024: {2}\n\u691C\u51FA\u5024: {1} ## The following are all possible strings for the first argument ({0}) of the ## above strings. compiler.misc.incompatible.types=\u4E92\u63DB\u6027\u306E\u306A\u3044\u578B + +# 0: message segment compiler.misc.incompatible.types.1=\u4E92\u63DB\u6027\u306E\u306A\u3044\u578B\u3002{0} + compiler.misc.inconvertible.types=\u5909\u63DB\u3067\u304D\u306A\u3044\u578B + compiler.misc.possible.loss.of.precision=\u7CBE\u5EA6\u304C\u4F4E\u4E0B\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027 compiler.misc.unchecked.assign=\u7121\u691C\u67FB\u5909\u63DB + # compiler.misc.storecheck=\ # assignment might cause later store checks to fail # compiler.misc.unchecked=\ @@ -627,7 +1105,9 @@ compiler.misc.unchecked.cast.to.type=\u7121\u691C\u67FB\u30AD\u30E3\u30B9\u30C8 compiler.misc.assignment.from.super-bound=\u30B9\u30FC\u30D1\u30FC\u30D0\u30A6\u30F3\u30C9\u578B{0}\u304B\u3089\u306E\u4EE3\u5165 + compiler.misc.assignment.to.extends-bound=\u62E1\u5F35\u30D0\u30A6\u30F3\u30C9\u578B{0}\u3078\u306E\u4EE3\u5165 + # compiler.err.star.expected=\ # ''*'' expected # compiler.err.no.elem.type=\ @@ -637,14 +1117,22 @@ ##### +# 0: message segment or type, 1: message segment compiler.err.type.found.req=\u4E88\u671F\u3057\u306A\u3044\u578B\n\u671F\u5F85\u5024: {1}\n\u691C\u51FA\u5024: {0} ## The following are all possible strings for the first argument ({0}) of the ## above string. compiler.misc.type.req.class=\u30AF\u30E9\u30B9 + compiler.misc.type.req.class.array=\u30AF\u30E9\u30B9\u307E\u305F\u306F\u914D\u5217 + +compiler.misc.type.req.array.or.iterable=\u914D\u5217\u307E\u305F\u306Fjava.lang.Iterable + compiler.misc.type.req.ref=\u53C2\u7167 + compiler.misc.type.req.exact=\u5883\u754C\u306E\u306A\u3044\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 + +# 0: type compiler.misc.type.parameter=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF{0} ##### @@ -652,29 +1140,52 @@ ## The following are all possible strings for the last argument of all those ## diagnostics whose key ends in ".1" compiler.misc.undetermined.type=\u672A\u5B9A\u578B + compiler.misc.type.variable.has.undetermined.type=\u578B\u5909\u6570{0}\u306F\u672A\u5B9A\u578B\u3067\u3059 + +# 0: type, 1: list of type compiler.misc.no.unique.maximal.instance.exists=\u578B\u5909\u6570{0}(\u4E0A\u9650{1})\u306E\u56FA\u6709\u306E\u6700\u5927\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u307E\u305B\u3093 + compiler.misc.no.unique.minimal.instance.exists=\u578B\u5909\u6570{0}(\u4E0B\u9650{1})\u306E\u56FA\u6709\u306E\u6700\u5C0F\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u307E\u305B\u3093 + +# 0: list of type, 1: type, 2: type compiler.misc.infer.no.conforming.instance.exists=\u578B\u5909\u6570{0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u306A\u3044\u306E\u3067\u3001{1}\u306F{2}\u306B\u9069\u5408\u3057\u307E\u305B\u3093 + +# 0: list of type, 1: type, 2: type compiler.misc.infer.no.conforming.assignment.exists=\u578B\u5909\u6570{0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u5B58\u5728\u3057\u306A\u3044\u306E\u3067\u3001\u5F15\u6570\u578B{1}\u306F\u4EEE\u30D1\u30E9\u30E1\u30FC\u30BF\u578B{2}\u306B\u9069\u5408\u3057\u307E\u305B\u3093 + compiler.misc.infer.arg.length.mismatch=\u5B9F\u5F15\u6570\u30EA\u30B9\u30C8\u3068\u4EEE\u5F15\u6570\u30EA\u30B9\u30C8\u306E\u9577\u3055\u304C\u7570\u306A\u308B\u305F\u3081\u3001\u5F15\u6570\u304B\u3089\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: list of type compiler.misc.inferred.do.not.conform.to.bounds=\u63A8\u5B9A\u578B\u306F\u5BA3\u8A00\u3055\u308C\u305F\u5883\u754C\u306B\u9069\u5408\u3057\u307E\u305B\u3093\n\u63A8\u5B9A: {0}\n\u5883\u754C: {1} -compiler.misc.inferred.do.not.conform.to.params=\u5B9F\u5F15\u6570\u306F\u63A8\u5B9A\u3055\u308C\u305F\u4EEE\u5F15\u6570\u306B\u9069\u5408\u3057\u307E\u305B\u3093\n\u671F\u5F85\u5024: {0}\n\u691C\u51FA\u5024: {1} + +# 0: symbol compiler.misc.diamond={0}<> -compiler.misc.diamond.invalid.arg={1}\u306B\u3064\u3044\u3066\u63A8\u5B9A\u3055\u308C\u305F\u578B\u5F15\u6570{0}\u306F\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 -compiler.misc.diamond.invalid.args={1}\u306B\u3064\u3044\u3066\u63A8\u5B9A\u3055\u308C\u305F\u578B\u5F15\u6570{0}\u306F\u3053\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093 + +# 0: type +compiler.misc.diamond.non.generic=\u975E\u6C4E\u7528\u30AF\u30E9\u30B9{0}\u3067''<>''\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +compiler.misc.diamond.and.explicit.params=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u660E\u793A\u7684\u306A\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F''<>''\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: list of type compiler.misc.explicit.param.do.not.conform.to.bounds=\u660E\u793A\u7684\u306A\u578B\u5F15\u6570{0}\u306F\u3001\u5BA3\u8A00\u3055\u308C\u305F\u5883\u754C{1}\u306B\u9069\u5408\u3057\u307E\u305B\u3093 compiler.misc.arg.length.mismatch=\u5B9F\u5F15\u6570\u30EA\u30B9\u30C8\u3068\u4EEE\u5F15\u6570\u30EA\u30B9\u30C8\u306E\u9577\u3055\u304C\u7570\u306A\u308A\u307E\u3059 + +# 0: type, 1: type compiler.misc.no.conforming.assignment.exists=\u5B9F\u5F15\u6570{0}\u306F\u30E1\u30BD\u30C3\u30C9\u547C\u51FA\u5909\u63DB\u306B\u3088\u3063\u3066{1}\u306B\u5909\u63DB\u3067\u304D\u307E\u305B\u3093 + +# 0: type, 1: type compiler.misc.varargs.argument.mismatch=\u5F15\u6570\u578B{0}\u306F\u53EF\u5909\u5F15\u6570\u8981\u7D20\u578B{1}\u306B\u9069\u5408\u3057\u307E\u305B\u3093 + ##### ## The first argument ({0}) is a "kindname". +# 0: symbol kind, 1: symbol, 2: symbol compiler.err.abstract.cant.be.accessed.directly=\u62BD\u8C61{0}\u3067\u3042\u308B{1}({2}\u5185)\u306B\u76F4\u63A5\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 ## The first argument ({0}) is a "kindname". +# 0: symbol kind, 1: symbol compiler.err.non-static.cant.be.ref=static\u3067\u306A\u3044{0} {1}\u3092static\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u53C2\u7167\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 ## Both arguments ({0}, {1}) are "kindname"s. {0} is a comma-separated list @@ -685,20 +1196,36 @@ ## The second argument {1} is the non-resolved symbol ## The third argument {2} is a list of type parameters (non-empty if {1} is a method) ## The fourth argument {3} is a list of argument types (non-empty if {1} is a method) +# 0: symbol kind, 1: name, 2: unused, 3: unused compiler.err.cant.resolve=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} {1} +# 0: symbol kind, 1: name, 2: unused, 3: list of type compiler.err.cant.resolve.args=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} {1}({3}) +# 0: symbol kind, 1: name, 2: list of type, 3: list of type compiler.err.cant.resolve.args.params=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} <{2}>{1}({3}) ## arguments from {0} to {3} have the same meaning as above -## The fifth argument {4} is the location "kindname" (e.g. 'constructor', 'field', etc.) -## The sixth argument {5} is the location type -compiler.err.cant.resolve.location=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} {1}\n\u5834\u6240: {4} {5} +## The fifth argument {4} is a location subdiagnostic (see below) +# 0: symbol kind, 1: name, 2: unused, 3: unused, 4: message segment +compiler.err.cant.resolve.location=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} {1}\n\u5834\u6240: {4} + +# 0: symbol kind, 1: name, 2: unused, 3: list of type, 4: message segment +compiler.err.cant.resolve.location.args=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} {1}({3})\n\u5834\u6240: {4} + +# 0: symbol kind, 1: name, 2: list of type, 3: list, 4: message segment +compiler.err.cant.resolve.location.args.params=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} <{2}>{1}({3})\n\u5834\u6240: {4} -compiler.err.cant.resolve.location.args=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} {1}({3})\n\u5834\u6240: {4} {5} +##a location subdiagnostic is composed as follows: +## The first argument {0} is the location "kindname" (e.g. 'constructor', 'field', etc.) +## The second argument {1} is the location name +## The third argument {2} is the location type (only when {1} is a variable name) -compiler.err.cant.resolve.location.args.params=\u30B7\u30F3\u30DC\u30EB\u3092\u898B\u3064\u3051\u3089\u308C\u307E\u305B\u3093\n\u30B7\u30F3\u30DC\u30EB: {0} <{2}>{1}({3})\n\u5834\u6240: {4} {5} +# 0: symbol kind, 1: symbol, 2: unused +compiler.misc.location={0} {1} + +# 0: symbol kind, 1: symbol, 2: type +compiler.misc.location.1=\u30BF\u30A4\u30D7{2}\u306E{0} {1} ## The following are all possible string for "kindname". ## They should be called whatever the JLS calls them after it been translated @@ -706,60 +1233,103 @@ # compiler.misc.kindname.constructor=\ # static member compiler.misc.kindname.annotation=@interface + compiler.misc.kindname.constructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF + compiler.misc.kindname.enum=\u5217\u6319 + compiler.misc.kindname.interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 + compiler.misc.kindname.static=static + compiler.misc.kindname.type.variable=\u578B\u5909\u6570 + compiler.misc.kindname.type.variable.bound=\u578B\u5909\u6570\u306E\u5883\u754C + compiler.misc.kindname.variable=\u5909\u6570 + compiler.misc.kindname.value=\u5024 + compiler.misc.kindname.method=\u30E1\u30BD\u30C3\u30C9 + compiler.misc.kindname.class=\u30AF\u30E9\u30B9 + compiler.misc.kindname.package=\u30D1\u30C3\u30B1\u30FC\u30B8 + ##### compiler.misc.no.args=\u5F15\u6570\u304C\u3042\u308A\u307E\u305B\u3093 +# 0: message segment compiler.err.override.static={0}\n\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\u30E1\u30BD\u30C3\u30C9\u304Cstatic\u3067\u3059 + +# 0: message segment, 1: set of modifier compiler.err.override.meth={0}\n\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u306F{1}\u3067\u3059 +# 0: message segment, 1: type compiler.err.override.meth.doesnt.throw={0}\n\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u306F{1}\u3092\u30B9\u30ED\u30FC\u3057\u307E\u305B\u3093 # In the following string {1} is a space separated list of Java Keywords, as # they would have been declared in the source code +# 0: message segment, 1: set of modifier compiler.err.override.weaker.access={0}\n({1})\u3088\u308A\u5F31\u3044\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u3092\u5272\u308A\u5F53\u3066\u3088\u3046\u3068\u3057\u307E\u3057\u305F +# 0: message segment, 1: type, 2: type compiler.err.override.incompatible.ret={0}\n\u623B\u308A\u5024\u306E\u578B{1}\u306F{2}\u3068\u4E92\u63DB\u6027\u304C\u3042\u308A\u307E\u305B\u3093 +# 0: message segment, 1: type, 2: type compiler.warn.override.unchecked.ret={0}\n\u623B\u308A\u5024\u306E\u578B\u306F{1}\u304B\u3089{2}\u3078\u306E\u7121\u691C\u67FB\u5909\u63DB\u304C\u5FC5\u8981\u3067\u3059 +# 0: message segment, 1: type compiler.warn.override.unchecked.thrown={0}\n\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u306F{1}\u3092\u30B9\u30ED\u30FC\u3057\u307E\u305B\u3093 ## The following are all possible strings for the first argument ({0}) of the ## above strings. +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.cant.override={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.cant.implement={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u5B9F\u88C5\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.clashes.with={1}\u306E{0}\u306F{3}\u306E{2}\u3068\u7AF6\u5408\u3057\u307E\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.unchecked.override={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.unchecked.implement={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u5B9F\u88C5\u3057\u307E\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.unchecked.clash.with={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.varargs.override={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.varargs.implement={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u5B9F\u88C5\u3057\u307E\u3059 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.varargs.clash.with={1}\u306E{0}\u306F{3}\u306E{2}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u3059 -compiler.misc.non.denotable.type=\u3053\u3053\u3067\u975E\u578B\u6307\u5B9A\u578B{0}\u3092\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +compiler.misc.diamond.and.anon.class=\u533F\u540D\u5185\u90E8\u30AF\u30E9\u30B9\u3067\u306F''<>''\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 + +# 0: symbol kind, 1: symbol, 2: symbol, 3: message segment compiler.misc.inapplicable.method={0} {1}.{2}\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\n({3}) ######################################## # Diagnostics for language feature changes ######################################## +# 0: string compiler.err.unsupported.fp.lit=16\u9032\u6570\u6D6E\u52D5\u5C0F\u6570\u70B9\u30EA\u30C6\u30E9\u30EB\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(16\u9032\u6570\u6D6E\u52D5\u5C0F\u6570\u70B9\u30EA\u30C6\u30E9\u30EB\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.unsupported.binary.lit=2\u9032\u6570\u30EA\u30C6\u30E9\u30EB\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(2\u9032\u6570\u30EA\u30C6\u30E9\u30EB\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F-source 7\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.unsupported.underscore.lit=\u30EA\u30C6\u30E9\u30EB\u5185\u306E\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30EA\u30C6\u30E9\u30EB\u5185\u306E\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 7\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.try.with.resources.not.supported.in.source=try-with-resource\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(try-with-resource\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 7\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) compiler.warn.enum.as.identifier=\u30EA\u30EA\u30FC\u30B95\u304B\u3089''enum''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n(''enum''\u3092\u30AD\u30FC\u30EF\u30FC\u30C9\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u306B\u306F-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) @@ -770,26 +1340,35 @@ compiler.err.assert.as.identifier=\u30EA\u30EA\u30FC\u30B91.4\u304B\u3089''assert''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u3001\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n(''assert''\u3092\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001-source 1.3\u4EE5\u524D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.generics.not.supported.in.source=\u7DCF\u79F0\u578B\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u7DCF\u79F0\u578B\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.varargs.not.supported.in.source=\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u53EF\u5909\u5F15\u6570\u30E1\u30BD\u30C3\u30C9\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.annotations.not.supported.in.source=\u6CE8\u91C8\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u6CE8\u91C8\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) #308 compiler.err.type.annotations.not.supported.in.source=\ #308 type annotations are not supported in -source {0}\n\ #308 (use -source 7 or higher to enable type annotations) +# 0: string compiler.err.foreach.not.supported.in.source=for-each\u30EB\u30FC\u30D7\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(for-each\u30EB\u30FC\u30D7\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.static.import.not.supported.in.source=static import\u5BA3\u8A00\u306F -source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(static import\u5BA3\u8A00\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.enums.not.supported.in.source=\u5217\u6319\u578B\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u5217\u6319\u578B\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F-source 5\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.diamond.not.supported.in.source=\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u30C0\u30A4\u30E4\u30E2\u30F3\u30C9\u6F14\u7B97\u5B50\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 7\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.multicatch.not.supported.in.source=\u8907\u6570catch\u6587\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(\u8907\u6570catch\u6587\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 7\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) +# 0: string compiler.err.string.switch.not.supported.in.source=switch\u5185\u306E\u6587\u5B57\u5217\u306F-source {0}\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\n(switch\u5185\u306E\u6587\u5B57\u5217\u3092\u4F7F\u7528\u53EF\u80FD\u306B\u3059\u308B\u306B\u306F\u3001-source 7\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044) ######################################## @@ -800,24 +1379,30 @@ compiler.misc.type.null=<null> # X#n (where n is an int id) is disambiguated tvar name +# 0: name, 1: number compiler.misc.type.var={0}#{1} # CAP#n (where n is an int id) is an abbreviation for 'captured type' +# 0: number compiler.misc.captured.type=CAP#{0} # <INT#n> (where n is an int id) is an abbreviation for 'intersection type' +# 0: number compiler.misc.intersection.type=INT#{0} # where clause for captured type: contains upper ('extends {1}') and lower # ('super {2}') bound along with the wildcard that generated this captured type ({3}) +# 0: type, 1: type, 2: type, 3: type compiler.misc.where.captured={3}\u306E\u30AD\u30E3\u30D7\u30C1\u30E3\u304B\u3089\u306E{0} extends {1} super: {2} # compact where clause for captured type: contains upper ('extends {1}') along # with the wildcard that generated this captured type ({3}) +# 0: type, 1: type, 2: unused, 3: type compiler.misc.where.captured.1={3}\u306E\u30AD\u30E3\u30D7\u30C1\u30E3\u304B\u3089\u306E{0} extends {1} # where clause for type variable: contains upper bound(s) ('extends {1}') along with # the kindname ({2}) and location ({3}) in which the typevar has been declared +# 0: type, 1: list of type, 2: symbol kind, 3: symbol compiler.misc.where.typevar={2} {3}\u3067\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B{0} extends {1} # compact where clause for type variable: contains the kindname ({2}) and location ({3}) @@ -826,14 +1411,24 @@ # where clause for type variable: contains all the upper bound(s) ('extends {1}') # of this intersection type +# 0: type, 1: list of type compiler.misc.where.intersection={0} extends {1} ### Where clause headers ### compiler.misc.where.description.captured={0}\u304C\u65B0\u3057\u3044\u578B\u5909\u6570\u306E\u5834\u5408: + +# 0: set of type compiler.misc.where.description.typevar={0}\u304C\u578B\u5909\u6570\u306E\u5834\u5408: + +# 0: set of type compiler.misc.where.description.intersection={0}\u304Cintersection\u578B\u306E\u5834\u5408: + +# 0: set of type compiler.misc.where.description.captured.1={0}\u304C\u65B0\u3057\u3044\u578B\u5909\u6570\u306E\u5834\u5408: + +# 0: set of type compiler.misc.where.description.typevar.1={0}\u304C\u578B\u5909\u6570\u306E\u5834\u5408: + compiler.misc.where.description.intersection.1={0}\u304Cintersection\u578B\u306E\u5834\u5408:
--- a/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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 @@ -23,137 +23,318 @@ # questions. # +# Messages in this file which use "placeholders" for values (e.g. {0}, {1}) +# are preceded by a stylized comment describing the type of the corresponding +# values. +# The types currently in use are +# +# boolean true or false +# file name the name of an input file; e.g. MyFile.java +# message segment a sub-message; see compiler.misc.* +# modifier a Java modifier; e.g. public, private, protected +# name a name, typically a Java identifier +# number an integer +# option name the name of a command line option +# source version a source version number, such as 1.5, 1.6, 1.7 +# string a general string +# symbol the name of a declared type +# symbol kind a description of the kind of a declaration; see compiler.misc.kindname.* +# token the name of a non-terminal in source code; see compiler.misc.token.* +# type a Java type; e.g. int, X, X<T> +# unused the value is not used in this message +# +# list of X a comma-separated list of items; e.g. list of type +# X or Y alternation; e.g. message segment or type +# set of X a comma-separated collection of items; e.g. set of modifier +# +# These may be composed: e.g. list of type or message segment +# +# These comments are verified by the jtreg test test/tools/javac/diags/MessageInfo, +# using info derived from the collected set of examples in test/tools/javac/diags/examples. +# MessageInfo can also be run as a standalone utility providing more facilities +# for manipulating this file. For more details, see MessageInfo.java. + ## ## errors ## +# 0: symbol compiler.err.abstract.cant.be.instantiated={0}\u662F\u62BD\u8C61\u7684; \u65E0\u6CD5\u5B9E\u4F8B\u5316 + compiler.err.abstract.meth.cant.have.body=\u62BD\u8C61\u65B9\u6CD5\u4E0D\u80FD\u6709\u4E3B\u4F53 + compiler.err.already.annotated={0} {1}\u5DF2\u8FDB\u884C\u6CE8\u91CA + +# 0: symbol, 1: symbol compiler.err.already.defined=\u5DF2\u5728{1}\u4E2D\u5B9A\u4E49{0} + +# 0: string compiler.err.already.defined.single.import=\u5DF2\u5728 single-type \u5BFC\u5165\u4E2D\u5B9A\u4E49{0} + +# 0: string compiler.err.already.defined.static.single.import=\u5DF2\u5728\u9759\u6001 single-type \u5BFC\u5165\u4E2D\u5B9A\u4E49{0} + compiler.err.already.defined.this.unit=\u5DF2\u5728\u8BE5\u7F16\u8BD1\u5355\u5143\u4E2D\u5B9A\u4E49{0} + +# 0: type, 1: list of name compiler.err.annotation.missing.default.value=\u5BF9\u4E8E\u5C5E\u6027{1}, \u6CE8\u91CA{0}\u7F3A\u5C11\u503C + +# 0: type, 1: list of name compiler.err.annotation.missing.default.value.1=\u5BF9\u4E8E\u5C5E\u6027{1}, \u6CE8\u91CA{0}\u7F3A\u5C11\u503C + +# 0: type compiler.err.annotation.not.valid.for.type=\u5BF9\u4E8E\u7C7B\u578B\u4E3A{0}\u7684\u503C, \u6CE8\u91CA\u65E0\u6548 + compiler.err.annotation.type.not.applicable=\u6CE8\u91CA\u7C7B\u578B\u4E0D\u9002\u7528\u4E8E\u8BE5\u7C7B\u578B\u7684\u58F0\u660E + compiler.err.annotation.value.must.be.annotation=\u6CE8\u91CA\u503C\u5FC5\u987B\u4E3A\u6CE8\u91CA + compiler.err.annotation.value.must.be.class.literal=\u6CE8\u91CA\u503C\u5FC5\u987B\u4E3A\u7C7B\u6587\u5B57 + compiler.err.annotation.value.must.be.name.value=\u6CE8\u91CA\u503C\u5FC5\u987B\u91C7\u7528 ''name=value'' \u683C\u5F0F + compiler.err.annotation.value.not.allowable.type=\u6CE8\u91CA\u503C\u4E0D\u662F\u5141\u8BB8\u7684\u7C7B\u578B + compiler.err.anon.class.impl.intf.no.args=\u533F\u540D\u7C7B\u5B9E\u73B0\u63A5\u53E3; \u4E0D\u80FD\u6709\u53C2\u6570 + compiler.err.anon.class.impl.intf.no.typeargs=\u533F\u540D\u7C7B\u5B9E\u73B0\u63A5\u53E3; \u4E0D\u80FD\u5177\u6709\u7C7B\u578B\u53C2\u6570 + compiler.err.anon.class.impl.intf.no.qual.for.new=\u533F\u540D\u7C7B\u5B9E\u73B0\u63A5\u53E3; \u4E0D\u80FD\u6709\u9650\u5B9A\u7B26 - \u5BF9\u4E8E\u65B0 + +# 0: symbol, 1: symbol, 2: symbol compiler.err.array.and.varargs=\u65E0\u6CD5\u5728{2}\u4E2D\u540C\u65F6\u58F0\u660E{0}\u548C{1} + compiler.err.array.dimension.missing=\u7F3A\u5C11\u6570\u7EC4\u7EF4 + +# 0: type compiler.err.array.req.but.found=\u9700\u8981\u6570\u7EC4, \u4F46\u627E\u5230{0} compiler.err.assignment.from.super-bound=\u901A\u8FC7\u901A\u914D\u7B26 {0} \u5206\u914D + compiler.err.assignment.to.extends-bound=\u5206\u914D\u7ED9\u901A\u914D\u7B26 {0} + compiler.err.attribute.value.must.be.constant=\u5C5E\u6027\u503C\u5FC5\u987B\u4E3A\u5E38\u91CF compiler.err.break.outside.switch.loop=\u5728 switch \u6216 loop \u5916\u90E8\u4E2D\u65AD +# 0: name compiler.err.call.must.be.first.stmt.in.ctor=\u5BF9{0}\u7684\u8C03\u7528\u5FC5\u987B\u662F\u6784\u9020\u5668\u4E2D\u7684\u7B2C\u4E00\u4E2A\u8BED\u53E5 + compiler.err.cant.apply.symbol=\u65E0\u6CD5\u5C06{4} {5}\u4E2D\u7684{0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B\n\u9700\u8981: {2}\n\u627E\u5230: {3} + +# 0: symbol kind, 1: name, 2: list of type or message segment, 3: list of type or message segment, 4: symbol kind, 5: type, 6: message segment compiler.err.cant.apply.symbol.1=\u65E0\u6CD5\u5C06{4} {5}\u4E2D\u7684{0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7C7B\u578B;\n\u9700\u8981: {2}\n\u627E\u5230: {3}\n\u539F\u56E0: {6} + +# 0: symbol kind, 1: name, 2: list of type compiler.err.cant.apply.symbols=\u5BF9\u4E8E{1}({2}), \u627E\u4E0D\u5230\u5408\u9002\u7684{0} + +# 0: symbol compiler.err.cant.assign.val.to.final.var=\u65E0\u6CD5\u4E3A\u6700\u7EC8\u53D8\u91CF{0}\u5206\u914D\u503C + +# 0: type compiler.err.cant.deref=\u65E0\u6CD5\u53D6\u6D88\u5F15\u7528{0} + compiler.err.cant.extend.intf.annotation=\u5BF9\u4E8E @interfaces, \u4E0D\u5141\u8BB8 ''extends'' + +# 0: symbol compiler.err.cant.inherit.from.final=\u65E0\u6CD5\u4ECE\u6700\u7EC8{0}\u8FDB\u884C\u7EE7\u627F + +# 0: symbol compiler.err.cant.ref.before.ctor.called=\u65E0\u6CD5\u5728\u8C03\u7528\u8D85\u7C7B\u578B\u6784\u9020\u5668\u4E4B\u524D\u5F15\u7528{0} + compiler.err.cant.ret.val.from.meth.decl.void=\u5BF9\u4E8E\u7ED3\u679C\u7C7B\u578B\u4E3A\u7A7A\u7684\u65B9\u6CD5, \u65E0\u6CD5\u8FD4\u56DE\u503C + compiler.err.cant.select.static.class.from.param.type=\u65E0\u6CD5\u4ECE\u53C2\u6570\u5316\u7684\u7C7B\u578B\u4E2D\u9009\u62E9\u9759\u6001\u7C7B + +# 0: symbol, 1: string, 2: string compiler.err.cant.inherit.diff.arg=\u65E0\u6CD5\u4F7F\u7528\u4EE5\u4E0B\u4E0D\u540C\u7684\u53C2\u6570\u7EE7\u627F{0}: <{1}> \u548C <{2}> + compiler.err.catch.without.try=\u6709 ''catch'', \u4F46\u662F\u6CA1\u6709 ''try'' -compiler.err.clash.with.pkg.of.same.name={0}\u4E0E\u5E26\u6709\u76F8\u540C\u540D\u79F0\u7684\u7A0B\u5E8F\u5305\u51B2\u7A81 + +# 0: symbol kind, 1: symbol +compiler.err.clash.with.pkg.of.same.name={0} {1}\u4E0E\u5E26\u6709\u76F8\u540C\u540D\u79F0\u7684\u7A0B\u5E8F\u5305\u51B2\u7A81 + compiler.err.const.expr.req=\u9700\u8981\u5E38\u91CF\u8868\u8FBE\u5F0F -compiler.err.enum.const.req=\u9700\u8981\u975E\u9650\u5B9A\u679A\u4E3E\u5E38\u91CF\u540D\u79F0 + compiler.err.cont.outside.loop=continue \u5728 loop \u5916\u90E8 + +# 0: symbol compiler.err.cyclic.inheritance=\u6D89\u53CA{0}\u7684\u5FAA\u73AF\u7EE7\u627F + compiler.err.cyclic.annotation.element=\u5FAA\u73AF\u6CE8\u91CA\u5143\u7D20\u7C7B\u578B + +# 0: unused compiler.err.call.to.super.not.allowed.in.enum.ctor=\u5728\u679A\u4E3E\u6784\u9020\u5668\u4E2D\u4E0D\u5141\u8BB8\u8C03\u7528\u8D85\u7C7B + +# 0: type compiler.err.no.superclass={0}\u4E0D\u5177\u6709\u8D85\u7C7B -compiler.warn.type.parameter.on.polymorphic.signature=\u5C06 MethodHandle \u8C03\u7528\u7684\u5DF2\u8FC7\u65F6\u6CE8\u91CA\u4ECE x.<T>invoke(y) \u66F4\u6539\u4E3A (T)x.invoke(y) -compiler.warn.wrong.target.for.polymorphic.signature.definition=MethodHandle API \u6784\u5EFA\u9700\u8981 -target 7 \u8FD0\u884C\u65F6\u6216\u66F4\u9AD8; \u5F53\u524D\u4E3A -target {0} +compiler.err.wrong.target.for.polymorphic.signature.definition=MethodHandle API \u6784\u5EFA\u9700\u8981 -target 7 \u8FD0\u884C\u65F6\u6216\u66F4\u9AD8; \u5F53\u524D\u4E3A -target {0} +# 0: symbol, 1: type, 2: symbol, 3: type, 4: unused compiler.err.concrete.inheritance.conflict={1}\u4E2D\u7684\u65B9\u6CD5{0}\u548C{3}\u4E2D\u7684\u65B9\u6CD5{2}\u662F\u4F7F\u7528\u76F8\u540C\u7684\u7B7E\u540D\u7EE7\u627F\u7684 compiler.err.default.allowed.in.intf.annotation.member=\u4EC5\u5728 @interface \u6210\u5458\u4E2D\u5141\u8BB8\u4F7F\u7528\u9ED8\u8BA4\u503C + +# 0: symbol compiler.err.doesnt.exist=\u7A0B\u5E8F\u5305{0}\u4E0D\u5B58\u5728 + compiler.err.duplicate.annotation=\u6CE8\u91CA\u91CD\u590D + +# 0: name, 1: type compiler.err.duplicate.annotation.member.value={1}\u4E2D\u7684\u6CE8\u91CA\u6210\u5458\u503C{0}\u91CD\u590D + +# 0: name compiler.err.duplicate.class=\u7C7B\u91CD\u590D: {0} + compiler.err.duplicate.case.label=case \u6807\u7B7E\u91CD\u590D + compiler.err.duplicate.default.label=default \u6807\u7B7E\u91CD\u590D compiler.err.else.without.if=\u6709 ''if'', \u4F46\u662F\u6CA1\u6709 ''else'' + compiler.err.empty.char.lit=\u7A7A\u5B57\u7B26\u6587\u5B57 + +# 0: symbol compiler.err.encl.class.required=\u9700\u8981\u5305\u542B{0}\u7684\u5C01\u95ED\u5B9E\u4F8B + compiler.err.enum.annotation.must.be.enum.constant=\u679A\u4E3E\u6CE8\u91CA\u503C\u5FC5\u987B\u662F\u679A\u4E3E\u5E38\u91CF compiler.err.enum.cant.be.instantiated=\u65E0\u6CD5\u5B9E\u4F8B\u5316\u679A\u4E3E\u7C7B\u578B + compiler.err.enum.label.must.be.unqualified.enum=\u679A\u4E3E switch case \u6807\u7B7E\u5FC5\u987B\u4E3A\u679A\u4E3E\u5E38\u91CF\u7684\u975E\u9650\u5B9A\u540D\u79F0 + compiler.err.enum.no.subclassing=\u7C7B\u65E0\u6CD5\u76F4\u63A5\u6269\u5C55 java.lang.Enum + compiler.err.enum.types.not.extensible=\u679A\u4E3E\u7C7B\u578B\u4E0D\u53EF\u7EE7\u627F + compiler.err.enum.no.finalize=\u679A\u4E3E\u4E0D\u80FD\u6709 finalize \u65B9\u6CD5 + +# 0: file name, 1: string compiler.err.error.reading.file=\u8BFB\u53D6{0}\u65F6\u51FA\u9519; {1} + +# 0: type compiler.err.except.already.caught=\u5DF2\u6355\u83B7\u5230\u5F02\u5E38\u9519\u8BEF{0} + +# 0: type compiler.err.except.never.thrown.in.try=\u5728\u76F8\u5E94\u7684 try \u8BED\u53E5\u4E3B\u4F53\u4E2D\u4E0D\u80FD\u629B\u51FA\u5F02\u5E38\u9519\u8BEF{0} +# 0: symbol compiler.err.final.parameter.may.not.be.assigned=\u4E0D\u80FD\u5206\u914D\u6700\u7EC8\u53C2\u6570{0} + +# 0: symbol compiler.err.try.resource.may.not.be.assigned=\u53EF\u80FD\u672A\u5206\u914D\u53EF\u81EA\u52A8\u5173\u95ED\u7684\u8D44\u6E90{0} + +# 0: symbol compiler.err.multicatch.parameter.may.not.be.assigned=\u53EF\u80FD\u672A\u5206\u914D multi-catch \u53C2\u6570{0} + +# 0: type, 1: type +compiler.err.multicatch.types.must.be.disjoint=multi-catch \u8BED\u53E5\u4E2D\u7684\u66FF\u4EE3\u65E0\u6CD5\u901A\u8FC7\u5B50\u7C7B\u5316\u5173\u8054\n\u66FF\u4EE3{0}\u662F\u66FF\u4EE3{1}\u7684\u5B50\u7C7B + compiler.err.finally.without.try=\u6709 ''finally'', \u4F46\u662F\u6CA1\u6709 ''try'' -compiler.err.foreach.not.applicable.to.type=foreach \u4E0D\u9002\u7528\u4E8E\u8868\u8FBE\u5F0F\u7C7B\u578B + +# 0: type, 1: message segment +compiler.err.foreach.not.applicable.to.type=for-each \u4E0D\u9002\u7528\u4E8E\u8868\u8FBE\u5F0F\u7C7B\u578B\n\u8981\u6C42: {1}\n\u627E\u5230: {0} + compiler.err.fp.number.too.large=\u6D6E\u70B9\u6570\u8FC7\u5927 + compiler.err.fp.number.too.small=\u6D6E\u70B9\u6570\u8FC7\u5C0F compiler.err.generic.array.creation=\u521B\u5EFA\u6CDB\u578B\u6570\u7EC4 + compiler.err.generic.throwable=\u6CDB\u578B\u7C7B\u4E0D\u80FD\u6269\u5C55 java.lang.Throwable -compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u7C7B\u4E0D\u80FD\u6709\u9759\u6001\u58F0\u660E +# 0: symbol +compiler.err.icls.cant.have.static.decl=\u5185\u90E8\u7C7B{0}\u4E2D\u7684\u9759\u6001\u58F0\u660E\u975E\u6CD5\n\u4FEE\u9970\u7B26 \''static\'' \u4EC5\u5141\u8BB8\u5728\u5E38\u91CF\u53D8\u91CF\u58F0\u660E\u4E2D\u4F7F\u7528 + +# 0: string compiler.err.illegal.char=\u975E\u6CD5\u5B57\u7B26: \\{0} + compiler.err.illegal.char.for.encoding=\u7F16\u7801{0}\u7684\u4E0D\u53EF\u6620\u5C04\u5B57\u7B26 + +# 0: set of modifier, 1: set of modifier compiler.err.illegal.combination.of.modifiers=\u975E\u6CD5\u7684\u4FEE\u9970\u7B26\u7EC4\u5408: {0}\u548C{1} + compiler.err.illegal.enum.static.ref=\u521D\u59CB\u5316\u7A0B\u5E8F\u4E2D\u5BF9\u9759\u6001\u5B57\u6BB5\u7684\u5F15\u7528\u4E0D\u5408\u6CD5 + compiler.err.illegal.esc.char=\u975E\u6CD5\u8F6C\u4E49\u7B26 + compiler.err.illegal.forward.ref=\u975E\u6CD5\u524D\u5411\u5F15\u7528 + +# 0: symbol compiler.warn.forward.ref=\u5148\u5F15\u7528\u53D8\u91CF ''{0}'', \u7136\u540E\u518D\u5BF9\u5176\u521D\u59CB\u5316 + compiler.err.illegal.self.ref=\u521D\u59CB\u5316\u7A0B\u5E8F\u4E2D\u5B58\u5728\u81EA\u5F15\u7528 + +# 0: symbol compiler.warn.self.ref=\u53D8\u91CF ''{0}'' \u7684\u521D\u59CB\u5316\u7A0B\u5E8F\u4E2D\u5B58\u5728\u81EA\u5F15\u7528 + compiler.err.illegal.generic.type.for.instof=instanceof \u7684\u6CDB\u578B\u7C7B\u578B\u4E0D\u5408\u6CD5 + +# 0: type compiler.err.illegal.initializer.for.type={0}\u7684\u521D\u59CB\u5316\u7A0B\u5E8F\u4E0D\u5408\u6CD5 + compiler.err.illegal.line.end.in.char.lit=\u5B57\u7B26\u6587\u5B57\u7684\u884C\u7ED3\u5C3E\u4E0D\u5408\u6CD5 + compiler.err.illegal.nonascii.digit=\u975E\u6CD5\u7684\u975E ASCII \u6570\u5B57 + compiler.err.illegal.underscore=\u975E\u6CD5\u4E0B\u5212\u7EBF + +# 0: symbol compiler.err.illegal.qual.not.icls=\u975E\u6CD5\u9650\u5B9A\u7B26; {0}\u4E0D\u662F\u5185\u90E8\u7C7B + compiler.err.illegal.start.of.expr=\u975E\u6CD5\u7684\u8868\u8FBE\u5F0F\u5F00\u59CB + compiler.err.illegal.start.of.type=\u975E\u6CD5\u7684\u7C7B\u578B\u5F00\u59CB + compiler.err.illegal.unicode.esc=\u975E\u6CD5\u7684 Unicode \u8F6C\u4E49 + +# 0: symbol compiler.err.import.requires.canonical=\u5BFC\u5165\u9700\u8981{0}\u7684\u89C4\u8303\u540D\u79F0 + compiler.err.improperly.formed.type.param.missing=\u7C7B\u578B\u7684\u683C\u5F0F\u4E0D\u6B63\u786E, \u7F3A\u5C11\u67D0\u4E9B\u53C2\u6570 + compiler.err.improperly.formed.type.inner.raw.param=\u7C7B\u578B\u7684\u683C\u5F0F\u4E0D\u6B63\u786E, \u7ED9\u51FA\u4E86\u539F\u59CB\u7C7B\u578B\u7684\u7C7B\u578B\u53C2\u6570 + +# 0: type, 1: type compiler.err.incomparable.types=\u4E0D\u53EF\u6BD4\u8F83\u7684\u7C7B\u578B: {0}\u548C{1} + +# 0: number compiler.err.int.number.too.large=\u8FC7\u5927\u7684\u6574\u6570: {0} + compiler.err.internal.error.cant.instantiate=\u5185\u90E8\u9519\u8BEF; \u65E0\u6CD5\u5C06\u4F4D\u4E8E{1}\u7684{0}\u5B9E\u4F8B\u5316\u4E3A ({2}) + compiler.err.intf.annotation.members.cant.have.params=@interface \u6210\u5458\u4E0D\u80FD\u5E26\u6709\u53C2\u6570 + compiler.err.intf.annotation.cant.have.type.params=@interface \u4E0D\u80FD\u5E26\u6709\u7C7B\u578B\u53C2\u6570 + compiler.err.intf.annotation.members.cant.have.type.params=@interface \u6210\u5458\u4E0D\u80FD\u5E26\u6709\u7C7B\u578B\u53C2\u6570 + +# 0: symbol, 1: type compiler.err.intf.annotation.member.clash=@interface \u6210\u5458\u4E0E{1}\u4E2D\u7684\u65B9\u6CD5 ''{0}'' \u51B2\u7A81 + compiler.err.intf.expected.here=\u6B64\u5904\u9700\u8981\u63A5\u53E3 + compiler.err.intf.meth.cant.have.body=\u63A5\u53E3\u65B9\u6CD5\u4E0D\u80FD\u5E26\u6709\u4E3B\u4F53 + compiler.err.invalid.annotation.member.type=\u6CE8\u91CA\u6210\u5458\u7684\u7C7B\u578B\u65E0\u6548 + compiler.err.invalid.binary.number=\u4E8C\u8FDB\u5236\u6570\u5B57\u4E2D\u5FC5\u987B\u5305\u542B\u81F3\u5C11\u4E00\u4E2A\u4E8C\u8FDB\u5236\u6570 + compiler.err.invalid.hex.number=\u5341\u516D\u8FDB\u5236\u6570\u5B57\u5FC5\u987B\u5305\u542B\u81F3\u5C11\u4E00\u4F4D\u5341\u516D\u8FDB\u5236\u6570 + compiler.err.invalid.meth.decl.ret.type.req=\u65B9\u6CD5\u58F0\u660E\u65E0\u6548; \u9700\u8981\u8FD4\u56DE\u7C7B\u578B +compiler.err.varargs.and.old.array.syntax=variable-arity \u53C2\u6570\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4F20\u7EDF\u6570\u7EC4\u8BB0\u53F7 + +# 0: name compiler.err.label.already.in.use=\u6807\u7B7E{0}\u5DF2\u4F7F\u7528 + +# 0: symbol compiler.err.local.var.accessed.from.icls.needs.final=\u4ECE\u5185\u90E8\u7C7B\u4E2D\u8BBF\u95EE\u672C\u5730\u53D8\u91CF{0}; \u9700\u8981\u88AB\u58F0\u660E\u4E3A\u6700\u7EC8\u7C7B\u578B + compiler.err.local.enum=\u679A\u4E3E\u7C7B\u578B\u4E0D\u80FD\u4E3A\u672C\u5730\u7C7B\u578B + compiler.err.cannot.create.array.with.type.arguments=\u65E0\u6CD5\u521B\u5EFA\u5177\u6709\u7C7B\u578B\u53D8\u91CF\u7684\u6570\u7EC4 # @@ -162,70 +343,131 @@ # detected during code generation. # compiler.err.limit.code=\u4EE3\u7801\u8FC7\u957F + compiler.err.limit.code.too.large.for.try.stmt=try \u8BED\u53E5\u7684\u4EE3\u7801\u8FC7\u957F + compiler.err.limit.dimensions=\u6570\u7EC4\u7C7B\u578B\u7EF4\u8FC7\u591A + compiler.err.limit.locals=\u672C\u5730\u53D8\u91CF\u8FC7\u591A + compiler.err.limit.parameters=\u53C2\u6570\u8FC7\u591A + compiler.err.limit.pool=\u5E38\u91CF\u8FC7\u591A + compiler.err.limit.pool.in.class=\u7C7B{0}\u4E2D\u7684\u5E38\u91CF\u8FC7\u591A + compiler.err.limit.stack=\u4EE3\u7801\u9700\u8981\u8FC7\u591A\u5806\u6808 + compiler.err.limit.string=\u5E38\u91CF\u5B57\u7B26\u4E32\u8FC7\u957F + compiler.err.limit.string.overflow=\u5BF9\u4E8E\u5E38\u91CF\u6C60\u6765\u8BF4, \u5B57\u7B26\u4E32 \"{0}...\" \u7684 UTF8 \u8868\u793A\u8FC7\u957F compiler.err.malformed.fp.lit=\u6D6E\u70B9\u6587\u5B57\u7684\u683C\u5F0F\u9519\u8BEF + compiler.err.method.does.not.override.superclass=\u65B9\u6CD5\u4E0D\u4F1A\u8986\u76D6\u6216\u5B9E\u73B0\u8D85\u7C7B\u578B\u7684\u65B9\u6CD5 + compiler.err.missing.meth.body.or.decl.abstract=\u7F3A\u5C11\u65B9\u6CD5\u4E3B\u4F53, \u6216\u58F0\u660E\u62BD\u8C61 + compiler.err.missing.ret.stmt=\u7F3A\u5C11\u8FD4\u56DE\u8BED\u53E5 + compiler.err.missing.ret.val=\u7F3A\u5C11\u8FD4\u56DE\u503C + +# 0: set of modifier compiler.err.mod.not.allowed.here=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u4FEE\u9970\u7B26{0} + compiler.err.intf.not.allowed.here=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u63A5\u53E3 + compiler.err.enums.must.be.static=\u53EA\u6709\u5728\u9759\u6001\u4E0A\u4E0B\u6587\u4E2D\u624D\u5141\u8BB8\u4F7F\u7528\u679A\u4E3E\u58F0\u660E +# 0: symbol, 1: symbol compiler.err.name.clash.same.erasure=\u540D\u79F0\u51B2\u7A81: {0}\u548C{1}\u5177\u6709\u76F8\u540C\u7591\u7B26 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol, 4: unused, 5: unused compiler.err.name.clash.same.erasure.no.override=\u540D\u79F0\u51B2\u7A81: {1}\u4E2D\u7684{0}\u548C{3}\u4E2D\u7684{2}\u5177\u6709\u76F8\u540C\u7591\u7B26, \u4F46\u4E24\u8005\u5747\u4E0D\u8986\u76D6\u5BF9\u65B9 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol, 4: symbol, 5: symbol +compiler.err.name.clash.same.erasure.no.override.1=\u540D\u79F0\u51B2\u7A81: {1} \u4E2D\u7684 {0} \u8986\u76D6\u7684\u65B9\u6CD5\u7684\u7591\u7B26\u4E0E\u53E6\u4E00\u4E2A\u65B9\u6CD5\u7684\u76F8\u540C, \u4F46\u4E24\u8005\u5747\u4E0D\u8986\u76D6\u5BF9\u65B9\n\u7B2C\u4E00\u4E2A\u65B9\u6CD5: {3} \u4E2D\u7684 {2}\n\u7B2C\u4E8C\u4E2A\u65B9\u6CD5: {5} \u4E2D\u7684 {4} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol +compiler.err.name.clash.same.erasure.no.hide=\u540D\u79F0\u51B2\u7A81: {1} \u4E2D\u7684 {0} \u548C {3} \u4E2D\u7684 {2} \u5177\u6709\u76F8\u540C\u7591\u7B26, \u4F46\u4E24\u8005\u5747\u4E0D\u9690\u85CF\u5BF9\u65B9 + compiler.err.name.reserved.for.internal.use={0}\u4E3A\u5185\u90E8\u4F7F\u7528\u4FDD\u7559 + compiler.err.native.meth.cant.have.body=\u672C\u673A\u65B9\u6CD5\u4E0D\u80FD\u5E26\u6709\u4E3B\u4F53 + +# 0: type, 1: type compiler.err.neither.conditional.subtype=? \u7684\u4E0D\u517C\u5BB9\u7C7B\u578B: \u4E24\u8005\u90FD\u4E0D\u662F\u5BF9\u65B9\u7684\u5B50\u7C7B\u578B\n\u7B2C\u4E8C\u4E2A\u64CD\u4F5C\u6570: {0}\n\u7B2C\u4E09\u4E2A\u64CD\u4F5C\u6570: {1} + compiler.err.new.not.allowed.in.annotation=\u6CE8\u91CA\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 ''new'' + compiler.err.no.annotation.member={1}\u4E2D\u6CA1\u6709\u6CE8\u91CA\u6210\u5458{0} + compiler.err.no.encl.instance.of.type.in.scope=\u4F5C\u7528\u57DF\u4E2D\u6CA1\u6709\u7C7B\u578B\u4E3A{0}\u7684\u5C01\u95ED\u5B9E\u4F8B + compiler.err.no.intf.expected.here=\u6B64\u5904\u4E0D\u9700\u8981\u63A5\u53E3 + compiler.err.no.match.entry={0}\u5728{1}\u7684\u6761\u76EE\u4E2D\u6CA1\u6709\u5339\u914D\u9879; \u9700\u8981{2} + compiler.err.not.annotation.type={0}\u4E0D\u662F\u6CE8\u91CA\u7C7B\u578B + +# 0: symbol, 1: symbol compiler.err.not.def.access.class.intf.cant.access={1}\u4E2D\u7684{0}\u662F\u5728\u4E0D\u53EF\u8BBF\u95EE\u7684\u7C7B\u6216\u63A5\u53E3\u4E2D\u5B9A\u4E49\u7684 + +# 0: symbol, 1: symbol compiler.err.not.def.public.cant.access={0}\u5728{1}\u4E2D\u4E0D\u662F\u516C\u5171\u7684; \u65E0\u6CD5\u4ECE\u5916\u90E8\u7A0B\u5E8F\u5305\u4E2D\u5BF9\u5176\u8FDB\u884C\u8BBF\u95EE + +# 0: name compiler.err.not.loop.label=\u4E0D\u662F loop \u6807\u7B7E: {0} + compiler.err.not.stmt=\u4E0D\u662F\u8BED\u53E5 + +# 0: symbol compiler.err.not.encl.class=\u4E0D\u662F\u5C01\u95ED\u7C7B: {0} -compiler.err.operator.cant.be.applied=\u8FD0\u7B97\u7B26{0}\u4E0D\u80FD\u5E94\u7528\u4E8E{1} +# 0: name, 1: type, 2: unused +compiler.err.operator.cant.be.applied=\u4E00\u5143\u8FD0\u7B97\u7B26 ''{0}'' \u7684\u64CD\u4F5C\u6570\u7C7B\u578B{1}\u9519\u8BEF + +# 0: name, 1: type, 2: type +compiler.err.operator.cant.be.applied.1=\u4E8C\u5143\u8FD0\u7B97\u7B26 ''{0}'' \u7684\u64CD\u4F5C\u6570\u7C7B\u578B\u9519\u8BEF\n\u7B2C\u4E00\u4E2A\u7C7B\u578B: {1}\n\u7B2C\u4E8C\u4E2A\u7C7B\u578B: {2} compiler.err.pkg.annotations.sb.in.package-info.java=\u7A0B\u5E8F\u5305\u6CE8\u91CA\u5E94\u5728\u6587\u4EF6 package-info.java \u4E2D + +# 0: symbol compiler.err.pkg.clashes.with.class.of.same.name=\u7A0B\u5E8F\u5305{0}\u4E0E\u5E26\u6709\u76F8\u540C\u540D\u79F0\u7684\u7C7B\u51B2\u7A81 compiler.err.warnings.and.werror=\u53D1\u73B0\u8B66\u544A, \u4F46\u6307\u5B9A\u4E86 -Werror # Errors related to annotation processing +# 0: symbol, 1: string, 2: stack-trace compiler.err.proc.cant.access=\u65E0\u6CD5\u8BBF\u95EE{0}\n{1}\n\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605\u4EE5\u4E0B\u5806\u6808\u8DDF\u8E2A\u3002\n{2} +# 0: symbol, 1: string +compiler.err.proc.cant.access.1=\u65E0\u6CD5\u8BBF\u95EE{0}\n{1} + +# 0: string compiler.err.proc.cant.find.class=\u627E\u4E0D\u5230 ''{0}'' \u7684\u7C7B\u6587\u4EF6\u3002 # Print a client-generated error message; assumed to be localized, no translation required +# 0: string compiler.err.proc.messager={0} +# 0: list of string compiler.err.proc.no.explicit.annotation.processing.requested=\u4EC5\u5F53\u663E\u5F0F\u8BF7\u6C42\u6CE8\u91CA\u5904\u7406\u65F6\u624D\u63A5\u53D7\u7C7B\u540D\u79F0 ''{0}'' compiler.err.proc.no.service=\u627E\u4E0D\u5230\u670D\u52A1\u52A0\u8F7D\u5668\u7C7B\u3002\njava.util.ServiceLoader \u6216 sun.misc.Service \u5FC5\u987B\u53EF\u7528\u3002 compiler.err.proc.processor.bad.option.name=\u5904\u7406\u7A0B\u5E8F ''{1}'' \u63D0\u4F9B\u7684\u9009\u9879\u540D\u79F0 ''{0}'' \u9519\u8BEF +# 0: string compiler.err.proc.processor.cant.instantiate=\u65E0\u6CD5\u5B9E\u4F8B\u5316\u5904\u7406\u7A0B\u5E8F ''{0}'' \u7684\u5B9E\u4F8B compiler.err.proc.processor.constructor.error=\u6784\u9020\u5904\u7406\u7A0B\u5E8F\u5BF9\u8C61{0}\u65F6\u629B\u51FA\u5F02\u5E38\u9519\u8BEF +# 0: string compiler.err.proc.processor.not.found=\u627E\u4E0D\u5230\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F ''{0}'' +# 0: string compiler.err.proc.processor.wrong.type=\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F ''{0}'' \u672A\u5B9E\u73B0 javax.annotation.processing.Processor compiler.err.proc.service.problem=\u521B\u5EFA\u670D\u52A1\u52A0\u8F7D\u5668\u4EE5\u52A0\u8F7D\u5904\u7406\u7A0B\u5E8F\u65F6\u51FA\u9519\u3002 @@ -234,67 +476,146 @@ compiler.err.proc.cant.create.loader=\u65E0\u6CD5\u4E3A\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F{0}\u521B\u5EFA\u7C7B\u52A0\u8F7D\u5668 +# 0: unused compiler.err.qualified.new.of.static.class=\u9650\u5B9A\u7684\u65B0\u9759\u6001\u7C7B compiler.err.recursive.ctor.invocation=\u9012\u5F52\u6784\u9020\u5668\u8C03\u7528 + +# 0: name, 1: symbol kind, 2: symbol, 3: symbol, 4: symbol kind, 5: symbol, 6: symbol compiler.err.ref.ambiguous=\u5BF9{0}\u7684\u5F15\u7528\u4E0D\u660E\u786E, {3}\u4E2D\u7684{1} {2}\u548C{6}\u4E2D\u7684{4} {5}\u90FD\u5339\u914D + compiler.err.repeated.annotation.target=\u6CE8\u91CA\u76EE\u6807\u91CD\u590D + compiler.err.repeated.interface=\u63A5\u53E3\u91CD\u590D + compiler.err.repeated.modifier=\u4FEE\u9970\u7B26\u91CD\u590D + +# 0: symbol, 1: set of modifier, 2: symbol compiler.err.report.access={0}\u53EF\u4EE5\u5728{2}\u4E2D\u8BBF\u95EE{1} + compiler.err.ret.outside.meth=\u8FD4\u56DE\u5916\u90E8\u65B9\u6CD5 compiler.err.signature.doesnt.match.supertype=\u7B7E\u540D\u4E0E{0}\u4E0D\u5339\u914D; \u4E0D\u517C\u5BB9\u7684\u8D85\u7C7B\u578B + compiler.err.signature.doesnt.match.intf=\u7B7E\u540D\u4E0E{0}\u4E0D\u5339\u914D; \u4E0D\u517C\u5BB9\u7684\u63A5\u53E3 + +# 0: symbol, 1: symbol, 2: symbol compiler.err.does.not.override.abstract={0}\u4E0D\u662F\u62BD\u8C61\u7684, \u5E76\u4E14\u672A\u8986\u76D6{2}\u4E2D\u7684\u62BD\u8C61\u65B9\u6CD5{1} + compiler.err.source.cant.overwrite.input.file=\u5199\u5165\u6E90\u65F6\u51FA\u9519; \u65E0\u6CD5\u8986\u76D6\u8F93\u5165\u6587\u4EF6{0} + compiler.err.stack.sim.error=\u5185\u90E8\u9519\u8BEF: {0}\u4E2D\u7684\u5806\u6808 sim \u9519\u8BEF + compiler.err.static.imp.only.classes.and.interfaces=\u4EC5\u4ECE\u7C7B\u548C\u63A5\u53E3\u9759\u6001\u5BFC\u5165 + compiler.err.string.const.req=\u9700\u8981\u5E38\u91CF\u5B57\u7B26\u4E32\u8868\u8FBE\u5F0F + +# 0: symbol, 1: symbol compiler.err.synthetic.name.conflict=\u7B26\u53F7{0}\u4E0E{1}\u4E2D\u7684 compiler-synthesized \u7B26\u53F7\u51B2\u7A81 + +# 0: symbol, 1: symbol compiler.warn.synthetic.name.conflict=\u7B26\u53F7{0}\u4E0E{1}\u4E2D\u7684 compiler-synthesized \u7B26\u53F7\u51B2\u7A81 compiler.err.throws.not.allowed.in.intf.annotation=@interface \u6210\u5458\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528 throws \u5B50\u53E5 + compiler.err.try.without.catch.or.finally=\u6709 ''try'', \u4F46\u662F\u6CA1\u6709 ''catch'' \u6216 ''finally'' + compiler.err.try.without.catch.finally.or.resource.decls=''try'' \u4E0D\u5E26\u6709 ''catch'', ''finally'' \u6216\u8D44\u6E90\u58F0\u660E + +# 0: symbol compiler.err.type.doesnt.take.params=\u7C7B\u578B{0}\u4E0D\u5E26\u6709\u53C2\u6570 + compiler.err.type.var.cant.be.deref=\u65E0\u6CD5\u4ECE\u7C7B\u578B\u53D8\u91CF\u4E2D\u8FDB\u884C\u9009\u62E9 + compiler.err.type.var.may.not.be.followed.by.other.bounds=\u7C7B\u578B\u53D8\u91CF\u540E\u9762\u4E0D\u80FD\u5E26\u6709\u5176\u4ED6\u9650\u5236\u8303\u56F4 + compiler.err.type.var.more.than.once=\u7C7B\u578B\u53D8\u91CF{0}\u5728{1}\u7684\u7ED3\u679C\u7C7B\u578B\u4E2D\u591A\u6B21\u51FA\u73B0; \u5FC5\u987B\u5BF9\u5176\u8FDB\u884C\u5B9E\u4F8B\u5316 + compiler.err.type.var.more.than.once.in.result=\u7C7B\u578B\u53D8\u91CF{0}\u5728{1}\u7684\u7C7B\u578B\u4E2D\u591A\u6B21\u51FA\u73B0; \u5FC5\u987B\u5BF9\u5176\u8FDB\u884C\u5B9E\u4F8B\u5316 + +# 0: type, 1: type, 2: string compiler.err.types.incompatible.diff.ret=\u7C7B\u578B{0}\u548C{1}\u4E0D\u517C\u5BB9; \u4E24\u8005\u90FD\u5B9A\u4E49\u4E86{2}, \u4F46\u5374\u5E26\u6709\u4E0D\u76F8\u5173\u7684\u8FD4\u56DE\u7C7B\u578B compiler.err.unclosed.char.lit=\u672A\u7ED3\u675F\u7684\u5B57\u7B26\u6587\u5B57 + compiler.err.unclosed.comment=\u672A\u7ED3\u675F\u7684\u6CE8\u91CA + compiler.err.unclosed.str.lit=\u672A\u7ED3\u675F\u7684\u5B57\u7B26\u4E32\u6587\u5B57 -compiler.err.unknown.enum.constant=\u5728\u7C7B\u6587\u4EF6{0}\u4E2D: \u672A\u77E5\u7684\u679A\u4E3E\u5E38\u91CF {1}.{2} + +# 0: name compiler.err.unsupported.encoding=\u4E0D\u652F\u6301\u7684\u7F16\u7801: {0} + compiler.err.io.exception=\u8BFB\u53D6\u6E90\u6587\u4EF6\u65F6\u51FA\u9519: {0} + +# 0: name compiler.err.undef.label=\u672A\u5B9A\u4E49\u7684\u6807\u7B7E: {0} -compiler.err.undetermined.type=\u65E0\u6CD5\u786E\u5B9A{0}\u7684\u7C7B\u578B\u53C2\u6570 -compiler.err.undetermined.type.1=\u65E0\u6CD5\u786E\u5B9A{0}\u7684\u7C7B\u578B\u53C2\u6570; {1} + +compiler.err.undetermined.type=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570 + +# 0: type, 1: message segment +compiler.err.undetermined.type.1=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570;\n\u539F\u56E0: {1} + +# 0: list of type, 1: message segment compiler.err.invalid.inferred.types={0}\u7684\u63A8\u65AD\u7C7B\u578B\u65E0\u6548; {1} + +# 0: message segment, 1: unused compiler.err.cant.apply.diamond=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570 + +# 0: message segment, 1: message segment compiler.err.cant.apply.diamond.1=\u65E0\u6CD5\u63A8\u65AD{0}\u7684\u7C7B\u578B\u53C2\u6570;\n\u539F\u56E0: {1} + compiler.err.unreachable.stmt=\u65E0\u6CD5\u8BBF\u95EE\u7684\u8BED\u53E5 + compiler.err.initializer.must.be.able.to.complete.normally=\u521D\u59CB\u5316\u7A0B\u5E8F\u5FC5\u987B\u80FD\u591F\u6B63\u5E38\u5B8C\u6210 + +# 0: type compiler.err.unreported.exception.need.to.catch.or.throw=\u672A\u62A5\u544A\u7684\u5F02\u5E38\u9519\u8BEF{0}; \u5FC5\u987B\u5BF9\u5176\u8FDB\u884C\u6355\u83B7\u6216\u58F0\u660E\u4EE5\u4FBF\u629B\u51FA + +# 0: type compiler.err.unreported.exception.default.constructor=\u9ED8\u8BA4\u6784\u9020\u5668\u4E2D\u672A\u62A5\u544A\u7684\u5F02\u5E38\u9519\u8BEF{0} + +# 0: type, 1: name +compiler.err.unreported.exception.implicit.close=\u672A\u62A5\u544A\u7684\u5F02\u5E38\u9519\u8BEF{0}; \u5FC5\u987B\u5BF9\u5176\u8FDB\u884C\u6355\u83B7\u6216\u58F0\u660E\u4EE5\u4FBF\u629B\u51FA\n\u5BF9\u8D44\u6E90\u53D8\u91CF ''{1}'' \u9690\u5F0F\u8C03\u7528 close() \u65F6\u629B\u51FA\u4E86\u5F02\u5E38\u9519\u8BEF + compiler.err.unsupported.cross.fp.lit=\u8BE5 VM \u4E0D\u652F\u6301\u5341\u516D\u8FDB\u5236\u6D6E\u70B9\u6587\u5B57 + compiler.err.void.not.allowed.here=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528 ''\u7A7A'' \u7C7B\u578B +# 0: string compiler.err.wrong.number.type.args=\u7C7B\u578B\u53D8\u91CF\u6570\u76EE\u9519\u8BEF; \u9700\u8981{0} +# 0: symbol compiler.err.var.might.already.be.assigned=\u53EF\u80FD\u5DF2\u5206\u914D\u53D8\u91CF{0} + +# 0: symbol compiler.err.var.might.not.have.been.initialized=\u53EF\u80FD\u5C1A\u672A\u521D\u59CB\u5316\u53D8\u91CF{0} + +# 0: symbol compiler.err.var.might.be.assigned.in.loop=\u53EF\u80FD\u5728 loop \u4E2D\u5206\u914D\u4E86\u53D8\u91CF{0} +# 0: symbol, 1: message segment +compiler.err.varargs.invalid.trustme.anno={0} \u6CE8\u91CA\u65E0\u6548\u3002{1} + +# 0: type +compiler.misc.varargs.trustme.on.reifiable.varargs=Varargs \u5143\u7D20\u7C7B\u578B{0}\u53EF\u5177\u4F53\u5316\u3002 + +# 0: symbol +compiler.misc.varargs.trustme.on.non.varargs.meth=\u65B9\u6CD5 {0} \u4E0D\u662F varargs \u65B9\u6CD5\u3002 + +# 0: symbol +compiler.misc.varargs.trustme.on.virtual.varargs=\u5B9E\u4F8B\u65B9\u6CD5 {0} \u4E0D\u662F\u6700\u7EC8\u7684\u3002 + +# 0: type, 1: kind, 2: symbol +compiler.misc.inaccessible.varargs.type=\u5F62\u5F0F varargs \u5143\u7D20\u7C7B\u578B{0}\u65E0\u6CD5\u4ECE {1} {2} \u8FDB\u884C\u8BBF\u95EE + # In the following string, {1} will always be the detail message from # java.io.IOException. +# 0: symbol, 1: string compiler.err.class.cant.write=\u5199\u5165{0}\u65F6\u51FA\u9519: {1} # In the following string, {0} is the name of the class in the Java source. # It really should be used two times.. +# 0: name compiler.err.class.public.should.be.in.file=\u7C7B{0}\u662F\u516C\u5171\u7684, \u5E94\u5728\u540D\u4E3A {0}.java \u7684\u6587\u4EF6\u4E2D\u58F0\u660E ## All errors which do not refer to a particular line in the source code are @@ -309,9 +630,13 @@ # Fatal Errors compiler.misc.fatal.err.no.java.lang=\u81F4\u547D\u9519\u8BEF: \u5728\u7C7B\u8DEF\u5F84\u6216\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u4E2D\u627E\u4E0D\u5230\u7A0B\u5E8F\u5305 java.lang + compiler.misc.fatal.err.cant.locate.meth=\u81F4\u547D\u9519\u8BEF: \u627E\u4E0D\u5230\u65B9\u6CD5{0} + compiler.misc.fatal.err.cant.locate.field=\u81F4\u547D\u9519\u8BEF: \u627E\u4E0D\u5230\u5B57\u6BB5{0} + compiler.misc.fatal.err.cant.locate.ctor=\u81F4\u547D\u9519\u8BEF: \u627E\u4E0D\u5230{0}\u7684\u6784\u9020\u5668 + compiler.misc.fatal.err.cant.close.loader=\u81F4\u547D\u9519\u8BEF: \u65E0\u6CD5\u5173\u95ED\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u7684\u7C7B\u52A0\u8F7D\u5668 ##### @@ -321,8 +646,13 @@ ## compiler.misc.source.unavailable=(\u6E90\u4E0D\u53EF\u7528) + compiler.misc.base.membership=\u60A8\u7684\u6240\u6709\u57FA\u7C7B\u90FD\u5C5E\u4E8E\u6211\u4EEC + +# 0: string, 1: string, 2: boolean compiler.misc.x.print.processor.info=\u5904\u7406\u7A0B\u5E8F{0}\u4E0E{1}\u5339\u914D\u5E76\u8FD4\u56DE{2}\u3002 + +# 0: number, 1: string, 2: set of symbol, 3: boolean compiler.misc.x.print.rounds=\u5FAA\u73AF {0}:\n\t\u8F93\u5165\u6587\u4EF6: {1}\n\t\u6CE8\u91CA: {2}\n\t\u6700\u540E\u4E00\u4E2A\u5FAA\u73AF: {3} ##### @@ -331,77 +661,106 @@ ## "compiler.note". compiler.note.note=\u6CE8:\u0020 +# 0: file name compiler.note.deprecated.filename={0}\u4F7F\u7528\u6216\u8986\u76D6\u4E86\u5DF2\u8FC7\u65F6\u7684 API\u3002 + compiler.note.deprecated.plural=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u4F7F\u7528\u6216\u8986\u76D6\u4E86\u5DF2\u8FC7\u65F6\u7684 API\u3002 + # The following string may appear after one of the above deprecation # messages. compiler.note.deprecated.recompile=\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -Xlint:deprecation \u91CD\u65B0\u7F16\u8BD1\u3002 +# 0: file name compiler.note.deprecated.filename.additional={0}\u8FD8\u4F7F\u7528\u6216\u8986\u76D6\u4E86\u5DF2\u8FC7\u65F6\u7684 API\u3002 + compiler.note.deprecated.plural.additional=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u8FD8\u4F7F\u7528\u6216\u8986\u76D6\u4E86\u5DF2\u8FC7\u65F6\u7684 API\u3002 +# 0: file name compiler.note.unchecked.filename={0}\u4F7F\u7528\u4E86\u672A\u7ECF\u68C0\u67E5\u6216\u4E0D\u5B89\u5168\u7684\u64CD\u4F5C\u3002 + compiler.note.unchecked.plural=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u4F7F\u7528\u4E86\u672A\u7ECF\u68C0\u67E5\u6216\u4E0D\u5B89\u5168\u7684\u64CD\u4F5C\u3002 + # The following string may appear after one of the above deprecation # messages. compiler.note.unchecked.recompile=\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -Xlint:unchecked \u91CD\u65B0\u7F16\u8BD1\u3002 +# 0: file name compiler.note.unchecked.filename.additional={0}\u8FD8\u6709\u672A\u7ECF\u68C0\u67E5\u6216\u4E0D\u5B89\u5168\u7684\u64CD\u4F5C\u3002 + compiler.note.unchecked.plural.additional=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u8FD8\u4F7F\u7528\u4E86\u672A\u7ECF\u68C0\u67E5\u6216\u4E0D\u5B89\u5168\u7684\u64CD\u4F5C\u3002 -compiler.note.varargs.filename={0}\u58F0\u660E\u4E86\u4E0D\u5B89\u5168\u7684 vararg \u65B9\u6CD5\u3002 -compiler.note.varargs.plural=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u58F0\u660E\u4E86\u4E0D\u5B89\u5168\u7684 vararg \u65B9\u6CD5\u3002 -# The following string may appear after one of the above unsafe varargs -# messages. -compiler.note.varargs.recompile=\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -Xlint:varargs \u91CD\u65B0\u7F16\u8BD1\u3002 +# 0: file name +compiler.note.sunapi.filename={0}\u4F7F\u7528\u4E86\u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u7684\u5185\u90E8\u4E13\u7528 API\u3002 -compiler.note.varargs.filename.additional={0}\u58F0\u660E\u4E86\u5176\u4ED6\u4E0D\u5B89\u5168\u7684 vararg \u65B9\u6CD5\u3002 -compiler.note.varargs.plural.additional=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u8FD8\u58F0\u660E\u4E86\u4E0D\u5B89\u5168\u7684 vararg \u65B9\u6CD5\u3002 +compiler.note.sunapi.plural=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u4F7F\u7528\u4E86\u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u7684\u5185\u90E8\u4E13\u7528 API\u3002 -compiler.note.sunapi.filename={0}\u4F7F\u7528\u4E86\u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u7684\u5185\u90E8\u4E13\u7528 API\u3002 -compiler.note.sunapi.plural=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u4F7F\u7528\u4E86\u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u7684\u5185\u90E8\u4E13\u7528 API\u3002 # The following string may appear after one of the above sunapi messages. compiler.note.sunapi.recompile=\u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u4F7F\u7528 -Xlint:sunapi \u91CD\u65B0\u7F16\u8BD1\u3002 +# 0: file name compiler.note.sunapi.filename.additional={0}\u4F7F\u7528\u4E86\u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u7684\u5176\u4ED6\u5185\u90E8\u4E13\u7528 API\u3002 + compiler.note.sunapi.plural.additional=\u67D0\u4E9B\u8F93\u5165\u6587\u4EF6\u4F7F\u7528\u4E86\u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664\u7684\u5176\u4ED6\u5185\u90E8\u4E13\u7528 API\u3002 # Notes related to annotation processing # Print a client-generated note; assumed to be localized, no translation required +# 0: string compiler.note.proc.messager={0} ##### +# 0: number compiler.misc.count.error={0} \u4E2A\u9519\u8BEF + +# 0: number compiler.misc.count.error.plural={0} \u4E2A\u9519\u8BEF + +# 0: number compiler.misc.count.warn={0} \u4E2A\u8B66\u544A + +# 0: number compiler.misc.count.warn.plural={0} \u4E2A\u8B66\u544A compiler.misc.version.not.available=(\u7248\u672C\u4FE1\u606F\u4E0D\u53EF\u7528) ## extra output when using -verbose (JavaCompiler) +# 0: symbol compiler.misc.verbose.checking.attribution=[\u6B63\u5728\u68C0\u67E5{0}] + +# 0: string compiler.misc.verbose.parsing.done=[\u8BED\u6CD5\u5206\u6790\u5DF2\u5B8C\u6210, \u7528\u65F6 {0} \u6BEB\u79D2] + +# 0: file name compiler.misc.verbose.parsing.started=[\u8BED\u6CD5\u5206\u6790\u5F00\u59CB\u65F6\u95F4 {0}] + +# 0: string compiler.misc.verbose.total=[\u5171 {0} \u6BEB\u79D2] + +# 0: file name compiler.misc.verbose.wrote.file=[\u5DF2\u5199\u5165{0}] ## extra output when using -verbose (Retro) compiler.misc.verbose.retro=[\u6B63\u5728\u66F4\u65B0{0}] + compiler.misc.verbose.retro.with=\t\u6B63\u5728\u4F7F\u7528{1}\u66F4\u65B0{0} + compiler.misc.verbose.retro.with.list=\t\u6B63\u5728\u4F7F\u7528\u7C7B\u578B\u53C2\u6570{1}, \u8D85\u7C7B\u578B{2}\u548C\u63A5\u53E3{3}\u66F4\u65B0{0} ## extra output when using -verbose (code/ClassReader) +# 0: string compiler.misc.verbose.loading=[\u6B63\u5728\u52A0\u8F7D{0}] +# 0: string compiler.misc.verbose.sourcepath=[\u6E90\u6587\u4EF6\u7684\u641C\u7D22\u8DEF\u5F84: {0}] +# 0: string compiler.misc.verbose.classpath=[\u7C7B\u6587\u4EF6\u7684\u641C\u7D22\u8DEF\u5F84: {0}] ## extra output when using -checkclassfile (code/ClassReader) compiler.misc.ccf.found.later.version=\u7C7B\u6587\u4EF6\u7684\u7248\u672C\u9AD8\u4E8E\u9884\u671F: {0} + compiler.misc.ccf.unrecognized.attribute=\u65E0\u6CD5\u8BC6\u522B\u7684\u5C5E\u6027: {0} ## extra output when using -prompt (util/Log) @@ -418,66 +777,106 @@ ## Warning messages may also include the following prefix to identify a ## lint option +# 0: option name compiler.warn.lintOption=[{0}]\u0020 +# 0: symbol compiler.warn.constant.SVUID=serialVersionUID \u5728\u7C7B{0}\u4E2D\u5FC5\u987B\u662F\u5E38\u91CF +# 0: file name compiler.warn.dir.path.element.not.found=\u9519\u8BEF\u7684\u8DEF\u5F84\u5143\u7D20 "{0}": \u6CA1\u6709\u8FD9\u79CD\u76EE\u5F55 compiler.warn.finally.cannot.complete=finally \u5B50\u53E5\u65E0\u6CD5\u6B63\u5E38\u5B8C\u6210 +# 0: symbol, 1: symbol compiler.warn.has.been.deprecated={1}\u4E2D\u7684{0}\u5DF2\u8FC7\u65F6 +# 0: symbol compiler.warn.sun.proprietary={0}\u662F\u5185\u90E8\u4E13\u7528 API, \u53EF\u80FD\u4F1A\u5728\u672A\u6765\u53D1\u884C\u7248\u4E2D\u5220\u9664 compiler.warn.illegal.char.for.encoding=\u7F16\u7801{0}\u7684\u4E0D\u53EF\u6620\u5C04\u5B57\u7B26 +# 0: symbol compiler.warn.improper.SVUID=\u5FC5\u987B\u5728\u7C7B{0}\u4E2D\u5C06 serialVersionUID \u58F0\u660E\u4E3A static final +# 0: type, 1: type compiler.warn.inexact.non-varargs.call=\u6700\u540E\u4E00\u4E2A\u53C2\u6570\u4F7F\u7528\u4E86\u4E0D\u51C6\u786E\u7684\u53D8\u91CF\u7C7B\u578B\u7684 varargs \u65B9\u6CD5\u7684\u975E varargs \u8C03\u7528; \n\u5BF9\u4E8E varargs \u8C03\u7528, \u5E94\u4F7F\u7528 {0}\n\u5BF9\u4E8E\u975E varargs \u8C03\u7528, \u5E94\u4F7F\u7528 {1}, \u8FD9\u6837\u4E5F\u53EF\u4EE5\u6291\u5236\u6B64\u8B66\u544A +# 0: list of type +compiler.warn.unreachable.catch=catch \u5B50\u53E5\u65E0\u6CD5\u8BBF\u95EE\n\u5DF2\u6355\u83B7\u5230\u629B\u51FA\u7684\u7C7B\u578B{0} + +# 0: list of type +compiler.warn.unreachable.catch.1=catch \u5B50\u53E5\u65E0\u6CD5\u8BBF\u95EE\n\u5DF2\u6355\u83B7\u5230\u629B\u51FA\u7684\u7C7B\u578B{0} + +# 0: symbol compiler.warn.long.SVUID=serialVersionUID \u5728\u7C7B{0}\u4E2D\u5FC5\u987B\u662F long \u7C7B\u578B +# 0: symbol compiler.warn.missing.SVUID=\u53EF\u5E8F\u5217\u5316\u7C7B{0}\u6CA1\u6709 serialVersionUID \u7684\u5B9A\u4E49 +# 0: message segment compiler.warn.override.varargs.missing={0}; \u88AB\u8986\u76D6\u7684\u65B9\u6CD5\u6CA1\u6709 ''...'' + +# 0: message segment compiler.warn.override.varargs.extra={0}; \u8986\u76D6\u7684\u65B9\u6CD5\u7F3A\u5C11 ''...'' + compiler.warn.override.bridge={0}; \u88AB\u8986\u76D6\u7684\u65B9\u6CD5\u4E3A bridge \u65B9\u6CD5 +# 0: symbol compiler.warn.pkg-info.already.seen=\u5DF2\u627E\u5230\u7A0B\u5E8F\u5305{0}\u7684 package-info.java \u6587\u4EF6 +# 0: file name compiler.warn.path.element.not.found=\u9519\u8BEF\u7684\u8DEF\u5F84\u5143\u7D20 "{0}": \u6CA1\u6709\u8FD9\u79CD\u6587\u4EF6\u6216\u76EE\u5F55 compiler.warn.possible.fall-through.into.case=\u53EF\u80FD\u65E0\u6CD5\u5B9E\u73B0 case +# 0: type compiler.warn.redundant.cast=\u51FA\u73B0\u5197\u4F59\u7684\u5230{0}\u7684\u8F6C\u6362 +# 0: number compiler.warn.position.overflow=\u884C {0} \u5904\u7684\u4F4D\u7F6E\u7F16\u7801\u6EA2\u51FA +# 0: file name, 1: number, 2: number compiler.warn.big.major.version={0}: \u4E3B\u7248\u672C {1} \u6BD4 {2} \u65B0, \u6B64\u7F16\u8BD1\u5668\u652F\u6301\u6700\u65B0\u7684\u4E3B\u7248\u672C\u3002\n\u5EFA\u8BAE\u5347\u7EA7\u6B64\u7F16\u8BD1\u5668\u3002 +# 0: symbol kind, 1: symbol compiler.warn.static.not.qualified.by.type=static {0}\u5E94\u7531\u7C7B\u578B\u540D\u79F0{1}\u800C\u4E0D\u662F\u8868\u8FBE\u5F0F\u9650\u5B9A +# 0: string compiler.warn.source.no.bootclasspath=\u672A\u4E0E -source {0} \u4E00\u8D77\u8BBE\u7F6E\u5F15\u5BFC\u7C7B\u8DEF\u5F84 +# 0: name, 1: number, 2: number, 3: number, 4: number +compiler.warn.future.attr={1}.{2} \u7248\u7C7B\u6587\u4EF6\u4E2D\u5F15\u5165\u7684 {0} \u5C5E\u6027\u5728 {3}.{4} \u7248\u7C7B\u6587\u4EF6\u4E2D\u88AB\u5FFD\u7565 + # Warnings related to annotation processing +# 0: name compiler.warn.proc.package.does.not.exist=\u7A0B\u5E8F\u5305{0}\u4E0D\u5B58\u5728 + +# 0: name compiler.warn.proc.file.reopening=\u5C1D\u8BD5\u591A\u6B21\u4E3A ''{0}'' \u521B\u5EFA\u6587\u4EF6 +# 0: name compiler.warn.proc.type.already.exists=\u7C7B\u578B ''{0}'' \u7684\u6587\u4EF6\u5DF2\u7ECF\u5B58\u5728\u4E8E\u6E90\u8DEF\u5F84\u6216\u7C7B\u8DEF\u5F84\u4E2D +# 0: name compiler.warn.proc.type.recreate=\u5C1D\u8BD5\u591A\u6B21\u521B\u5EFA\u7C7B\u578B ''{0}'' \u7684\u6587\u4EF6 +# 0: string compiler.warn.proc.illegal.file.name=\u65E0\u6CD5\u521B\u5EFA\u5E26\u6709\u975E\u6CD5\u540D\u79F0 ''{0}'' \u7684\u6587\u4EF6\u3002 +# 0: string, 1: string compiler.warn.proc.suspicious.class.name=\u6B63\u5728\u4E3A\u540D\u79F0\u4EE5{1}\u7ED3\u5C3E\u7684\u7C7B\u578B\u521B\u5EFA\u6587\u4EF6: ''{0}'' +# 0: name compiler.warn.proc.file.create.last.round=\u5C06\u4E0D\u5BF9\u5728\u6700\u540E\u4E00\u4E2A\u5FAA\u73AF\u4E2D\u521B\u5EFA\u7684\u7C7B\u578B\u4E3A ''{0}'' \u7684\u6587\u4EF6\u8FDB\u884C\u6CE8\u91CA\u5904\u7406\u3002 +# 0: string, 1: string compiler.warn.proc.malformed.supported.string=\u5904\u7406\u7A0B\u5E8F ''{1}'' \u4E3A\u652F\u6301\u7684\u6CE8\u91CA\u7C7B\u578B\u8FD4\u56DE\u683C\u5F0F\u9519\u8BEF\u7684\u5B57\u7B26\u4E32 ''{0}'' +# 0: set of string compiler.warn.proc.annotations.without.processors=\u6CA1\u6709\u5904\u7406\u7A0B\u5E8F\u8981\u4F7F\u7528\u4EE5\u4E0B\u4EFB\u4F55\u6CE8\u91CA: {0} +# 0: source version, 1: string, 2: string compiler.warn.proc.processor.incompatible.source.version=\u6765\u81EA\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F ''{1}'' \u7684\u53D7\u652F\u6301 source \u7248\u672C ''{0}'' \u4F4E\u4E8E -source ''{2}'' compiler.warn.proc.proc-only.requested.no.procs=\u5728\u672A\u8BF7\u6C42\u7F16\u8BD1\u7684\u60C5\u51B5\u4E0B\u8FDB\u884C\u6CE8\u91CA\u5904\u7406, \u4F46\u627E\u4E0D\u5230\u5904\u7406\u7A0B\u5E8F\u3002 @@ -487,23 +886,44 @@ compiler.warn.proc.use.proc.or.implicit=\u6CE8\u91CA\u5904\u7406\u4E0D\u9002\u7528\u4E8E\u9690\u5F0F\u7F16\u8BD1\u7684\u6587\u4EF6\u3002\n\u4F7F\u7528 -proc:none \u7981\u7528\u6CE8\u91CA\u5904\u7406\u6216\u4F7F\u7528 -implicit \u6307\u5B9A\u7528\u4E8E\u9690\u5F0F\u7F16\u8BD1\u7684\u7B56\u7565\u3002 # Print a client-generated warning; assumed to be localized, no translation required +# 0: string compiler.warn.proc.messager={0} +# 0: set of name compiler.warn.proc.unclosed.type.files=\u7C7B\u578B ''{0}'' \u7684\u6587\u4EF6\u672A\u5173\u95ED; \u5C06\u4E0D\u9488\u5BF9\u8FD9\u4E9B\u7C7B\u578B\u8FDB\u884C\u6CE8\u91CA\u5904\u7406 +# 0: string compiler.warn.proc.unmatched.processor.options=\u4EE5\u4E0B\u9009\u9879\u672A\u88AB\u4EFB\u4F55\u5904\u7406\u7A0B\u5E8F\u8BC6\u522B: ''{0}'' compiler.warn.try.explicit.close.call=\u5728\u53EF\u81EA\u52A8\u7ED3\u675F\u7684\u8D44\u6E90\u4E0A\u663E\u5F0F\u8C03\u7528 close() + +# 0: symbol compiler.warn.try.resource.not.referenced=\u4E0D\u80FD\u5728\u76F8\u5E94\u7684 try \u8BED\u53E5\u7684\u6B63\u6587\u4E2D\u5F15\u7528\u53EF\u81EA\u52A8\u7ED3\u675F\u7684\u8D44\u6E90{0} + +# 0: type +compiler.warn.try.resource.throws.interrupted.exc=\u53EF\u81EA\u52A8\u5173\u95ED\u7684\u8D44\u6E90{0}\u5305\u542B\u7684\u6210\u5458\u65B9\u6CD5 close() \u53EF\u80FD\u629B\u51FA InterruptedException + compiler.warn.unchecked.assign=\u672A\u7ECF\u68C0\u67E5\u7684\u5206\u914D: \u5C06{0}\u5206\u914D\u7ED9{1} + +# 0: symbol, 1: type compiler.warn.unchecked.assign.to.var=\u5BF9\u4F5C\u4E3A\u539F\u59CB\u7C7B\u578B{1}\u7684\u6210\u5458\u7684\u53D8\u91CF{0}\u7684\u5206\u914D\u672A\u7ECF\u8FC7\u68C0\u67E5 + +# 0: symbol, 1: type compiler.warn.unchecked.call.mbr.of.raw.type=\u5BF9\u4F5C\u4E3A\u539F\u59CB\u7C7B\u578B{1}\u7684\u6210\u5458\u7684{0}\u7684\u8C03\u7528\u672A\u7ECF\u8FC7\u68C0\u67E5 + compiler.warn.unchecked.cast.to.type=\u5411\u7C7B\u578B{0}\u7684\u8F6C\u6362\u672A\u7ECF\u8FC7\u68C0\u67E5 + +# 0: symbol kind, 1: name, 2: list of type, 3: list of type, 4: symbol kind, 5: symbol compiler.warn.unchecked.meth.invocation.applied=\u65B9\u6CD5\u8C03\u7528\u672A\u7ECF\u8FC7\u68C0\u67E5: \u5C06{4} {5}\u4E2D\u7684{0} {1}\u5E94\u7528\u5230\u7ED9\u5B9A\u7684\u7C7B\u578B\n\u9700\u8981: {2}\n\u627E\u5230: {3} +# 0: type compiler.warn.unchecked.generic.array.creation=\u5BF9\u4E8E\u7C7B\u578B\u4E3A{0}\u7684 varargs \u53C2\u6570, \u6CDB\u578B\u6570\u7EC4\u521B\u5EFA\u672A\u7ECF\u8FC7\u68C0\u67E5 -compiler.warn.varargs.non.reifiable.type=\u53C2\u6570\u5316 vararg \u7C7B\u578B{0}\u7684\u5806\u53EF\u80FD\u5DF2\u53D7\u6C61\u67D3 +# 0: type +compiler.warn.unchecked.varargs.non.reifiable.type=\u53C2\u6570\u5316 vararg \u7C7B\u578B{0}\u7684\u5806\u53EF\u80FD\u5DF2\u53D7\u6C61\u67D3 + +# 0: symbol +compiler.warn.varargs.unsafe.use.varargs.param=Varargs \u65B9\u6CD5\u53EF\u80FD\u5BFC\u81F4\u6765\u81EA\u4E0D\u53EF\u5177\u4F53\u5316 varargs \u53C2\u6570 {0} \u7684\u5806\u6C61\u67D3 compiler.warn.missing.deprecated.annotation=\u672A\u4F7F\u7528 @Deprecated \u5BF9\u5DF2\u8FC7\u65F6\u7684\u9879\u76EE\u8FDB\u884C\u6CE8\u91CA @@ -519,23 +939,44 @@ compiler.warn.annotation.method.not.found.reason=\u65E0\u6CD5\u627E\u5230\u7C7B\u578B ''{0}'' \u7684\u6CE8\u91CA\u65B9\u6CD5 ''{1}()'': {2} +# 0: symbol, 1: name +compiler.warn.unknown.enum.constant=\u672A\u77E5\u7684\u679A\u4E3E\u5E38\u91CF {1}.{2} + +# 0: symbol, 1: name, 2: message segment +compiler.warn.unknown.enum.constant.reason=\u672A\u77E5\u7684\u679A\u4E3E\u5E38\u91CF {1}.{2}\n\u539F\u56E0: {3} + +# 0: type, 1: type compiler.warn.raw.class.use=\u627E\u5230\u539F\u59CB\u7C7B\u578B: {0}\n\u7F3A\u5C11\u6CDB\u578B\u7C7B{1}\u7684\u7C7B\u578B\u53C2\u6570 +# 0: unused, 1: unused compiler.warn.diamond.redundant.args=\u65B0\u8868\u8FBE\u5F0F\u4E2D\u5B58\u5728\u5197\u4F59\u7C7B\u578B\u53C2\u6570 (\u6539\u7528 diamond \u8FD0\u7B97\u7B26)\u3002 + +# 0: type, 1: type compiler.warn.diamond.redundant.args.1=\u65B0\u8868\u8FBE\u5F0F\u4E2D\u5B58\u5728\u5197\u4F59\u7C7B\u578B\u53C2\u6570 (\u6539\u7528 diamond \u8FD0\u7B97\u7B26)\u3002\n\u663E\u5F0F: {0}\n\u63A8\u65AD: {1} +# 0: symbol, 1: message segment +compiler.warn.varargs.redundant.trustme.anno=\u5197\u4F59\u7684 {0} \u6CE8\u91CA\u3002{1} + ##### ## The following are tokens which are non-terminals in the language. They should ## be named as JLS3 calls them when translated to the appropriate language. compiler.misc.token.identifier=<\u6807\u8BC6\u7B26> + compiler.misc.token.character=<\u5B57\u7B26> + compiler.misc.token.string=<\u5B57\u7B26\u4E32> + compiler.misc.token.integer=<\u6574\u578B> + compiler.misc.token.long-integer=<\u957F\u6574\u578B> + compiler.misc.token.float=<\u6D6E\u70B9\u578B> + compiler.misc.token.double=<\u53CC\u7CBE\u5EA6\u578B> + compiler.misc.token.bad-symbol=<\u9519\u8BEF\u7B26\u53F7> + compiler.misc.token.end-of-input=<\u8F93\u5165\u7ED3\u675F> ## The argument to the following string will always be one of the following: @@ -547,8 +988,13 @@ ## 6. an operator (JLS3.12) ## ## This is the only place these tokens will be used. +# 0: token compiler.err.expected=\u9700\u8981{0} + +# 0: token, 1: token compiler.err.expected2=\u9700\u8981{0}\u6216{1} + +# 0: token, 1: token, 2: token compiler.err.expected3=\u9700\u8981{0}, {1}\u6216{2} compiler.err.premature.eof=\u8FDB\u884C\u8BED\u6CD5\u5206\u6790\u65F6\u5DF2\u5230\u8FBE\u6587\u4EF6\u7ED3\u5C3E @@ -557,10 +1003,13 @@ compiler.err.dot.class.expected=\u9700\u8981 ''.class'' ## The argument to this string will always be either 'case' or 'default'. +# 0: token compiler.err.orphaned=\u5B64\u7ACB\u7684{0} +# 0: name compiler.misc.anonymous.class=<\u533F\u540D{0}> +# 0: name, 1: type compiler.misc.type.captureof=capture#{0}, \u5171 {1} compiler.misc.type.captureof.1=capture#{0} @@ -571,35 +1020,55 @@ ##### +# 0: symbol, 1: message segment compiler.err.cant.access=\u65E0\u6CD5\u8BBF\u95EE{0}\n{1} compiler.misc.bad.class.file.header=\u9519\u8BEF\u7684\u7C7B\u6587\u4EF6: {0}\n{1}\n\u8BF7\u5220\u9664\u8BE5\u6587\u4EF6\u6216\u786E\u4FDD\u8BE5\u6587\u4EF6\u4F4D\u4E8E\u6B63\u786E\u7684\u7C7B\u8DEF\u5F84\u5B50\u76EE\u5F55\u4E2D\u3002 + +# 0: file name, 1: message segment compiler.misc.bad.source.file.header=\u9519\u8BEF\u7684\u6E90\u6587\u4EF6: {0}\n{1}\n\u8BF7\u5220\u9664\u8BE5\u6587\u4EF6\u6216\u786E\u4FDD\u8BE5\u6587\u4EF6\u4F4D\u4E8E\u6B63\u786E\u7684\u6E90\u8DEF\u5F84\u5B50\u76EE\u5F55\u4E2D\u3002 ## The following are all possible strings for the second argument ({1}) of the ## above strings. compiler.misc.bad.class.signature=\u9519\u8BEF\u7684\u7C7B\u7B7E\u540D: {0} -compiler.misc.bad.enclosing.method=\u9519\u8BEF\u7684\u5C01\u95ED\u65B9\u6CD5\u5C5E\u6027: {0} + +#0: symbol, 1: symbol +compiler.misc.bad.enclosing.class={0}\u7684\u5C01\u95ED\u7C7B\u9519\u8BEF: {1} + +# 0: symbol +compiler.misc.bad.enclosing.method=\u7C7B {0} \u7684\u5C01\u95ED\u65B9\u6CD5\u5C5E\u6027\u9519\u8BEF + compiler.misc.bad.runtime.invisible.param.annotations=\u9519\u8BEF\u7684 RuntimeInvisibleParameterAnnotations \u5C5E\u6027: {0} + compiler.misc.bad.const.pool.tag=\u9519\u8BEF\u7684\u5E38\u91CF\u6C60\u6807\u8BB0: {0} + compiler.misc.bad.const.pool.tag.at=\u9519\u8BEF\u7684\u5E38\u91CF\u6C60\u6807\u8BB0: {0}, \u4F4D\u4E8E{1} + compiler.misc.bad.signature=\u9519\u8BEF\u7684\u7B7E\u540D: {0} -compiler.misc.bad.type.annotation.value=\u9519\u8BEF\u7684\u7C7B\u578B\u6CE8\u91CA\u76EE\u6807\u7C7B\u578B\u503C: {0} + compiler.misc.class.file.wrong.class=\u7C7B\u6587\u4EF6\u5305\u542B\u9519\u8BEF\u7684\u7C7B: {0} + compiler.misc.class.file.not.found=\u627E\u4E0D\u5230{0}\u7684\u7C7B\u6587\u4EF6 + +# 0: name compiler.misc.file.doesnt.contain.class=\u6587\u4EF6\u4E0D\u5305\u542B\u7C7B{0} + compiler.misc.file.does.not.contain.package=\u6587\u4EF6\u4E0D\u5305\u542B\u7A0B\u5E8F\u5305{0} + compiler.misc.illegal.start.of.class.file=\u975E\u6CD5\u7684\u7C7B\u6587\u4EF6\u5F00\u59CB + compiler.misc.unable.to.access.file=\u65E0\u6CD5\u8BBF\u95EE\u6587\u4EF6: {0} + compiler.misc.unicode.str.not.supported=\u4E0D\u652F\u6301\u7C7B\u6587\u4EF6\u4E2D\u7684 Unicode \u5B57\u7B26\u4E32 + compiler.misc.undecl.type.var=\u672A\u58F0\u660E\u7684\u7C7B\u578B\u53D8\u91CF: {0} + compiler.misc.wrong.version=\u7C7B\u6587\u4EF6\u5177\u6709\u9519\u8BEF\u7684\u7248\u672C {0}.{1}, \u5E94\u4E3A {2}.{3} ##### -compiler.err.not.within.bounds=\u7C7B\u578B\u53C2\u6570{0}\u4E0D\u5728\u5176\u9650\u5236\u8303\u56F4\u4E4B\u5185 - -compiler.err.not.within.bounds.explain=\u7C7B\u578B\u53C2\u6570{0}\u4E0D\u5728\u5176\u9650\u5236\u8303\u56F4\u4E4B\u5185; {1} +# 0: type, 1: type or symbol +compiler.err.not.within.bounds=\u7C7B\u578B\u53C2\u6570{0}\u4E0D\u5728\u7C7B\u578B\u53D8\u91CF{1}\u7684\u8303\u56F4\u5185 ## The following are all possible strings for the second argument ({1}) of the ## above string. @@ -608,18 +1077,27 @@ ##### +# 0: message segment, 1: type, 2: type compiler.err.prob.found.req={0}\n\u9700\u8981: {2}\n\u627E\u5230: {1} + +# 0: message segment, 1: type, 2: type compiler.warn.prob.found.req={0}\n\u9700\u8981: {2}\n\u627E\u5230: {1} + compiler.err.prob.found.req.1={0} {3}\n\u9700\u8981: {2}\n\u627E\u5230: {1} ## The following are all possible strings for the first argument ({0}) of the ## above strings. compiler.misc.incompatible.types=\u4E0D\u517C\u5BB9\u7684\u7C7B\u578B + +# 0: message segment compiler.misc.incompatible.types.1=\u4E0D\u517C\u5BB9\u7684\u7C7B\u578B; {0} + compiler.misc.inconvertible.types=\u4E0D\u53EF\u8F6C\u6362\u7684\u7C7B\u578B + compiler.misc.possible.loss.of.precision=\u53EF\u80FD\u635F\u5931\u7CBE\u5EA6 compiler.misc.unchecked.assign=\u672A\u7ECF\u68C0\u67E5\u7684\u8F6C\u6362 + # compiler.misc.storecheck=\ # assignment might cause later store checks to fail # compiler.misc.unchecked=\ @@ -627,7 +1105,9 @@ compiler.misc.unchecked.cast.to.type=\u672A\u7ECF\u68C0\u67E5\u7684\u8F6C\u6362 compiler.misc.assignment.from.super-bound=\u4ECE super-bound \u7C7B\u578B{0}\u8FDB\u884C\u5206\u914D + compiler.misc.assignment.to.extends-bound=\u5230 extends-bound \u7C7B\u578B{0}\u7684\u5206\u914D + # compiler.err.star.expected=\ # ''*'' expected # compiler.err.no.elem.type=\ @@ -637,14 +1117,22 @@ ##### +# 0: message segment or type, 1: message segment compiler.err.type.found.req=\u610F\u5916\u7684\u7C7B\u578B\n\u9700\u8981: {1}\n\u627E\u5230: {0} ## The following are all possible strings for the first argument ({0}) of the ## above string. compiler.misc.type.req.class=\u7C7B + compiler.misc.type.req.class.array=\u7C7B\u6216\u6570\u7EC4 + +compiler.misc.type.req.array.or.iterable=\u6570\u7EC4\u6216 java.lang.Iterable + compiler.misc.type.req.ref=\u5F15\u7528 + compiler.misc.type.req.exact=\u4E0D\u5E26\u9650\u5236\u8303\u56F4\u7684\u7C7B\u6216\u63A5\u53E3 + +# 0: type compiler.misc.type.parameter=\u7C7B\u578B\u53C2\u6570{0} ##### @@ -652,29 +1140,52 @@ ## The following are all possible strings for the last argument of all those ## diagnostics whose key ends in ".1" compiler.misc.undetermined.type=\u672A\u786E\u5B9A\u7684\u7C7B\u578B + compiler.misc.type.variable.has.undetermined.type=\u7C7B\u578B\u53D8\u91CF{0}\u5E26\u6709\u672A\u786E\u5B9A\u7684\u7C7B\u578B + +# 0: type, 1: list of type compiler.misc.no.unique.maximal.instance.exists=\u5BF9\u4E8E\u4E0A\u9650\u4E3A{1}\u7684\u7C7B\u578B\u53D8\u91CF{0}, \u4E0D\u5B58\u5728\u552F\u4E00\u6700\u5927\u5B9E\u4F8B + compiler.misc.no.unique.minimal.instance.exists=\u5BF9\u4E8E\u4E0B\u9650\u4E3A{1}\u7684\u7C7B\u578B\u53D8\u91CF{0}, \u4E0D\u5B58\u5728\u552F\u4E00\u6700\u5C0F\u5B9E\u4F8B + +# 0: list of type, 1: type, 2: type compiler.misc.infer.no.conforming.instance.exists=\u4E0D\u5B58\u5728\u7C7B\u578B\u53D8\u91CF{0}\u7684\u5B9E\u4F8B, \u4EE5\u4F7F{1}\u4E0E{2}\u4E00\u81F4 + +# 0: list of type, 1: type, 2: type compiler.misc.infer.no.conforming.assignment.exists=\u4E0D\u5B58\u5728\u7C7B\u578B\u53D8\u91CF{0}\u7684\u5B9E\u4F8B, \u4EE5\u4F7F\u53C2\u6570\u7C7B\u578B{1}\u4E0E\u5F62\u5F0F\u53C2\u6570\u7C7B\u578B{2}\u4E00\u81F4 + compiler.misc.infer.arg.length.mismatch=\u65E0\u6CD5\u4ECE\u53C2\u6570\u8FDB\u884C\u5B9E\u4F8B\u5316, \u56E0\u4E3A\u5B9E\u9645\u53C2\u6570\u5217\u8868\u548C\u5F62\u5F0F\u53C2\u6570\u5217\u8868\u957F\u5EA6\u4E0D\u540C + +# 0: type, 1: list of type compiler.misc.inferred.do.not.conform.to.bounds=\u63A8\u65AD\u7C7B\u578B\u4E0D\u7B26\u5408\u58F0\u660E\u7684\u8303\u56F4\n\u63A8\u65AD: {0}\n\u8303\u56F4: {1} -compiler.misc.inferred.do.not.conform.to.params=\u5B9E\u9645\u53C2\u6570\u4E0D\u7B26\u5408\u63A8\u65AD\u7684\u5F62\u5F0F\u53C2\u6570\n\u9700\u8981: {0}\n\u627E\u5230: {1} + +# 0: symbol compiler.misc.diamond={0}<> -compiler.misc.diamond.invalid.arg=\u6B64\u4E0A\u4E0B\u6587\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4E3A{1}\u63A8\u65AD\u7684\u7C7B\u578B\u53C2\u6570{0} -compiler.misc.diamond.invalid.args=\u6B64\u4E0A\u4E0B\u6587\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4E3A{1}\u63A8\u65AD\u7684\u7C7B\u578B\u53C2\u6570{0} + +# 0: type +compiler.misc.diamond.non.generic=\u65E0\u6CD5\u5C06 ''<>'' \u4E0E\u975E\u6CDB\u578B\u7C7B{0}\u4E00\u8D77\u4F7F\u7528 +compiler.misc.diamond.and.explicit.params=\u4E0D\u80FD\u5C06 ''<>'' \u4E0E\u6784\u9020\u5668\u7684\u663E\u5F0F\u7C7B\u578B\u53C2\u6570\u4E00\u8D77\u4F7F\u7528 + +# 0: type, 1: list of type compiler.misc.explicit.param.do.not.conform.to.bounds=\u663E\u5F0F\u7C7B\u578B\u53C2\u6570{0}\u4E0D\u7B26\u5408\u58F0\u660E\u7684\u8303\u56F4{1} compiler.misc.arg.length.mismatch=\u5B9E\u9645\u53C2\u6570\u5217\u8868\u548C\u5F62\u5F0F\u53C2\u6570\u5217\u8868\u957F\u5EA6\u4E0D\u540C + +# 0: type, 1: type compiler.misc.no.conforming.assignment.exists=\u65E0\u6CD5\u901A\u8FC7\u65B9\u6CD5\u8C03\u7528\u8F6C\u6362\u5C06\u5B9E\u9645\u53C2\u6570{0}\u8F6C\u6362\u4E3A{1} + +# 0: type, 1: type compiler.misc.varargs.argument.mismatch=\u53C2\u6570\u7C7B\u578B{0}\u4E0D\u7B26\u5408 vararg \u5143\u7D20\u7C7B\u578B{1} + ##### ## The first argument ({0}) is a "kindname". +# 0: symbol kind, 1: symbol, 2: symbol compiler.err.abstract.cant.be.accessed.directly=\u65E0\u6CD5\u76F4\u63A5\u8BBF\u95EE{2}\u4E2D\u7684\u62BD\u8C61{0} {1} ## The first argument ({0}) is a "kindname". +# 0: symbol kind, 1: symbol compiler.err.non-static.cant.be.ref=\u65E0\u6CD5\u4ECE\u9759\u6001\u4E0A\u4E0B\u6587\u4E2D\u5F15\u7528\u975E\u9759\u6001 {0} {1} ## Both arguments ({0}, {1}) are "kindname"s. {0} is a comma-separated list @@ -685,20 +1196,36 @@ ## The second argument {1} is the non-resolved symbol ## The third argument {2} is a list of type parameters (non-empty if {1} is a method) ## The fourth argument {3} is a list of argument types (non-empty if {1} is a method) +# 0: symbol kind, 1: name, 2: unused, 3: unused compiler.err.cant.resolve=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} {1} +# 0: symbol kind, 1: name, 2: unused, 3: list of type compiler.err.cant.resolve.args=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} {1}({3}) +# 0: symbol kind, 1: name, 2: list of type, 3: list of type compiler.err.cant.resolve.args.params=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} <{2}>{1}({3}) ## arguments from {0} to {3} have the same meaning as above -## The fifth argument {4} is the location "kindname" (e.g. 'constructor', 'field', etc.) -## The sixth argument {5} is the location type -compiler.err.cant.resolve.location=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} {1}\n\u4F4D\u7F6E: {4} {5} +## The fifth argument {4} is a location subdiagnostic (see below) +# 0: symbol kind, 1: name, 2: unused, 3: unused, 4: message segment +compiler.err.cant.resolve.location=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} {1}\n\u4F4D\u7F6E: {4} + +# 0: symbol kind, 1: name, 2: unused, 3: list of type, 4: message segment +compiler.err.cant.resolve.location.args=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} {1}({3})\n\u4F4D\u7F6E: {4} + +# 0: symbol kind, 1: name, 2: list of type, 3: list, 4: message segment +compiler.err.cant.resolve.location.args.params=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} <{2}>{1}({3})\n\u4F4D\u7F6E: {4} -compiler.err.cant.resolve.location.args=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} {1}({3})\n\u4F4D\u7F6E: {4} {5} +##a location subdiagnostic is composed as follows: +## The first argument {0} is the location "kindname" (e.g. 'constructor', 'field', etc.) +## The second argument {1} is the location name +## The third argument {2} is the location type (only when {1} is a variable name) -compiler.err.cant.resolve.location.args.params=\u627E\u4E0D\u5230\u7B26\u53F7\n\u7B26\u53F7: {0} <{2}>{1}({3})\n\u4F4D\u7F6E: {4} {5} +# 0: symbol kind, 1: symbol, 2: unused +compiler.misc.location={0} {1} + +# 0: symbol kind, 1: symbol, 2: type +compiler.misc.location.1=\u7C7B\u578B\u4E3A{2}\u7684{0} {1} ## The following are all possible string for "kindname". ## They should be called whatever the JLS calls them after it been translated @@ -706,60 +1233,103 @@ # compiler.misc.kindname.constructor=\ # static member compiler.misc.kindname.annotation=@interface + compiler.misc.kindname.constructor=\u6784\u9020\u5668 + compiler.misc.kindname.enum=\u679A\u4E3E + compiler.misc.kindname.interface=\u63A5\u53E3 + compiler.misc.kindname.static=\u9759\u6001 + compiler.misc.kindname.type.variable=\u7C7B\u578B\u53D8\u91CF + compiler.misc.kindname.type.variable.bound=\u7C7B\u578B\u53D8\u91CF\u7684\u9650\u5236\u8303\u56F4 + compiler.misc.kindname.variable=\u53D8\u91CF + compiler.misc.kindname.value=\u503C + compiler.misc.kindname.method=\u65B9\u6CD5 + compiler.misc.kindname.class=\u7C7B + compiler.misc.kindname.package=\u7A0B\u5E8F\u5305 + ##### compiler.misc.no.args=\u6CA1\u6709\u53C2\u6570 +# 0: message segment compiler.err.override.static={0}\n\u8986\u76D6\u7684\u65B9\u6CD5\u4E3A static + +# 0: message segment, 1: set of modifier compiler.err.override.meth={0}\n\u88AB\u8986\u76D6\u7684\u65B9\u6CD5\u4E3A{1} +# 0: message segment, 1: type compiler.err.override.meth.doesnt.throw={0}\n\u88AB\u8986\u76D6\u7684\u65B9\u6CD5\u672A\u629B\u51FA{1} # In the following string {1} is a space separated list of Java Keywords, as # they would have been declared in the source code +# 0: message segment, 1: set of modifier compiler.err.override.weaker.access={0}\n\u6B63\u5728\u5C1D\u8BD5\u5206\u914D\u66F4\u4F4E\u7684\u8BBF\u95EE\u6743\u9650; \u4EE5\u524D\u4E3A{1} +# 0: message segment, 1: type, 2: type compiler.err.override.incompatible.ret={0}\n\u8FD4\u56DE\u7C7B\u578B{1}\u4E0E{2}\u4E0D\u517C\u5BB9 +# 0: message segment, 1: type, 2: type compiler.warn.override.unchecked.ret={0}\n\u8FD4\u56DE\u7C7B\u578B\u9700\u8981\u4ECE{1}\u5230{2}\u7684\u672A\u7ECF\u68C0\u67E5\u7684\u8F6C\u6362 +# 0: message segment, 1: type compiler.warn.override.unchecked.thrown={0}\n\u88AB\u8986\u76D6\u7684\u65B9\u6CD5\u672A\u629B\u51FA{1} ## The following are all possible strings for the first argument ({0}) of the ## above strings. +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.cant.override={1}\u4E2D\u7684{0}\u65E0\u6CD5\u8986\u76D6{3}\u4E2D\u7684{2} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.cant.implement={1}\u4E2D\u7684{0}\u65E0\u6CD5\u5B9E\u73B0{3}\u4E2D\u7684{2} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.clashes.with={1}\u4E2D\u7684{0}\u4E0E{3}\u4E2D\u7684{2}\u51B2\u7A81 + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.unchecked.override={1}\u4E2D\u7684{0}\u8986\u76D6\u4E86{3}\u4E2D\u7684{2} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.unchecked.implement={1}\u4E2D\u7684{0}\u5B9E\u73B0\u4E86{3}\u4E2D\u7684{2} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.unchecked.clash.with={1}\u4E2D\u7684{0}\u8986\u76D6\u4E86{3}\u4E2D\u7684{2} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.varargs.override={1}\u4E2D\u7684{0}\u8986\u76D6\u4E86{3}\u4E2D\u7684{2} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.varargs.implement={1}\u4E2D\u7684{0}\u5B9E\u73B0\u4E86{3}\u4E2D\u7684{2} + +# 0: symbol, 1: symbol, 2: symbol, 3: symbol compiler.misc.varargs.clash.with={1}\u4E2D\u7684{0}\u8986\u76D6\u4E86{3}\u4E2D\u7684{2} -compiler.misc.non.denotable.type=\u6B64\u5904\u4E0D\u5141\u8BB8\u4F7F\u7528\u4E0D\u53EF\u6307\u793A\u7684\u7C7B\u578B{0} +compiler.misc.diamond.and.anon.class=\u65E0\u6CD5\u5C06 ''<>'' \u4E0E\u533F\u540D\u5185\u90E8\u7C7B\u4E00\u8D77\u4F7F\u7528 + +# 0: symbol kind, 1: symbol, 2: symbol, 3: message segment compiler.misc.inapplicable.method={0} {1}.{2}\u4E0D\u9002\u7528\n({3}) ######################################## # Diagnostics for language feature changes ######################################## +# 0: string compiler.err.unsupported.fp.lit=-source {0} \u4E2D\u4E0D\u652F\u6301\u5341\u516D\u8FDB\u5236\u6D6E\u70B9\u6587\u5B57\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u5341\u516D\u8FDB\u5236\u6D6E\u70B9\u6587\u5B57) +# 0: string compiler.err.unsupported.binary.lit=-source {0} \u4E2D\u4E0D\u652F\u6301\u4E8C\u8FDB\u5236\u6587\u5B57\n(\u8BF7\u4F7F\u7528 -source 7 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u4E8C\u8FDB\u5236\u6587\u5B57) +# 0: string compiler.err.unsupported.underscore.lit=-source {0} \u4E2D\u4E0D\u652F\u6301\u6587\u5B57\u4E2D\u5B58\u5728\u4E0B\u5212\u7EBF\n(\u8BF7\u4F7F\u7528 -source 7 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u5141\u8BB8\u6587\u5B57\u4E2D\u5B58\u5728\u4E0B\u5212\u7EBF) +# 0: string compiler.err.try.with.resources.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 try-with-resources\n(\u8BF7\u4F7F\u7528 -source 7 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528 try-with-resources) compiler.warn.enum.as.identifier=\u4ECE\u53D1\u884C\u7248 5 \u5F00\u59CB, ''enum'' \u4E3A\u5173\u952E\u5B57, \u800C\u4E0D\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u5C06 ''enum'' \u7528\u4F5C\u5173\u952E\u5B57) @@ -770,26 +1340,35 @@ compiler.err.assert.as.identifier=\u4ECE\u53D1\u884C\u7248 1.4 \u5F00\u59CB, ''assert'' \u662F\u4E00\u4E2A\u5173\u952E\u5B57, \u4F46\u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u8BF7\u4F7F\u7528 -source 1.3 \u6216\u66F4\u4F4E\u7248\u672C\u4EE5\u5C06 ''assert'' \u7528\u4F5C\u6807\u8BC6\u7B26) +# 0: string compiler.err.generics.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u6CDB\u578B\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u6CDB\u578B) +# 0: string compiler.err.varargs.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 variable-arity \u65B9\u6CD5\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528 variable-arity \u65B9\u6CD5) +# 0: string compiler.err.annotations.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u6CE8\u91CA\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u6CE8\u91CA) #308 compiler.err.type.annotations.not.supported.in.source=\ #308 type annotations are not supported in -source {0}\n\ #308 (use -source 7 or higher to enable type annotations) +# 0: string compiler.err.foreach.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 for-each \u5FAA\u73AF\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528 for-each \u5FAA\u73AF) +# 0: string compiler.err.static.import.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u9759\u6001\u5BFC\u5165\u58F0\u660E\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u9759\u6001\u5BFC\u5165\u58F0\u660E) +# 0: string compiler.err.enums.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301\u679A\u4E3E\n(\u8BF7\u4F7F\u7528 -source 5 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528\u679A\u4E3E) +# 0: string compiler.err.diamond.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 diamond \u8FD0\u7B97\u7B26\n(\u8BF7\u4F7F\u7528 -source 7 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528 diamond \u8FD0\u7B97\u7B26) +# 0: string compiler.err.multicatch.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 multi-catch \u8BED\u53E5\n(\u8BF7\u4F7F\u7528 -source 7 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u542F\u7528 multi-catch \u8BED\u53E5) +# 0: string compiler.err.string.switch.not.supported.in.source=-source {0} \u4E2D\u4E0D\u652F\u6301 switch \u4E2D\u5B58\u5728\u5B57\u7B26\u4E32\n(\u8BF7\u4F7F\u7528 -source 7 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u5141\u8BB8 switch \u4E2D\u5B58\u5728\u5B57\u7B26\u4E32) ######################################## @@ -800,24 +1379,30 @@ compiler.misc.type.null=<\u7A7A\u503C> # X#n (where n is an int id) is disambiguated tvar name +# 0: name, 1: number compiler.misc.type.var={0}#{1} # CAP#n (where n is an int id) is an abbreviation for 'captured type' +# 0: number compiler.misc.captured.type=CAP#{0} # <INT#n> (where n is an int id) is an abbreviation for 'intersection type' +# 0: number compiler.misc.intersection.type=INT#{0} # where clause for captured type: contains upper ('extends {1}') and lower # ('super {2}') bound along with the wildcard that generated this captured type ({3}) +# 0: type, 1: type, 2: type, 3: type compiler.misc.where.captured={0}\u4ECE{3}\u7684\u6355\u83B7\u6269\u5C55{1} \u8D85 {2} # compact where clause for captured type: contains upper ('extends {1}') along # with the wildcard that generated this captured type ({3}) +# 0: type, 1: type, 2: unused, 3: type compiler.misc.where.captured.1={0}\u4ECE{3}\u7684\u6355\u83B7\u6269\u5C55{1} # where clause for type variable: contains upper bound(s) ('extends {1}') along with # the kindname ({2}) and location ({3}) in which the typevar has been declared +# 0: type, 1: list of type, 2: symbol kind, 3: symbol compiler.misc.where.typevar={0}\u6269\u5C55\u5DF2\u5728{2} {3}\u4E2D\u58F0\u660E\u7684{1} # compact where clause for type variable: contains the kindname ({2}) and location ({3}) @@ -826,14 +1411,24 @@ # where clause for type variable: contains all the upper bound(s) ('extends {1}') # of this intersection type +# 0: type, 1: list of type compiler.misc.where.intersection={0}\u6269\u5C55{1} ### Where clause headers ### compiler.misc.where.description.captured=\u5176\u4E2D, {0}\u662F\u65B0\u7C7B\u578B\u53D8\u91CF: + +# 0: set of type compiler.misc.where.description.typevar=\u5176\u4E2D, {0}\u662F\u7C7B\u578B\u53D8\u91CF: + +# 0: set of type compiler.misc.where.description.intersection=\u5176\u4E2D, {0}\u662F\u4EA4\u53C9\u7C7B\u578B: + +# 0: set of type compiler.misc.where.description.captured.1=\u5176\u4E2D, {0}\u662F\u65B0\u7C7B\u578B\u53D8\u91CF: + +# 0: set of type compiler.misc.where.description.typevar.1=\u5176\u4E2D, {0}\u662F\u7C7B\u578B\u53D8\u91CF: + compiler.misc.where.description.intersection.1=\u5176\u4E2D, {0}\u662F\u4EA4\u53C9\u7C7B\u578B:
--- a/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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 @@ -87,6 +87,7 @@ javac.opt.printRounds=\u6CE8\u91C8\u51E6\u7406\u306E\u5F80\u5FA9\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u5370\u5237\u3059\u308B javac.opt.printProcessorInfo=\u30D7\u30ED\u30BB\u30C3\u30B5\u304C\u51E6\u7406\u3092\u4F9D\u983C\u3055\u308C\u308B\u6CE8\u91C8\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u5370\u5237\u3059\u308B javac.opt.prefer=\u6697\u9ED9\u7684\u306B\u30B3\u30F3\u30D1\u30A4\u30EB\u3055\u308C\u308B\u30AF\u30E9\u30B9\u306B\u3064\u3044\u3066\u3001\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3068\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u4E21\u65B9\u304C\u898B\u3064\u304B\u3063\u305F\u969B\u3069\u3061\u3089\u3092\u8AAD\u307F\u8FBC\u3080\u304B\u6307\u5B9A\u3059\u308B +javac.opt.AT=\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u306E\u8AAD\u53D6\u308A\u30AA\u30D7\u30B7\u30E7\u30F3\u304A\u3088\u3073\u30D5\u30A1\u30A4\u30EB\u540D ## errors @@ -96,6 +97,7 @@ javac.err.invalid.flag={0}\u306F\u7121\u52B9\u306A\u30D5\u30E9\u30B0\u3067\u3059 javac.err.invalid.target={0}\u306F\u7121\u52B9\u306A\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30EA\u30EA\u30FC\u30B9\u3067\u3059 javac.err.no.source.files=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093 +javac.err.no.source.files.classes=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9\u540D\u304C\u3042\u308A\u307E\u305B\u3093 javac.err.req.arg={0}\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059 javac.err.invalid.source={0}\u306F\u7121\u52B9\u306A\u30BD\u30FC\u30B9\u30FB\u30EA\u30EA\u30FC\u30B9\u3067\u3059 javac.err.error.writing.file={0}\u306E\u66F8\u8FBC\u307F\u30A8\u30E9\u30FC\u3067\u3059\u3002{1}
--- a/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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 @@ -87,6 +87,7 @@ javac.opt.printRounds=\u8F93\u51FA\u6709\u5173\u6CE8\u91CA\u5904\u7406\u5FAA\u73AF\u7684\u4FE1\u606F javac.opt.printProcessorInfo=\u8F93\u51FA\u6709\u5173\u8BF7\u6C42\u5904\u7406\u7A0B\u5E8F\u5904\u7406\u54EA\u4E9B\u6CE8\u91CA\u7684\u4FE1\u606F javac.opt.prefer=\u6307\u5B9A\u8BFB\u53D6\u6587\u4EF6, \u5F53\u540C\u65F6\u627E\u5230\u9690\u5F0F\u7F16\u8BD1\u7C7B\u7684\u6E90\u6587\u4EF6\u548C\u7C7B\u6587\u4EF6\u65F6 +javac.opt.AT=\u4ECE\u6587\u4EF6\u8BFB\u53D6\u9009\u9879\u548C\u6587\u4EF6\u540D ## errors @@ -96,6 +97,7 @@ javac.err.invalid.flag=\u65E0\u6548\u7684\u6807\u8BB0: {0} javac.err.invalid.target=\u65E0\u6548\u7684\u76EE\u6807\u53D1\u884C\u7248: {0} javac.err.no.source.files=\u65E0\u6E90\u6587\u4EF6 +javac.err.no.source.files.classes=\u65E0\u6E90\u6587\u4EF6\u6216\u7C7B\u540D javac.err.req.arg={0}\u9700\u8981\u53C2\u6570 javac.err.invalid.source=\u65E0\u6548\u7684\u6E90\u53D1\u884C\u7248: {0} javac.err.error.writing.file=\u5199\u5165{0}\u65F6\u51FA\u9519; {1}
--- a/src/share/classes/com/sun/tools/javac/resources/legacy.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/resources/legacy.properties Thu Jun 02 19:00:16 2011 +0100 @@ -266,6 +266,8 @@ com.sun.swing.internal.plaf.basic.resources = tiger legacy com.sun.swing.internal.plaf.metal.resources = tiger legacy com.sun.swing.internal.plaf.synth.resources = tiger legacy +com.sun.tracing = tiger legacy +com.sun.tracing.dtrace = tiger legacy java.applet = tiger legacy java.awt = tiger legacy java.awt.color = tiger legacy
--- a/src/share/classes/com/sun/tools/javac/tree/JCTree.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/tree/JCTree.java Thu Jun 02 19:00:16 2011 +0100 @@ -236,13 +236,13 @@ */ public static final int TYPEAPPLY = TYPEARRAY + 1; - /** Disjunction types, of type TypeDisjunction + /** Union types, of type TypeUnion */ - public static final int TYPEDISJUNCTION = TYPEAPPLY + 1; + public static final int TYPEUNION = TYPEAPPLY + 1; /** Formal type parameters, of type TypeParameter. */ - public static final int TYPEPARAMETER = TYPEDISJUNCTION + 1; + public static final int TYPEPARAMETER = TYPEUNION + 1; /** Type argument. */ @@ -1881,30 +1881,30 @@ } /** - * A disjunction type, T1 | T2 | ... Tn (used in multicatch statements) + * A union type, T1 | T2 | ... Tn (used in multicatch statements) */ - public static class JCTypeDisjunction extends JCExpression implements DisjunctiveTypeTree { + public static class JCTypeUnion extends JCExpression implements UnionTypeTree { public List<JCExpression> alternatives; - protected JCTypeDisjunction(List<JCExpression> components) { + protected JCTypeUnion(List<JCExpression> components) { this.alternatives = components; } @Override - public void accept(Visitor v) { v.visitTypeDisjunction(this); } + public void accept(Visitor v) { v.visitTypeUnion(this); } - public Kind getKind() { return Kind.DISJUNCTIVE_TYPE; } + public Kind getKind() { return Kind.UNION_TYPE; } public List<JCExpression> getTypeAlternatives() { return alternatives; } @Override public <R,D> R accept(TreeVisitor<R,D> v, D d) { - return v.visitDisjunctiveType(this, d); + return v.visitUnionType(this, d); } @Override public int getTag() { - return TYPEDISJUNCTION; + return TYPEUNION; } } @@ -2227,7 +2227,7 @@ public void visitTypeIdent(JCPrimitiveTypeTree that) { visitTree(that); } public void visitTypeArray(JCArrayTypeTree that) { visitTree(that); } public void visitTypeApply(JCTypeApply that) { visitTree(that); } - public void visitTypeDisjunction(JCTypeDisjunction that) { visitTree(that); } + public void visitTypeUnion(JCTypeUnion that) { visitTree(that); } public void visitTypeParameter(JCTypeParameter that) { visitTree(that); } public void visitWildcard(JCWildcard that) { visitTree(that); } public void visitTypeBoundKind(TypeBoundKind that) { visitTree(that); }
--- a/src/share/classes/com/sun/tools/javac/tree/Pretty.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/tree/Pretty.java Thu Jun 02 19:00:16 2011 +0100 @@ -1169,7 +1169,7 @@ } } - public void visitTypeDisjunction(JCTypeDisjunction tree) { + public void visitTypeUnion(JCTypeUnion tree) { try { printExprs(tree.alternatives, " | "); } catch (IOException e) {
--- a/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java Thu Jun 02 19:00:16 2011 +0100 @@ -338,10 +338,10 @@ return M.at(t.pos).TypeApply(clazz, arguments); } - public JCTree visitDisjunctiveType(DisjunctiveTypeTree node, P p) { - JCTypeDisjunction t = (JCTypeDisjunction) node; + public JCTree visitUnionType(UnionTypeTree node, P p) { + JCTypeUnion t = (JCTypeUnion) node; List<JCExpression> components = copy(t.alternatives, p); - return M.at(t.pos).TypeDisjunction(components); + return M.at(t.pos).TypeUnion(components); } public JCTree visitArrayType(ArrayTypeTree node, P p) {
--- a/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Thu Jun 02 19:00:16 2011 +0100 @@ -119,7 +119,7 @@ } public static boolean isMultiCatch(JCCatch catchClause) { - return catchClause.param.vartype.getTag() == JCTree.TYPEDISJUNCTION; + return catchClause.param.vartype.getTag() == JCTree.TYPEUNION; } /** Is statement an initializer for a synthetic field?
--- a/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java Thu Jun 02 19:00:16 2011 +0100 @@ -435,8 +435,8 @@ return tree; } - public JCTypeDisjunction TypeDisjunction(List<JCExpression> components) { - JCTypeDisjunction tree = new JCTypeDisjunction(components); + public JCTypeUnion TypeUnion(List<JCExpression> components) { + JCTypeUnion tree = new JCTypeUnion(components); tree.pos = pos; return tree; }
--- a/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java Thu Jun 02 19:00:16 2011 +0100 @@ -272,7 +272,7 @@ scan(tree.arguments); } - public void visitTypeDisjunction(JCTypeDisjunction tree) { + public void visitTypeUnion(JCTypeUnion tree) { scan(tree.alternatives); }
--- a/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java Thu Jun 02 19:00:16 2011 +0100 @@ -363,7 +363,7 @@ result = tree; } - public void visitTypeDisjunction(JCTypeDisjunction tree) { + public void visitTypeUnion(JCTypeUnion tree) { tree.alternatives = translate(tree.alternatives); result = tree; }
--- a/src/share/classes/com/sun/tools/javac/util/JavacMessages.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/util/JavacMessages.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -44,7 +44,7 @@ */ public class JavacMessages implements Messages { /** The context key for the JavacMessages object. */ - protected static final Context.Key<JavacMessages> messagesKey = + public static final Context.Key<JavacMessages> messagesKey = new Context.Key<JavacMessages>(); /** Get the JavacMessages instance for this context. */ @@ -77,7 +77,7 @@ /** Creates a JavacMessages object. */ public JavacMessages(Context context) { - this(defaultBundleName); + this(defaultBundleName, context.get(Locale.class)); context.put(messagesKey, this); } @@ -85,10 +85,17 @@ * @param bundleName the name to identify the resource buundle of localized messages. */ public JavacMessages(String bundleName) throws MissingResourceException { + this(bundleName, null); + } + + /** Creates a JavacMessages object. + * @param bundleName the name to identify the resource buundle of localized messages. + */ + public JavacMessages(String bundleName, Locale locale) throws MissingResourceException { bundleNames = List.nil(); bundleCache = new HashMap<Locale, SoftReference<List<ResourceBundle>>>(); add(bundleName); - setCurrentLocale(Locale.getDefault()); + setCurrentLocale(locale); } public JavacMessages() throws MissingResourceException {
--- a/src/share/classes/com/sun/tools/javac/util/Log.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/util/Log.java Thu Jun 02 19:00:16 2011 +0100 @@ -425,13 +425,8 @@ */ protected void writeDiagnostic(JCDiagnostic diag) { if (diagListener != null) { - try { - diagListener.report(diag); - return; - } - catch (Throwable t) { - throw new ClientCodeException(t); - } + diagListener.report(diag); + return; } PrintWriter writer = getWriterForDiagnosticType(diag.getType());
--- a/src/share/classes/com/sun/tools/javac/util/Names.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/util/Names.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2011, 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 @@ -73,7 +73,6 @@ public final Name java_io_Serializable; public final Name serialVersionUID; public final Name java_lang_Enum; - public final Name transient_java_dyn_MethodHandle; // transient - 292 public final Name java_lang_invoke_MethodHandle; public final Name package_info; public final Name ConstantValue; @@ -184,7 +183,6 @@ java_lang_Cloneable = fromString("java.lang.Cloneable"); java_io_Serializable = fromString("java.io.Serializable"); java_lang_Enum = fromString("java.lang.Enum"); - transient_java_dyn_MethodHandle = fromString("java.dyn.MethodHandle"); //transient - 292 java_lang_invoke_MethodHandle = fromString("java.lang.invoke.MethodHandle"); package_info = fromString("package-info"); serialVersionUID = fromString("serialVersionUID");
--- a/src/share/classes/com/sun/tools/javac/util/Options.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javac/util/Options.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, 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
--- a/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2011, 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 @@ -75,7 +75,7 @@ tag.End_delimiter_missing_for_possible_SeeTag=\u30B3\u30E1\u30F3\u30C8\u6587\u5B57\u5217"{0}"\u3067\u3001\u6709\u52B9\u306Asee\u30BF\u30B0\u306B\u7D42\u7AEF\u30C7\u30EA\u30DF\u30BF}\u304C\u3042\u308A\u307E\u305B\u3093 tag.Improper_Use_Of_Link_Tag=\u30A4\u30F3\u30E9\u30A4\u30F3\u30FB\u30BF\u30B0"{0}"\u306B\u7D42\u4E86\u6587\u5B57''}''\u304C\u3042\u308A\u307E\u305B\u3093 javadoc.File_Read_Error=\u30D5\u30A1\u30A4\u30EB{0}\u306E\u8AAD\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F -javadoc.Body_missing_from_html_file=HTML\u30D5\u30A1\u30A4\u30EB\u306Bbody\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093 +javadoc.Body_missing_from_html_file=HTML\u306Bbody\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093 javadoc.End_body_missing_from_html_file=HTML\u30D5\u30A1\u30A4\u30EB\u306Bbody\u306E\u9589\u3058\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093 javadoc.Multiple_package_comments=\u30D1\u30C3\u30B1\u30FC\u30B8"{0}"\u306B\u8907\u6570\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30B3\u30E1\u30F3\u30C8\u306E\u30BD\u30FC\u30B9\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F javadoc.class_not_found=\u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
--- a/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2011, 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 @@ -43,7 +43,7 @@ main.no_source_files_for_package=\u6CA1\u6709\u7A0B\u5E8F\u5305{0}\u7684\u6E90\u6587\u4EF6 main.fatal.error=\u81F4\u547D\u9519\u8BEF main.fatal.exception=\u81F4\u547D\u5F02\u5E38\u9519\u8BEF -main.out.of.memory=java.lang.OutOfMemoryError: \u8BF7\u589E\u5927\u5185\u5B58\u3002\n\u4F8B\u5982, \u5BF9\u4E8E JDK \u7ECF\u5178\u6216\u70ED\u70B9 VM, \u8BF7\u589E\u5927\u9009\u9879 -J-Xmx,\n\u4F8B\u5982 -J-Xmx32m\u3002 +main.out.of.memory=java.lang.OutOfMemoryError: \u8BF7\u589E\u5927\u5185\u5B58\u3002\n\u4F8B\u5982, \u5BF9\u4E8E JDK \u7ECF\u5178\u6216 HotSpot VM, \u8BF7\u589E\u5927\u9009\u9879 -J-Xmx,\n\u4F8B\u5982 -J-Xmx32m\u3002 main.done_in=[\u5728 {0} \u6BEB\u79D2\u5185\u5B8C\u6210] main.doclet_method_must_be_static=\u5728 doclet \u7C7B{0}\u4E2D, \u65B9\u6CD5{1}\u5FC5\u987B\u4E3A\u9759\u6001\u3002 main.must_return_int=\u5728 doclet \u7C7B{0}\u4E2D, \u65B9\u6CD5{1}\u5FC5\u987B\u8FD4\u56DE\u6574\u578B\u503C\u3002 @@ -75,7 +75,7 @@ tag.End_delimiter_missing_for_possible_SeeTag=\u6CE8\u91CA\u5B57\u7B26\u4E32\u4E2D\u53EF\u80FD\u51FA\u73B0\u7684 See \u6807\u8BB0\u7F3A\u5C11\u7ED3\u675F\u5206\u9694\u7B26 }: "{0}" tag.Improper_Use_Of_Link_Tag=\u5185\u5D4C\u6807\u8BB0\u7F3A\u5C11\u7ED3\u675F ''}'' \u5B57\u7B26: "{0}" javadoc.File_Read_Error=\u8BFB\u53D6\u6587\u4EF6{0}\u65F6\u51FA\u9519 -javadoc.Body_missing_from_html_file=HTML \u4E2D\u7F3A\u5C11\u4E3B\u4F53\u6807\u8BB0 +javadoc.Body_missing_from_html_file=HTML \u6587\u4EF6\u4E2D\u7F3A\u5C11\u4E3B\u4F53\u6807\u8BB0 javadoc.End_body_missing_from_html_file=HTML \u6587\u4EF6\u4E2D\u7F3A\u5C11\u4E3B\u4F53\u7ED3\u675F\u6807\u8BB0 javadoc.Multiple_package_comments=\u627E\u5230\u7A0B\u5E8F\u5305 "{0}" \u7684\u591A\u4E2A\u7A0B\u5E8F\u5305\u6CE8\u91CA\u6E90 javadoc.class_not_found=\u627E\u4E0D\u5230\u7C7B{0}\u3002
--- a/src/share/classes/com/sun/tools/javah/resources/l10n_ja.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javah/resources/l10n_ja.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2011, 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
--- a/src/share/classes/com/sun/tools/javah/resources/l10n_zh_CN.properties Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javah/resources/l10n_zh_CN.properties Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2011, 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
--- a/src/share/classes/com/sun/tools/javap/ClassWriter.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/com/sun/tools/javap/ClassWriter.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011, 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 @@ -48,6 +48,13 @@ import com.sun.tools.classfile.Signature_attribute; import com.sun.tools.classfile.SourceFile_attribute; import com.sun.tools.classfile.Type; +import com.sun.tools.classfile.Type.ArrayType; +import com.sun.tools.classfile.Type.ClassSigType; +import com.sun.tools.classfile.Type.ClassType; +import com.sun.tools.classfile.Type.MethodType; +import com.sun.tools.classfile.Type.SimpleType; +import com.sun.tools.classfile.Type.TypeParamType; +import com.sun.tools.classfile.Type.WildcardType; import static com.sun.tools.classfile.AccessFlags.*; @@ -166,8 +173,10 @@ // use info from class file header if (classFile.isClass() && classFile.super_class != 0 ) { String sn = getJavaSuperclassName(cf); - print(" extends "); - print(sn); + if (!sn.equals("java.lang.Object")) { + print(" extends "); + print(sn); + } } for (int i = 0; i < classFile.interfaces.length; i++) { print(i == 0 ? (classFile.isClass() ? " implements " : " extends ") : ","); @@ -176,13 +185,14 @@ } else { try { Type t = sigAttr.getParsedSignature().getType(constant_pool); + JavaTypePrinter p = new JavaTypePrinter(classFile.isInterface()); // The signature parser cannot disambiguate between a // FieldType and a ClassSignatureType that only contains a superclass type. - if (t instanceof Type.ClassSigType) - print(getJavaName(t.toString())); - else { + if (t instanceof Type.ClassSigType) { + print(p.print(t)); + } else if (options.verbose || !t.isObject()) { print(" extends "); - print(getJavaName(t.toString())); + print(p.print(t)); } } catch (ConstantPoolException e) { print(report(e)); @@ -210,6 +220,124 @@ indent(-1); println("}"); } + // where + class JavaTypePrinter implements Type.Visitor<StringBuilder,StringBuilder> { + boolean isInterface; + + JavaTypePrinter(boolean isInterface) { + this.isInterface = isInterface; + } + + String print(Type t) { + return t.accept(this, new StringBuilder()).toString(); + } + + public StringBuilder visitSimpleType(SimpleType type, StringBuilder sb) { + sb.append(getJavaName(type.name)); + return sb; + } + + public StringBuilder visitArrayType(ArrayType type, StringBuilder sb) { + append(sb, type.elemType); + sb.append("[]"); + return sb; + } + + public StringBuilder visitMethodType(MethodType type, StringBuilder sb) { + appendIfNotEmpty(sb, "<", type.typeParamTypes, "> "); + append(sb, type.returnType); + append(sb, " (", type.paramTypes, ")"); + appendIfNotEmpty(sb, " throws ", type.throwsTypes, ""); + return sb; + } + + public StringBuilder visitClassSigType(ClassSigType type, StringBuilder sb) { + appendIfNotEmpty(sb, "<", type.typeParamTypes, ">"); + if (isInterface) { + appendIfNotEmpty(sb, " extends ", type.superinterfaceTypes, ""); + } else { + if (type.superclassType != null + && (options.verbose || !type.superclassType.isObject())) { + sb.append(" extends "); + append(sb, type.superclassType); + } + appendIfNotEmpty(sb, " implements ", type.superinterfaceTypes, ""); + } + return sb; + } + + public StringBuilder visitClassType(ClassType type, StringBuilder sb) { + if (type.outerType != null) { + append(sb, type.outerType); + sb.append("."); + } + sb.append(getJavaName(type.name)); + appendIfNotEmpty(sb, "<", type.typeArgs, ">"); + return sb; + } + + public StringBuilder visitTypeParamType(TypeParamType type, StringBuilder sb) { + sb.append(type.name); + String sep = " extends "; + if (type.classBound != null + && (options.verbose || !type.classBound.isObject())) { + sb.append(sep); + append(sb, type.classBound); + sep = " & "; + } + if (type.interfaceBounds != null) { + for (Type bound: type.interfaceBounds) { + sb.append(sep); + append(sb, bound); + sep = " & "; + } + } + return sb; + } + + public StringBuilder visitWildcardType(WildcardType type, StringBuilder sb) { + switch (type.kind) { + case UNBOUNDED: + sb.append("?"); + break; + case EXTENDS: + sb.append("? extends "); + append(sb, type.boundType); + break; + case SUPER: + sb.append("? super "); + append(sb, type.boundType); + break; + default: + throw new AssertionError(); + } + return sb; + } + + private void append(StringBuilder sb, Type t) { + t.accept(this, sb); + } + + private void append(StringBuilder sb, String prefix, List<? extends Type> list, String suffix) { + sb.append(prefix); + String sep = ""; + for (Type t: list) { + sb.append(sep); + append(sb, t); + sep = ", "; + } + sb.append(suffix); + } + + private void appendIfNotEmpty(StringBuilder sb, String prefix, List<? extends Type> list, String suffix) { + if (!isEmpty(list)) + append(sb, prefix, list, suffix); + } + + private boolean isEmpty(List<? extends Type> list) { + return (list == null || list.isEmpty()); + } + } protected void writeFields() { for (Field f: classFile.fields) { @@ -298,7 +426,7 @@ try { methodType = (Type.MethodType) methodSig.getType(constant_pool); methodExceptions = methodType.throwsTypes; - if (methodExceptions != null && methodExceptions.size() == 0) + if (methodExceptions != null && methodExceptions.isEmpty()) methodExceptions = null; } catch (ConstantPoolException e) { // report error?
--- a/src/share/classes/javax/annotation/processing/Processor.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/annotation/processing/Processor.java Thu Jun 02 19:00:16 2011 +0100 @@ -225,12 +225,13 @@ * </dl> * </blockquote> * - * where <i>TypeName</i> is as defined in the <i>Java Language Specification</i>. + * where <i>TypeName</i> is as defined in + * <cite>The Java™ Language Specification</cite>. * * @return the names of the annotation types supported by this processor * @see javax.annotation.processing.SupportedAnnotationTypes - * @jls3 3.8 Identifiers - * @jls3 6.5.5 Meaning of Type Names + * @jls 3.8 Identifiers + * @jls 6.5.5 Meaning of Type Names */ Set<String> getSupportedAnnotationTypes();
--- a/src/share/classes/javax/lang/model/SourceVersion.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/SourceVersion.java Thu Jun 02 19:00:16 2011 +0100 @@ -32,10 +32,9 @@ /** * Source versions of the Java™ programming language. * - * See <a - * href="http://java.sun.com/docs/books/jls/">http://java.sun.com/docs/books/jls/</a> - * for information on editions of <i>The Java™ Language - * Specification</i>, including updates and clarifications. + * See the appropriate edition of + * <cite>The Java™ Language Specification</cite> + * for information about a particular source version. * * <p>Note that additional source version constants will be added to * model future releases of the language. @@ -59,17 +58,16 @@ /** * The original version. * - * The language described in the first edition of <i>The - * Java™ Language Specification</i>. + * The language described in + * <cite>The Java™ Language Specification, First Edition</cite>. */ RELEASE_0, /** * The version recognized by the Java Platform 1.1. * - * The language is {@code RELEASE_0} <a - * href="http://java.sun.com/docs/books/jls/first_edition/html/1.1Update.html">augmented</a> - * with nested classes. + * The language is {@code RELEASE_0} augmented with nested classes as described in the 1.1 update to + * <cite>The Java™ Language Specification, First Edition</cite>. */ RELEASE_1, @@ -77,8 +75,9 @@ * The version recognized by the Java 2 Platform, Standard Edition, * v 1.2. * - * The language described in <i>The Java™ Language - * Specification, Second Edition</i>, which includes the {@code + * The language described in + * <cite>The Java™ Language Specification, + * Second Edition</cite>, which includes the {@code * strictfp} modifier. */ RELEASE_2, @@ -103,8 +102,9 @@ * The version recognized by the Java 2 Platform, Standard * Edition 5.0. * - * The language described in <i>The Java™ Language - * Specification, Third Edition</i>. First release to support + * The language described in + * <cite>The Java™ Language Specification, + * Third Edition</cite>. First release to support * generics, annotations, autoboxing, var-args, enhanced {@code * for} loop, and hexadecimal floating-point literals. */ @@ -210,7 +210,7 @@ * @param name the string to check * @return {@code true} if this string is a * syntactically valid name, {@code false} otherwise. - * @jls3 6.2 Names and Identifiers + * @jls 6.2 Names and Identifiers */ public static boolean isName(CharSequence name) { String id = name.toString();
--- a/src/share/classes/javax/lang/model/element/Element.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/element/Element.java Thu Jun 02 19:00:16 2011 +0100 @@ -232,8 +232,8 @@ * * @return the enclosed elements, or an empty list if none * @see Elements#getAllMembers - * @jls3 8.8.9 Default Constructor - * @jls3 8.9 Enums + * @jls 8.8.9 Default Constructor + * @jls 8.9 Enums */ List<? extends Element> getEnclosedElements();
--- a/src/share/classes/javax/lang/model/element/Modifier.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/element/Modifier.java Thu Jun 02 19:00:16 2011 +0100 @@ -46,7 +46,7 @@ public enum Modifier { - // See JLS2 sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1. + // See JLS sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1. // java.lang.reflect.Modifier includes INTERFACE, but that's a VMism. /** The modifier {@code public} */ PUBLIC,
--- a/src/share/classes/javax/lang/model/element/PackageElement.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/element/PackageElement.java Thu Jun 02 19:00:16 2011 +0100 @@ -43,7 +43,7 @@ * * @return the fully qualified name of this package, or an * empty name if this is an unnamed package - * @jls3 6.7 Fully Qualified Names and Canonical Names + * @jls 6.7 Fully Qualified Names and Canonical Names */ Name getQualifiedName(); @@ -63,7 +63,7 @@ * * @return {@code true} is this is an unnamed package and {@code * false} otherwise - * @jls3 7.4.2 Unnamed Packages + * @jls 7.4.2 Unnamed Packages */ boolean isUnnamed();
--- a/src/share/classes/javax/lang/model/element/TypeElement.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/element/TypeElement.java Thu Jun 02 19:00:16 2011 +0100 @@ -101,7 +101,7 @@ * an empty name if none * * @see Elements#getBinaryName - * @jls3 6.7 Fully Qualified Names and Canonical Names + * @jls 6.7 Fully Qualified Names and Canonical Names */ Name getQualifiedName();
--- a/src/share/classes/javax/lang/model/element/VariableElement.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/element/VariableElement.java Thu Jun 02 19:00:16 2011 +0100 @@ -59,8 +59,8 @@ * otherwise * * @see Elements#getConstantExpression(Object) - * @jls3 15.28 Constant Expression - * @jls3 4.12.4 final Variables + * @jls 15.28 Constant Expression + * @jls 4.12.4 final Variables */ Object getConstantValue(); }
--- a/src/share/classes/javax/lang/model/type/DeclaredType.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/type/DeclaredType.java Thu Jun 02 19:00:16 2011 +0100 @@ -79,8 +79,8 @@ * enclosing instance. * * @return a type mirror for the enclosing type - * @jls3 8.1.3 Inner Classes and Enclosing Instances - * @jls3 15.9.2 Determining Enclosing Instances + * @jls 8.1.3 Inner Classes and Enclosing Instances + * @jls 15.9.2 Determining Enclosing Instances */ TypeMirror getEnclosingType();
--- a/src/share/classes/javax/lang/model/type/DisjunctiveType.java Thu Jun 02 17:45:51 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010, 2011, 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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -package javax.lang.model.type; - -import java.util.List; - -/** - * Represents a disjunctive type. - * - * As of the {@link javax.lang.model.SourceVersion#RELEASE_7 - * RELEASE_7} source version, disjunctive types can appear as the type - * of a multi-catch exception parameter. - * - * @since 1.7 - */ -public interface DisjunctiveType extends TypeMirror { - - /** - * Return the alternatives comprising this disjunctive type. - * - * The alternatives are formally referred to as <i>disjuncts</i>. - * - * @return the alternatives comprising this disjunctive type. - */ - List<? extends TypeMirror> getAlternatives(); -}
--- a/src/share/classes/javax/lang/model/type/TypeKind.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/type/TypeKind.java Thu Jun 02 19:00:16 2011 +0100 @@ -140,11 +140,11 @@ OTHER, /** - * A disjunctive type. + * A union type. * * @since 1.7 */ - DISJUNCTIVE; + UNION; /** * Returns {@code true} if this kind corresponds to a primitive
--- a/src/share/classes/javax/lang/model/type/TypeVariable.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/type/TypeVariable.java Thu Jun 02 19:00:16 2011 +0100 @@ -38,8 +38,8 @@ * type, method, or constructor. * A type variable may also be declared implicitly, as by * the capture conversion of a wildcard type argument - * (see chapter 5 of <i>The Java Language Specification, Third - * Edition</i>). + * (see chapter 5 of + * <cite>The Java™ Language Specification</cite>). * * @author Joseph D. Darcy * @author Scott Seligman
--- a/src/share/classes/javax/lang/model/type/TypeVisitor.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/type/TypeVisitor.java Thu Jun 02 19:00:16 2011 +0100 @@ -164,12 +164,12 @@ R visitUnknown(TypeMirror t, P p); /** - * Visits a disjunctive type. + * Visits a union type. * * @param t the type to visit * @param p a visitor-specified parameter * @return a visitor-specified result * @since 1.7 */ - R visitDisjunctive(DisjunctiveType t, P p); + R visitUnion(UnionType t, P p); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/javax/lang/model/type/UnionType.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010, 2011, 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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. + */ + +package javax.lang.model.type; + +import java.util.List; + +/** + * Represents a union type. + * + * As of the {@link javax.lang.model.SourceVersion#RELEASE_7 + * RELEASE_7} source version, union types can appear as the type + * of a multi-catch exception parameter. + * + * @since 1.7 + */ +public interface UnionType extends TypeMirror { + + /** + * Return the alternatives comprising this union type. + * + * @return the alternatives comprising this union type. + */ + List<? extends TypeMirror> getAlternatives(); +}
--- a/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java Thu Jun 02 19:00:16 2011 +0100 @@ -96,7 +96,7 @@ } /** - * Visits a {@code DisjunctiveType} element by calling {@code + * Visits a {@code UnionType} element by calling {@code * visitUnknown}. * @param t {@inheritDoc} @@ -105,7 +105,7 @@ * * @since 1.7 */ - public R visitDisjunctive(DisjunctiveType t, P p) { + public R visitUnion(UnionType t, P p) { return visitUnknown(t, p); }
--- a/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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 @@ -67,11 +67,11 @@ } /** - * Visits a {@code DisjunctiveType} in a manner defined by a subclass. + * Visits a {@code UnionType} in a manner defined by a subclass. * * @param t {@inheritDoc} * @param p {@inheritDoc} * @return the result of the visit as defined by a subclass */ - public abstract R visitDisjunctive(DisjunctiveType t, P p); + public abstract R visitUnion(UnionType t, P p); }
--- a/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/src/share/classes/javax/lang/model/util/Elements.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/util/Elements.java Thu Jun 02 19:00:16 2011 +0100 @@ -95,7 +95,7 @@ * @param e the element being examined * @return the documentation comment of the element, or {@code null} * if there is none - * @jls3 3.6 White Space + * @jls 3.6 White Space */ String getDocComment(Element e); @@ -114,7 +114,7 @@ * @return the binary name * * @see TypeElement#getQualifiedName - * @jls3 13.1 The Form of a Binary + * @jls 13.1 The Form of a Binary */ Name getBinaryName(TypeElement type); @@ -210,8 +210,8 @@ * @param type the type of which the first method is a member * @return {@code true} if and only if the first method overrides * the second - * @jls3 8.4.8 Inheritance, Overriding, and Hiding - * @jls3 9.4.1 Inheritance and Overriding + * @jls 8.4.8 Inheritance, Overriding, and Hiding + * @jls 9.4.1 Inheritance and Overriding */ boolean overrides(ExecutableElement overrider, ExecutableElement overridden, TypeElement type);
--- a/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java Thu Jun 02 19:00:16 2011 +0100 @@ -91,7 +91,7 @@ } /** - * This implementation visits a {@code DisjunctiveType} by calling + * This implementation visits a {@code UnionType} by calling * {@code defaultAction}. * * @param t {@inheritDoc} @@ -99,7 +99,7 @@ * @return the result of {@code defaultAction} */ @Override - public R visitDisjunctive(DisjunctiveType t, P p) { + public R visitUnion(UnionType t, P p) { return defaultAction(t, p); } }
--- a/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java Thu Jun 02 19:00:16 2011 +0100 @@ -94,7 +94,7 @@ } /** - * This implementation visits a {@code DisjunctiveType} by calling + * This implementation visits a {@code UnionType} by calling * {@code defaultAction}. * * @param t {@inheritDoc} @@ -102,7 +102,7 @@ * @return the result of {@code defaultAction} */ @Override - public R visitDisjunctive(DisjunctiveType t, P p) { + public R visitUnion(UnionType t, P p) { return defaultAction(t, p); } }
--- a/src/share/classes/javax/lang/model/util/Types.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/lang/model/util/Types.java Thu Jun 02 19:00:16 2011 +0100 @@ -81,7 +81,7 @@ * @return {@code true} if and only if the first type is a subtype * of the second * @throws IllegalArgumentException if given an executable or package type - * @jls3 4.10 Subtyping + * @jls 4.10 Subtyping */ boolean isSubtype(TypeMirror t1, TypeMirror t2); @@ -93,7 +93,7 @@ * @return {@code true} if and only if the first type is assignable * to the second * @throws IllegalArgumentException if given an executable or package type - * @jls3 5.2 Assignment Conversion + * @jls 5.2 Assignment Conversion */ boolean isAssignable(TypeMirror t1, TypeMirror t2); @@ -104,7 +104,7 @@ * @param t2 the second type * @return {@code true} if and only if the first type contains the second * @throws IllegalArgumentException if given an executable or package type - * @jls3 4.5.1.1 Type Argument Containment and Equivalence + * @jls 4.5.1.1 Type Argument Containment and Equivalence */ boolean contains(TypeMirror t1, TypeMirror t2); @@ -116,7 +116,7 @@ * @param m2 the second method * @return {@code true} if and only if the first signature is a * subsignature of the second - * @jls3 8.4.2 Method Signature + * @jls 8.4.2 Method Signature */ boolean isSubsignature(ExecutableType m1, ExecutableType m2); @@ -136,7 +136,7 @@ * @param t the type to be erased * @return the erasure of the given type * @throws IllegalArgumentException if given a package type - * @jls3 4.6 Type Erasure + * @jls 4.6 Type Erasure */ TypeMirror erasure(TypeMirror t); @@ -146,7 +146,7 @@ * * @param p the primitive type to be converted * @return the class of a boxed value of type {@code p} - * @jls3 5.1.7 Boxing Conversion + * @jls 5.1.7 Boxing Conversion */ TypeElement boxedClass(PrimitiveType p); @@ -158,7 +158,7 @@ * @return the type of an unboxed value of type {@code t} * @throws IllegalArgumentException if the given type has no * unboxing conversion - * @jls3 5.1.8 Unboxing Conversion + * @jls 5.1.8 Unboxing Conversion */ PrimitiveType unboxedType(TypeMirror t); @@ -168,7 +168,7 @@ * @param t the type to be converted * @return the result of applying capture conversion * @throws IllegalArgumentException if given an executable or package type - * @jls3 5.1.10 Capture Conversion + * @jls 5.1.10 Capture Conversion */ TypeMirror capture(TypeMirror t);
--- a/src/share/classes/javax/tools/JavaCompiler.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/tools/JavaCompiler.java Thu Jun 02 19:00:16 2011 +0100 @@ -58,9 +58,11 @@ * standard file manager such as the one returned by {@linkplain * #getStandardFileManager getStandardFileManager}. * - * <p>An instance implementing this interface must conform to the Java - * Language Specification and generate class files conforming to the - * Java Virtual Machine specification. The versions of these + * <p>An instance implementing this interface must conform to + * <cite>The Java™ Language Specification</cite> + * and generate class files conforming to + * <cite>The Java™ Virtual Machine Specification</cite>. + * The versions of these * specifications are defined in the {@linkplain Tool} interface. * * Additionally, an instance of this interface supporting {@link
--- a/src/share/classes/javax/tools/JavaFileManager.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/tools/JavaFileManager.java Thu Jun 02 19:00:16 2011 +0100 @@ -49,17 +49,16 @@ * names must be given in the Java Virtual Machine internal form of * fully qualified class and interface names. For convenience '.' * and '/' are interchangeable. The internal form is defined in - * chapter four of the - * <a href="http://java.sun.com/docs/books/vmspec/2nd-edition/jvms-maintenance.html">Java - * Virtual Machine Specification</a>. + * chapter four of + * <cite>The Java™ Virtual Machine Specification</cite>. * <blockquote><p> * <i>Discussion:</i> this means that the names * "java/lang.package-info", "java/lang/package-info", * "java.lang.package-info", are valid and equivalent. Compare to - * binary name as defined in the - * <a href="http://java.sun.com/docs/books/jls/">Java Language - * Specification (JLS)</a> section 13.1 "The Form of a Binary". + * binary name as defined in + * <cite>The Java™ Language Specification</cite>, + * section 13.1 "The Form of a Binary". * </p></blockquote> * * <p>The case of names is significant. All names should be treated @@ -173,7 +172,8 @@ /** * Infers a binary name of a file object based on a location. The - * binary name returned might not be a valid JLS binary name. + * binary name returned might not be a valid binary name according to + * <cite>The Java™ Language Specification</cite>. * * @param location a location * @param file a file object
--- a/src/share/classes/javax/tools/JavaFileObject.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/classes/javax/tools/JavaFileObject.java Thu Jun 02 19:00:16 2011 +0100 @@ -99,9 +99,9 @@ /** * Checks if this file object is compatible with the specified * simple name and kind. A simple name is a single identifier - * (not qualified) as defined in the <a - * href="http://java.sun.com/docs/books/jls/">Java Language - * Specification</a> 3rd ed., section 6.2 "Names and Identifiers". + * (not qualified) as defined in + * <cite>The Java™ Language Specification</cite>, + * section 6.2 "Names and Identifiers". * * @param simpleName a simple name of a class * @param kind a kind
--- a/src/share/sample/javac/processing/src/CheckNamesProcessor.java Thu Jun 02 17:45:51 2011 +0100 +++ b/src/share/sample/javac/processing/src/CheckNamesProcessor.java Thu Jun 02 19:00:16 2011 +0100 @@ -152,7 +152,8 @@ * Provide checks that an element and its enclosed elements follow * the usual naming conventions. * - * <p> Conventions from JLSv3 section 6.8: + * <p> Conventions from section 6.8 of + * <cite>The Java™ Language Specification</cite> * * <ul> * <li> Classes and interfaces: camel case, first letter is uppercase @@ -163,7 +164,8 @@ * <li> non-final: camel case, initial lowercase * <li> constant: uppercase separated by underscores * </ul> - * <li> Packages: checks left as exercise for the reader, see JLSv3 section 7.7 + * <li> Packages: checks left as exercise for the reader, see section 7.7 of + * <cite>The Java™ Language Specification</cite>. * </ul> */ private static class NameChecker { @@ -286,7 +288,7 @@ public Void visitPackage(PackageElement e, Void p) { /* * Implementing the checks of package names is left - * as an exercise for the reader, see JLSv3 section + * as an exercise for the reader, see JLS section * 7.7 for conventions. */
--- a/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -27,8 +27,7 @@ * @summary <DESC> * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestDeprecatedDocs + * @build JavadocTester TestDeprecatedDocs * @run main TestDeprecatedDocs */ @@ -77,7 +76,7 @@ {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"}, {TARGET_FILE2, "<pre>@Deprecated" + NL + - "public class <strong>DeprecatedClassByAnnotation</strong>" + NL + + "public class <span class=\"strong\">DeprecatedClassByAnnotation</span>" + NL + "extends java.lang.Object</pre>"}, {TARGET_FILE2, "<pre>@Deprecated" + NL +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2011, 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 6553182 + * @summary This test verifies the -Xdocrootparent option. + * @author Bhavesh Patel + * @library ../lib/ + * @build JavadocTester TestDocRootLink + * @run main TestDocRootLink + */ +public class TestDocRootLink extends JavadocTester { + + private static final String BUG_ID = "6553182"; + private static final String[][] TEST1 = { + {BUG_ID + FS + "pkg1" + FS + "C1.html", + "<a href=\"../../technotes/guides/index.html\">" + }, + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", + "<a href=\"../../technotes/guides/index.html\">" + } + }; + private static final String[][] NEGATED_TEST1 = { + {BUG_ID + FS + "pkg1" + FS + "C1.html", + "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + }, + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", + "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + } + }; + private static final String[][] TEST2 = { + {BUG_ID + FS + "pkg2" + FS + "C2.html", + "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + }, + {BUG_ID + FS + "pkg2" + FS + "package-summary.html", + "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + } + }; + private static final String[][] NEGATED_TEST2 = { + {BUG_ID + FS + "pkg2" + FS + "C2.html", + "<a href=\"../../technotes/guides/index.html\">" + }, + {BUG_ID + FS + "pkg2" + FS + "package-summary.html", + "<a href=\"../../technotes/guides/index.html\">" + } + }; + private static final String[] ARGS1 = + new String[]{ + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" + }; + private static final String[] ARGS2 = + new String[]{ + "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2" + }; + + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestDocRootLink tester = new TestDocRootLink(); + run(tester, ARGS1, TEST1, NEGATED_TEST1); + run(tester, ARGS2, TEST2, NEGATED_TEST2); + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testDocRootLink/pkg1/C1.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg1; + +/** + * Class 1. This is a test. + * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. Lets see if this works + * or not. + */ +public class C1 {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testDocRootLink/pkg1/package.html Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,18 @@ +<html> +<head> +<title>javax.management package</title> +</head> +<body bgcolor="white"> +This is a test. + <p id="spec"> + @see <a href="{@docRoot}/../technotes/guides/index.html"> + Test document 1</a> + in particular the + <a href="{@docRoot}/../technotes/guides/index.html"> + + Test document 2.</a> + + @since 1.5 + +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testDocRootLink/pkg2/C2.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg2; + +/** + * Class 1. This is a test. + * Refer <a href="{@docRoot}/../technotes/guides/index.html">Here</a>. Lets see if this works + * or not. + */ +public class C2 {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testDocRootLink/pkg2/package.html Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,18 @@ +<html> +<head> +<title>javax.management package</title> +</head> +<body bgcolor="white"> +This is a test. + <p id="spec"> + @see <a href="{@docRoot}/../technotes/guides/index.html"> + Test document 1</a> + in particular the + <a href="{@docRoot}/../technotes/guides/index.html"> + + Test document 2.</a> + + @since 1.5 + +</body> +</html>
--- a/test/com/sun/javadoc/testHelpOption/TestHelpOption.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testHelpOption/TestHelpOption.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -23,20 +23,19 @@ /* * @test - * @bug 4934778 4777599 + * @bug 4934778 4777599 6553182 * @summary Make sure that the -help option works properly. Make sure * the help link appears in the documentation. * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestHelpOption + * @build JavadocTester TestHelpOption * @run main TestHelpOption */ public class TestHelpOption extends JavadocTester { //Test information. - private static final String BUG_ID = "4934778-4777599"; + private static final String BUG_ID = "4934778-4777599-6553182"; //Javadoc arguments. private static final String[] ARGS = new String[] { @@ -79,6 +78,7 @@ {STANDARD_OUTPUT, "-tag "}, {STANDARD_OUTPUT, "-taglet "}, {STANDARD_OUTPUT, "-tagletpath "}, + {STANDARD_OUTPUT, "-Xdocrootparent "}, {STANDARD_OUTPUT, "-charset "}, {STANDARD_OUTPUT, "-helpfile "}, {STANDARD_OUTPUT, "-linksource "},
--- a/test/com/sun/javadoc/testHref/TestHref.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testHref/TestHref.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -27,8 +27,7 @@ * @summary Verify that spaces do not appear in hrefs and anchors. * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestHref + * @build JavadocTester TestHref * @run main TestHref */ @@ -81,7 +80,7 @@ //Signature does not link to the page itself. {BUG_ID + FS + "pkg" + FS + "C4.html", - "public abstract class <strong>C4<E extends C4<E>></strong>" + "public abstract class <span class=\"strong\">C4<E extends C4<E>></span>" }, }; private static final String[][] NEGATED_TEST =
--- a/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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 @@ -29,8 +29,7 @@ * @summary This test verifies the nesting of definition list tags. * @author Bhavesh Patel * @library ../lib/ - * @build JavadocTester - * @build TestHtmlDefinitionListTag + * @build JavadocTester TestHtmlDefinitionListTag * @run main TestHtmlDefinitionListTag */ @@ -43,7 +42,8 @@ // Optional Element should print properly nested definition list tags // for default value. private static final String[][] TEST_ALL = { - {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class <strong>C1</strong>" + NL + + {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class " + + "<span class=\"strong\">C1</span>" + NL + "extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"}, {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL + "<dt>Default:</dt>" + NL + "<dd>true</dd>" + NL +
--- a/test/com/sun/javadoc/testJavascript/TestJavascript.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testJavascript/TestJavascript.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2011, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 4665566 4855876 + * @bug 4665566 4855876 7025314 * @summary Verify that the output has the right javascript. * @author jamieh * @library ../lib/ @@ -45,9 +45,9 @@ //Input for string search tests. private static final String[][] TEST = { {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../index.html?pkg/C.html\" target=\"_top\">FRAMES</a>"}, + "<a href=\"../index.html?pkg/C.html\" target=\"_top\">Frames</a>"}, {BUG_ID + FS + "TestJavascript.html", - "<a href=\"index.html?TestJavascript.html\" target=\"_top\">FRAMES</a>"}, + "<a href=\"index.html?TestJavascript.html\" target=\"_top\">Frames</a>"}, {BUG_ID + FS + "index.html", "<script type=\"text/javascript\">" + NL + " targetPage = \"\" + window.location.search;" + NL +
--- a/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2011, 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 @@ -28,8 +28,7 @@ * right files. * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestLinkOption + * @build JavadocTester TestLinkOption * @run main TestLinkOption */ @@ -62,7 +61,7 @@ "Object</a> p3)" }, {BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html", - "<pre>public abstract class <strong>StringBuilderChild</strong>" + NL + + "<pre>public abstract class <span class=\"strong\">StringBuilderChild</span>" + NL + "extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " + "title=\"class or interface in java.lang\">Object</a></pre>" },
--- a/test/com/sun/javadoc/testNavagation/TestNavagation.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testNavagation/TestNavagation.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 4131628 4664607 + * @bug 4131628 4664607 7025314 * @summary Make sure the Next/Prev Class links iterate through all types. * Make sure the navagation is 2 columns, not 3. * @author jamieh @@ -45,20 +45,20 @@ //Input for string search tests. private static final String[][] TEST = { - {BUG_ID + FS + "pkg" + FS + "A.html", "<li>PREV CLASS</li>"}, + {BUG_ID + FS + "pkg" + FS + "A.html", "<li>Prev Class</li>"}, {BUG_ID + FS + "pkg" + FS + "A.html", - "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">NEXT CLASS</span></a>"}, + "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Next Class</span></a>"}, {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"strong\">PREV CLASS</span></a>"}, + "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"strong\">Prev Class</span></a>"}, {BUG_ID + FS + "pkg" + FS + "C.html", - "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">NEXT CLASS</span></a>"}, + "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Next Class</span></a>"}, {BUG_ID + FS + "pkg" + FS + "E.html", - "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">PREV CLASS</span></a>"}, + "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">Prev Class</span></a>"}, {BUG_ID + FS + "pkg" + FS + "E.html", - "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"strong\">NEXT CLASS</span></a>"}, + "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"strong\">Next Class</span></a>"}, {BUG_ID + FS + "pkg" + FS + "I.html", - "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">PREV CLASS</span></a>"}, - {BUG_ID + FS + "pkg" + FS + "I.html", "<li>NEXT CLASS</li>"}, + "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">Prev Class</span></a>"}, + {BUG_ID + FS + "pkg" + FS + "I.html", "<li>Next Class</li>"}, // Test for 4664607 {BUG_ID + FS + "pkg" + FS + "I.html", "<a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">" + NL +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2011, 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 6758050 + * @summary Test HTML output for nested generic types. + * @author bpatel + * @library ../lib/ + * @build JavadocTester TestNestedGenerics + * @run main TestNestedGenerics + */ + +public class TestNestedGenerics extends JavadocTester { + + //Test information. + private static final String BUG_ID = "6758050"; + + //Javadoc arguments. + private static final String[] ARGS = new String[]{ + "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, + "pkg" + }; + + //Input for string search tests. + private static final String[][] TEST = { + {BUG_ID + FS + "pkg" + FS + "NestedGenerics.html", + "<div class=\"block\">Contains <a " + + "href=\"../pkg/NestedGenerics.html#foo(java.util.Map)\"><code>foo" + + "(java.util.Map<A, java.util.Map<A, A>>)</code></a></div>" + } + }; + private static final String[][] NEGATED_TEST = NO_TEST; + + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestNestedGenerics tester = new TestNestedGenerics(); + run(tester, ARGS, TEST, NEGATED_TEST); + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testNestedGenerics/pkg/NestedGenerics.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg; + +import java.util.Map; + +/** Contains {@link #foo} */ +public class NestedGenerics { + public static <A> void foo(Map<A, Map<A, A>> map) {} +}
--- a/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -23,14 +23,13 @@ /* * @test - * @bug 4789689 4905985 4927164 4827184 4993906 5004549 + * @bug 4789689 4905985 4927164 4827184 4993906 5004549 7025314 7010344 * @summary Run Javadoc on a set of source files that demonstrate new * language features. Check the output to ensure that the new * language features are properly documented. * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestNewLanguageFeatures + * @build JavadocTester TestNewLanguageFeatures * @run main TestNewLanguageFeatures */ @@ -53,9 +52,10 @@ //Make sure enum header is correct. {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"}, //Make sure enum signature is correct. - {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum <strong>Coin</strong>" + NL + - "extends java.lang.Enum<<a href=\"../pkg/Coin.html\" " + - "title=\"enum in pkg\">Coin</a>></pre>" + {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum " + + "<span class=\"strong\">Coin</span>" + NL + + "extends java.lang.Enum<<a href=\"../pkg/Coin.html\" " + + "title=\"enum in pkg\">Coin</a>></pre>" }, //Check for enum constant section {BUG_ID + FS + "pkg" + FS + "Coin.html", "<caption><span>Enum Constants" + @@ -118,8 +118,8 @@ //Signature of subclass that has type parameters. {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html", - "<pre>public class <strong>TypeParameterSubClass<T extends " + - "java.lang.String></strong>" + NL + "extends " + + "<pre>public class <span class=\"strong\">TypeParameterSubClass<T extends " + + "java.lang.String></span>" + NL + "extends " + "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" + "TypeParameterSuperClass</a><T></pre>"}, @@ -155,20 +155,20 @@ //================================= //Make sure the summary links are correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<li>SUMMARY: </li>" + NL + + "<li>Summary: </li>" + NL + "<li><a href=\"#annotation_type_required_element_summary\">" + - "REQUIRED</a> | </li>" + NL + "<li>" + - "<a href=\"#annotation_type_optional_element_summary\">OPTIONAL</a></li>"}, + "Required</a> | </li>" + NL + "<li>" + + "<a href=\"#annotation_type_optional_element_summary\">Optional</a></li>"}, //Make sure the detail links are correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "<li>DETAIL: </li>" + NL + - "<li><a href=\"#annotation_type_element_detail\">ELEMENT</a></li>"}, + "<li>Detail: </li>" + NL + + "<li><a href=\"#annotation_type_element_detail\">Element</a></li>"}, //Make sure the heading is correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", "Annotation Type AnnotationType</h2>"}, //Make sure the signature is correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", - "public @interface <strong>AnnotationType</strong>"}, + "public @interface <span class=\"strong\">AnnotationType</span>"}, //Make sure member summary headings are correct. {BUG_ID + FS + "pkg" + FS + "AnnotationType.html", "<h3>Required Element Summary</h3>"}, @@ -198,8 +198,8 @@ "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" + "=\"Class Annotation\"," + NL + " <a href=\"../pkg/AnnotationType.html#required()\">" + - "required</a>=1994)" + NL + "public class <strong>" + - "AnnotationTypeUsage</strong>" + NL + "extends java.lang.Object</pre>"}, + "required</a>=1994)" + NL + "public class <span class=\"strong\">" + + "AnnotationTypeUsage</span>" + NL + "extends java.lang.Object</pre>"}, //FIELD {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html", @@ -299,7 +299,7 @@ {BUG_ID + FS + "pkg1" + FS + "B.html", "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"}, {BUG_ID + FS + "pkg1" + FS + "B.html", - "public interface <strong>B</strong></pre>"}, + "public interface <span class=\"strong\">B</span></pre>"}, //============================================================== @@ -320,9 +320,11 @@ "Foo</a></span><span class=\"tabEnd\"> </span></caption>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", - "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" + - "ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1" + - "<T extends Foo & Foo2></a></strong></code> </td>" + "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " + + "title=\"class in pkg2\">ClassUseTest1</a><T extends " + + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" + + "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" + + "Foo2</a>></strong></code> </td>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html", "<caption><span>Methods in <a href=\"../../pkg2/" + @@ -370,10 +372,11 @@ "</span></caption>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", - "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" + - "ClassUseTest1.html\" title=\"class in pkg2\">" + - "ClassUseTest1<T extends Foo & Foo2></a></strong>" + - "</code> </td>" + "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " + + "title=\"class in pkg2\">ClassUseTest1</a><T extends " + + "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" + + "</a> & <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" + + "Foo2</a>></strong></code> </td>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html", "<caption><span>Methods in <a href=\"../../pkg2/" + @@ -398,10 +401,11 @@ " </span></caption>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", - "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" + - "ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2<T " + - "extends ParamTest<<a href=\"../../pkg2/Foo3.html\" title=\"class " + - "in pkg2\">Foo3</a>>></a></strong></code> </td>" + "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " + + "title=\"class in pkg2\">ClassUseTest2</a><T extends " + + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" + + "ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + + "Foo3</a>>></strong></code> </td>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html", "<caption><span>Methods in <a href=\"../../pkg2/" + @@ -452,11 +456,11 @@ "Foo3</a></span><span class=\"tabEnd\"> </span></caption>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", - "<td class=\"colLast\"><code><strong><a href=\"../../" + - "pkg2/ClassUseTest2.html\" title=\"class in pkg2\">" + - "ClassUseTest2<T extends ParamTest<<a href=\"../../" + - "pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</a>>>" + - "</a></strong></code> </td>" + "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " + + "title=\"class in pkg2\">ClassUseTest2</a><T extends " + + "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" + + "ParamTest</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" + + "Foo3</a>>></strong></code> </td>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html", "<caption><span>Methods in <a href=\"../../pkg2/" + @@ -496,10 +500,12 @@ " </span></caption>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", - "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" + - "ClassUseTest3.html\" title=\"class in pkg2\">" + - "ClassUseTest3<T extends ParamTest2<java.util.List" + - "<? extends Foo4>>></a></strong></code> </td>" + "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " + + "title=\"class in pkg2\">ClassUseTest3</a><T extends " + + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + + "ParamTest2</a><java.util.List<? extends " + + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" + + "Foo4</a>>>></strong></code> </td>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html", "<caption><span>Methods in <a href=\"../../pkg2/" + @@ -532,10 +538,12 @@ "</span></caption>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", - "<td class=\"colLast\"><code><strong><a href=\"../../" + - "pkg2/ClassUseTest3.html\" title=\"class in pkg2\">" + - "ClassUseTest3<T extends ParamTest2<java.util.List" + - "<? extends Foo4>>></a></strong></code> </td>" + "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " + + "title=\"class in pkg2\">ClassUseTest3</a><T extends " + + "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" + + "ParamTest2</a><java.util.List<? extends " + + "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" + + "Foo4</a>>>></strong></code> </td>" }, {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html", "<caption><span>Methods in <a href=\"../../pkg2/" +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testNonFrameWarning/TestNonFrameWarning.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011, 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 7001086 + * @summary Test Non-frame warning. + * @author Bhavesh Patel + * @library ../lib/ + * @build JavadocTester TestNonFrameWarning + * @run main TestNonFrameWarning + */ + +public class TestNonFrameWarning extends JavadocTester { + + private static final String BUG_ID = "7001086"; + private static final String[][] TEST = { + {BUG_ID + FS + "index.html", + "<p>This document is designed to be viewed using the frames feature. " + + "If you see this message, you are using a non-frame-capable web client. " + + "Link to <a href=\"pkg/package-summary.html\">Non-frame version</a>.</p>" + } + }; + private static final String[] ARGS = new String[]{ + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + }; + + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestNonFrameWarning tester = new TestNonFrameWarning(); + run(tester, ARGS, TEST, NO_TEST); + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testNonFrameWarning/pkg/C.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg; + +/** + * Source file for C + */ +public class C { +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/C2.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2011, 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. + */ + +/** + * Another test class. + * + * @author Bhavesh Patel + */ +public class C2 { + + public static enum ModalExclusionType { + /** + * Test comment. + */ + NO_EXCLUDE, + /** + * Another comment. + */ + APPLICATION_EXCLUDE + }; + + /** + * A string constant. + */ + public static final String CONSTANT1 = "C2"; + + /** + * A sample method. + * + * @param param some parameter. + */ + public void method(String param) { + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/FooDepr.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2011, 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. + */ + +import java.util.*; + +/** +* Test Deprecated class +* @deprecated This class is Deprecated. +*/ +public class FooDepr { + + public void method(Vector<Object> o){} + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2011, 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 6492694 + * @summary Test package deprecation. + * @author bpatel + * @library ../lib/ + * @build JavadocTester TestPackageDeprecation + * @run main TestPackageDeprecation + */ + +public class TestPackageDeprecation extends JavadocTester { + + //Test information. + private static final String BUG_ID = "6492694"; + + //Javadoc arguments. + private static final String[] ARGS1 = new String[]{ + "-d", BUG_ID + "-1", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1", + SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java" + }; + private static final String[] ARGS2 = new String[]{ + "-d", BUG_ID + "-2", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "-nodeprecated", + "pkg", "pkg1", SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java" + }; + + //Input for string search tests. + private static final String[][] TEST1 = { + {BUG_ID + "-1" + FS + "pkg1" + FS + "package-summary.html", + "<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>" + NL + + "<div class=\"block\"><i>This package is Deprecated.</i></div>" + }, + {BUG_ID + "-1" + FS + "deprecated-list.html", + "<li><a href=\"#package\">Deprecated Packages</a></li>" + } + }; + private static final String[][] TEST2 = NO_TEST; + private static final String[][] NEGATED_TEST1 = NO_TEST; + private static final String[][] NEGATED_TEST2 = { + {BUG_ID + "-2" + FS + "overview-summary.html", "pkg1"}, + {BUG_ID + "-2" + FS + "allclasses-frame.html", "FooDepr"} + }; + + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestPackageDeprecation tester = new TestPackageDeprecation(); + run(tester, ARGS1, TEST1, NEGATED_TEST1); + run(tester, ARGS2, TEST2, NEGATED_TEST2); + if ((new java.io.File(BUG_ID + "-2" + FS + "pkg1" + FS + + "package-summary.html")).exists()) { + throw new Error("Test Fails: packages summary should not be" + + "generated for deprecated package."); + } else { + System.out.println("Test passes: package-summary.html not found."); + } + if ((new java.io.File(BUG_ID + "-2" + FS + "FooDepr.html")).exists()) { + throw new Error("Test Fails: FooDepr should not be" + + "generated as it is deprecated."); + } else { + System.out.println("Test passes: FooDepr.html not found."); + } + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/pkg/A.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg; + +public class A { + /** Test constant. */ + public static final String DEMO= "y"; + public static final String THIS_IS_OK= "(x)"; + + public String DEMO_STRING = "<Hello World>"; + + public A() { + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/pkg1/ClassUseTest1.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg1; + +public class ClassUseTest1 <T extends Foo & Foo2> { + + public <T extends Foo & Foo2> T method(T t) { + return null; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg1; + +import java.util.*; + +/** +* Test Deprecated class +* @deprecated This class is Deprecated. +*/ +public class Foo { + + public void method(Vector<Object> o){} + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/pkg1/Foo2.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg1; + +public interface Foo2 {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testPackageDeprecation/pkg1/package-info.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2011, 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 pkg1 used. + * @deprecated This package is Deprecated. + */ +package pkg1;
--- a/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testStylesheet/TestStylesheet.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, 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 @@ -23,19 +23,18 @@ /* * @test - * @bug 4494033 + * @bug 4494033 7028815 * @summary Run tests on doclet stylesheet. * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestStylesheet + * @build JavadocTester TestStylesheet * @run main TestStylesheet */ public class TestStylesheet extends JavadocTester { //Test information. - private static final String BUG_ID = "4494033"; + private static final String BUG_ID = "4494033-7028815"; //Javadoc arguments. private static final String[] ARGS = new String[] { @@ -56,15 +55,18 @@ "body {" + NL + " font-family:Helvetica, Arial, sans-serif;" + NL + " color:#000000;" + NL + "}"}, {BUG_ID + FS + "stylesheet.css", - "dl dd ul li {" + NL + " list-style:none;" + NL + - " margin:10px 0 10px 0;" + NL + "}"}, + "ul {" + NL + " margin:10px 0 10px 20px;" + NL + + " list-style-type:disc;" + NL + "}"}, // Test whether a link to the stylesheet file is inserted properly // in the class documentation. {BUG_ID + FS + "pkg" + FS + "A.html", "<link rel=\"stylesheet\" type=\"text/css\" " + "href=\"../stylesheet.css\" title=\"Style\">"} }; - private static final String[][] NEGATED_TEST = NO_TEST; + private static final String[][] NEGATED_TEST = { + {BUG_ID + FS + "stylesheet.css", + "* {" + NL + " margin:0;" + NL + " padding:0;" + NL + "}"} + }; /** * The entry point of the test.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSubTitle/TestSubTitle.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2011, 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 7010342 + * @summary Test for correct sub title generation. + * @author Bhavesh Patel + * @library ../lib/ + * @build JavadocTester + * @build TestSubTitle + * @run main TestSubTitle + */ + +public class TestSubTitle extends JavadocTester { + + private static final String BUG_ID = "7010342"; + private static final String[][] TEST = { + {BUG_ID + FS + "pkg" + FS + "package-summary.html", + "<div class=\"block\">This is the description of package pkg.</div>" + }, + {BUG_ID + FS + "pkg" + FS + "C.html", + "<div class=\"subTitle\">pkg</div>" + } + }; + private static final String[][] NEG_TEST = { + {BUG_ID + FS + "pkg" + FS + "package-summary.html", + "<p class=\"subTitle\">" + NL + "<div class=\"block\">This is the " + + "description of package pkg.</div>" + NL + "</p>" + }, + {BUG_ID + FS + "pkg" + FS + "C.html", + "<p class=\"subTitle\">pkg</p>" + } + }; + private static final String[] ARGS = new String[]{ + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + }; + + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestSubTitle tester = new TestSubTitle(); + run(tester, ARGS, TEST, NEG_TEST); + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSubTitle/pkg/C.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg; + +/** + * Source file for C + */ +public class C { +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testSubTitle/pkg/package.html Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,8 @@ +<html lang="en"> +<head> + <title>Package Summary</title> +</head> +<body> +This is the description of package pkg. +</body> +</html>
--- a/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, 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 @@ -23,55 +23,77 @@ /* * @test - * @bug 4927167 4974929 + * @bug 4927167 4974929 7010344 * @summary When the type parameters are more than 10 characters in length, * make sure there is a line break between type params and return type - * in member summary. + * in member summary. Also, test for type parameter links in package-summary and + * class-use pages. The class/annotation pages should check for type + * parameter links in the class/annotation signature section when -linksource is set. * @author jamieh * @library ../lib/ - * @build JavadocTester - * @build TestTypeParameters + * @build JavadocTester TestTypeParameters * @run main TestTypeParameters */ public class TestTypeParameters extends JavadocTester { //Test information. - private static final String BUG_ID = "4927167-4974929"; + private static final String BUG_ID = "4927167-4974929-7010344"; //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, - "pkg" + private static final String[] ARGS1 = new String[]{ + "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, + "pkg" + }; + private static final String[] ARGS2 = new String[]{ + "-d", BUG_ID, "-linksource", "-source", "1.5", "-sourcepath", SRC_DIR, + "pkg" }; //Input for string search tests. - private static final String[][] TEST = - { + private static final String[][] TEST1 = { {BUG_ID + FS + "pkg" + FS + "C.html", "<td class=\"colFirst\"><code><W extends java.lang.String,V extends " + - "java.util.List> <br>java.lang.Object</code></td>"}, + "java.util.List> <br>java.lang.Object</code></td>" + }, {BUG_ID + FS + "pkg" + FS + "C.html", - "<code><T> java.lang.Object</code>"}, + "<code><T> java.lang.Object</code>" + }, {BUG_ID + FS + "pkg" + FS + "package-summary.html", - "C<E extends Parent>"}, + "C</a><E extends <a href=\"../pkg/Parent.html\" " + + "title=\"class in pkg\">Parent</a>>" + }, + {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Foo4.html", + "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" + + "ClassUseTest3</a><T extends <a href=\"../../pkg/ParamTest2.html\" " + + "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + + "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" + }, //Nested type parameters {BUG_ID + FS + "pkg" + FS + "C.html", "<a name=\"formatDetails(java.util.Collection, java.util.Collection)\">" + NL + "<!-- -->" + NL + - "</a>"}, - + "</a>" + }, + }; + private static final String[][] TEST2 = { + {BUG_ID + FS + "pkg" + FS + "ClassUseTest3.html", + "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" + + "ClassUseTest3</a><T extends <a href=\"../pkg/ParamTest2.html\" " + + "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + + "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" + } }; private static final String[][] NEGATED_TEST = NO_TEST; - /** * The entry point of the test. * @param args the array of command line arguments. */ public static void main(String[] args) { TestTypeParameters tester = new TestTypeParameters(); - run(tester, ARGS, TEST, NEGATED_TEST); + run(tester, ARGS1, TEST1, NEGATED_TEST); + run(tester, ARGS2, TEST2, NEGATED_TEST); tester.printSummary(); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testTypeParams/pkg/ClassUseTest3.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg; + +import java.util.*; + +public class ClassUseTest3 <T extends ParamTest2<List<? extends Foo4>>> { + + public ClassUseTest3(Set<Foo4> p) {} + + public <T extends ParamTest2<List<? extends Foo4>>> ParamTest2<List<? extends Foo4>> method(T t) { + return null; + } + + public void method(Set<Foo4> p) {} +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testTypeParams/pkg/Foo4.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg; + +public class Foo4 {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/javadoc/testTypeParams/pkg/ParamTest2.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2011, 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. + */ + +package pkg; + +public class ParamTest2<E> { +}
--- a/test/tools/javac/4241573/T4241573.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/4241573/T4241573.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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
--- a/test/tools/javac/4917091/Test255.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/4917091/Test255.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/4917091/Test256a.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/4917091/Test256a.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/4917091/Test256b.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/4917091/Test256b.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/6508981/TestInferBinaryName.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/6508981/TestInferBinaryName.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2011, 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
--- a/test/tools/javac/6558548/T6558548.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/6558548/T6558548.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,9 +1,9 @@ /* * @test /nodynamiccopyright/ - * @bug 6558548 + * @bug 6558548 7039937 * @summary The compiler needs to be aligned with clarified specification of throws * @compile/fail/ref=T6558548_latest.out -XDrawDiagnostics T6558548.java - * @compile/fail/ref=T6558548_6.out -source 6 -XDrawDiagnostics T6558548.java + * @compile/fail/ref=T6558548_6.out -source 6 -Xlint:-options -XDrawDiagnostics T6558548.java */ class T6558548 { @@ -12,7 +12,7 @@ void checked() throws InterruptedException {} void runtime() throws IllegalArgumentException {} - void m1() { + void m1a() { try { throw new java.io.FileNotFoundException(); } @@ -20,7 +20,7 @@ catch(java.io.IOException exc) { } // 6: ok; latest: unreachable } - void m1a() { + void m1b() { try { throw new java.io.IOException(); } @@ -28,11 +28,20 @@ catch(java.io.IOException exc) { } //ok } - void m2() { + void m1c() { try { - nothing(); + throw new java.io.FileNotFoundException(); } - catch(Exception exc) { } // ok + catch(java.io.FileNotFoundException exc) { } + catch(Exception ex) { } //ok (Exception/Throwable always allowed) + } + + void m1d() { + try { + throw new java.io.FileNotFoundException(); + } + catch(java.io.FileNotFoundException exc) { } + catch(Throwable ex) { } //ok (Exception/Throwable always allowed) } void m3() { @@ -131,7 +140,7 @@ runtime(); } catch(RuntimeException exc) { } - catch(Exception exc) { } //6: ok; latest: unreachable + catch(Exception exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m17() { @@ -139,7 +148,7 @@ nothing(); } catch(RuntimeException exc) { } - catch(Exception exc) { } //6: ok; latest: unreachable + catch(Exception exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m18() { @@ -148,7 +157,7 @@ } catch(RuntimeException exc) { } catch(InterruptedException exc) { } - catch(Exception exc) { } //6: ok; latest: unreachable + catch(Exception exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m19() { @@ -157,7 +166,7 @@ } catch(RuntimeException exc) { } catch(InterruptedException exc) { } //never thrown in try - catch(Exception exc) { } //6: ok; latest: unreachable + catch(Exception exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m20() { @@ -166,7 +175,7 @@ } catch(RuntimeException exc) { } catch(InterruptedException exc) { } //never thrown in try - catch(Exception exc) { } //6: ok; latest: unreachable + catch(Exception exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m21() { @@ -182,7 +191,7 @@ runtime(); } catch(RuntimeException exc) { } - catch(Exception exc) { } // 6: ok; latest: unreachable + catch(Exception exc) { } // 6: ok; latest: ok (Exception/Throwable always allowed) } void m23() { @@ -190,7 +199,7 @@ nothing(); } catch(RuntimeException exc) { } - catch(Exception exc) { } // 6: ok; latest: unreachable + catch(Exception exc) { } // 6: ok; latest: ok (Exception/Throwable always allowed) } void m24() { @@ -208,7 +217,7 @@ } catch(RuntimeException exc) { } catch(Error exc) { } - catch(Throwable exc) { } //6: ok; latest: unreachable + catch(Throwable exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m26() { @@ -217,7 +226,7 @@ } catch(RuntimeException exc) { } catch(Error exc) { } - catch(Throwable exc) { } //6: ok; latest: unreachable + catch(Throwable exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m27() { @@ -227,7 +236,7 @@ catch(RuntimeException exc) { } catch(Error exc) { } catch(InterruptedException exc) { } - catch(Throwable exc) { } //6: ok; latest: unreachable + catch(Throwable exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m28() { @@ -237,7 +246,7 @@ catch(RuntimeException exc) { } catch(Error exc) { } catch(InterruptedException exc) { } //never thrown in try - catch(Throwable exc) { } //6: ok; latest: unreachable + catch(Throwable exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m29() { @@ -247,7 +256,7 @@ catch(RuntimeException exc) { } catch(Error exc) { } catch(InterruptedException exc) { } //never thrown in try - catch(Throwable exc) { } //6: ok; latest: unreachable + catch(Throwable exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m30() { @@ -265,7 +274,7 @@ } catch(RuntimeException exc) { } catch(Error exc) { } - catch(Throwable exc) { } //6: ok; latest: unreachable + catch(Throwable exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m32() { @@ -274,7 +283,7 @@ } catch(RuntimeException exc) { } catch(Error exc) { } - catch(Throwable exc) { } //6: ok; latest: unreachable + catch(Throwable exc) { } //6: ok; latest: ok (Exception/Throwable always allowed) } void m33() {
--- a/test/tools/javac/6558548/T6558548_6.out Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/6558548/T6558548_6.out Thu Jun 02 19:00:16 2011 +0100 @@ -1,9 +1,7 @@ -- compiler.warn.source.no.bootclasspath: 1.6 -T6558548.java:159:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException T6558548.java:168:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:239:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:249:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:291:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:298:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:177:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:248:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:258:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:300:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:307:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException 6 errors -1 warning
--- a/test/tools/javac/6558548/T6558548_latest.out Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/6558548/T6558548_latest.out Thu Jun 02 19:00:16 2011 +0100 @@ -1,23 +1,9 @@ T6558548.java:20:9: compiler.warn.unreachable.catch: java.io.FileNotFoundException -T6558548.java:134:9: compiler.warn.unreachable.catch: java.lang.RuntimeException -T6558548.java:142:9: compiler.warn.unreachable.catch: java.lang.RuntimeException -T6558548.java:151:9: compiler.warn.unreachable.catch.1: java.lang.InterruptedException,java.lang.RuntimeException -T6558548.java:159:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:160:9: compiler.warn.unreachable.catch: java.lang.RuntimeException T6558548.java:168:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:169:9: compiler.warn.unreachable.catch: java.lang.RuntimeException -T6558548.java:185:9: compiler.warn.unreachable.catch: java.lang.RuntimeException -T6558548.java:193:9: compiler.warn.unreachable.catch: java.lang.RuntimeException -T6558548.java:211:9: compiler.warn.unreachable.catch.1: java.lang.RuntimeException,java.lang.Error -T6558548.java:220:9: compiler.warn.unreachable.catch.1: java.lang.RuntimeException,java.lang.Error -T6558548.java:230:9: compiler.warn.unreachable.catch.1: java.lang.InterruptedException,java.lang.RuntimeException,java.lang.Error -T6558548.java:239:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:240:9: compiler.warn.unreachable.catch.1: java.lang.RuntimeException,java.lang.Error -T6558548.java:249:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:250:9: compiler.warn.unreachable.catch.1: java.lang.RuntimeException,java.lang.Error -T6558548.java:268:9: compiler.warn.unreachable.catch.1: java.lang.RuntimeException,java.lang.Error -T6558548.java:277:9: compiler.warn.unreachable.catch.1: java.lang.RuntimeException,java.lang.Error -T6558548.java:291:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException -T6558548.java:298:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:177:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:248:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:258:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:300:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException +T6558548.java:307:9: compiler.err.except.never.thrown.in.try: java.lang.InterruptedException 6 errors -15 warnings +1 warning
--- a/test/tools/javac/ClassPathTest/ClassPathTest.sh Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/ClassPathTest/ClassPathTest.sh Thu Jun 02 19:00:16 2011 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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
--- a/test/tools/javac/ExtDirs/ExtDirs.sh Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/ExtDirs/ExtDirs.sh Thu Jun 02 19:00:16 2011 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2011, 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
--- a/test/tools/javac/Paths/Help.sh Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/Paths/Help.sh Thu Jun 02 19:00:16 2011 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/T7040104.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2011, 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 7040104 + * @summary javac NPE on Object a[]; Object o = (a=null)[0]; + */ + +public class T7040104 { + public static void main(String[] args) { + T7040104 t = new T7040104(); + t.test1(); + t.test2(); + t.test3(); + if (t.npeCount != 3) { + throw new AssertionError(); + } + } + + int npeCount = 0; + + void test1() { + Object a[]; + try { + Object o = (a = null)[0]; + } + catch (NullPointerException npe) { + npeCount++; + } + } + + void test2() { + Object a[][]; + try { + Object o = (a = null)[0][0]; + } + catch (NullPointerException npe) { + npeCount++; + } + } + + void test3() { + Object a[][][]; + try { + Object o = (a = null)[0][0][0]; + } + catch (NullPointerException npe) { + npeCount++; + } + } +}
--- a/test/tools/javac/TryWithResources/DuplicateResource.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/TryWithResources/DuplicateResource.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/TryWithResources/InterruptedExceptionTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,234 @@ +/* + * Copyright (c) 2011, 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 7027157 + * @summary Project Coin: javac warnings for AutoCloseable.close throwing InterruptedException + */ + +import com.sun.source.util.JavacTask; +import java.net.URI; +import java.util.Arrays; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +public class InterruptedExceptionTest { + + enum XlintOption { + NONE("none"), + TRY("try"); + + String opt; + + XlintOption(String opt) { + this.opt = opt; + } + + String getXlintOption() { + return "-Xlint:" + opt; + } + } + + enum SuppressLevel { + NONE, + SUPPRESS; + + String getSuppressAnno() { + return this == SUPPRESS ? + "@SuppressWarnings(\"try\")" : + ""; + } + } + + enum ClassKind { + ABSTRACT_CLASS("abstract class", "implements", false), + CLASS("class", "implements", true), + INTERFACE("interface", "extends", false); + + String kindName; + String extendsClause; + boolean hasBody; + + private ClassKind(String kindName, String extendsClause, boolean hasBody) { + this.kindName = kindName; + this.extendsClause = extendsClause; + this.hasBody = hasBody; + } + + String getBody() { + return hasBody ? "{}" : ";"; + } + } + + enum ExceptionKind { + NONE("", false), + EXCEPTION("Exception", true), + INTERRUPTED_EXCEPTION("InterruptedException", true), + ILLEGAL_ARGUMENT_EXCEPTION("IllegalArgumentException", false), + X("X", false); + + String exName; + boolean shouldWarn; + + private ExceptionKind(String exName, boolean shouldWarn) { + this.exName = exName; + this.shouldWarn = shouldWarn; + } + + String getThrowsClause() { + return this == NONE ? "" : "throws " + exName; + } + + String getTypeArguments(ExceptionKind decl) { + return (decl != X || this == NONE) ? "" : "<" + exName + ">"; + } + + String getTypeParameter() { + return this == X ? "<X extends Exception>" : ""; + } + } + + public static void main(String... args) throws Exception { + + //create default shared JavaCompiler - reused across multiple compilations + JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null); + + for (XlintOption xlint : XlintOption.values()) { + for (SuppressLevel suppress_decl : SuppressLevel.values()) { + for (SuppressLevel suppress_use : SuppressLevel.values()) { + for (ClassKind ck : ClassKind.values()) { + for (ExceptionKind ek_decl : ExceptionKind.values()) { + for (ExceptionKind ek_use : ExceptionKind.values()) { + new InterruptedExceptionTest(xlint, suppress_decl, + suppress_use, ck, ek_decl, ek_use).run(comp, fm); + } + } + } + } + } + } + } + + XlintOption xlint; + SuppressLevel suppress_decl; + SuppressLevel suppress_use; + ClassKind ck; + ExceptionKind ek_decl; + ExceptionKind ek_use; + JavaSource source; + DiagnosticChecker diagChecker; + + InterruptedExceptionTest(XlintOption xlint, SuppressLevel suppress_decl, SuppressLevel suppress_use, + ClassKind ck, ExceptionKind ek_decl, ExceptionKind ek_use) { + this.xlint = xlint; + this.suppress_decl = suppress_decl; + this.suppress_use = suppress_use; + this.ck = ck; + this.ek_decl = ek_decl; + this.ek_use = ek_use; + this.source = new JavaSource(); + this.diagChecker = new DiagnosticChecker(); + } + + class JavaSource extends SimpleJavaFileObject { + + String template = "#S1 #CK Resource#G #EC AutoCloseable {\n" + + "public void close() #TK #BK\n" + + "}\n" + + "class Test {\n" + + "#S2 <X> void test() {\n" + + "try (Resource#PK r = null) { }\n" + + "}\n" + + "}\n"; + + String source; + + public JavaSource() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = template.replace("#S1", suppress_decl.getSuppressAnno()) + .replace("#S2", suppress_use.getSuppressAnno()) + .replace("#CK", ck.kindName) + .replace("#EC", ck.extendsClause) + .replace("#G", ek_decl.getTypeParameter()) + .replace("#TK", ek_decl.getThrowsClause()) + .replace("#BK", ck.getBody()) + .replace("#PK", ek_use.getTypeArguments(ek_decl)); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { + JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, + Arrays.asList(xlint.getXlintOption()), null, Arrays.asList(source)); + ct.analyze(); + check(); + } + + void check() { + + boolean shouldWarnDecl = ek_decl.shouldWarn && + xlint == XlintOption.TRY && + suppress_decl != SuppressLevel.SUPPRESS; + + boolean shouldWarnUse = (ek_decl.shouldWarn || + ((ek_use.shouldWarn || ek_use == ExceptionKind.NONE) && ek_decl == ExceptionKind.X)) && + xlint == XlintOption.TRY && + suppress_use != SuppressLevel.SUPPRESS; + + int foundWarnings = 0; + + if (shouldWarnDecl) foundWarnings++; + if (shouldWarnUse) foundWarnings++; + + if (foundWarnings != diagChecker.tryWarnFound) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nOptions: " + xlint.getXlintOption() + + "\nFound warnings: " + diagChecker.tryWarnFound + + "\nExpected decl warning: " + shouldWarnDecl + + "\nExpected use warning: " + shouldWarnUse); + } + } + + static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> { + + int tryWarnFound; + + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.WARNING && + diagnostic.getCode().contains("try.resource.throws.interrupted.exc")) { + tryWarnFound++; + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/TryWithResources/T7032633.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2011, 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 7032633 + * @summary javac -Xlint:all warns about flush() within try on an auto-closeable resource + * @compile -Xlint:try -Werror T7032633.java + */ + +import java.io.IOException; +import java.io.OutputStream; + +public class T7032633 { + void test() throws IOException { + try (OutputStream out = System.out) { + out.flush(); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/annotations/6550655/T6550655.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2011, 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 6550655 + * @summary javac crashes when compiling against an annotated class + */ + +import java.io.File; +import java.net.URI; +import java.util.Arrays; + +import javax.tools.Diagnostic; +import javax.tools.DiagnosticListener; +import javax.tools.JavaCompiler; +import javax.tools.JavaCompiler.CompilationTask; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +public class T6550655 { + + JavaCompiler javacTool; + File testDir; + TestKind testKind; + EnumActionKind actionKind; + + String testSource = "enum E { NORTH, SOUTH, WEST, EAST; }\n" + + "@I(val = E.NORTH)class A {}\n" + + "@interface I { E val(); }"; + + T6550655(JavaCompiler javacTool, File testDir, TestKind testKind, EnumActionKind actionKind) { + this.javacTool = javacTool; + this.testDir = testDir; + this.testKind = testKind; + this.actionKind = actionKind; + } + + void test() { + testDir.mkdirs(); + compile(null, new JavaSource("Test.java", testSource)); + actionKind.doAction(this); + compile(new DiagnosticChecker(), testKind.source); + } + + void compile(DiagnosticChecker dc, JavaSource... sources) { + try { + CompilationTask ct = javacTool.getTask(null, null, dc, + Arrays.asList("-d", testDir.getAbsolutePath(), "-cp", testDir.getAbsolutePath()), + null, Arrays.asList(sources)); + ct.call(); + } + catch (Exception e) { + error("Internal compilation error"); + } + } + + void replaceEnum(String newSource) { + compile(null, new JavaSource("Replace.java", newSource)); + }; + + void removeEnum() { + File enumClass = new File(testDir, "E.class"); + if (!enumClass.exists()) { + error("Expected file E.class does not exists in folder " + testDir); + } + enumClass.delete(); + }; + + void error(String msg) { + System.err.println(msg); + nerrors++; + } + + class DiagnosticChecker implements DiagnosticListener<JavaFileObject> { + + String[][] expectedKeys = new String[][] { + // DIRECT, INDIRECT + {/*REPLACE1*/ "compiler.err.cant.resolve.location" , "compiler.warn.unknown.enum.constant" }, + {/*REPLACE2*/ "compiler.err.cant.resolve.location.args", "compiler.warn.annotation.method.not.found" }, + {/*REMOVE*/ "compiler.err.cant.resolve" , "compiler.warn.unknown.enum.constant.reason" } }; + + String keyToIgnore = "compiler.err.attribute.value.must.be.constant"; + + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + String expectedCode = expectedKeys[actionKind.ordinal()][testKind.ordinal()]; + if (!diagnostic.getCode().equals(keyToIgnore) && + !diagnostic.getCode().equals(expectedCode)) { + error("Unexpected diagnostic" + + "\nfound " + diagnostic.getCode() + + "\nexpected " + expectedCode + + "\ntestKind " + testKind + + "\nactionKind " + actionKind); + } + } + } + + //global declarations + + enum EnumActionKind { + REPLACE1("enum E { SOUTH, WEST, EAST; }") { + @Override + void doAction(T6550655 test) { + test.replaceEnum(optionalSource); + } + }, + REPLACE2("@interface I { E valNew() default E.EAST; }") { + @Override + void doAction(T6550655 test) { + test.replaceEnum(optionalSource); + } + }, + REMOVE(null) { + @Override + void doAction(T6550655 test) { test.removeEnum(); } + }; + + String optionalSource; + + private EnumActionKind(String optionalSource) { + this.optionalSource = optionalSource; + } + + abstract void doAction(T6550655 test); + } + + enum TestKind { + DIRECT("@I(val = E.NORTH)class C1 {}"), + INDIRECT("class C2 { A a; }"); + + JavaSource source; + + private TestKind(final String code) { + this.source = new JavaSource("Test.java", code); + } + } + + public static void main(String[] args) throws Exception { + String SCRATCH_DIR = System.getProperty("user.dir"); + JavaCompiler javacTool = ToolProvider.getSystemJavaCompiler(); + int n = 0; + for (TestKind testKind : TestKind.values()) { + for (EnumActionKind actionKind : EnumActionKind.values()) { + File testDir = new File(SCRATCH_DIR, "test"+n); + new T6550655(javacTool, testDir, testKind, actionKind).test(); + n++; + } + } + if (nerrors > 0) { + throw new AssertionError("Some errors have been detected"); + } + } + + static class JavaSource extends SimpleJavaFileObject { + + String source; + + public JavaSource(String filename, String source) { + super(URI.create("myfo:/" + filename), JavaFileObject.Kind.SOURCE); + this.source = source; + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + static int nerrors = 0; +}
--- a/test/tools/javac/api/6411310/Test.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/api/6411310/Test.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/api/T6437138.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2011, 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 6437138 + * @summary JSR 199: Compiler doesn't diagnose crash in user code + */ + +import java.net.URI; +import java.util.Arrays; +import javax.tools.*; +import static javax.tools.JavaFileObject.Kind.*; + + +public class T6437138 { + static class JFO extends SimpleJavaFileObject { + public JFO(URI uri, JavaFileObject.Kind kind) { + super(uri, kind); + } + // getCharContent not impl, will throw UnsupportedOperationException + } + + public static void main(String... arg) throws Exception { + try { + JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); + JavaFileObject jfo = new JFO(new URI("JFOTest04.java"),SOURCE); + JavaCompiler.CompilationTask ct = javac.getTask(null,null,null,null, + null, Arrays.asList(jfo)); + ct.call(); + throw new Exception("no exception thrown by JavaCompiler.CompilationTask"); + } catch (RuntimeException e) { + if (e.getCause() instanceof UnsupportedOperationException) { + System.err.println("RuntimeException(UnsupportedOperationException) caught as expected"); + return; + } + throw new Exception("unexpected exception caught", e); + } + } +} +
--- a/test/tools/javac/api/T6838467.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/api/T6838467.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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
--- a/test/tools/javac/api/T6877206.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/api/T6877206.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/api/TestClientCodeWrapper.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,604 @@ +/* + * Copyright (c) 2011, 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 6437138 6482554 + * @summary JSR 199: Compiler doesn't diagnose crash in user code + * @library ../lib + * @build JavacTestingAbstractProcessor TestClientCodeWrapper + * @run main TestClientCodeWrapper + */ + +import java.io.*; +import java.lang.reflect.Method; +import java.net.URI; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; +import javax.tools.*; +import com.sun.source.util.*; +import com.sun.tools.javac.api.*; +import javax.tools.JavaFileObject.Kind; + +public class TestClientCodeWrapper extends JavacTestingAbstractProcessor { + public static void main(String... args) throws Exception { + new TestClientCodeWrapper().run(); + } + + /** + * Run a series of compilations, each with a different user-provided object + * configured to throw an exception when a specific method is invoked. + * Then, verify the exception is thrown as expected. + * + * Some methods are not invoked from the compiler, and are excluded from the test. + */ + void run() throws Exception { + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + defaultFileManager = compiler.getStandardFileManager(null, null, null); + + for (Method m: getMethodsExcept(JavaFileManager.class, "close", "getJavaFileForInput")) { + test(m); + } + + for (Method m: getMethodsExcept(FileObject.class, "delete")) { + test(m); + } + + for (Method m: getMethods(JavaFileObject.class)) { + test(m); + } + + for (Method m: getMethodsExcept(Processor.class, "getCompletions")) { + test(m); + } + + for (Method m: DiagnosticListener.class.getDeclaredMethods()) { + test(m); + } + + for (Method m: TaskListener.class.getDeclaredMethods()) { + test(m); + } + + if (errors > 0) + throw new Exception(errors + " errors occurred"); + } + + /** Get a sorted set of the methods declared on a class. */ + Set<Method> getMethods(Class<?> clazz) { + return getMethodsExcept(clazz, new String[0]); + } + + /** Get a sorted set of the methods declared on a class, excluding + * specified methods by name. */ + Set<Method> getMethodsExcept(Class<?> clazz, String... exclude) { + Set<Method> methods = new TreeSet<Method>(new Comparator<Method>() { + public int compare(Method m1, Method m2) { + return m1.toString().compareTo(m2.toString()); + } + }); + Set<String> e = new HashSet<String>(Arrays.asList(exclude)); + for (Method m: clazz.getDeclaredMethods()) { + if (!e.contains(m.getName())) + methods.add(m); + } + return methods; + } + + /** + * Test a method in a user supplied component, to verify javac's handling + * of any exceptions thrown by that method. + */ + void test(Method m) throws Exception { + testNum++; + + File extDirs = new File("empty-extdirs"); + extDirs.mkdirs(); + + File testClasses = new File("test" + testNum); + testClasses.mkdirs(); + defaultFileManager.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(testClasses)); + + System.err.println("test " + testNum + ": " + + m.getDeclaringClass().getSimpleName() + "." + m.getName()); + + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + + List<String> javacOptions = Arrays.asList( + "-extdirs", extDirs.getPath(), // for use by filemanager handleOption + "-processor", TestClientCodeWrapper.class.getName() + ); + + List<String> classes = Collections.emptyList(); + + JavacTool tool = JavacTool.create(); + try { + JavacTask task = tool.getTask(pw, + getFileManager(m, defaultFileManager), + getDiagnosticListener(m, pw), + javacOptions, + classes, + getCompilationUnits(m)); + + if (isDeclaredIn(m, Processor.class)) + task.setProcessors(getProcessors(m)); + + if (isDeclaredIn(m, TaskListener.class)) + task.setTaskListener(getTaskListener(m, pw)); + + boolean ok = task.call(); + error("compilation " + (ok ? "succeeded" : "failed") + " unexpectedly"); + } catch (RuntimeException e) { + System.err.println("caught " + e); + if (e.getClass() == RuntimeException.class) { + Throwable cause = e.getCause(); + if (cause instanceof UserError) { + String expect = m.getName(); + String found = cause.getMessage(); + checkEqual("exception messaqe", expect, found); + } else { + cause.printStackTrace(System.err); + error("Unexpected exception: " + cause); + } + } else { + e.printStackTrace(System.err); + error("Unexpected exception: " + e); + } + } + + pw.close(); + String out = sw.toString(); + System.err.println(out); + } + + /** Get a file manager to use for the test compilation. */ + JavaFileManager getFileManager(Method m, JavaFileManager defaultFileManager) { + return isDeclaredIn(m, JavaFileManager.class, FileObject.class, JavaFileObject.class) + ? new UserFileManager(m, defaultFileManager) + : defaultFileManager; + } + + /** Get a diagnostic listener to use for the test compilation. */ + DiagnosticListener<JavaFileObject> getDiagnosticListener(Method m, PrintWriter out) { + return isDeclaredIn(m, DiagnosticListener.class) + ? new UserDiagnosticListener(m, out) + : null; + } + + /** Get a set of file objects to use for the test compilation. */ + Iterable<? extends JavaFileObject> getCompilationUnits(Method m) { + File testSrc = new File(System.getProperty("test.src")); + File thisSrc = new File(testSrc, TestClientCodeWrapper.class.getName() + ".java"); + Iterable<? extends JavaFileObject> files = defaultFileManager.getJavaFileObjects(thisSrc); + if (isDeclaredIn(m, FileObject.class, JavaFileObject.class)) + return Arrays.asList(new UserFileObject(m, files.iterator().next())); + else + return files; + } + + /** Get a set of annotation processors to use for the test compilation. */ + Iterable<? extends Processor> getProcessors(Method m) { + return Arrays.asList(new UserProcessor(m)); + } + + /** Get a task listener to use for the test compilation. */ + TaskListener getTaskListener(Method m, PrintWriter out) { + return new UserTaskListener(m, out); + } + + /** Check if two values are .equal, and report an error if not. */ + <T> void checkEqual(String label, T expect, T found) { + if (!expect.equals(found)) + error("Unexpected value for " + label + ": " + found + "; expected: " + expect); + } + + /** Report an error. */ + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + /** Check if a method is declared in any of a set of classes */ + static boolean isDeclaredIn(Method m, Class<?>... classes) { + Class<?> dc = m.getDeclaringClass(); + for (Class<?> c: classes) { + if (c == dc) return true; + } + return false; + } + + /** Throw an intentional error if the method has a given name. */ + static void throwUserExceptionIfNeeded(Method m, String name) { + if (m != null && m.getName().equals(name)) + throw new UserError(name); + } + + StandardJavaFileManager defaultFileManager; + int testNum; + int errors; + + //-------------------------------------------------------------------------- + + /** + * Processor used to trigger use of methods not normally used by javac. + */ + @Override + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { + boolean firstRound = false; + for (Element e: roundEnv.getRootElements()) { + if (e.getSimpleName().contentEquals(TestClientCodeWrapper.class.getSimpleName())) + firstRound = true; + } + if (firstRound) { + try { + FileObject f1 = filer.getResource(StandardLocation.CLASS_PATH, "", + TestClientCodeWrapper.class.getName() + ".java"); + f1.openInputStream().close(); + f1.openReader(false).close(); + + FileObject f2 = filer.createResource( + StandardLocation.CLASS_OUTPUT, "", "f2.txt", (Element[]) null); + f2.openOutputStream().close(); + + FileObject f3 = filer.createResource( + StandardLocation.CLASS_OUTPUT, "", "f3.txt", (Element[]) null); + f3.openWriter().close(); + + JavaFileObject f4 = filer.createSourceFile("f4", (Element[]) null); + f4.openWriter().close(); + f4.getNestingKind(); + f4.getAccessLevel(); + + messager.printMessage(Diagnostic.Kind.NOTE, "informational note", + roundEnv.getRootElements().iterator().next()); + + } catch (IOException e) { + throw new UserError(e); + } + } + return true; + } + + //-------------------------------------------------------------------------- + + // <editor-fold defaultstate="collapsed" desc="User classes"> + + static class UserError extends Error { + private static final long serialVersionUID = 1L; + UserError(String msg) { + super(msg); + } + UserError(Throwable t) { + super(t); + } + } + + static class UserFileManager extends ForwardingJavaFileManager<JavaFileManager> { + Method fileManagerMethod; + Method fileObjectMethod; + + UserFileManager(Method m, JavaFileManager delegate) { + super(delegate); + if (isDeclaredIn(m, JavaFileManager.class)) { + fileManagerMethod = m; + } else if (isDeclaredIn(m, FileObject.class, JavaFileObject.class)) { + fileObjectMethod = m; + } else + assert false; + } + + @Override + public ClassLoader getClassLoader(Location location) { + throwUserExceptionIfNeeded(fileManagerMethod, "getClassLoader"); + return super.getClassLoader(location); + } + + @Override + public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "list"); + return wrap(super.list(location, packageName, kinds, recurse)); + } + + @Override + public String inferBinaryName(Location location, JavaFileObject file) { + throwUserExceptionIfNeeded(fileManagerMethod, "inferBinaryName"); + return super.inferBinaryName(location, unwrap(file)); + } + + @Override + public boolean isSameFile(FileObject a, FileObject b) { + throwUserExceptionIfNeeded(fileManagerMethod, "isSameFile"); + return super.isSameFile(unwrap(a), unwrap(b)); + } + + @Override + public boolean handleOption(String current, Iterator<String> remaining) { + throwUserExceptionIfNeeded(fileManagerMethod, "handleOption"); + return super.handleOption(current, remaining); + } + + @Override + public boolean hasLocation(Location location) { + throwUserExceptionIfNeeded(fileManagerMethod, "hasLocation"); + return super.hasLocation(location); + } + + @Override + public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "getJavaFileForInput"); + return wrap(super.getJavaFileForInput(location, className, kind)); + } + + @Override + public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "getJavaFileForOutput"); + return wrap(super.getJavaFileForOutput(location, className, kind, sibling)); + } + + @Override + public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "getFileForInput"); + return wrap(super.getFileForInput(location, packageName, relativeName)); + } + + @Override + public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "getFileForOutput"); + return wrap(super.getFileForOutput(location, packageName, relativeName, sibling)); + } + + @Override + public void flush() throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "flush"); + super.flush(); + } + + @Override + public void close() throws IOException { + throwUserExceptionIfNeeded(fileManagerMethod, "close"); + super.close(); + } + + @Override + public int isSupportedOption(String option) { + throwUserExceptionIfNeeded(fileManagerMethod, "isSupportedOption"); + return super.isSupportedOption(option); + } + + public FileObject wrap(FileObject fo) { + if (fileObjectMethod == null) + return fo; + return new UserFileObject(fileObjectMethod, (JavaFileObject)fo); + } + + FileObject unwrap(FileObject fo) { + if (fo instanceof UserFileObject) + return ((UserFileObject) fo).unwrap(); + else + return fo; + } + + public JavaFileObject wrap(JavaFileObject fo) { + if (fileObjectMethod == null) + return fo; + return new UserFileObject(fileObjectMethod, fo); + } + + public Iterable<JavaFileObject> wrap(Iterable<? extends JavaFileObject> list) { + List<JavaFileObject> wrapped = new ArrayList<JavaFileObject>(); + for (JavaFileObject fo : list) + wrapped.add(wrap(fo)); + return Collections.unmodifiableList(wrapped); + } + + JavaFileObject unwrap(JavaFileObject fo) { + if (fo instanceof UserFileObject) + return ((UserFileObject) fo).unwrap(); + else + return fo; + } + } + + static class UserFileObject extends ForwardingJavaFileObject<JavaFileObject> { + Method method; + + UserFileObject(Method m, JavaFileObject delegate) { + super(delegate); + assert isDeclaredIn(m, FileObject.class, JavaFileObject.class); + this.method = m; + } + + JavaFileObject unwrap() { + return fileObject; + } + + @Override + public Kind getKind() { + throwUserExceptionIfNeeded(method, "getKind"); + return super.getKind(); + } + + @Override + public boolean isNameCompatible(String simpleName, Kind kind) { + throwUserExceptionIfNeeded(method, "isNameCompatible"); + return super.isNameCompatible(simpleName, kind); + } + + @Override + public NestingKind getNestingKind() { + throwUserExceptionIfNeeded(method, "getNestingKind"); + return super.getNestingKind(); + } + + @Override + public Modifier getAccessLevel() { + throwUserExceptionIfNeeded(method, "getAccessLevel"); + return super.getAccessLevel(); + } + + @Override + public URI toUri() { + throwUserExceptionIfNeeded(method, "toUri"); + return super.toUri(); + } + + @Override + public String getName() { + throwUserExceptionIfNeeded(method, "getName"); + return super.getName(); + } + + @Override + public InputStream openInputStream() throws IOException { + throwUserExceptionIfNeeded(method, "openInputStream"); + return super.openInputStream(); + } + + @Override + public OutputStream openOutputStream() throws IOException { + throwUserExceptionIfNeeded(method, "openOutputStream"); + return super.openOutputStream(); + } + + @Override + public Reader openReader(boolean ignoreEncodingErrors) throws IOException { + throwUserExceptionIfNeeded(method, "openReader"); + return super.openReader(ignoreEncodingErrors); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { + throwUserExceptionIfNeeded(method, "getCharContent"); + return super.getCharContent(ignoreEncodingErrors); + } + + @Override + public Writer openWriter() throws IOException { + throwUserExceptionIfNeeded(method, "openWriter"); + return super.openWriter(); + } + + @Override + public long getLastModified() { + throwUserExceptionIfNeeded(method, "getLastModified"); + return super.getLastModified(); + } + + @Override + public boolean delete() { + throwUserExceptionIfNeeded(method, "delete"); + return super.delete(); + } + + } + + static class UserProcessor extends JavacTestingAbstractProcessor { + Method method; + + UserProcessor(Method m) { + assert isDeclaredIn(m, Processor.class); + method = m; + } + + @Override + public Set<String> getSupportedOptions() { + throwUserExceptionIfNeeded(method, "getSupportedOptions"); + return super.getSupportedOptions(); + } + + @Override + public Set<String> getSupportedAnnotationTypes() { + throwUserExceptionIfNeeded(method, "getSupportedAnnotationTypes"); + return super.getSupportedAnnotationTypes(); + } + + @Override + public SourceVersion getSupportedSourceVersion() { + throwUserExceptionIfNeeded(method, "getSupportedSourceVersion"); + return super.getSupportedSourceVersion(); + } + + @Override + public void init(ProcessingEnvironment processingEnv) { + throwUserExceptionIfNeeded(method, "init"); + super.init(processingEnv); + } + + @Override + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { + throwUserExceptionIfNeeded(method, "process"); + return true; + } + + @Override + public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) { + throwUserExceptionIfNeeded(method, "getCompletions"); + return super.getCompletions(element, annotation, member, userText); + } + } + + static class UserDiagnosticListener implements DiagnosticListener<JavaFileObject> { + Method method; + PrintWriter out; + + UserDiagnosticListener(Method m, PrintWriter out) { + assert isDeclaredIn(m, DiagnosticListener.class); + this.method = m; + this.out = out; + } + + @Override + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + throwUserExceptionIfNeeded(method, "report"); + out.println("report: " + diagnostic); + } + } + + static class UserTaskListener implements TaskListener { + Method method; + PrintWriter out; + + UserTaskListener(Method m, PrintWriter out) { + assert isDeclaredIn(m, TaskListener.class); + this.method = m; + this.out = out; + } + + @Override + public void started(TaskEvent e) { + throwUserExceptionIfNeeded(method, "started"); + out.println("started: " + e); + } + + @Override + public void finished(TaskEvent e) { + throwUserExceptionIfNeeded(method, "finished"); + out.println("finished: " + e); + } + } + + // </editor-fold> +}
--- a/test/tools/javac/api/TestJavacTask_Lock.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/api/TestJavacTask_Lock.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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
--- a/test/tools/javac/api/TestJavacTask_Multiple.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/api/TestJavacTask_Multiple.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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
--- a/test/tools/javac/api/TestJavacTask_ParseAttrGen.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/api/TestJavacTask_ParseAttrGen.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/classreader/T7031108.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2011, 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 7031108 + * @summary NPE in javac.jvm.ClassReader.findMethod in PackageElement.enclosedElements from AP in incr build + * @library ../lib + * @build JavacTestingAbstractProcessor T7031108 + * @run main T7031108 + */ + +import java.io.*; +import java.net.*; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.element.*; +import javax.tools.*; +import javax.tools.JavaCompiler.CompilationTask; + +public class T7031108 extends JavacTestingAbstractProcessor { + public static void main(String... args) throws Exception { + new T7031108().run(); + } + + /* Class containing a local class definition; + * compiled class file will have an EnclosedMethod attribute. + */ + static final JavaSource pC = + new JavaSource("p/C.java", + "package p;\n" + + "class C {\n" + + " void m() {\n" + + " new Runnable() {\n" + + " public void run() {\n" + + " new Runnable() {\n" + + " public void run() { }\n" + + " };\n" + + " }\n" + + " };\n" + + " }\n" + + "}"); + + /* Dummy source file to compile while running anno processor. */ + static final JavaSource dummy = + new JavaSource("Dummy.java", + "class Dummy { }"); + + void run() throws Exception { + JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null); + + // step 1: compile test classes + File cwd = new File("."); + fm.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(cwd)); + compile(comp, fm, null, null, pC); + + // step 2: verify functioning of processor + fm.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, + fm.getLocation(StandardLocation.CLASS_PATH)); + fm.setLocation(StandardLocation.CLASS_PATH, Arrays.asList(cwd)); + compile(comp, fm, null, getClass().getName(), dummy); + + File pC_class = new File(new File("p"), "C.class"); + pC_class.delete(); + + DiagnosticCollector<JavaFileObject> dc = new DiagnosticCollector<JavaFileObject>(); + compile(comp, fm, dc, getClass().getName(), dummy); + List<Diagnostic<? extends JavaFileObject>> diags =dc.getDiagnostics(); + + System.err.println(diags); + switch (diags.size()) { + case 0: + throw new Exception("no diagnostics received"); + case 1: + String code = diags.get(0).getCode(); + String expect = "compiler.err.proc.cant.access.1"; + if (!expect.equals(code)) + throw new Exception("unexpected diag code: " + code + + ", expected: " + expect); + break; + default: + throw new Exception("unexpected diags received"); + } + } + + void compile(JavaCompiler comp, JavaFileManager fm, + DiagnosticListener<JavaFileObject> dl, + String processor, JavaFileObject... files) throws Exception { + System.err.println("compile processor:" + processor + ", files:" + Arrays.asList(files)); + List<String> opts = new ArrayList<String>(); + if (processor != null) { + // opts.add("-verbose"); + opts.addAll(Arrays.asList("-processor", processor)); + } + CompilationTask task = comp.getTask(null, fm, dl, opts, null, Arrays.asList(files)); + boolean ok = task.call(); + if (dl == null && !ok) + throw new Exception("compilation failed"); + } + + static class JavaSource extends SimpleJavaFileObject { + JavaSource(String name, String text) { + super(URI.create("js://" + name), JavaFileObject.Kind.SOURCE); + this.text = text; + } + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return text; + } + final String text; + } + + // annotation processor method + + @Override + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) { + PackageElement p = elements.getPackageElement("p"); + List<? extends Element> elems = p.getEnclosedElements(); + System.err.println("contents of package p: " + elems); + if (elems.size() != 1 || !elems.get(0).getSimpleName().contentEquals("C")) { + messager.printMessage(Diagnostic.Kind.ERROR, "unexpected package contents"); + } + } + return true; + } +} +
--- a/test/tools/javac/diags/CheckResourceKeys.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/diags/CheckResourceKeys.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/diags/examples.not-yet.txt Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/diags/examples.not-yet.txt Thu Jun 02 19:00:16 2011 +0100 @@ -27,6 +27,7 @@ compiler.err.prob.found.req.1 # Check: DEAD, in unused method compiler.err.proc.bad.config.file # JavacProcessingEnvironment compiler.err.proc.cant.access # completion failure +compiler.err.proc.cant.access.1 # completion failure, no stack trace compiler.err.proc.cant.create.loader # security exception from service loader compiler.err.proc.no.service # JavacProcessingEnvironment: no service loader available compiler.err.proc.processor.bad.option.name # cannot happen? masked by javac.err.invalid.A.key @@ -40,7 +41,6 @@ compiler.err.type.var.more.than.once.in.result # UNUSED compiler.err.undetermined.type compiler.err.unexpected.type -compiler.err.unknown.enum.constant # in bad class file compiler.err.unsupported.cross.fp.lit # Scanner: host system dependent compiler.err.wrong.target.for.polymorphic.signature.definition # Transitional 292 compiler.misc.assignment.from.super-bound @@ -49,6 +49,7 @@ compiler.misc.bad.class.signature # bad class file compiler.misc.bad.const.pool.tag # bad class file compiler.misc.bad.const.pool.tag.at # bad class file +compiler.misc.bad.enclosing.class # bad class file compiler.misc.bad.enclosing.method # bad class file compiler.misc.bad.runtime.invisible.param.annotations # bad class file compiler.misc.bad.signature # bad class file @@ -110,3 +111,5 @@ compiler.warn.unchecked.assign # DEAD, replaced by compiler.misc.unchecked.assign compiler.warn.unchecked.cast.to.type # DEAD, replaced by compiler.misc.unchecked.cast.to.type compiler.warn.unexpected.archive.file # Paths: zip file with unknown extn +compiler.warn.unknown.enum.constant # in bad class file +compiler.warn.unknown.enum.constant.reason # in bad class file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/diags/examples/DiamondAndExplicitParams.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2011, 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. + */ + +// key: compiler.misc.diamond.and.explicit.params +// key: compiler.err.cant.apply.diamond.1 + +class DiamondAndAnonClass { + static class Foo<X> { + <Z> Foo() {} + } + void m() { + Foo<String> foo = new <Integer> Foo<>(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/diags/examples/MulticatchTypesMustBeDisjoint.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2011, 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. + */ + +// key: compiler.err.multicatch.types.must.be.disjoint + +class MulticatchTypesMustBeDisjoint { + class E1 extends Exception { } + class E2 extends E1 { } + + void e1() throws E1 { } + void e2() throws E2 { } + + void m() { + try { + e1(); + e2(); + } catch (E1 | E2 e) { } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/diags/examples/TryResourceThrowsInterruptedExc.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2011, 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. + */ + +// key: compiler.warn.try.resource.throws.interrupted.exc +// options: -Xlint:try + +class TryResourceThrowsInterruptedException implements AutoCloseable { + public void close() throws InterruptedException {} +}
--- a/test/tools/javac/diags/examples/UnreachableCatch1.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/diags/examples/UnreachableCatch1.java Thu Jun 02 19:00:16 2011 +0100 @@ -23,14 +23,21 @@ // key: compiler.warn.unreachable.catch.1 +import java.io.*; + class UnreachableCatch1 { void test() { try { - throw new IllegalArgumentException(); + if (true) { + throw new FileNotFoundException(); + } + else { + throw new EOFException(); + } } - catch(Error err) { } - catch(RuntimeException rex) { } - catch(Throwable t) { } //unreachable + catch(FileNotFoundException fnf) { } + catch(EOFException eof) { } + catch(IOException ex) { } //unreachable } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034019/T7034019a.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2011, 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 7034019 + * @summary ClassCastException in javac with conjunction types + * + * @compile T7034019a.java + */ + +class T7034019a { + interface A { + abstract <T> void foo(); + } + + interface B { + abstract void foo(); + } + + static class C<T extends A & B> { + void test(T x) { + x.foo(); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034019/T7034019b.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2011, 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 7034019 + * @summary ClassCastException in javac with conjunction types + * + * @compile T7034019b.java + */ + +class T7034019a { + interface A { + <T> void foo(); + } + + interface B { + void foo(); + } + + static abstract class E implements A,B { + void test() { + foo(); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034019/T7034019c.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,23 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7034019 + * @summary ClassCastException in javac with conjunction types + * + * @compile/fail/ref=T7034019c.out -XDrawDiagnostics T7034019c.java + */ + +class T7034019c { + interface A { + abstract <T extends Number> T foo(); + } + + interface B { + abstract <T> T foo(); + } + + static class C<T extends A & B> { + void test(T x) { + x.foo(); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034019/T7034019c.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,3 @@ +T7034019c.java:18:20: compiler.err.name.clash.same.erasure.no.override: <T>foo(), T7034019c.B, <T>foo(), T7034019c.A +T7034019c.java:20:14: compiler.err.ref.ambiguous: foo, kindname.method, <T>foo(), T7034019c.B, kindname.method, <T>foo(), T7034019c.A +2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034019/T7034019d.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,23 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7034019 + * @summary ClassCastException in javac with conjunction types + * + * @compile/fail/ref=T7034019d.out -XDrawDiagnostics T7034019d.java + */ + +class T7034019c { + interface A { + abstract <T extends Number> T foo(); + } + + interface B { + abstract <T> T foo(); + } + + static abstract class E implements A,B { + void test() { + foo(); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034019/T7034019d.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,3 @@ +T7034019d.java:18:21: compiler.err.name.clash.same.erasure.no.override: <T>foo(), T7034019c.B, <T>foo(), T7034019c.A +T7034019d.java:20:13: compiler.err.ref.ambiguous: foo, kindname.method, <T>foo(), T7034019c.B, kindname.method, <T>foo(), T7034019c.A +2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034511/T7034511a.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,22 @@ +/* + * @test /nodynamiccopyright/ + * @ignore backing out 7034511, see 7040883 + * @bug 7034511 7040883 + * @summary Loophole in typesafety + * @compile/fail/ref=T7034511a.out -XDrawDiagnostics T7034511a.java + */ + +class T7034511a { + + interface A<T> { + void foo(T x); + } + + interface B<T> extends A<T[]> { } + + static abstract class C implements B<Integer> { + <T extends B<?>> void test(T x, String[] ss) { + x.foo(ss); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034511/T7034511a.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,2 @@ +T7034511a.java:18:14: compiler.err.cant.apply.symbol.1: kindname.method, foo, compiler.misc.type.captureof: 1, ?[], java.lang.String[], kindname.interface, T7034511a.A<T>, (compiler.misc.no.conforming.assignment.exists: java.lang.String[], compiler.misc.type.captureof: 1, ?[]) +1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034511/T7034511b.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,17 @@ +/* + * @test /nodynamiccopyright/ + * @ignore backing out 7034511, see 7040883 + * @bug 7034511 7040883 + * @summary Loophole in typesafety + * @compile/fail/ref=T7034511b.out -XDrawDiagnostics T7034511b.java + */ + +class T7034511b { + static class MyList<E> { + E toArray(E[] e) { return null; } + } + + void test(MyList<?> ml, Object o[]) { + ml.toArray(o); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/7034511/T7034511b.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,2 @@ +T7034511b.java:14:11: compiler.err.cant.apply.symbol.1: kindname.method, toArray, compiler.misc.type.captureof: 1, ?[], java.lang.Object[], kindname.class, T7034511b.MyList<E>, (compiler.misc.no.conforming.assignment.exists: java.lang.Object[], compiler.misc.type.captureof: 1, ?[]) +1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/diamond/7030150/GenericConstructorAndDiamondTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2011, 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 7030150 7039931 + * @summary Type inference for generic instance creation failed for formal type parameter + */ + +import com.sun.source.util.JavacTask; +import java.net.URI; +import java.util.Arrays; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +public class GenericConstructorAndDiamondTest { + + enum BoundKind { + NO_BOUND(""), + STRING_BOUND("extends String"), + INTEGER_BOUND("extends Integer"); + + String boundStr; + + private BoundKind(String boundStr) { + this.boundStr = boundStr; + } + + boolean matches(TypeArgumentKind tak) { + switch (tak) { + case NONE: return true; + case STRING: return this != INTEGER_BOUND; + case INTEGER: return this != STRING_BOUND; + default: return false; + } + } + } + + enum ConstructorKind { + NON_GENERIC("Foo(Object o) {}"), + GENERIC_NO_BOUND("<T> Foo(T t) {}"), + GENERIC_STRING_BOUND("<T extends String> Foo(T t) {}"), + GENERIC_INTEGER_BOUND("<T extends Integer> Foo(T t) {}"); + + String constrStr; + + private ConstructorKind(String constrStr) { + this.constrStr = constrStr; + } + + boolean matches(ArgumentKind ak) { + switch (ak) { + case STRING: return this != GENERIC_INTEGER_BOUND; + case INTEGER: return this != GENERIC_STRING_BOUND; + default: return false; + } + } + } + + enum TypeArgArity { + ONE(1), + TWO(2), + THREE(3); + + int n; + + private TypeArgArity(int n) { + this.n = n; + } + } + + enum TypeArgumentKind { + NONE(""), + STRING("String"), + INTEGER("Integer"); + + String typeargStr; + + private TypeArgumentKind(String typeargStr) { + this.typeargStr = typeargStr; + } + + String getArgs(TypeArgArity arity) { + if (this == NONE) return ""; + else { + StringBuilder buf = new StringBuilder(); + String sep = ""; + for (int i = 0 ; i < arity.n ; i++) { + buf.append(sep); + buf.append(typeargStr); + sep = ","; + } + return "<" + buf.toString() + ">"; + } + } + + boolean matches(ArgumentKind ak) { + switch (ak) { + case STRING: return this != INTEGER; + case INTEGER: return this != STRING; + default: return false; + } + } + + boolean matches(TypeArgumentKind other) { + switch (other) { + case STRING: return this != INTEGER; + case INTEGER: return this != STRING; + default: return true; + } + } + } + + enum ArgumentKind { + STRING("\"\""), + INTEGER("1"); + + String argStr; + + private ArgumentKind(String argStr) { + this.argStr = argStr; + } + } + + public static void main(String... args) throws Exception { + + //create default shared JavaCompiler - reused across multiple compilations + JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null); + + for (BoundKind boundKind : BoundKind.values()) { + for (ConstructorKind constructorKind : ConstructorKind.values()) { + for (TypeArgumentKind declArgKind : TypeArgumentKind.values()) { + for (TypeArgArity arity : TypeArgArity.values()) { + for (TypeArgumentKind useArgKind : TypeArgumentKind.values()) { + for (TypeArgumentKind diamondArgKind : TypeArgumentKind.values()) { + for (ArgumentKind argKind : ArgumentKind.values()) { + new GenericConstructorAndDiamondTest(boundKind, constructorKind, + declArgKind, arity, useArgKind, diamondArgKind, argKind).run(comp, fm); + } + } + } + } + } + } + } + } + + BoundKind boundKind; + ConstructorKind constructorKind; + TypeArgumentKind declTypeArgumentKind; + TypeArgArity useTypeArgArity; + TypeArgumentKind useTypeArgumentKind; + TypeArgumentKind diamondTypeArgumentKind; + ArgumentKind argumentKind; + JavaSource source; + DiagnosticChecker diagChecker; + + GenericConstructorAndDiamondTest(BoundKind boundKind, ConstructorKind constructorKind, + TypeArgumentKind declTypeArgumentKind, TypeArgArity useTypeArgArity, + TypeArgumentKind useTypeArgumentKind, TypeArgumentKind diamondTypeArgumentKind, + ArgumentKind argumentKind) { + this.boundKind = boundKind; + this.constructorKind = constructorKind; + this.declTypeArgumentKind = declTypeArgumentKind; + this.useTypeArgArity = useTypeArgArity; + this.useTypeArgumentKind = useTypeArgumentKind; + this.diamondTypeArgumentKind = diamondTypeArgumentKind; + this.argumentKind = argumentKind; + this.source = new JavaSource(); + this.diagChecker = new DiagnosticChecker(); + } + + class JavaSource extends SimpleJavaFileObject { + + String template = "class Foo<X #BK> {\n" + + "#CK\n" + + "}\n" + + "class Test {\n" + + "void test() {\n" + + "Foo#TA1 f = new #TA2 Foo<#TA3>(#A);\n" + + "}\n" + + "}\n"; + + String source; + + public JavaSource() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = template.replace("#BK", boundKind.boundStr). + replace("#CK", constructorKind.constrStr) + .replace("#TA1", declTypeArgumentKind.getArgs(TypeArgArity.ONE)) + .replace("#TA2", useTypeArgumentKind.getArgs(useTypeArgArity)) + .replace("#TA3", diamondTypeArgumentKind.typeargStr) + .replace("#A", argumentKind.argStr); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { + JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, + null, null, Arrays.asList(source)); + ct.analyze(); + check(); + } + + void check() { + boolean badActual = !constructorKind.matches(argumentKind); + + boolean badArity = constructorKind != ConstructorKind.NON_GENERIC && + useTypeArgumentKind != TypeArgumentKind.NONE && + useTypeArgArity != TypeArgArity.ONE; + + boolean badMethodTypeArg = constructorKind != ConstructorKind.NON_GENERIC && + !useTypeArgumentKind.matches(argumentKind); + + boolean badExplicitParams = (useTypeArgumentKind != TypeArgumentKind.NONE && + diamondTypeArgumentKind == TypeArgumentKind.NONE) || + !boundKind.matches(diamondTypeArgumentKind); + + boolean badGenericType = !boundKind.matches(declTypeArgumentKind) || + !diamondTypeArgumentKind.matches(declTypeArgumentKind); + + boolean shouldFail = badActual || badArity || + badMethodTypeArg || badExplicitParams || badGenericType; + + if (shouldFail != diagChecker.errorFound) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nFound error: " + diagChecker.errorFound + + "\nExpected error: " + shouldFail); + } + } + + static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> { + + boolean errorFound; + + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { + errorFound = true; + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/diamond/7030687/ParserTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2011, 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 7030687 + * @summary Diamond: compiler accepts erroneous code where diamond is used with non-generic inner class + */ + +import com.sun.source.util.JavacTask; +import java.net.URI; +import java.util.Arrays; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +public class ParserTest { + + enum TypeArgumentKind { + NONE(""), + EXPLICIT("<String>"), + DIAMOND("<>"); + + String typeargStr; + + private TypeArgumentKind(String typeargStr) { + this.typeargStr = typeargStr; + } + } + + enum TypeQualifierArity { + ONE(1, "A1#TA1"), + TWO(2, "A1#TA1.A2#TA2"), + THREE(3, "A1#TA1.A2#TA2.A3#TA3"), + FOUR(4, "A1#TA1.A2#TA2.A3#TA3.A4#TA4"); + + int n; + String qualifierStr; + + private TypeQualifierArity(int n, String qualifierStr) { + this.n = n; + this.qualifierStr = qualifierStr; + } + + String getType(TypeArgumentKind... typeArgumentKinds) { + String res = qualifierStr; + for (int i = 1 ; i <= typeArgumentKinds.length ; i++) { + res = res.replace("#TA" + i, typeArgumentKinds[i-1].typeargStr); + } + return res; + } + } + + public static void main(String... args) throws Exception { + + //create default shared JavaCompiler - reused across multiple compilations + JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null); + + for (TypeQualifierArity arity : TypeQualifierArity.values()) { + for (TypeArgumentKind tak1 : TypeArgumentKind.values()) { + if (arity == TypeQualifierArity.ONE) { + new ParserTest(arity, tak1).run(comp, fm); + continue; + } + for (TypeArgumentKind tak2 : TypeArgumentKind.values()) { + if (arity == TypeQualifierArity.TWO) { + new ParserTest(arity, tak1, tak2).run(comp, fm); + continue; + } + for (TypeArgumentKind tak3 : TypeArgumentKind.values()) { + if (arity == TypeQualifierArity.THREE) { + new ParserTest(arity, tak1, tak2, tak3).run(comp, fm); + continue; + } + for (TypeArgumentKind tak4 : TypeArgumentKind.values()) { + new ParserTest(arity, tak1, tak2, tak3, tak4).run(comp, fm); + } + } + } + } + } + } + + TypeQualifierArity qualifierArity; + TypeArgumentKind[] typeArgumentKinds; + JavaSource source; + DiagnosticChecker diagChecker; + + ParserTest(TypeQualifierArity qualifierArity, TypeArgumentKind... typeArgumentKinds) { + this.qualifierArity = qualifierArity; + this.typeArgumentKinds = typeArgumentKinds; + this.source = new JavaSource(); + this.diagChecker = new DiagnosticChecker(); + } + + class JavaSource extends SimpleJavaFileObject { + + String template = "class Test {\n" + + "R res = new #T();\n" + + "}\n"; + + String source; + + public JavaSource() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = template.replace("#T", qualifierArity.getType(typeArgumentKinds)); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { + JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, + null, null, Arrays.asList(source)); + ct.parse(); + check(); + } + + void check() { + + boolean errorExpected = false; + + for (int i = 0 ; i < qualifierArity.n - 1 ; i++) { + if (typeArgumentKinds[i] == TypeArgumentKind.DIAMOND) { + errorExpected = true; + break; + } + } + + if (errorExpected != diagChecker.errorFound) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nFound error: " + diagChecker.errorFound + + "\nExpected error: " + errorExpected); + } + } + + static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> { + + boolean errorFound; + + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { + errorFound = true; + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/diamond/7030687/T7030687.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,19 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7030687 + * @summary Diamond: compiler accepts erroneous code where diamond is used with non-generic inner class + * @compile/fail/ref=T7030687.out -XDrawDiagnostics T7030687.java + */ + +class T7030687<X> { + class Member { } + static class Nested {} + + void test() { + class Local {} + + Member m = new Member<>(); + Nested n = new Nested<>(); + Local l = new Local<>(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/diamond/7030687/T7030687.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,4 @@ +T7030687.java:15:30: compiler.err.cant.apply.diamond.1: T7030687<X>.Member, (compiler.misc.diamond.non.generic: T7030687<X>.Member) +T7030687.java:16:30: compiler.err.cant.apply.diamond.1: T7030687.Nested, (compiler.misc.diamond.non.generic: T7030687.Nested) +T7030687.java:17:28: compiler.err.cant.apply.diamond.1: Local, (compiler.misc.diamond.non.generic: Local) +3 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/typevars/T7040883.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2011, 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 7040883 7034511 + * @summary Compilation error: "length in Array is defined in an inaccessible class or interface" + * @compile T7040883.java + */ + +public class T7040883 { + + <Z> Z[] getListeners(Class<Z> z) { return null; } + + void test(String s) { + int i = getListeners(s.getClass()).length; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/wildcards/7034495/T7034495.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2008, 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 7034495 + * @summary Javac asserts on usage of wildcards in bounds + * @compile/fail/ref=T7034495.out -XDrawDiagnostics T7034495.java + */ +class T7034495 { + + interface A<T> { + T foo(); + } + + interface B<T> { + T foo(); + } + + interface C<T extends A<?> & B<?>> { } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/generics/wildcards/7034495/T7034495.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,2 @@ +T7034495.java:40:17: compiler.err.types.incompatible.diff.ret: T7034495.B<?>, T7034495.A<?>, foo() +1 error
--- a/test/tools/javac/javazip/Test.sh Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/javazip/Test.sh Thu Jun 02 19:00:16 2011 +0100 @@ -1,7 +1,7 @@ #! /bin/sh -f # -# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2011, 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
--- a/test/tools/javac/meth/InvokeMH.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/meth/InvokeMH.java Thu Jun 02 19:00:16 2011 +0100 @@ -42,7 +42,7 @@ package meth; -import java.dyn.MethodHandle; +import java.lang.invoke.MethodHandle; public class InvokeMH { void test(MethodHandle mh_SiO,
--- a/test/tools/javac/meth/TestCP.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/meth/TestCP.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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 @@ -35,7 +35,7 @@ import com.sun.tools.classfile.ConstantPool.*; import com.sun.tools.classfile.Method; -import java.dyn.*; +import java.lang.invoke.*; import java.io.*; public class TestCP {
--- a/test/tools/javac/meth/XlintWarn.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/meth/XlintWarn.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2011, 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 @@ -30,7 +30,7 @@ * @compile -Werror -Xlint:cast XlintWarn.java */ -import java.dyn.*; +import java.lang.invoke.*; class XlintWarn { void test(MethodHandle mh) throws Throwable {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/multicatch/7030606/DisjunctiveTypeWellFormednessTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2011, 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 7030606 + * @summary Project-coin: multi-catch types should be pairwise disjoint + */ + +import com.sun.source.util.JavacTask; +import java.net.URI; +import java.util.Arrays; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +public class DisjunctiveTypeWellFormednessTest { + + enum Alternative { + EXCEPTION("Exception"), + RUNTIME_EXCEPTION("RuntimeException"), + IO_EXCEPTION("java.io.IOException"), + FILE_NOT_FOUND_EXCEPTION("java.io.FileNotFoundException"), + ILLEGAL_ARGUMENT_EXCEPTION("IllegalArgumentException"); + + String exceptionStr; + + private Alternative(String exceptionStr) { + this.exceptionStr = exceptionStr; + } + + static String makeDisjunctiveType(Alternative... alternatives) { + StringBuilder buf = new StringBuilder(); + String sep = ""; + for (Alternative alternative : alternatives) { + buf.append(sep); + buf.append(alternative.exceptionStr); + sep = "|"; + } + return buf.toString(); + } + + boolean disjoint(Alternative that) { + return disjoint[this.ordinal()][that.ordinal()]; + } + + static boolean[][] disjoint = { + // Exception RuntimeException IOException FileNotFoundException IllegalArgumentException + /*Exception*/ { false, false, false, false, false }, + /*RuntimeException*/ { false, false, true, true, false }, + /*IOException*/ { false, true, false, false, true }, + /*FileNotFoundException*/ { false, true, false, false, true }, + /*IllegalArgumentException*/ { false, false, true, true, false } + }; + } + + enum Arity { + ONE(1), + TWO(2), + THREE(3), + FOUR(4), + FIVE(5); + + int n; + + private Arity(int n) { + this.n = n; + } + } + + public static void main(String... args) throws Exception { + + //create default shared JavaCompiler - reused across multiple compilations + JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null); + + for (Arity arity : Arity.values()) { + for (Alternative a1 : Alternative.values()) { + if (arity == Arity.ONE) { + new DisjunctiveTypeWellFormednessTest(a1).run(comp, fm); + continue; + } + for (Alternative a2 : Alternative.values()) { + if (arity == Arity.TWO) { + new DisjunctiveTypeWellFormednessTest(a1, a2).run(comp, fm); + continue; + } + for (Alternative a3 : Alternative.values()) { + if (arity == Arity.THREE) { + new DisjunctiveTypeWellFormednessTest(a1, a2, a3).run(comp, fm); + continue; + } + for (Alternative a4 : Alternative.values()) { + if (arity == Arity.FOUR) { + new DisjunctiveTypeWellFormednessTest(a1, a2, a3, a4).run(comp, fm); + continue; + } + for (Alternative a5 : Alternative.values()) { + new DisjunctiveTypeWellFormednessTest(a1, a2, a3, a4, a5).run(comp, fm); + } + } + } + } + } + } + } + + Alternative[] alternatives; + JavaSource source; + DiagnosticChecker diagChecker; + + DisjunctiveTypeWellFormednessTest(Alternative... alternatives) { + this.alternatives = alternatives; + this.source = new JavaSource(); + this.diagChecker = new DiagnosticChecker(); + } + + class JavaSource extends SimpleJavaFileObject { + + String template = "class Test {\n" + + "void test() {\n" + + "try {} catch (#T e) {}\n" + + "}\n" + + "}\n"; + + String source; + + public JavaSource() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = template.replace("#T", Alternative.makeDisjunctiveType(alternatives)); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { + JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, + null, null, Arrays.asList(source)); + ct.analyze(); + check(); + } + + void check() { + + int non_disjoint = 0; + int i = 0; + for (Alternative a1 : alternatives) { + int j = 0; + for (Alternative a2 : alternatives) { + if (i == j) continue; + if (!a1.disjoint(a2)) { + non_disjoint++; + break; + } + j++; + } + i++; + } + + if (non_disjoint != diagChecker.errorsFound) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nFound errors: " + diagChecker.errorsFound + + "\nExpected errors: " + non_disjoint); + } + } + + static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> { + + int errorsFound; + + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.ERROR && + diagnostic.getCode().startsWith("compiler.err.multicatch.types.must.be.disjoint")) { + errorsFound++; + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/multicatch/7030606/T7030606.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,57 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7030606 + * + * @summary Project-coin: multi-catch types should be pairwise disjoint + * @compile/fail/ref=T7030606.out -XDrawDiagnostics T7030606.java + */ + +class T7030606 { + class E1 extends Exception { } + class E2 extends E1 { } + + void e1() throws E1 { } + void e2() throws E2 { } + + void m1() { + try { + e1(); + e2(); + } catch (NonExistentType | E2 | E1 e) { } + } + + void m2() { + try { + e1(); + e2(); + } catch (NonExistentType | E1 | E2 e) { } + } + + void m3() { + try { + e1(); + e2(); + } catch (E2 | NonExistentType | E1 e) { } + } + + void m4() { + try { + e1(); + e2(); + } catch (E1 | NonExistentType | E2 e) { } + } + + void m5() { + try { + e1(); + e2(); + } catch (E2 | E1 | NonExistentType e) { } + } + + void m6() { + try { + e1(); + e2(); + } catch (E1 | E2 | NonExistentType e) { } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/multicatch/7030606/T7030606.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,13 @@ +T7030606.java:20:18: compiler.err.cant.resolve.location: kindname.class, NonExistentType, , , (compiler.misc.location: kindname.class, T7030606, null) +T7030606.java:20:41: compiler.err.multicatch.types.must.be.disjoint: T7030606.E2, T7030606.E1 +T7030606.java:27:18: compiler.err.cant.resolve.location: kindname.class, NonExistentType, , , (compiler.misc.location: kindname.class, T7030606, null) +T7030606.java:27:41: compiler.err.multicatch.types.must.be.disjoint: T7030606.E2, T7030606.E1 +T7030606.java:34:23: compiler.err.cant.resolve.location: kindname.class, NonExistentType, , , (compiler.misc.location: kindname.class, T7030606, null) +T7030606.java:34:41: compiler.err.multicatch.types.must.be.disjoint: T7030606.E2, T7030606.E1 +T7030606.java:41:23: compiler.err.cant.resolve.location: kindname.class, NonExistentType, , , (compiler.misc.location: kindname.class, T7030606, null) +T7030606.java:41:41: compiler.err.multicatch.types.must.be.disjoint: T7030606.E2, T7030606.E1 +T7030606.java:48:23: compiler.err.multicatch.types.must.be.disjoint: T7030606.E2, T7030606.E1 +T7030606.java:48:28: compiler.err.cant.resolve.location: kindname.class, NonExistentType, , , (compiler.misc.location: kindname.class, T7030606, null) +T7030606.java:55:23: compiler.err.multicatch.types.must.be.disjoint: T7030606.E2, T7030606.E1 +T7030606.java:55:28: compiler.err.cant.resolve.location: kindname.class, NonExistentType, , , (compiler.misc.location: kindname.class, T7030606, null) +12 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/multicatch/Neg07.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,50 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7039822 + * @summary Verify typing of lub of exception parameter w.r.t getClass + * @author Joseph D. Darcy + * @compile/fail/ref=Neg07.out -XDrawDiagnostics Neg07.java + */ + +public class Neg07 { + private static void test(int i) { + try { + thrower(i); + } catch (SonException | DaughterException e) { + Class<? extends HasFoo> clazz2 = e.getClass(); // Rejected! + HasFoo m = e; + e.foo(); + } + } + + private static interface HasFoo { + void foo(); + } + + static void thrower(int i) throws SonException, DaughterException { + if (i == 0) + throw new SonException(); + else + throw new DaughterException(); + } + + private static class ParentException extends RuntimeException {} + + private static class SonException + extends ParentException + implements HasFoo { + + public void foo() { + System.out.println("SonException.foo"); + } + } + + private static class DaughterException + extends ParentException + implements HasFoo { + + public void foo() { + System.out.println("DaughterException.foo"); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/multicatch/Neg07.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,2 @@ +Neg07.java:14:56: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Class<compiler.misc.type.captureof: 1, ? extends Neg07.ParentException>, java.lang.Class<? extends Neg07.HasFoo> +1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/multicatch/Pos10.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2011, 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 7039822 + * @summary Verify lub of an exception parameter can be an intersection type + * @author Joseph D. Darcy + */ + +public class Pos10 { + public static void main(String... args) { + test(0); + test(1); + + if (record != 0b11) + throw new RuntimeException("Unexpected exception execution: " + + record); + if (closeRecord != 0b11) + throw new RuntimeException("Unexpected close execution: " + + closeRecord); + } + + private static int record = 0; + private static int closeRecord = 0; + + private static void test(int i) { + try { + thrower(i); + } catch (SonException | DaughterException e) { + Class<? extends ParentException> clazz = e.getClass(); + HasFoo m = e; + e.foo(); + + try (AutoCloseable ac = e) { + e.toString(); + } catch(Exception except) { + throw new RuntimeException(except); + } + } + } + + private static interface HasFoo { + void foo(); + } + + private static void thrower(int i) throws SonException, DaughterException { + if (i == 0) + throw new SonException(); + else + throw new DaughterException(); + } + + private static class ParentException extends RuntimeException {} + + private static class SonException + extends ParentException + implements HasFoo, AutoCloseable { + + public void foo() { + record |= 0b01; + } + + @Override + public void close() { + closeRecord |= 0b01; + } + } + + private static class DaughterException + extends ParentException + implements HasFoo, AutoCloseable { + + public void foo() { + record |= 0b10; + } + + @Override + public void close() { + closeRecord |= 0b10; + } + } +}
--- a/test/tools/javac/multicatch/model/Model01.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/multicatch/model/Model01.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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 @@ -43,6 +43,6 @@ else throw new B2(); } - catch(B1 | B2 ex) { } + catch(@UnionTypeInfo({"Test.B1", "Test.B2"}) B1 | B2 ex) { } } }
--- a/test/tools/javac/multicatch/model/ModelChecker.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/multicatch/model/ModelChecker.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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 @@ -30,7 +30,7 @@ * @compile -processor ModelChecker Model01.java */ -import com.sun.source.tree.VariableTree; +import com.sun.source.tree.CatchTree; import com.sun.source.util.TreePathScanner; import com.sun.source.util.Trees; import com.sun.source.util.TreePath; @@ -41,6 +41,12 @@ import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; +import javax.lang.model.type.TypeMirror; +import javax.lang.model.type.TypeKind; +import javax.lang.model.type.UnionType; +import javax.lang.model.type.UnknownTypeException; +import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.SimpleTypeVisitor7; @SupportedAnnotationTypes("Check") public class ModelChecker extends JavacTestingAbstractProcessor { @@ -69,20 +75,59 @@ } @Override - public Void visitVariable(VariableTree node, Void p) { - Element ex = trees.getElement(getCurrentPath()); + public Void visitCatch(CatchTree node, Void p) { + TreePath param = new TreePath(getCurrentPath(), node.getParameter()); + Element ex = trees.getElement(param); + validateUnionTypeInfo(ex); if (ex.getSimpleName().contentEquals("ex")) { assertTrue(ex.getKind() == ElementKind.EXCEPTION_PARAMETER, "Expected EXCEPTION_PARAMETER - found " + ex.getKind()); - for (Element e : types.asElement(ex.asType()).getEnclosedElements()) { + for (Element e : types.asElement(trees.getLub(node)).getEnclosedElements()) { Member m = e.getAnnotation(Member.class); if (m != null) { assertTrue(e.getKind() == m.value(), "Expected " + m.value() + " - found " + e.getKind()); } } - assertTrue(assertionCount == 3, "Expected 3 assertions - found " + assertionCount); + assertTrue(assertionCount == 9, "Expected 9 assertions - found " + assertionCount); } - return super.visitVariable(node, p); + return super.visitCatch(node, p); + } + } + + private void validateUnionTypeInfo(Element ex) { + UnionTypeInfo ut = ex.getAnnotation(UnionTypeInfo.class); + assertTrue(ut != null, "UnionType annotation must be present"); + + TypeMirror expectedUnionType = ex.asType(); + assertTrue(expectedUnionType.getKind() == TypeKind.UNION, "UNION kind expected"); + + try { + new SimpleTypeVisitor6<Void, Void>(){}.visit(expectedUnionType); + throw new RuntimeException("Expected UnknownTypeException not thrown."); + } catch (UnknownTypeException ute) { + ; // Expected } + + UnionType unionType = new SimpleTypeVisitor7<UnionType, Void>(){ + @Override + protected UnionType defaultAction(TypeMirror e, Void p) {return null;} + + @Override + public UnionType visitUnion(UnionType t, Void p) {return t;} + }.visit(expectedUnionType); + assertTrue(unionType != null, "Must get a non-null union type."); + + assertTrue(ut.value().length == unionType.getAlternatives().size(), "Cardinalities do not match"); + + String[] typeNames = ut.value(); + for(int i = 0; i < typeNames.length; i++) { + TypeMirror typeFromAnnotation = nameToType(typeNames[i]); + assertTrue(types.isSameType(typeFromAnnotation, unionType.getAlternatives().get(i)), + "Types were not equal."); + } + } + + private TypeMirror nameToType(String name) { + return elements.getTypeElement(name).asType(); } private static void assertTrue(boolean cond, String msg) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/multicatch/model/UnionTypeInfo.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2011, 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. + */ + +/** + * Used by ModelChecker to validate the modeling information of a union type. + */ +@interface UnionTypeInfo { + String[] value(); +}
--- a/test/tools/javac/options/T6900037.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/options/T6900037.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/processing/model/TestSymtabItems.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/processing/model/TestSymtabItems.java Thu Jun 02 19:00:16 2011 +0100 @@ -44,6 +44,7 @@ import com.sun.tools.javac.code.Symbol.ClassSymbol; import com.sun.tools.javac.code.Symtab; import com.sun.tools.javac.file.JavacFileManager; +import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.model.JavacTypes; import com.sun.tools.javac.util.Context; @@ -62,6 +63,7 @@ JavacFileManager.preRegister(c); Symtab syms = Symtab.instance(c); JavacTypes types = JavacTypes.instance(c); + JavaCompiler.instance(c); // will init ClassReader.sourceCompleter // print("noSymbol", syms.noSymbol); // print("errSymbol", syms.errSymbol);
--- a/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface1.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface1.java Thu Jun 02 19:00:16 2011 +0100 @@ -3,7 +3,7 @@ * 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, asrm + * 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
--- a/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface2.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface2.java Thu Jun 02 19:00:16 2011 +0100 @@ -3,7 +3,7 @@ * 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, asrm + * 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
--- a/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingInterface.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingInterface.java Thu Jun 02 19:00:16 2011 +0100 @@ -3,7 +3,7 @@ * 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, asrm + * 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/processing/model/type/TestUnionType.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2011, 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 7029150 + * @summary Test support for union types + * @library ../../../lib + */ + +import java.net.URI; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.element.*; +import javax.lang.model.type.*; +import javax.lang.model.util.*; +import javax.tools.*; + +import com.sun.source.tree.*; +import com.sun.source.util.*; + + +public class TestUnionType extends JavacTestingAbstractProcessor { + enum TestKind { + SingleType("E1", "E1", + "VariableTree: E1 e", + "VariableTree: elem EXCEPTION_PARAMETER e", + "VariableTree: elem.type DECLARED", + "VariableTree: elem.type.elem CLASS E1", + "VariableTree: type DECLARED", + "VariableTree: type.elem CLASS E1", + "VariableTree: type.elem.type DECLARED"), + + ValidTypes("E1, E2", "E1 | E2", + "VariableTree: E1 | E2 e", + "VariableTree: elem EXCEPTION_PARAMETER e", + "VariableTree: elem.type UNION Test.E1,Test.E2", + "VariableTree: elem.type.elem null", + "VariableTree: type UNION Test.E1,Test.E2", + "VariableTree: type.elem null"), + + InvalidTypes("E1, E2", "E1 | EMissing", + "VariableTree: E1 | EMissing e", + "VariableTree: elem EXCEPTION_PARAMETER e", + "VariableTree: elem.type UNION Test.E1,EMissing", + "VariableTree: elem.type.elem null", + "VariableTree: type UNION Test.E1,EMissing", + "VariableTree: type.elem null"), + + Uncaught("E1", "E1 | E2", + "VariableTree: E1 | E2 e", + "VariableTree: elem EXCEPTION_PARAMETER e", + "VariableTree: elem.type UNION Test.E1,Test.E2", + "VariableTree: elem.type.elem null", + "VariableTree: type UNION Test.E1,Test.E2", + "VariableTree: type.elem null"); + + TestKind(String throwsTypes, String catchTypes, String... gold) { + this.throwsTypes = throwsTypes; + this.catchTypes = catchTypes; + this.gold = Arrays.asList(gold); + } + + final String throwsTypes; + final String catchTypes; + final List<String> gold; + } + + static class TestFileObject extends SimpleJavaFileObject { + public static final String template = + "class Test {\n" + + " class E1 extends Exception { }\n" + + " class E2 extends Exception { }\n" + + " void doSomething() throws #T { }\n" + + " void test() {\n" + + " try {\n" + + " doSomething();\n" + + " } catch (#C e) {\n" + + " }\n" + + " }\n" + + "}\n"; + + public TestFileObject(TestKind tk) { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + this.tk = tk; + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return template + .replace("#T", tk.throwsTypes) + .replace("#C", tk.catchTypes); + } + final TestKind tk; + } + + public static void main(String... args) throws Exception { + JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); + List<String> options = Arrays.asList("-proc:only"); + for (TestKind tk: TestKind.values()) { + System.err.println("Test: " + tk); + TestUnionType p = new TestUnionType(); + JavaFileObject fo = new TestFileObject(tk); + JavaCompiler.CompilationTask task = comp.getTask(null, null, null, options, null, Arrays.asList(fo)); + task.setProcessors(Arrays.asList(p)); + boolean ok = task.call(); + System.err.println("compilation " + (ok ? "passed" : "failed")); + if (!ok) + throw new Exception("compilation failed unexpectedly"); + if (!p.log.equals(tk.gold)) { + System.err.println("Expected output:"); + for (String g: tk.gold) + System.err.println(g); + throw new Exception("unexpected output from test"); + } + System.err.println(); + } + } + + Trees trees; + List<String> log; + + @Override + public void init(ProcessingEnvironment env) { + super.init(env); + trees = Trees.instance(env); + log = new ArrayList<String>(); + } + + @Override + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) { + for (Element e: roundEnv.getRootElements()) { + scan(trees.getPath(e)); + } + } + return true; + } + + void scan(TreePath path) { + new Scanner().scan(path, null); + } + + class Scanner extends TreePathScanner<Void,Void> { + @Override + public Void visitVariable(VariableTree tree, Void ignore) { + TreePath p = getCurrentPath(); + Element e = trees.getElement(p); + if (e.getKind() == ElementKind.EXCEPTION_PARAMETER) { + log("VariableTree: " + tree); + log("VariableTree: elem " + print(e)); + log("VariableTree: elem.type " + print(e.asType())); + log("VariableTree: elem.type.elem " + print(types.asElement(e.asType()))); + TypeMirror tm = trees.getTypeMirror(p); + log("VariableTree: type " + print(tm)); + log("VariableTree: type.elem " + print(types.asElement(tm))); + if (types.asElement(tm) != null) + log("VariableTree: type.elem.type " + print(types.asElement(tm).asType())); + } + return super.visitVariable(tree, null); + } + + String print(TypeMirror tm) { + return (tm == null) ? null : new TypePrinter().visit(tm); + } + + String print(Element e) { + return (e == null) ? null : (e.getKind() + " " + e.getSimpleName()); + } + + void log(String msg) { + System.err.println(msg); + log.add(msg); + } + } + + class TypePrinter extends SimpleTypeVisitor7<String, Void> { + @Override + protected String defaultAction(TypeMirror tm, Void ignore) { + return String.valueOf(tm.getKind()); + } + + @Override + public String visitUnion(UnionType t, Void ignore) { + return (t.getKind() + " " + t.getAlternatives()); + } + } +}
--- a/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2010 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2010, 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
--- a/test/tools/javac/scope/7017664/CompoundScopeTest.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/scope/7017664/CompoundScopeTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -23,7 +23,7 @@ /* * @test - * @bug 7017664 + * @bug 7017664 7036906 * @summary Basher for CompoundScopes */ @@ -127,8 +127,17 @@ } } log("testing scope: " + root); - checkElems(root); - checkShadowed(root); + checkElems(root, null); + checkElems(root, new OddFilter()); + checkShadowed(root, null); + checkShadowed(root, new OddFilter()); + } + } + + class OddFilter implements Filter<Symbol> { + public boolean accepts(Symbol s) { + Name numPart = s.name.subName(1, s.name.length()); + return Integer.parseInt(numPart.toString()) % 2 != 0; } } @@ -165,15 +174,20 @@ * Check that CompoundScope.getElements() correctly visits all symbols * in all subscopes (in the correct order) */ - void checkElems(CompoundScope cs) { - List<Symbol> allSymbols = elems; + void checkElems(CompoundScope cs, Filter<Symbol> sf) { int count = 0; - for (Symbol s : cs.getElements()) { + ListBuffer<Symbol> found = ListBuffer.lb(); + List<Symbol> allSymbols = sf == null ? + elems : + filter(elems, sf); + int expectedCount = allSymbols.length(); + for (Symbol s : sf == null ? cs.getElements() : cs.getElements(sf)) { checkSameSymbols(s, allSymbols.head); allSymbols = allSymbols.tail; + found.append(s); count++; } - if (count != elems.size()) { + if (count != expectedCount) { error("CompoundScope.getElements() did not returned enough symbols"); } } @@ -182,22 +196,35 @@ * Check that CompoundScope.getElements() correctly visits all symbols * with a given name in all subscopes (in the correct order) */ - void checkShadowed(CompoundScope cs) { + void checkShadowed(CompoundScope cs, Filter<Symbol> sf) { for (Map.Entry<Name, List<Symbol>> shadowedEntry : shadowedMap.entrySet()) { int count = 0; - List<Symbol> shadowed = shadowedEntry.getValue(); + List<Symbol> shadowed = sf == null ? + shadowedEntry.getValue() : + filter(shadowedEntry.getValue(), sf); + int expectedCount = shadowed.length(); Name name = shadowedEntry.getKey(); - for (Symbol s : cs.getElementsByName(name)) { + for (Symbol s : sf == null ? cs.getElementsByName(name) : cs.getElementsByName(name, sf)) { checkSameSymbols(s, shadowed.head); shadowed = shadowed.tail; count++; } - if (count != shadowedEntry.getValue().size()) { + if (count != expectedCount) { error("CompoundScope.lookup() did not returned enough symbols for name " + name); } } } + List<Symbol> filter(List<Symbol> elems, Filter<Symbol> sf) { + ListBuffer<Symbol> res = ListBuffer.lb(); + for (Symbol s : elems) { + if (sf.accepts(s)) { + res.append(s); + } + } + return res.toList(); + } + void checkSameSymbols(Symbol found, Symbol req) { if (found != req) { error("Symbol mismatch - found : " + found + ":" + found.hashCode() + "\n" +
--- a/test/tools/javac/scope/HashCollisionTest.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/scope/HashCollisionTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/scope/StarImportTest.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/scope/StarImportTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/tree/T6963934.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/tree/T6963934.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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
--- a/test/tools/javac/types/BoxingConversionTest.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/types/BoxingConversionTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -118,7 +118,6 @@ static final Result T = Result.OK_BOTH; static final Result F = Result.FAIL_BOTH; static final Result A = Result.OK_ASSIGN_ONLY; - static final Result X = Result.FAIL_BOTH.FAIL_BOTH; Result[][] results1 = { //byte, short, int, long, float, double, char, bool, Byte, Short, Integer, Long, Float, Double, Character, Boolean
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/types/CastObjectToPrimitiveTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2011, 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 7038363 + * @summary cast from object to primitive should be for source >= 1.7 + * @compile/fail/ref=CastObjectToPrimitiveTest.out -XDrawDiagnostics -Xlint:-options -source 5 CastObjectToPrimitiveTest.java + * @compile/fail/ref=CastObjectToPrimitiveTest.out -XDrawDiagnostics -Xlint:-options -source 6 CastObjectToPrimitiveTest.java + * @compile CastObjectToPrimitiveTest.java + */ + +class CastObjectToPrimitiveTest { + void m() { + Object o = 42; + int i = (int) o; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/types/CastObjectToPrimitiveTest.out Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,2 @@ +CastObjectToPrimitiveTest.java:36:23: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), java.lang.Object, int +1 error
--- a/test/tools/javac/types/CastTest.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/types/CastTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -42,12 +42,13 @@ */ public class CastTest extends TypeHarness { - Type[] allTypes; + Type[] types_no_boxing; + Type[] types_boxing; static final boolean T = true; static final boolean F = false; - boolean[][] cast_result = { + boolean[][] cast_result_no_boxing = { //byte, short, int, long, float, double, char, bool, C, +C, I, T, byte[], short[], int[], long[], float[], double[], char[], bool[], C[], +C[], I[], T[] /*byte*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, /*short*/ { T , T , T , T , T , T , T , F , F, F , F, F, F , F , F , F , F , F , F , F , F , F , F , F }, @@ -74,6 +75,25 @@ /*I[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , F , F , T , F , T , T }, /*T[]*/ { F , F , F , F , F , F , F , F , F, F , F, T, F , F , F , F , F , F , F , F , T , T , T , T }}; + boolean[][] cast_result_boxing = { + //byte, short, int, long, float, double, char, bool, Byte, Short, Integer, Long, Float, Double, Character, Boolean, Object + /*byte*/ { T , T , T , T , T , T , T , F , T , F , F , F , F , F , F , F , T }, + /*short*/ { T , T , T , T , T , T , T , F , F , T , F , F , F , F , F , F , T }, + /*int*/ { T , T , T , T , T , T , T , F , F , F , T , F , F , F , F , F , T }, + /*long*/ { T , T , T , T , T , T , T , F , F , F , F , T , F , F , F , F , T }, + /*float*/ { T , T , T , T , T , T , T , F , F , F , F , F , T , F , F , F , T }, + /*double*/ { T , T , T , T , T , T , T , F , F , F , F , F , F , T , F , F , T }, + /*char*/ { T , T , T , T , T , T , T , F , F , F , F , F , F , F , T , F , T }, + /*bool*/ { F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , T , T }, + /*Byte*/ { T , T , T , T , T , T , F , F , T , F , F , F , F , F , F , F , T }, + /*Short*/ { F , T , T , T , T , T , F , F , F , T , F , F , F , F , F , F , T }, + /*Integer*/ { F , F , T , T , T , T , F , F , F , F , T , F , F , F , F , F , T }, + /*Long*/ { F , F , F , T , T , T , F , F , F , F , F , T , F , F , F , F , T }, + /*Float*/ { F , F , F , F , T , T , F , F , F , F , F , F , T , F , F , F , T }, + /*Double*/ { F , F , F , F , F , T , F , F , F , F , F , F , F , T , F , F , T }, + /*Character*/ { F , F , T , T , T , T , T , F , F , F , F , F , F , F , T , F , T }, + /*Boolean*/ { F , F , F , F , F , F , F , T , F , F , F , F , F , F , F , T , T }, + /*Object*/ { T , T , T , T , T , T , T , T , T , T , T , T , T , T , T , T , T }}; CastTest() { Type[] primitiveTypes = { predef.byteType, @@ -85,6 +105,15 @@ predef.charType, predef.booleanType }; + Type[] boxedTypes = new Type[primitiveTypes.length + 1]; + for (int i = 0 ; i < primitiveTypes.length ; i++) { + boxedTypes[i] = box(primitiveTypes[i]); + } + + boxedTypes[primitiveTypes.length] = predef.objectType; + + types_boxing = join(Type.class, primitiveTypes, boxedTypes); + Type[] referenceTypes = { fac.Class(), fac.Class(FINAL), @@ -97,17 +126,22 @@ arrayTypes[idx++] = fac.Array(t); } - allTypes = join(Type.class, primitiveTypes, referenceTypes, arrayTypes); + types_no_boxing = join(Type.class, primitiveTypes, referenceTypes, arrayTypes); } - void test() { - for (int i = 0; i < allTypes.length ; i++) { - for (int j = 0; j < allTypes.length ; j++) { - assertCastable(allTypes[i], allTypes[j], cast_result[i][j]); + void test(Type[] all_types, boolean[][] cast_result) { + for (int i = 0; i < all_types.length ; i++) { + for (int j = 0; j < all_types.length ; j++) { + assertCastable(all_types[i], all_types[j], cast_result[i][j]); } } } + void runTests() { + test(types_no_boxing, cast_result_no_boxing); + test(types_boxing, cast_result_boxing); + } + @SuppressWarnings("unchecked") <T> T[] join(Class<T> type, T[]... args) { int totalLength = 0; @@ -124,6 +158,6 @@ } public static void main(String[] args) { - new CastTest().test(); + new CastTest().runTests(); } }
--- a/test/tools/javac/types/GenericTypeWellFormednessTest.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/types/GenericTypeWellFormednessTest.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/types/TypeHarness.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/types/TypeHarness.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/util/T6597678.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2011, 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 6597678 + * @summary Ensure Messages propogated between rounds + * @library ../lib + * @build JavacTestingAbstractProcessor T6597678 + * @run main T6597678 + */ + +import java.io.*; +import java.util.*; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedOptions; +import javax.lang.model.element.TypeElement; +import javax.tools.Diagnostic; + + +import com.sun.tools.javac.processing.JavacProcessingEnvironment; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.JavacMessages; + +public class T6597678 extends JavacTestingAbstractProcessor { + public static void main(String... args) throws Exception { + new T6597678().run(); + } + + + void run() throws Exception { + String myName = T6597678.class.getSimpleName(); + File testSrc = new File(System.getProperty("test.src")); + File file = new File(testSrc, myName + ".java"); + + compile( + "-proc:only", + "-processor", myName, + file.getPath()); + } + + void compile(String... args) throws Exception { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javac.Main.compile(args, pw); + pw.close(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + if (rc != 0) + throw new Exception("compilation failed unexpectedly: rc=" + rc); + } + + //--------------- + + @Override + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { + Context context = ((JavacProcessingEnvironment) processingEnv).getContext(); + Locale locale = context.get(Locale.class); + JavacMessages messages = context.get(JavacMessages.messagesKey); + + round++; + if (round == 1) { + initialLocale = locale; + initialMessages = messages; + } else { + checkEqual("locale", locale, initialLocale); + checkEqual("messages", messages, initialMessages); + } + + return true; + } + + <T> void checkEqual(String label, T actual, T expected) { + if (actual != expected) + messager.printMessage(Diagnostic.Kind.ERROR, + "Unexpected value for " + label + + "; expected: " + expected + + "; found: " + actual); + } + + int round = 0; + Locale initialLocale; + JavacMessages initialMessages; +}
--- a/test/tools/javac/varargs/6199075/T6199075.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/varargs/6199075/T6199075.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/varargs/7042566/T7042566.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,350 @@ +/* + * Copyright (c) 2011, 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 7042566 + * @summary Unambiguous varargs method calls flagged as ambiguous + */ + +import com.sun.source.util.JavacTask; +import com.sun.tools.classfile.Instruction; +import com.sun.tools.classfile.Attribute; +import com.sun.tools.classfile.ClassFile; +import com.sun.tools.classfile.Code_attribute; +import com.sun.tools.classfile.ConstantPool.*; +import com.sun.tools.classfile.Method; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.util.List; + +import java.io.File; +import java.net.URI; +import java.util.Arrays; +import java.util.Locale; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +public class T7042566 { + + VarargsMethod m1; + VarargsMethod m2; + TypeConfiguration actuals; + + T7042566(TypeConfiguration m1_conf, TypeConfiguration m2_conf, TypeConfiguration actuals) { + this.m1 = new VarargsMethod(m1_conf); + this.m2 = new VarargsMethod(m2_conf); + this.actuals = actuals; + } + + void compileAndCheck() throws Exception { + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + JavaSource source = new JavaSource(); + ErrorChecker ec = new ErrorChecker(); + JavacTask ct = (JavacTask)tool.getTask(null, fm, ec, + null, null, Arrays.asList(source)); + ct.call(); + check(source, ec); + } + + void check(JavaSource source, ErrorChecker ec) { + checkCount++; + boolean resolutionError = false; + VarargsMethod selectedMethod = null; + + boolean m1_applicable = m1.isApplicable(actuals); + boolean m2_applicable = m2.isApplicable(actuals); + + if (!m1_applicable && !m2_applicable) { + resolutionError = true; + } else if (m1_applicable && m2_applicable) { + //most specific + boolean m1_moreSpecific = m1.isMoreSpecificThan(m2); + boolean m2_moreSpecific = m2.isMoreSpecificThan(m1); + + resolutionError = m1_moreSpecific == m2_moreSpecific; + selectedMethod = m1_moreSpecific ? m1 : m2; + } else { + selectedMethod = m1_applicable ? + m1 : m2; + } + + if (ec.errorFound != resolutionError) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nExpected resolution error: " + resolutionError + + "\nFound error: " + ec.errorFound + + "\nCompiler diagnostics:\n" + ec.printDiags()); + } else if (!resolutionError) { + verifyBytecode(selectedMethod, source); + } + } + + void verifyBytecode(VarargsMethod selected, JavaSource source) { + bytecodeCheckCount++; + File compiledTest = new File("Test.class"); + try { + ClassFile cf = ClassFile.read(compiledTest); + Method testMethod = null; + for (Method m : cf.methods) { + if (m.getName(cf.constant_pool).equals("test")) { + testMethod = m; + break; + } + } + if (testMethod == null) { + throw new Error("Test method not found"); + } + Code_attribute ea = (Code_attribute)testMethod.attributes.get(Attribute.Code); + if (testMethod == null) { + throw new Error("Code attribute for test() method not found"); + } + + for (Instruction i : ea.getInstructions()) { + if (i.getMnemonic().equals("invokevirtual")) { + int cp_entry = i.getUnsignedShort(1); + CONSTANT_Methodref_info methRef = + (CONSTANT_Methodref_info)cf.constant_pool.get(cp_entry); + String type = methRef.getNameAndTypeInfo().getType(); + String sig = selected.parameterTypes.bytecodeSigStr; + if (!type.contains(sig)) { + throw new Error("Unexpected type method call: " + type + "" + + "\nfound: " + sig + + "\n" + source.getCharContent(true)); + } + break; + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new Error("error reading " + compiledTest +": " + e); + } + } + + class JavaSource extends SimpleJavaFileObject { + + static final String source_template = "class Test {\n" + + " #V1\n" + + " #V2\n" + + " void test() { m(#E); }\n" + + "}"; + + String source; + + public JavaSource() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = source_template.replaceAll("#V1", m1.toString()). + replaceAll("#V2", m2.toString()). + replaceAll("#E", actuals.expressionListStr); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + /** global decls ***/ + + // Create a single file manager and reuse it for each compile to save time. + static StandardJavaFileManager fm = JavacTool.create().getStandardFileManager(null, null, null); + + //statistics + static int checkCount = 0; + static int bytecodeCheckCount = 0; + + public static void main(String... args) throws Exception { + for (TypeConfiguration tconf1 : TypeConfiguration.values()) { + for (TypeConfiguration tconf2 : TypeConfiguration.values()) { + for (TypeConfiguration tconf3 : TypeConfiguration.values()) { + new T7042566(tconf1, tconf2, tconf3).compileAndCheck(); + } + } + } + + System.out.println("Total checks made: " + checkCount); + System.out.println("Bytecode checks made: " + bytecodeCheckCount); + } + + enum TypeKind { + OBJECT("Object", "(Object)null", "Ljava/lang/Object;"), + STRING("String", "(String)null", "Ljava/lang/String;"); + + String typeString; + String valueString; + String bytecodeString; + + TypeKind(String typeString, String valueString, String bytecodeString) { + this.typeString = typeString; + this.valueString = valueString; + this.bytecodeString = bytecodeString; + } + + boolean isSubtypeOf(TypeKind that) { + return that == OBJECT || + (that == STRING && this == STRING); + } + } + + enum TypeConfiguration { + A(TypeKind.OBJECT), + B(TypeKind.STRING), + AA(TypeKind.OBJECT, TypeKind.OBJECT), + AB(TypeKind.OBJECT, TypeKind.STRING), + BA(TypeKind.STRING, TypeKind.OBJECT), + BB(TypeKind.STRING, TypeKind.STRING), + AAA(TypeKind.OBJECT, TypeKind.OBJECT, TypeKind.OBJECT), + AAB(TypeKind.OBJECT, TypeKind.OBJECT, TypeKind.STRING), + ABA(TypeKind.OBJECT, TypeKind.STRING, TypeKind.OBJECT), + ABB(TypeKind.OBJECT, TypeKind.STRING, TypeKind.STRING), + BAA(TypeKind.STRING, TypeKind.OBJECT, TypeKind.OBJECT), + BAB(TypeKind.STRING, TypeKind.OBJECT, TypeKind.STRING), + BBA(TypeKind.STRING, TypeKind.STRING, TypeKind.OBJECT), + BBB(TypeKind.STRING, TypeKind.STRING, TypeKind.STRING); + + List<TypeKind> typeKindList; + String expressionListStr; + String parameterListStr; + String bytecodeSigStr; + + private TypeConfiguration(TypeKind... typeKindList) { + this.typeKindList = List.from(typeKindList); + expressionListStr = asExpressionList(); + parameterListStr = asParameterList(); + bytecodeSigStr = asBytecodeString(); + } + + private String asExpressionList() { + StringBuilder buf = new StringBuilder(); + String sep = ""; + for (TypeKind tk : typeKindList) { + buf.append(sep); + buf.append(tk.valueString); + sep = ","; + } + return buf.toString(); + } + + private String asParameterList() { + StringBuilder buf = new StringBuilder(); + String sep = ""; + int count = 0; + for (TypeKind arg : typeKindList) { + buf.append(sep); + buf.append(arg.typeString); + if (count == (typeKindList.size() - 1)) { + buf.append("..."); + } + buf.append(" "); + buf.append("arg" + count++); + sep = ","; + } + return buf.toString(); + } + + private String asBytecodeString() { + StringBuilder buf = new StringBuilder(); + int count = 0; + for (TypeKind arg : typeKindList) { + if (count == (typeKindList.size() - 1)) { + buf.append("["); + } + buf.append(arg.bytecodeString); + count++; + } + return buf.toString(); + } + } + + static class VarargsMethod { + TypeConfiguration parameterTypes; + + public VarargsMethod(TypeConfiguration parameterTypes) { + this.parameterTypes = parameterTypes; + } + + @Override + public String toString() { + return "void m( " + parameterTypes.parameterListStr + ") {}"; + } + + boolean isApplicable(TypeConfiguration that) { + List<TypeKind> actuals = that.typeKindList; + List<TypeKind> formals = parameterTypes.typeKindList; + if ((actuals.size() - formals.size()) < -1) + return false; //not enough args + for (TypeKind actual : actuals) { + if (!actual.isSubtypeOf(formals.head)) + return false; //type mismatch + formals = formals.tail.isEmpty() ? + formals : + formals.tail; + } + return true; + } + + boolean isMoreSpecificThan(VarargsMethod that) { + List<TypeKind> actuals = parameterTypes.typeKindList; + List<TypeKind> formals = that.parameterTypes.typeKindList; + int checks = 0; + int expectedCheck = Math.max(actuals.size(), formals.size()); + while (checks < expectedCheck) { + if (!actuals.head.isSubtypeOf(formals.head)) + return false; //type mismatch + formals = formals.tail.isEmpty() ? + formals : + formals.tail; + actuals = actuals.tail.isEmpty() ? + actuals : + actuals.tail; + checks++; + } + return true; + } + } + + static class ErrorChecker implements javax.tools.DiagnosticListener<JavaFileObject> { + + boolean errorFound; + List<String> errDiags = List.nil(); + + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { + errDiags = errDiags.append(diagnostic.getMessage(Locale.getDefault())); + errorFound = true; + } + } + + String printDiags() { + StringBuilder buf = new StringBuilder(); + for (String s : errDiags) { + buf.append(s); + buf.append("\n"); + } + return buf.toString(); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/varargs/7043922/T7043922.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2011, 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 7043922 + * @summary Regression: internal compiler error for nested anonymous inner class featuring varargs constructor + */ + +import com.sun.source.util.JavacTask; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.util.List; + +import java.net.URI; +import java.util.Arrays; +import java.util.Locale; +import javax.tools.Diagnostic; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; + +public class T7043922 { + + ClassKind[] classKinds; + ConstructorKind[] constructorKinds; + + T7043922(ClassKind[] classKinds, ConstructorKind[] constructorKinds) { + this.classKinds = classKinds; + this.constructorKinds = constructorKinds; + } + + void compileAndCheck() throws Exception { + JavaSource source = new JavaSource(); + ErrorChecker ec = new ErrorChecker(); + JavacTask ct = (JavacTask)tool.getTask(null, fm, ec, + null, null, Arrays.asList(source)); + ct.analyze(); + if (ec.errorFound) { + throw new Error("invalid diagnostics for source:\n" + + source.getCharContent(true) + + "\nCompiler diagnostics:\n" + ec.printDiags()); + } + } + + class JavaSource extends SimpleJavaFileObject { + + static final String source_template = "#C0 A0 { #K0 }\n" + + "#C1 A1 { #K1 }\n" + + "#C2 A2 { #K2 }\n" + + "class D {\n" + + " void test() {\n" + + " new A0(#V0) {\n" + + " void test() {\n" + + " new A1(#V1) {\n" + + " void test() {\n" + + " new A2(#V2) {};\n" + + " }\n" + + " };\n" + + " }\n" + + " };\n" + + " }\n" + + "}\n"; + + String source; + + public JavaSource() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = source_template; + for (int i = 0; i < 3; i++) { + source = source.replaceAll("#C" + i, classKinds[i].classKind). + replaceAll("#K" + i, classKinds[i].getConstructor("A" + i, constructorKinds[i])). + replaceAll("#V" + i, constructorKinds[i].constrArgs); + } + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + + /** global decls ***/ + + enum ConstructorKind { + DEFAULT("", ""), + FIXED_ARITY("String s", "\"\""), + VARIABLE_ARITY("String... ss", "\"\",\"\""); + + String constrParam; + String constrArgs; + + private ConstructorKind(String constrParam, String constrArgs) { + this.constrParam = constrParam; + this.constrArgs = constrArgs; + } + } + + enum ClassKind { + ABSTRACT("abstract class"), + CLASS("class"), + INTERFACE("interface"); + + String classKind; + + private ClassKind(String classKind) { + this.classKind = classKind; + } + + boolean isConstructorOk(ConstructorKind ck) { + return this != INTERFACE || + ck == ConstructorKind.DEFAULT; + } + + String getConstructor(String className, ConstructorKind ck) { + return this == INTERFACE ? + "" : + (className + "(" + ck.constrParam + ") {}"); + } + } + + // Create a single file manager and JavaCompiler tool + // and reuse them for each compile to save time. + static final StandardJavaFileManager fm = JavacTool.create().getStandardFileManager(null, null, null); + static final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + + public static void main(String... args) throws Exception { + for (ClassKind classKind1 : ClassKind.values()) { + for (ConstructorKind constrKind1 : ConstructorKind.values()) { + if (!classKind1.isConstructorOk(constrKind1)) continue; + for (ClassKind classKind2 : ClassKind.values()) { + for (ConstructorKind constrKind2 : ConstructorKind.values()) { + if (!classKind2.isConstructorOk(constrKind2)) continue; + for (ClassKind classKind3 : ClassKind.values()) { + for (ConstructorKind constrKind3 : ConstructorKind.values()) { + if (!classKind3.isConstructorOk(constrKind3)) continue; + new T7043922(new ClassKind[] { classKind1, classKind2, classKind3 }, + new ConstructorKind[] { constrKind1, constrKind2, constrKind3 }).compileAndCheck(); + } + } + } + } + } + } + } + + static class ErrorChecker implements javax.tools.DiagnosticListener<JavaFileObject> { + + boolean errorFound; + List<String> errDiags = List.nil(); + + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { + errDiags = errDiags.append(diagnostic.getMessage(Locale.getDefault())); + errorFound = true; + } + } + + String printDiags() { + StringBuilder buf = new StringBuilder(); + for (String s : errDiags) { + buf.append(s); + buf.append("\n"); + } + return buf.toString(); + } + } +}
--- a/test/tools/javac/varargs/warning/Warn4.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/varargs/warning/Warn4.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/varargs/warning/Warn5.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/varargs/warning/Warn5.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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
--- a/test/tools/javac/versions/check.sh Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javac/versions/check.sh Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2011, 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
--- a/test/tools/javap/6937244/T6937244A.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javap/6937244/T6937244A.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2011, 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 @@ -49,8 +49,8 @@ int count = 0; for (String line: out.split("[\r\n]+")) { - if (line.contains("extends")) { - verify(line, "extends java.lang.Object implements java.util.List<java.lang.String>"); + if (line.contains("implements")) { + verify(line, "implements java.util.List<java.lang.String>"); count++; }
--- a/test/tools/javap/T4880663.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javap/T4880663.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2011, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 4880663 6715757 + * @bug 4880663 6715757 7031005 * @summary javap could output whitespace between class name and opening brace * javap prints "extends java.lang.Object" */ @@ -39,7 +39,7 @@ public void run() throws IOException { File javaFile = writeTestFile(); File classFile = compileTestFile(javaFile); - verify(classFile, "class Test extends java.lang.Object {"); + verify(classFile, "class Test {"); if (errors > 0) throw new Error(errors + " found.");
--- a/test/tools/javap/T4880672.java Thu Jun 02 17:45:51 2011 +0100 +++ b/test/tools/javap/T4880672.java Thu Jun 02 19:00:16 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2011, 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 @@ -24,7 +24,7 @@ /* * @test - * @bug 4880672 + * @bug 4880672 7031005 * @summary javap does not output inner interfaces of an interface */ @@ -39,7 +39,7 @@ void run() { verify("java.util.Map", "public interface java.util.Map$Entry"); - verify("T4880672", "class T4880672$A$B extends java.lang.Object"); + verify("T4880672", "class T4880672$A$B"); verify("C", ""); // must not give error if no InnerClasses attribute if (errors > 0) throw new Error(errors + " found.");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javap/TestSuperclass.java Thu Jun 02 19:00:16 2011 +0100 @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2011, 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 7031005 + * @summary javap prints "extends java.lang.Object" + */ + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.net.URI; +import java.util.Arrays; +import javax.tools.JavaCompiler; +import javax.tools.JavaCompiler.CompilationTask; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.StandardLocation; +import javax.tools.ToolProvider; + +public class TestSuperclass { + enum ClassKind { + CLASS("class"), + INTERFACE("interface"); + ClassKind(String keyword) { + this.keyword = keyword; + } + final String keyword; + } + + enum GenericKind { + NO(""), + YES("<T>"); + GenericKind(String typarams) { + this.typarams = typarams; + } + final String typarams; + } + + enum SuperKind { + NONE(null), + SUPER("Super"); + SuperKind(String name) { + this.name = name; + } + String extend() { + return (name == null) ? "" : "extends " + name; + } + String decl(ClassKind ck) { + return (name == null) ? "" : ck.keyword + " " + name + " { }"; + } + final String name; + } + + public static void main(String... args) throws Exception { + JavaCompiler comp = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null); + int errors = 0; + + for (ClassKind ck: ClassKind.values()) { + for (GenericKind gk: GenericKind.values()) { + for (SuperKind sk: SuperKind.values()) { + errors += new TestSuperclass(ck, gk, sk).run(comp, fm); + } + } + } + + if (errors > 0) + throw new Exception(errors + " errors found"); + } + + final ClassKind ck; + final GenericKind gk; + final SuperKind sk; + + TestSuperclass(ClassKind ck, GenericKind gk, SuperKind sk) { + this.ck = ck; + this.gk = gk; + this.sk = sk; + } + + int run(JavaCompiler comp, StandardJavaFileManager fm) throws IOException { + System.err.println("test: ck:" + ck + " gk:" + gk + " sk:" + sk); + File testDir = new File(ck + "-" + gk + "-" + sk); + testDir.mkdirs(); + fm.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(testDir)); + + JavaSource js = new JavaSource(); + System.err.println(js.getCharContent(false)); + CompilationTask t = comp.getTask(null, fm, null, null, null, Arrays.asList(js)); + if (!t.call()) + throw new Error("compilation failed"); + + File testClass = new File(testDir, "Test.class"); + String out = javap(testClass); + + // Extract class sig from first line of Java source + String expect = js.source.replaceAll("(?s)^(.* Test[^{]+?) *\\{.*", "$1"); + + // Extract class sig from line from javap output + String found = out.replaceAll("(?s).*\n(.* Test[^{]+?) *\\{.*", "$1"); + + checkEqual("class signature", expect, found); + + return errors; + } + + String javap(File file) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + String[] args = { file.getPath() }; + int rc = com.sun.tools.javap.Main.run(args, pw); + pw.close(); + String out = sw.toString(); + if (!out.isEmpty()) + System.err.println(out); + if (rc != 0) + throw new Error("javap failed: rc=" + rc); + return out; + } + + void checkEqual(String label, String expect, String found) { + if (!expect.equals(found)) + error("Unexpected " + label + " found: '" + found + "', expected: '" + expect + "'"); + } + + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + int errors; + + class JavaSource extends SimpleJavaFileObject { + static final String template = + "#CK Test#GK #EK { }\n" + + "#SK\n"; + final String source; + + public JavaSource() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + source = template + .replace("#CK", ck.keyword) + .replace("#GK", gk.typarams) + .replace("#EK", sk.extend()) + .replace("#SK", sk.decl(ck)); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return source; + } + } + +}