Tue, 15 Oct 2013 14:17:11 +0100
Merge
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/classes/com/sun/javadoc/package-info.java Tue Oct 15 14:17:11 2013 +0100 1.3 @@ -0,0 +1,148 @@ 1.4 +/* 1.5 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +/** 1.30 +The Doclet API (also called the Javadoc API) provides a mechanism 1.31 +for clients to inspect the source-level structure of programs and 1.32 +libraries, including javadoc comments embedded in the source. 1.33 +This is useful for documentation, program checking, automatic 1.34 +code generation and many other tools. 1.35 +<p> 1.36 + 1.37 +Doclets are invoked by javadoc and use this API to write out 1.38 +program information to files. For example, the standard doclet is called 1.39 +by default and writes out documentation to HTML files. 1.40 +<p> 1.41 + 1.42 +The invocation is defined by the abstract {@link com.sun.javadoc.Doclet} class 1.43 +-- the entry point is the {@link com.sun.javadoc.Doclet#start(RootDoc) start} method: 1.44 +<pre> 1.45 + public static boolean <b>start</b>(RootDoc root) 1.46 +</pre> 1.47 +The {@link com.sun.javadoc.RootDoc} instance holds the root of the program structure 1.48 +information. From this root all other program structure 1.49 +information can be extracted. 1.50 +<p> 1.51 + 1.52 +<a name="terminology"></a> 1.53 +<h3>Terminology</h3> 1.54 + 1.55 +<a name="included"></a> 1.56 +When calling javadoc, you pass in package names and source file names -- 1.57 +these are called the <em>specified</em> packages and classes. 1.58 +You also pass in Javadoc options; the <em>access control</em> Javadoc options 1.59 +(<code>-public</code>, <code>-protected</code>, <code>-package</code>, 1.60 +and <code>-private</code>) filter program elements, producing a 1.61 +result set, called the <em>included</em> set, or "documented" set. 1.62 +(The unfiltered set is also available through 1.63 +{@link com.sun.javadoc.PackageDoc#allClasses(boolean) allClasses(false)}.) 1.64 +<p> 1.65 + 1.66 +<a name="class"></a> 1.67 +Throughout this API, the term <em>class</em> is normally a 1.68 +shorthand for "class or interface", as in: {@link com.sun.javadoc.ClassDoc}, 1.69 +{@link com.sun.javadoc.PackageDoc#allClasses() allClasses()}, and 1.70 +{@link com.sun.javadoc.PackageDoc#findClass(String) findClass(String)}. 1.71 +In only a couple of other places, it means "class, as opposed to interface", 1.72 +as in: {@link com.sun.javadoc.Doc#isClass()}. 1.73 +In the second sense, this API calls out four kinds of classes: 1.74 +{@linkplain com.sun.javadoc.Doc#isOrdinaryClass() ordinary classes}, 1.75 +{@linkplain com.sun.javadoc.Doc#isEnum() enums}, 1.76 +{@linkplain com.sun.javadoc.Doc#isError() errors} and 1.77 +{@linkplain com.sun.javadoc.Doc#isException() exceptions}. 1.78 +Throughout the API, the detailed description of each program element 1.79 +describes explicitly which meaning is being used. 1.80 +<p> 1.81 + 1.82 +<a name="qualified"></a> 1.83 +A <em>qualified</em> class or interface name is one that has its package 1.84 +name prepended to it, such as <code>java.lang.String</code>. A non-qualified 1.85 +name has no package name, such as <code>String</code>. 1.86 +<p> 1.87 + 1.88 +<a name="example"></a> 1.89 +<h3>Example</h3> 1.90 + 1.91 +The following is an example doclet that 1.92 +displays information in the <code>@param</code> tags of the processed 1.93 +classes: 1.94 +<pre> 1.95 +import com.sun.javadoc.*; 1.96 + 1.97 +public class ListParams extends <font color=red title="Doclet API">Doclet</font> { 1.98 + 1.99 + public static boolean start(<font color=red title="Doclet API">RootDoc</font> root) { 1.100 + <font color=red title="Doclet API">ClassDoc</font>[] classes = root.<font color=red title="Doclet API">classes</font>(); 1.101 + for (int i = 0; i < classes.length; ++i) { 1.102 + <font color=red title="Doclet API">ClassDoc</font> cd = classes[i]; 1.103 + printMembers(cd.<font color=red title="Doclet API">constructors</font>()); 1.104 + printMembers(cd.<font color=red title="Doclet API">methods</font>()); 1.105 + } 1.106 + return true; 1.107 + } 1.108 + 1.109 + static void printMembers(<font color=red title="Doclet API">ExecutableMemberDoc</font>[] mems) { 1.110 + for (int i = 0; i < mems.length; ++i) { 1.111 + <font color=red title="Doclet API">ParamTag</font>[] params = mems[i].<font color=red title="Doclet API">paramTags</font>(); 1.112 + System.out.println(mems[i].<font color=red title="Doclet API">qualifiedName</font>()); 1.113 + for (int j = 0; j < params.length; ++j) { 1.114 + System.out.println(" " + params[j].<font color=red title="Doclet API">parameterName</font>() 1.115 + + " - " + params[j].<font color=red title="Doclet API">parameterComment</font>()); 1.116 + } 1.117 + } 1.118 + } 1.119 +} 1.120 +</pre> 1.121 +Interfaces and methods from the Javadoc API are marked in 1.122 +<font color=red title="Doclet API">red</font>. 1.123 +{@link com.sun.javadoc.Doclet Doclet} is an abstract class that specifies 1.124 +the invocation interface for doclets, 1.125 +{@link com.sun.javadoc.Doclet Doclet} holds class or interface information, 1.126 +{@link com.sun.javadoc.ExecutableMemberDoc} is a 1.127 +superinterface of {@link com.sun.javadoc.MethodDoc} and 1.128 +{@link com.sun.javadoc.ConstructorDoc}, 1.129 +and {@link com.sun.javadoc.ParamTag} holds information 1.130 +from "<code>@param</code>" tags. 1.131 +<p> 1.132 +This doclet when invoked with a command line like: 1.133 +<pre> 1.134 + javadoc -doclet ListParams -sourcepath <source-location> java.util 1.135 +</pre> 1.136 +producing output like: 1.137 +<pre> 1.138 + ... 1.139 + java.util.ArrayList.add 1.140 + index - index at which the specified element is to be inserted. 1.141 + element - element to be inserted. 1.142 + java.util.ArrayList.remove 1.143 + index - the index of the element to removed. 1.144 + ... 1.145 + 1.146 +</pre> 1.147 +@see com.sun.javadoc.Doclet 1.148 +@see com.sun.javadoc.RootDoc 1.149 +*/ 1.150 +@jdk.Exported 1.151 +package com.sun.javadoc;
2.1 --- a/src/share/classes/com/sun/javadoc/package.html Fri Oct 11 19:05:18 2013 +0100 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,152 +0,0 @@ 2.4 -<html> 2.5 -<head> 2.6 -<TITLE>Doclet API Package</TITLE> 2.7 -<!-- 2.8 - 2.9 -Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved. 2.10 -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.11 - 2.12 -This code is free software; you can redistribute it and/or modify it 2.13 -under the terms of the GNU General Public License version 2 only, as 2.14 -published by the Free Software Foundation. Oracle designates this 2.15 -particular file as subject to the "Classpath" exception as provided 2.16 -by Oracle in the LICENSE file that accompanied this code. 2.17 - 2.18 -This code is distributed in the hope that it will be useful, but WITHOUT 2.19 -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.20 -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.21 -version 2 for more details (a copy is included in the LICENSE file that 2.22 -accompanied this code). 2.23 - 2.24 -You should have received a copy of the GNU General Public License version 2.25 -2 along with this work; if not, write to the Free Software Foundation, 2.26 -Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.27 - 2.28 -Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.29 -or visit www.oracle.com if you need additional information or have any 2.30 -questions. 2.31 ---> 2.32 -</head> 2.33 -<body bgcolor="white"> 2.34 - 2.35 -The Doclet API (also called the Javadoc API) provides a mechanism 2.36 -for clients to inspect the source-level structure of programs and 2.37 -libraries, including javadoc comments embedded in the source. 2.38 -This is useful for documentation, program checking, automatic 2.39 -code generation and many other tools. 2.40 -<p> 2.41 - 2.42 -Doclets are invoked by javadoc and use this API to write out 2.43 -program information to files. For example, the standard doclet is called 2.44 -by default and writes out documentation to HTML files. 2.45 -<p> 2.46 - 2.47 -The invocation is defined by the abstract {@link com.sun.javadoc.Doclet} class 2.48 --- the entry point is the {@link com.sun.javadoc.Doclet#start(RootDoc) start} method: 2.49 -<pre> 2.50 - public static boolean <b>start</b>(RootDoc root) 2.51 -</pre> 2.52 -The {@link com.sun.javadoc.RootDoc} instance holds the root of the program structure 2.53 -information. From this root all other program structure 2.54 -information can be extracted. 2.55 -<p> 2.56 - 2.57 -<a name="terminology"></a> 2.58 -<h3>Terminology</h3> 2.59 - 2.60 -<a name="included"></a> 2.61 -When calling javadoc, you pass in package names and source file names -- 2.62 -these are called the <em>specified</em> packages and classes. 2.63 -You also pass in Javadoc options; the <em>access control</em> Javadoc options 2.64 -(<code>-public</code>, <code>-protected</code>, <code>-package</code>, 2.65 -and <code>-private</code>) filter program elements, producing a 2.66 -result set, called the <em>included</em> set, or "documented" set. 2.67 -(The unfiltered set is also available through 2.68 -{@link com.sun.javadoc.PackageDoc#allClasses(boolean) allClasses(false)}.) 2.69 -<p> 2.70 - 2.71 -<a name="class"></a> 2.72 -Throughout this API, the term <em>class</em> is normally a 2.73 -shorthand for "class or interface", as in: {@link com.sun.javadoc.ClassDoc}, 2.74 -{@link com.sun.javadoc.PackageDoc#allClasses() allClasses()}, and 2.75 -{@link com.sun.javadoc.PackageDoc#findClass(String) findClass(String)}. 2.76 -In only a couple of other places, it means "class, as opposed to interface", 2.77 -as in: {@link com.sun.javadoc.Doc#isClass()}. 2.78 -In the second sense, this API calls out four kinds of classes: 2.79 -{@linkplain com.sun.javadoc.Doc#isOrdinaryClass() ordinary classes}, 2.80 -{@linkplain com.sun.javadoc.Doc#isEnum() enums}, 2.81 -{@linkplain com.sun.javadoc.Doc#isError() errors} and 2.82 -{@linkplain com.sun.javadoc.Doc#isException() exceptions}. 2.83 -Throughout the API, the detailed description of each program element 2.84 -describes explicitly which meaning is being used. 2.85 -<p> 2.86 - 2.87 -<a name="qualified"></a> 2.88 -A <em>qualified</em> class or interface name is one that has its package 2.89 -name prepended to it, such as <code>java.lang.String</code>. A non-qualified 2.90 -name has no package name, such as <code>String</code>. 2.91 -<p> 2.92 - 2.93 -<a name="example"></a> 2.94 -<h3>Example</h3> 2.95 - 2.96 -The following is an example doclet that 2.97 -displays information in the <code>@param</code> tags of the processed 2.98 -classes: 2.99 -<pre> 2.100 -import com.sun.javadoc.*; 2.101 - 2.102 -public class ListParams extends <font color=red title="Doclet API">Doclet</font> { 2.103 - 2.104 - public static boolean start(<font color=red title="Doclet API">RootDoc</font> root) { 2.105 - <font color=red title="Doclet API">ClassDoc</font>[] classes = root.<font color=red title="Doclet API">classes</font>(); 2.106 - for (int i = 0; i < classes.length; ++i) { 2.107 - <font color=red title="Doclet API">ClassDoc</font> cd = classes[i]; 2.108 - printMembers(cd.<font color=red title="Doclet API">constructors</font>()); 2.109 - printMembers(cd.<font color=red title="Doclet API">methods</font>()); 2.110 - } 2.111 - return true; 2.112 - } 2.113 - 2.114 - static void printMembers(<font color=red title="Doclet API">ExecutableMemberDoc</font>[] mems) { 2.115 - for (int i = 0; i < mems.length; ++i) { 2.116 - <font color=red title="Doclet API">ParamTag</font>[] params = mems[i].<font color=red title="Doclet API">paramTags</font>(); 2.117 - System.out.println(mems[i].<font color=red title="Doclet API">qualifiedName</font>()); 2.118 - for (int j = 0; j < params.length; ++j) { 2.119 - System.out.println(" " + params[j].<font color=red title="Doclet API">parameterName</font>() 2.120 - + " - " + params[j].<font color=red title="Doclet API">parameterComment</font>()); 2.121 - } 2.122 - } 2.123 - } 2.124 -} 2.125 -</pre> 2.126 -Interfaces and methods from the Javadoc API are marked in 2.127 -<font color=red title="Doclet API">red</font>. 2.128 -{@link com.sun.javadoc.Doclet Doclet} is an abstract class that specifies 2.129 -the invocation interface for doclets, 2.130 -{@link com.sun.javadoc.Doclet Doclet} holds class or interface information, 2.131 -{@link com.sun.javadoc.ExecutableMemberDoc} is a 2.132 -superinterface of {@link com.sun.javadoc.MethodDoc} and 2.133 -{@link com.sun.javadoc.ConstructorDoc}, 2.134 -and {@link com.sun.javadoc.ParamTag} holds information 2.135 -from "<code>@param</code>" tags. 2.136 -<p> 2.137 -This doclet when invoked with a command line like: 2.138 -<pre> 2.139 - javadoc -doclet ListParams -sourcepath <source-location> java.util 2.140 -</pre> 2.141 -producing output like: 2.142 -<pre> 2.143 - ... 2.144 - java.util.ArrayList.add 2.145 - index - index at which the specified element is to be inserted. 2.146 - element - element to be inserted. 2.147 - java.util.ArrayList.remove 2.148 - index - the index of the element to removed. 2.149 - ... 2.150 - 2.151 -</pre> 2.152 -@see com.sun.javadoc.Doclet 2.153 -@see com.sun.javadoc.RootDoc 2.154 -</BODY> 2.155 -</HTML>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/src/share/classes/com/sun/tools/classfile/package-info.java Tue Oct 15 14:17:11 2013 +0100 3.3 @@ -0,0 +1,37 @@ 3.4 +/* 3.5 + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 + * 3.8 + * This code is free software; you can redistribute it and/or modify it 3.9 + * under the terms of the GNU General Public License version 2 only, as 3.10 + * published by the Free Software Foundation. Oracle designates this 3.11 + * particular file as subject to the "Classpath" exception as provided 3.12 + * by Oracle in the LICENSE file that accompanied this code. 3.13 + * 3.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 3.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.17 + * version 2 for more details (a copy is included in the LICENSE file that 3.18 + * accompanied this code). 3.19 + * 3.20 + * You should have received a copy of the GNU General Public License version 3.21 + * 2 along with this work; if not, write to the Free Software Foundation, 3.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.23 + * 3.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3.25 + * or visit www.oracle.com if you need additional information or have any 3.26 + * questions. 3.27 + */ 3.28 + 3.29 +/** 3.30 + A minimalist library to read and write class files into objects closely 3.31 + based on the corresponding definitions in 3.32 + <cite>The Java™ Virtual Machine Specification</cite> (JVMS). 3.33 + 3.34 + <p><b>This is NOT part of any supported API. 3.35 + If you write code that depends on this, you do so at your own risk. 3.36 + This code and its internal interfaces are subject to change or 3.37 + deletion without notice.</b> 3.38 +*/ 3.39 +@jdk.Exported(false) 3.40 +package com.sun.tools.classfile;
4.1 --- a/src/share/classes/com/sun/tools/classfile/package.html Fri Oct 11 19:05:18 2013 +0100 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,12 +0,0 @@ 4.4 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 4.5 -<html> 4.6 - <head> 4.7 - <title></title> 4.8 - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4.9 - </head> 4.10 - <body> 4.11 - A minimalist library to read and write class files into objects closely 4.12 - based on the corresponding definitions in 4.13 - <cite>The Java™ Virtual Machine Specification</cite> (JVMS). 4.14 - </body> 4.15 -</html>
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java Tue Oct 15 14:17:11 2013 +0100 5.3 @@ -0,0 +1,35 @@ 5.4 +/* 5.5 + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 5.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5.7 + * 5.8 + * This code is free software; you can redistribute it and/or modify it 5.9 + * under the terms of the GNU General Public License version 2 only, as 5.10 + * published by the Free Software Foundation. Oracle designates this 5.11 + * particular file as subject to the "Classpath" exception as provided 5.12 + * by Oracle in the LICENSE file that accompanied this code. 5.13 + * 5.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 5.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5.17 + * version 2 for more details (a copy is included in the LICENSE file that 5.18 + * accompanied this code). 5.19 + * 5.20 + * You should have received a copy of the GNU General Public License version 5.21 + * 2 along with this work; if not, write to the Free Software Foundation, 5.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5.23 + * 5.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 5.25 + * or visit www.oracle.com if you need additional information or have any 5.26 + * questions. 5.27 + */ 5.28 + 5.29 +/** 5.30 + This package contains classes that write HTML markup tags. 5.31 + 5.32 + <p><b>This is NOT part of any supported API. 5.33 + If you write code that depends on this, you do so at your own risk. 5.34 + This code and its internal interfaces are subject to change or 5.35 + deletion without notice.</b> 5.36 + */ 5.37 +@jdk.Exported(false) 5.38 +package com.sun.tools.doclets.formats.html.markup;
6.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/package.html Fri Oct 11 19:05:18 2013 +0100 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,32 +0,0 @@ 6.4 -<!-- 6.5 - Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 6.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.7 - 6.8 - This code is free software; you can redistribute it and/or modify it 6.9 - under the terms of the GNU General Public License version 2 only, as 6.10 - published by the Free Software Foundation. Oracle designates this 6.11 - particular file as subject to the "Classpath" exception as provided 6.12 - by Oracle in the LICENSE file that accompanied this code. 6.13 - 6.14 - This code is distributed in the hope that it will be useful, but WITHOUT 6.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6.17 - version 2 for more details (a copy is included in the LICENSE file that 6.18 - accompanied this code). 6.19 - 6.20 - You should have received a copy of the GNU General Public License version 6.21 - 2 along with this work; if not, write to the Free Software Foundation, 6.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6.23 - 6.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 6.25 - or visit www.oracle.com if you need additional information or have any 6.26 - questions. 6.27 ---> 6.28 - 6.29 -<html> 6.30 -<head> 6.31 -<title>com.sun.tools.doclets.formats.html.markup package</title> 6.32 -<body bgcolor="white"> 6.33 - This package contains classes that write HTML markup tags. 6.34 - </body> 6.35 -</html>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/package-info.java Tue Oct 15 14:17:11 2013 +0100 7.3 @@ -0,0 +1,40 @@ 7.4 +/* 7.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 7.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7.7 + * 7.8 + * This code is free software; you can redistribute it and/or modify it 7.9 + * under the terms of the GNU General Public License version 2 only, as 7.10 + * published by the Free Software Foundation. Oracle designates this 7.11 + * particular file as subject to the "Classpath" exception as provided 7.12 + * by Oracle in the LICENSE file that accompanied this code. 7.13 + * 7.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 7.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 7.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 7.17 + * version 2 for more details (a copy is included in the LICENSE file that 7.18 + * accompanied this code). 7.19 + * 7.20 + * You should have received a copy of the GNU General Public License version 7.21 + * 2 along with this work; if not, write to the Free Software Foundation, 7.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 7.23 + * 7.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 7.25 + * or visit www.oracle.com if you need additional information or have any 7.26 + * questions. 7.27 + */ 7.28 + 7.29 +/** 7.30 + This is the default doclet provided with JDK that produces Javadoc's 7.31 + default HTML-formatted API output. For more documentation 7.32 + on this doclet, please refer to the link below. 7.33 + 7.34 + @see <a href="http://www.java.sun.com/javadoc/standard-doclet.html"> 7.35 + http://www.java.sun.com/javadoc/standard-doclet.html </a> 7.36 + 7.37 + <p><b>This is NOT part of any supported API. 7.38 + If you write code that depends on this, you do so at your own risk. 7.39 + This code and its internal interfaces are subject to change or 7.40 + deletion without notice.</b> 7.41 +*/ 7.42 +@jdk.Exported(false) 7.43 +package com.sun.tools.doclets.formats.html;
8.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/package.html Fri Oct 11 19:05:18 2013 +0100 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,38 +0,0 @@ 8.4 -<!-- 8.5 - Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 8.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8.7 - 8.8 - This code is free software; you can redistribute it and/or modify it 8.9 - under the terms of the GNU General Public License version 2 only, as 8.10 - published by the Free Software Foundation. Oracle designates this 8.11 - particular file as subject to the "Classpath" exception as provided 8.12 - by Oracle in the LICENSE file that accompanied this code. 8.13 - 8.14 - This code is distributed in the hope that it will be useful, but WITHOUT 8.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 8.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 8.17 - version 2 for more details (a copy is included in the LICENSE file that 8.18 - accompanied this code). 8.19 - 8.20 - You should have received a copy of the GNU General Public License version 8.21 - 2 along with this work; if not, write to the Free Software Foundation, 8.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 8.23 - 8.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 8.25 - or visit www.oracle.com if you need additional information or have any 8.26 - questions. 8.27 ---> 8.28 - 8.29 -<html> 8.30 -<head> 8.31 -<title>com.sun.tools.doclets.formats.html package</title> 8.32 -</head> 8.33 -<body bgcolor="white"> 8.34 - This is the default doclet provided with JDK that produces Javadoc's 8.35 - default HTML-formatted API output. For more documentation 8.36 - on this doclet, please refer to the link below. 8.37 - 8.38 - @see <a href="http://www.java.sun.com/javadoc/standard-doclet.html"> 8.39 - http://www.java.sun.com/javadoc/standard-doclet.html </a> 8.40 - </body> 8.41 -</html>
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java Tue Oct 15 14:17:11 2013 +0100 9.3 @@ -0,0 +1,41 @@ 9.4 +/* 9.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 9.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.7 + * 9.8 + * This code is free software; you can redistribute it and/or modify it 9.9 + * under the terms of the GNU General Public License version 2 only, as 9.10 + * published by the Free Software Foundation. Oracle designates this 9.11 + * particular file as subject to the "Classpath" exception as provided 9.12 + * by Oracle in the LICENSE file that accompanied this code. 9.13 + * 9.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 9.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 9.17 + * version 2 for more details (a copy is included in the LICENSE file that 9.18 + * accompanied this code). 9.19 + * 9.20 + * You should have received a copy of the GNU General Public License version 9.21 + * 2 along with this work; if not, write to the Free Software Foundation, 9.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 9.23 + * 9.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 9.25 + * or visit www.oracle.com if you need additional information or have any 9.26 + * questions. 9.27 + */ 9.28 + 9.29 +/** 9.30 + This doclet-independent package has a set of classes and 9.31 + interfaces that are the building blocks for doclets. They 9.32 + define the basic structure of doclets and make doclet 9.33 + writing much easier because they provide the content generation 9.34 + code to be shared among different doclets. Builders only provide 9.35 + the structure and content of API documentation. 9.36 + They will not provide any style markup. 9.37 + 9.38 + <p><b>This is NOT part of any supported API. 9.39 + If you write code that depends on this, you do so at your own risk. 9.40 + This code and its internal interfaces are subject to change or 9.41 + deletion without notice.</b> 9.42 +*/ 9.43 +@jdk.Exported(false) 9.44 +package com.sun.tools.doclets.internal.toolkit.builders;
10.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package.html Fri Oct 11 19:05:18 2013 +0100 10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 10.3 @@ -1,43 +0,0 @@ 10.4 -<!-- 10.5 - Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 10.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 10.7 - 10.8 - This code is free software; you can redistribute it and/or modify it 10.9 - under the terms of the GNU General Public License version 2 only, as 10.10 - published by the Free Software Foundation. Oracle designates this 10.11 - particular file as subject to the "Classpath" exception as provided 10.12 - by Oracle in the LICENSE file that accompanied this code. 10.13 - 10.14 - This code is distributed in the hope that it will be useful, but WITHOUT 10.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 10.17 - version 2 for more details (a copy is included in the LICENSE file that 10.18 - accompanied this code). 10.19 - 10.20 - You should have received a copy of the GNU General Public License version 10.21 - 2 along with this work; if not, write to the Free Software Foundation, 10.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 10.23 - 10.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 10.25 - or visit www.oracle.com if you need additional information or have any 10.26 - questions. 10.27 ---> 10.28 - 10.29 -<html> 10.30 -<head> 10.31 -<title>com.sun.tools.doclets.internal.toolkit.builders package</title> 10.32 -</head> 10.33 -<body bgcolor="white"> 10.34 - This doclet-independent package has a set of classes and 10.35 - interfaces that are the building blocks for doclets. They 10.36 - define the basic structure of doclets and make doclet 10.37 - writing much easier because they provide the content generation 10.38 - code to be shared among different doclets. Builders only provide 10.39 - the structure and content of API documentation. 10.40 - They will not provide any style markup. 10.41 - <p> 10.42 - This code is not part of an API. 10.43 - It is implementation that is subject to change. 10.44 - Do not use it as an API. 10.45 - </body> 10.46 -</html>
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 11.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java Tue Oct 15 14:17:11 2013 +0100 11.3 @@ -0,0 +1,57 @@ 11.4 +/* 11.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 11.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 11.7 + * 11.8 + * This code is free software; you can redistribute it and/or modify it 11.9 + * under the terms of the GNU General Public License version 2 only, as 11.10 + * published by the Free Software Foundation. Oracle designates this 11.11 + * particular file as subject to the "Classpath" exception as provided 11.12 + * by Oracle in the LICENSE file that accompanied this code. 11.13 + * 11.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 11.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11.17 + * version 2 for more details (a copy is included in the LICENSE file that 11.18 + * accompanied this code). 11.19 + * 11.20 + * You should have received a copy of the GNU General Public License version 11.21 + * 2 along with this work; if not, write to the Free Software Foundation, 11.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 11.23 + * 11.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 11.25 + * or visit www.oracle.com if you need additional information or have any 11.26 + * questions. 11.27 + */ 11.28 + 11.29 +/** 11.30 + Contains the base classes that make up a doclet. Doclets that reuse 11.31 + the functionality provided by the toolkit should have the following 11.32 + characteristics: 11.33 + <ul> 11.34 + <li> 11.35 + The main driver class should extend 11.36 + {@link com.sun.tools.doclets.internal.toolkit.AbstractDoclet}. 11.37 + </li> 11.38 + <li> 11.39 + The doclet configuration class should extend 11.40 + {@link com.sun.tools.doclets.internal.toolkit.Configuration}. 11.41 + </li> 11.42 + <li> 11.43 + The doclet should have a writer factory that implements 11.44 + {@link com.sun.tools.doclets.internal.toolkit.WriterFactory}. 11.45 + This class constructs writers that write doclet specific output. 11.46 + </li> 11.47 + <li> 11.48 + The doclet should have a taglet writer that extends 11.49 + {@link com.sun.tools.doclets.internal.toolkit.taglets.TagletWriter}. 11.50 + This writer determines how to output each given tag. 11.51 + </li> 11.52 + </ul> 11.53 + 11.54 + <p><b>This is NOT part of any supported API. 11.55 + If you write code that depends on this, you do so at your own risk. 11.56 + This code and its internal interfaces are subject to change or 11.57 + deletion without notice.</b> 11.58 +*/ 11.59 +@jdk.Exported(false) 11.60 +package com.sun.tools.doclets.internal.toolkit;
12.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/package.html Fri Oct 11 19:05:18 2013 +0100 12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 12.3 @@ -1,55 +0,0 @@ 12.4 -<!-- 12.5 - Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 12.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 12.7 - 12.8 - This code is free software; you can redistribute it and/or modify it 12.9 - under the terms of the GNU General Public License version 2 only, as 12.10 - published by the Free Software Foundation. Oracle designates this 12.11 - particular file as subject to the "Classpath" exception as provided 12.12 - by Oracle in the LICENSE file that accompanied this code. 12.13 - 12.14 - This code is distributed in the hope that it will be useful, but WITHOUT 12.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12.17 - version 2 for more details (a copy is included in the LICENSE file that 12.18 - accompanied this code). 12.19 - 12.20 - You should have received a copy of the GNU General Public License version 12.21 - 2 along with this work; if not, write to the Free Software Foundation, 12.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 12.23 - 12.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 12.25 - or visit www.oracle.com if you need additional information or have any 12.26 - questions. 12.27 ---> 12.28 - 12.29 -<html> 12.30 -<head> 12.31 -<title>com.sun.tools.doclets.internal.toolkit package</title> 12.32 -</head> 12.33 -<body bgcolor="white"> 12.34 - 12.35 - Contains the base classes that make up a doclet. Doclets that reuse 12.36 - the functionality provided by the toolkit should have the following 12.37 - characteristics: 12.38 - <ul> 12.39 - <li> 12.40 - The main driver class should extend 12.41 - {@link com.sun.tools.doclets.internal.toolkit.AbstractDoclet}. 12.42 - </li> 12.43 - <li> 12.44 - The doclet configuration class should extend 12.45 - {@link com.sun.tools.doclets.internal.toolkit.Configuration}. 12.46 - </li> 12.47 - <li> 12.48 - The doclet should have a writer factory that implements 12.49 - {@link com.sun.tools.doclets.internal.toolkit.WriterFactory}. 12.50 - This class constructs writers that write doclet specific output. 12.51 - </li> 12.52 - <li> 12.53 - The doclet should have a taglet writer that extends 12.54 - {@link com.sun.tools.doclets.internal.toolkit.taglets.TagletWriter}. 12.55 - This writer determines how to output each given tag. 12.56 - </li> 12.57 - </body> 12.58 -</html>
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 13.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/package-info.java Tue Oct 15 14:17:11 2013 +0100 13.3 @@ -0,0 +1,52 @@ 13.4 +/* 13.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 13.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 13.7 + * 13.8 + * This code is free software; you can redistribute it and/or modify it 13.9 + * under the terms of the GNU General Public License version 2 only, as 13.10 + * published by the Free Software Foundation. Oracle designates this 13.11 + * particular file as subject to the "Classpath" exception as provided 13.12 + * by Oracle in the LICENSE file that accompanied this code. 13.13 + * 13.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 13.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13.17 + * version 2 for more details (a copy is included in the LICENSE file that 13.18 + * accompanied this code). 13.19 + * 13.20 + * You should have received a copy of the GNU General Public License version 13.21 + * 2 along with this work; if not, write to the Free Software Foundation, 13.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 13.23 + * 13.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 13.25 + * or visit www.oracle.com if you need additional information or have any 13.26 + * questions. 13.27 + */ 13.28 + 13.29 +/** 13.30 + This package has classes used to generate Javadoc tag documentation. 13.31 + Doclets no longer have to implement its own version of standard tags 13.32 + such as @param and @throws. This is the single, doclet 13.33 + implementation of each standard tag that is shared by all 13.34 + doclets. Each doclet must have a taglet writer that takes a taglet 13.35 + as input and writes doclet-dependent output. The taglet itself will 13.36 + do the tag processing. For example, suppose we are outputing 13.37 + @throws tags. The taglet would: 13.38 + <ul> 13.39 + <li> Retrieve the list of throws tags to be documented. 13.40 + <li> Replace {@inheritDoc} with the appropriate documentation. 13.41 + <li> Add throws documentation for exceptions that are declared in 13.42 + the signature of the method but 13.43 + not documented with the throws tags. 13.44 + </ul> 13.45 + After doing the steps above, the taglet would pass the information to 13.46 + the taglet writer for writing. The taglets are essentially builders for 13.47 + tags. 13.48 + 13.49 + <p><b>This is NOT part of any supported API. 13.50 + If you write code that depends on this, you do so at your own risk. 13.51 + This code and its internal interfaces are subject to change or 13.52 + deletion without notice.</b> 13.53 +*/ 13.54 +@jdk.Exported(false) 13.55 +package com.sun.tools.doclets.internal.toolkit.taglets;
14.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/package.html Fri Oct 11 19:05:18 2013 +0100 14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 14.3 @@ -1,54 +0,0 @@ 14.4 -<!-- 14.5 - Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 14.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 14.7 - 14.8 - This code is free software; you can redistribute it and/or modify it 14.9 - under the terms of the GNU General Public License version 2 only, as 14.10 - published by the Free Software Foundation. Oracle designates this 14.11 - particular file as subject to the "Classpath" exception as provided 14.12 - by Oracle in the LICENSE file that accompanied this code. 14.13 - 14.14 - This code is distributed in the hope that it will be useful, but WITHOUT 14.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14.17 - version 2 for more details (a copy is included in the LICENSE file that 14.18 - accompanied this code). 14.19 - 14.20 - You should have received a copy of the GNU General Public License version 14.21 - 2 along with this work; if not, write to the Free Software Foundation, 14.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 14.23 - 14.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 14.25 - or visit www.oracle.com if you need additional information or have any 14.26 - questions. 14.27 ---> 14.28 - 14.29 -<html> 14.30 -<head> 14.31 -<title>com.sun.tools.doclets.internal.toolkit.taglets package</title> 14.32 -</head> 14.33 -<body bgcolor="white"> 14.34 - This package has classes used to generate Javadoc tag documentation. 14.35 - Doclets no longer have to implement its own version of standard tags 14.36 - such as @param and @throws. This is the single, doclet 14.37 - implementation of each standard tag that is shared by all 14.38 - doclets. Each doclet must have a taglet writer that takes a taglet 14.39 - as input and writes doclet-dependent output. The taglet itself will 14.40 - do the tag processing. For example, suppose we are outputing 14.41 - @throws tags. The taglet would: 14.42 - <ul> 14.43 - <li> Retrieve the list of throws tags to be documented. 14.44 - <li> Replace {@inheritDoc} with the appropriate documentation. 14.45 - <li> Add throws documentation for exceptions that are declared in 14.46 - the signature of the method but 14.47 - not documented with the throws tags. 14.48 - </ul> 14.49 - After doing the steps above, the taglet would pass the information to 14.50 - the taglet writer for writing. The taglets are essentially builders for 14.51 - tags. 14.52 - <p> 14.53 - This code is not part of an API. 14.54 - It is implementation that is subject to change. 14.55 - Do not use it as an API. 14.56 - </body> 14.57 -</html>
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 15.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/package-info.java Tue Oct 15 14:17:11 2013 +0100 15.3 @@ -0,0 +1,35 @@ 15.4 +/* 15.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 15.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 15.7 + * 15.8 + * This code is free software; you can redistribute it and/or modify it 15.9 + * under the terms of the GNU General Public License version 2 only, as 15.10 + * published by the Free Software Foundation. Oracle designates this 15.11 + * particular file as subject to the "Classpath" exception as provided 15.12 + * by Oracle in the LICENSE file that accompanied this code. 15.13 + * 15.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 15.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15.17 + * version 2 for more details (a copy is included in the LICENSE file that 15.18 + * accompanied this code). 15.19 + * 15.20 + * You should have received a copy of the GNU General Public License version 15.21 + * 2 along with this work; if not, write to the Free Software Foundation, 15.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 15.23 + * 15.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 15.25 + * or visit www.oracle.com if you need additional information or have any 15.26 + * questions. 15.27 + */ 15.28 + 15.29 +/** 15.30 + Provides a factory for constructing links. 15.31 + 15.32 + <p><b>This is NOT part of any supported API. 15.33 + If you write code that depends on this, you do so at your own risk. 15.34 + This code and its internal interfaces are subject to change or 15.35 + deletion without notice.</b> 15.36 +*/ 15.37 +@jdk.Exported(false) 15.38 +package com.sun.tools.doclets.internal.toolkit.util.links;
16.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/package.html Fri Oct 11 19:05:18 2013 +0100 16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 16.3 @@ -1,33 +0,0 @@ 16.4 -<!-- 16.5 - Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 16.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 16.7 - 16.8 - This code is free software; you can redistribute it and/or modify it 16.9 - under the terms of the GNU General Public License version 2 only, as 16.10 - published by the Free Software Foundation. Oracle designates this 16.11 - particular file as subject to the "Classpath" exception as provided 16.12 - by Oracle in the LICENSE file that accompanied this code. 16.13 - 16.14 - This code is distributed in the hope that it will be useful, but WITHOUT 16.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16.17 - version 2 for more details (a copy is included in the LICENSE file that 16.18 - accompanied this code). 16.19 - 16.20 - You should have received a copy of the GNU General Public License version 16.21 - 2 along with this work; if not, write to the Free Software Foundation, 16.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 16.23 - 16.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 16.25 - or visit www.oracle.com if you need additional information or have any 16.26 - questions. 16.27 ---> 16.28 - 16.29 -<html> 16.30 -<head> 16.31 -<title>com.sun.tools.doclets.interal.toolkit.util.links package</title> 16.32 -</head> 16.33 -<body bgcolor="white"> 16.34 - Provides a factory for constructing links. 16.35 - </body> 16.36 -</html>
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 17.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/package-info.java Tue Oct 15 14:17:11 2013 +0100 17.3 @@ -0,0 +1,36 @@ 17.4 +/* 17.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 17.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 17.7 + * 17.8 + * This code is free software; you can redistribute it and/or modify it 17.9 + * under the terms of the GNU General Public License version 2 only, as 17.10 + * published by the Free Software Foundation. Oracle designates this 17.11 + * particular file as subject to the "Classpath" exception as provided 17.12 + * by Oracle in the LICENSE file that accompanied this code. 17.13 + * 17.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 17.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 17.17 + * version 2 for more details (a copy is included in the LICENSE file that 17.18 + * accompanied this code). 17.19 + * 17.20 + * You should have received a copy of the GNU General Public License version 17.21 + * 2 along with this work; if not, write to the Free Software Foundation, 17.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 17.23 + * 17.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 17.25 + * or visit www.oracle.com if you need additional information or have any 17.26 + * questions. 17.27 + */ 17.28 + 17.29 +/** 17.30 + This package has utility classes that perform common services required 17.31 + for API documentation generation. 17.32 + 17.33 + <p><b>This is NOT part of any supported API. 17.34 + If you write code that depends on this, you do so at your own risk. 17.35 + This code and its internal interfaces are subject to change or 17.36 + deletion without notice.</b> 17.37 +*/ 17.38 +@jdk.Exported(false) 17.39 +package com.sun.tools.doclets.internal.toolkit.util;
18.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/package.html Fri Oct 11 19:05:18 2013 +0100 18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 18.3 @@ -1,38 +0,0 @@ 18.4 -<!-- 18.5 - Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 18.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 18.7 - 18.8 - This code is free software; you can redistribute it and/or modify it 18.9 - under the terms of the GNU General Public License version 2 only, as 18.10 - published by the Free Software Foundation. Oracle designates this 18.11 - particular file as subject to the "Classpath" exception as provided 18.12 - by Oracle in the LICENSE file that accompanied this code. 18.13 - 18.14 - This code is distributed in the hope that it will be useful, but WITHOUT 18.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 18.17 - version 2 for more details (a copy is included in the LICENSE file that 18.18 - accompanied this code). 18.19 - 18.20 - You should have received a copy of the GNU General Public License version 18.21 - 2 along with this work; if not, write to the Free Software Foundation, 18.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18.23 - 18.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 18.25 - or visit www.oracle.com if you need additional information or have any 18.26 - questions. 18.27 ---> 18.28 - 18.29 -<html> 18.30 -<head> 18.31 -<title>com.sun.tools.doclets.internal.toolkit.util package</title> 18.32 -</head> 18.33 -<body bgcolor="white"> 18.34 - This package has utility classes that perform common services required 18.35 - for API documentation generation. 18.36 - <p> 18.37 - This code is not part of an API. 18.38 - It is implementation that is subject to change. 18.39 - Do not use it as an API. 18.40 - </body> 18.41 -</html>
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 19.2 +++ b/src/share/classes/com/sun/tools/doclets/package-info.java Tue Oct 15 14:17:11 2013 +0100 19.3 @@ -0,0 +1,36 @@ 19.4 +/* 19.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 19.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 19.7 + * 19.8 + * This code is free software; you can redistribute it and/or modify it 19.9 + * under the terms of the GNU General Public License version 2 only, as 19.10 + * published by the Free Software Foundation. Oracle designates this 19.11 + * particular file as subject to the "Classpath" exception as provided 19.12 + * by Oracle in the LICENSE file that accompanied this code. 19.13 + * 19.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 19.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 19.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 19.17 + * version 2 for more details (a copy is included in the LICENSE file that 19.18 + * accompanied this code). 19.19 + * 19.20 + * You should have received a copy of the GNU General Public License version 19.21 + * 2 along with this work; if not, write to the Free Software Foundation, 19.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19.23 + * 19.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 19.25 + * or visit www.oracle.com if you need additional information or have any 19.26 + * questions. 19.27 + */ 19.28 + 19.29 +/** 19.30 + As of JDK version 1.5, replaced by 19.31 + {@code com.sun.tools.doclets.internal.toolkit.util}. 19.32 + 19.33 + <p><b>This is NOT part of any supported API. 19.34 + If you write code that depends on this, you do so at your own risk. 19.35 + This code and its internal interfaces are subject to change or 19.36 + deletion without notice.</b> 19.37 +*/ 19.38 +@jdk.Exported(false) 19.39 +package com.sun.tools.doclets;
20.1 --- a/src/share/classes/com/sun/tools/doclets/package.html Fri Oct 11 19:05:18 2013 +0100 20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 20.3 @@ -1,34 +0,0 @@ 20.4 -<!-- 20.5 - Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 20.6 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 20.7 - 20.8 - This code is free software; you can redistribute it and/or modify it 20.9 - under the terms of the GNU General Public License version 2 only, as 20.10 - published by the Free Software Foundation. Oracle designates this 20.11 - particular file as subject to the "Classpath" exception as provided 20.12 - by Oracle in the LICENSE file that accompanied this code. 20.13 - 20.14 - This code is distributed in the hope that it will be useful, but WITHOUT 20.15 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 20.16 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20.17 - version 2 for more details (a copy is included in the LICENSE file that 20.18 - accompanied this code). 20.19 - 20.20 - You should have received a copy of the GNU General Public License version 20.21 - 2 along with this work; if not, write to the Free Software Foundation, 20.22 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20.23 - 20.24 - Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20.25 - or visit www.oracle.com if you need additional information or have any 20.26 - questions. 20.27 ---> 20.28 - 20.29 -<html> 20.30 -<head> 20.31 -<title>com.sun.tools/doclets package</title> 20.32 -</head> 20.33 -<body bgcolor="white"> 20.34 - As of JDK version 1.5, replaced by 20.35 - {@code com.sun.tools.doclets.internal.toolkit.util}. 20.36 - </body> 20.37 -</html>
21.1 --- a/src/share/classes/com/sun/tools/doclint/Checker.java Fri Oct 11 19:05:18 2013 +0100 21.2 +++ b/src/share/classes/com/sun/tools/doclint/Checker.java Tue Oct 15 14:17:11 2013 +0100 21.3 @@ -213,6 +213,7 @@ 21.4 public Void visitDocComment(DocCommentTree tree, Void ignore) { 21.5 super.visitDocComment(tree, ignore); 21.6 for (TagStackItem tsi: tagStack) { 21.7 + warnIfEmpty(tsi, null); 21.8 if (tsi.tree.getKind() == DocTree.Kind.START_ELEMENT 21.9 && tsi.tag.endKind == HtmlTag.EndKind.REQUIRED) { 21.10 StartElementTree t = (StartElementTree) tsi.tree; 21.11 @@ -270,7 +271,6 @@ 21.12 21.13 @Override 21.14 public Void visitStartElement(StartElementTree tree, Void ignore) { 21.15 - markEnclosingTag(Flag.HAS_ELEMENT); 21.16 final Name treeName = tree.getName(); 21.17 final HtmlTag t = HtmlTag.get(treeName); 21.18 if (t == null) { 21.19 @@ -279,7 +279,10 @@ 21.20 boolean done = false; 21.21 for (TagStackItem tsi: tagStack) { 21.22 if (tsi.tag.accepts(t)) { 21.23 - while (tagStack.peek() != tsi) tagStack.pop(); 21.24 + while (tagStack.peek() != tsi) { 21.25 + warnIfEmpty(tagStack.peek(), null); 21.26 + tagStack.pop(); 21.27 + } 21.28 done = true; 21.29 break; 21.30 } else if (tsi.tag.endKind != HtmlTag.EndKind.OPTIONAL) { 21.31 @@ -288,9 +291,13 @@ 21.32 } 21.33 } 21.34 if (!done && HtmlTag.BODY.accepts(t)) { 21.35 - tagStack.clear(); 21.36 + while (!tagStack.isEmpty()) { 21.37 + warnIfEmpty(tagStack.peek(), null); 21.38 + tagStack.pop(); 21.39 + } 21.40 } 21.41 21.42 + markEnclosingTag(Flag.HAS_ELEMENT); 21.43 checkStructure(tree, t); 21.44 21.45 // tag specific checks 21.46 @@ -447,12 +454,7 @@ 21.47 "dc.no.summary.or.caption.for.table"); 21.48 } 21.49 } 21.50 - if (t.flags.contains(HtmlTag.Flag.EXPECT_CONTENT) 21.51 - && !top.flags.contains(Flag.HAS_TEXT) 21.52 - && !top.flags.contains(Flag.HAS_ELEMENT) 21.53 - && !top.flags.contains(Flag.HAS_INLINE_TAG)) { 21.54 - env.messages.warning(HTML, tree, "dc.tag.empty", treeName); 21.55 - } 21.56 + warnIfEmpty(top, tree); 21.57 tagStack.pop(); 21.58 done = true; 21.59 break; 21.60 @@ -485,6 +487,20 @@ 21.61 21.62 return super.visitEndElement(tree, ignore); 21.63 } 21.64 + 21.65 + void warnIfEmpty(TagStackItem tsi, DocTree endTree) { 21.66 + if (tsi.tag != null && tsi.tree instanceof StartElementTree) { 21.67 + if (tsi.tag.flags.contains(HtmlTag.Flag.EXPECT_CONTENT) 21.68 + && !tsi.flags.contains(Flag.HAS_TEXT) 21.69 + && !tsi.flags.contains(Flag.HAS_ELEMENT) 21.70 + && !tsi.flags.contains(Flag.HAS_INLINE_TAG)) { 21.71 + DocTree tree = (endTree != null) ? endTree : tsi.tree; 21.72 + Name treeName = ((StartElementTree) tsi.tree).getName(); 21.73 + env.messages.warning(HTML, tree, "dc.tag.empty", treeName); 21.74 + } 21.75 + } 21.76 + } 21.77 + 21.78 // </editor-fold> 21.79 21.80 // <editor-fold defaultstate="collapsed" desc="HTML attributes">
22.1 --- a/src/share/classes/com/sun/tools/javac/code/Flags.java Fri Oct 11 19:05:18 2013 +0100 22.2 +++ b/src/share/classes/com/sun/tools/javac/code/Flags.java Tue Oct 15 14:17:11 2013 +0100 22.3 @@ -270,6 +270,11 @@ 22.4 */ 22.5 public static final long POTENTIALLY_AMBIGUOUS = 1L<<48; 22.6 22.7 + /** 22.8 + * Flag that marks a synthetic method body for a lambda expression 22.9 + */ 22.10 + public static final long LAMBDA_METHOD = 1L<<49; 22.11 + 22.12 /** Modifier masks. 22.13 */ 22.14 public static final int 22.15 @@ -378,7 +383,8 @@ 22.16 NOT_IN_PROFILE(Flags.NOT_IN_PROFILE), 22.17 BAD_OVERRIDE(Flags.BAD_OVERRIDE), 22.18 SIGNATURE_POLYMORPHIC(Flags.SIGNATURE_POLYMORPHIC), 22.19 - THROWS(Flags.THROWS); 22.20 + THROWS(Flags.THROWS), 22.21 + LAMBDA_METHOD(Flags.LAMBDA_METHOD); 22.22 22.23 Flag(long flag) { 22.24 this.value = flag;
23.1 --- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Fri Oct 11 19:05:18 2013 +0100 23.2 +++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Tue Oct 15 14:17:11 2013 +0100 23.3 @@ -50,6 +50,7 @@ 23.4 import com.sun.tools.javac.code.Symbol.MethodSymbol; 23.5 import com.sun.tools.javac.comp.Annotate; 23.6 import com.sun.tools.javac.comp.Annotate.Annotator; 23.7 +import com.sun.tools.javac.comp.Attr; 23.8 import com.sun.tools.javac.comp.AttrContext; 23.9 import com.sun.tools.javac.comp.Env; 23.10 import com.sun.tools.javac.tree.JCTree; 23.11 @@ -95,6 +96,7 @@ 23.12 final Names names; 23.13 final Symtab syms; 23.14 final Annotate annotate; 23.15 + final Attr attr; 23.16 private final boolean typeAnnoAsserts; 23.17 23.18 protected TypeAnnotations(Context context) { 23.19 @@ -103,6 +105,7 @@ 23.20 log = Log.instance(context); 23.21 syms = Symtab.instance(context); 23.22 annotate = Annotate.instance(context); 23.23 + attr = Attr.instance(context); 23.24 Options options = Options.instance(context); 23.25 typeAnnoAsserts = options.isSet("TypeAnnotationAsserts"); 23.26 } 23.27 @@ -131,6 +134,21 @@ 23.28 } ); 23.29 } 23.30 23.31 + public void validateTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) { 23.32 + annotate.validate(new Annotator() { //validate annotations 23.33 + @Override 23.34 + public void enterAnnotation() { 23.35 + JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile); 23.36 + 23.37 + try { 23.38 + attr.validateTypeAnnotations(tree, true); 23.39 + } finally { 23.40 + log.useSource(oldSource); 23.41 + } 23.42 + } 23.43 + } ); 23.44 + } 23.45 + 23.46 /** 23.47 * This version only visits types in bodies, that is, field initializers, 23.48 * top-level blocks, and method bodies, and should be called from Attr.
24.1 --- a/src/share/classes/com/sun/tools/javac/comp/Annotate.java Fri Oct 11 19:05:18 2013 +0100 24.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Annotate.java Tue Oct 15 14:17:11 2013 +0100 24.3 @@ -92,6 +92,7 @@ 24.4 ListBuffer<Annotator> typesQ = new ListBuffer<Annotator>(); 24.5 ListBuffer<Annotator> repeatedQ = new ListBuffer<Annotator>(); 24.6 ListBuffer<Annotator> afterRepeatedQ = new ListBuffer<Annotator>(); 24.7 + ListBuffer<Annotator> validateQ = new ListBuffer<Annotator>(); 24.8 24.9 public void earlier(Annotator a) { 24.10 q.prepend(a); 24.11 @@ -113,6 +114,10 @@ 24.12 afterRepeatedQ.append(a); 24.13 } 24.14 24.15 + public void validate(Annotator a) { 24.16 + validateQ.append(a); 24.17 + } 24.18 + 24.19 /** Called when the Enter phase starts. */ 24.20 public void enterStart() { 24.21 enterCount++; 24.22 @@ -140,6 +145,9 @@ 24.23 while (afterRepeatedQ.nonEmpty()) { 24.24 afterRepeatedQ.next().enterAnnotation(); 24.25 } 24.26 + while (validateQ.nonEmpty()) { 24.27 + validateQ.next().enterAnnotation(); 24.28 + } 24.29 } finally { 24.30 enterCount--; 24.31 }
25.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Oct 11 19:05:18 2013 +0100 25.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Tue Oct 15 14:17:11 2013 +0100 25.3 @@ -965,12 +965,6 @@ 25.4 chk.validateAnnotationType(tree.restype); 25.5 // ensure that annotation method does not clash with members of Object/Annotation 25.6 chk.validateAnnotationMethod(tree.pos(), m); 25.7 - 25.8 - if (tree.defaultValue != null) { 25.9 - // if default value is an annotation, check it is a well-formed 25.10 - // annotation value (e.g. no duplicate values, no missing values, etc.) 25.11 - chk.validateAnnotationTree(tree.defaultValue); 25.12 - } 25.13 } 25.14 25.15 for (List<JCExpression> l = tree.thrown; l.nonEmpty(); l = l.tail) 25.16 @@ -1032,7 +1026,6 @@ 25.17 25.18 localEnv.info.scope.leave(); 25.19 result = tree.type = m.type; 25.20 - chk.validateAnnotations(tree.mods.annotations, m); 25.21 } 25.22 finally { 25.23 chk.setLint(prevLint); 25.24 @@ -1090,7 +1083,6 @@ 25.25 } 25.26 } 25.27 result = tree.type = v.type; 25.28 - chk.validateAnnotations(tree.mods.annotations, v); 25.29 } 25.30 finally { 25.31 chk.setLint(prevLint); 25.32 @@ -4155,7 +4147,6 @@ 25.33 JCCompilationUnit toplevel = env.toplevel; 25.34 try { 25.35 annotate.flush(); 25.36 - chk.validateAnnotations(toplevel.packageAnnotations, toplevel.packge); 25.37 } catch (CompletionFailure ex) { 25.38 chk.completionError(toplevel.pos(), ex); 25.39 } 25.40 @@ -4240,6 +4231,7 @@ 25.41 25.42 chk.checkDeprecatedAnnotation(env.tree.pos(), c); 25.43 chk.checkClassOverrideEqualsAndHashIfNeeded(env.tree.pos(), c); 25.44 + chk.checkFunctionalInterface((JCClassDecl) env.tree, c); 25.45 } finally { 25.46 env.info.returnResult = prevReturnRes; 25.47 log.useSource(prev); 25.48 @@ -4258,9 +4250,6 @@ 25.49 JCClassDecl tree = (JCClassDecl)env.tree; 25.50 Assert.check(c == tree.sym); 25.51 25.52 - // Validate annotations 25.53 - chk.validateAnnotations(tree.mods.annotations, c); 25.54 - 25.55 // Validate type parameters, supertype and interfaces. 25.56 attribStats(tree.typarams, env); 25.57 if (!c.isAnonymous()) { 25.58 @@ -4361,7 +4350,7 @@ 25.59 typeAnnotations.organizeTypeAnnotationsBodies(tree); 25.60 25.61 // Check type annotations applicability rules 25.62 - validateTypeAnnotations(tree); 25.63 + validateTypeAnnotations(tree, false); 25.64 } 25.65 } 25.66 // where 25.67 @@ -4436,14 +4425,19 @@ 25.68 return types.capture(type); 25.69 } 25.70 25.71 - private void validateTypeAnnotations(JCTree tree) { 25.72 - tree.accept(typeAnnotationsValidator); 25.73 + public void validateTypeAnnotations(JCTree tree, boolean sigOnly) { 25.74 + tree.accept(new TypeAnnotationsValidator(sigOnly)); 25.75 } 25.76 //where 25.77 - private final JCTree.Visitor typeAnnotationsValidator = new TreeScanner() { 25.78 - 25.79 + private final class TypeAnnotationsValidator extends TreeScanner { 25.80 + 25.81 + private final boolean sigOnly; 25.82 private boolean checkAllAnnotations = false; 25.83 25.84 + public TypeAnnotationsValidator(boolean sigOnly) { 25.85 + this.sigOnly = sigOnly; 25.86 + } 25.87 + 25.88 public void visitAnnotation(JCAnnotation tree) { 25.89 if (tree.hasTag(TYPE_ANNOTATION) || checkAllAnnotations) { 25.90 chk.validateTypeAnnotation(tree, false); 25.91 @@ -4467,12 +4461,26 @@ 25.92 if (tree.restype != null && tree.restype.type != null) { 25.93 validateAnnotatedType(tree.restype, tree.restype.type); 25.94 } 25.95 - super.visitMethodDef(tree); 25.96 + if (sigOnly) { 25.97 + scan(tree.mods); 25.98 + scan(tree.restype); 25.99 + scan(tree.typarams); 25.100 + scan(tree.recvparam); 25.101 + scan(tree.params); 25.102 + scan(tree.thrown); 25.103 + } else { 25.104 + scan(tree.defaultValue); 25.105 + scan(tree.body); 25.106 + } 25.107 } 25.108 public void visitVarDef(final JCVariableDecl tree) { 25.109 if (tree.sym != null && tree.sym.type != null) 25.110 validateAnnotatedType(tree, tree.sym.type); 25.111 - super.visitVarDef(tree); 25.112 + scan(tree.mods); 25.113 + scan(tree.vartype); 25.114 + if (!sigOnly) { 25.115 + scan(tree.init); 25.116 + } 25.117 } 25.118 public void visitTypeCast(JCTypeCast tree) { 25.119 if (tree.clazz != null && tree.clazz.type != null) 25.120 @@ -4509,6 +4517,29 @@ 25.121 super.visitNewArray(tree); 25.122 } 25.123 25.124 + @Override 25.125 + public void visitClassDef(JCClassDecl tree) { 25.126 + if (sigOnly) { 25.127 + scan(tree.mods); 25.128 + scan(tree.typarams); 25.129 + scan(tree.extending); 25.130 + scan(tree.implementing); 25.131 + } 25.132 + for (JCTree member : tree.defs) { 25.133 + if (member.hasTag(Tag.CLASSDEF)) { 25.134 + continue; 25.135 + } 25.136 + scan(member); 25.137 + } 25.138 + } 25.139 + 25.140 + @Override 25.141 + public void visitBlock(JCBlock tree) { 25.142 + if (!sigOnly) { 25.143 + scan(tree.stats); 25.144 + } 25.145 + } 25.146 + 25.147 /* I would want to model this after 25.148 * com.sun.tools.javac.comp.Check.Validator.visitSelectInternal(JCFieldAccess) 25.149 * and override visitSelect and visitTypeApply.
26.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java Fri Oct 11 19:05:18 2013 +0100 26.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java Tue Oct 15 14:17:11 2013 +0100 26.3 @@ -30,6 +30,7 @@ 26.4 import javax.tools.JavaFileManager; 26.5 26.6 import com.sun.tools.javac.code.*; 26.7 +import com.sun.tools.javac.code.Attribute.Compound; 26.8 import com.sun.tools.javac.jvm.*; 26.9 import com.sun.tools.javac.tree.*; 26.10 import com.sun.tools.javac.util.*; 26.11 @@ -1951,7 +1952,7 @@ 26.12 * for errors. 26.13 * @param m The overriding method. 26.14 */ 26.15 - void checkOverride(JCTree tree, MethodSymbol m) { 26.16 + void checkOverride(JCMethodDecl tree, MethodSymbol m) { 26.17 ClassSymbol origin = (ClassSymbol)m.owner; 26.18 if ((origin.flags() & ENUM) != 0 && names.finalize.equals(m.name)) 26.19 if (m.overrides(syms.enumFinalFinalize, origin, types, false)) { 26.20 @@ -1967,6 +1968,17 @@ 26.21 checkOverride(tree, t2, origin, m); 26.22 } 26.23 } 26.24 + 26.25 + if (m.attribute(syms.overrideType.tsym) != null && !isOverrider(m)) { 26.26 + DiagnosticPosition pos = tree.pos(); 26.27 + for (JCAnnotation a : tree.getModifiers().annotations) { 26.28 + if (a.annotationType.type.tsym == syms.overrideType.tsym) { 26.29 + pos = a.pos(); 26.30 + break; 26.31 + } 26.32 + } 26.33 + log.error(pos, "method.does.not.override.superclass"); 26.34 + } 26.35 } 26.36 26.37 void checkOverride(JCTree tree, Type site, ClassSymbol origin, MethodSymbol m) { 26.38 @@ -2725,20 +2737,11 @@ 26.39 if (!annotationApplicable(a, s)) 26.40 log.error(a.pos(), "annotation.type.not.applicable"); 26.41 26.42 - if (a.annotationType.type.tsym == syms.overrideType.tsym) { 26.43 - if (!isOverrider(s)) 26.44 - log.error(a.pos(), "method.does.not.override.superclass"); 26.45 - } 26.46 - 26.47 if (a.annotationType.type.tsym == syms.functionalInterfaceType.tsym) { 26.48 if (s.kind != TYP) { 26.49 log.error(a.pos(), "bad.functional.intf.anno"); 26.50 - } else { 26.51 - try { 26.52 - types.findDescriptorSymbol((TypeSymbol)s); 26.53 - } catch (Types.FunctionDescriptorLookupError ex) { 26.54 - log.error(a.pos(), "bad.functional.intf.anno.1", ex.getDiagnostic()); 26.55 - } 26.56 + } else if (!s.isInterface() || (s.flags() & ANNOTATION) != 0) { 26.57 + log.error(a.pos(), "bad.functional.intf.anno.1", diags.fragment("not.a.functional.intf", s)); 26.58 } 26.59 } 26.60 } 26.61 @@ -2953,7 +2956,7 @@ 26.62 return false; 26.63 } 26.64 26.65 - /** Is the annotation applicable to type annotations? */ 26.66 + /** Is the annotation applicable to types? */ 26.67 protected boolean isTypeAnnotation(JCAnnotation a, boolean isTypeParameter) { 26.68 Attribute.Compound atTarget = 26.69 a.annotationType.type.tsym.attribute(syms.annotationTargetType.tsym); 26.70 @@ -3507,4 +3510,23 @@ 26.71 public Warner convertWarner(DiagnosticPosition pos, Type found, Type expected) { 26.72 return new ConversionWarner(pos, "unchecked.assign", found, expected); 26.73 } 26.74 + 26.75 + public void checkFunctionalInterface(JCClassDecl tree, ClassSymbol cs) { 26.76 + Compound functionalType = cs.attribute(syms.functionalInterfaceType.tsym); 26.77 + 26.78 + if (functionalType != null) { 26.79 + try { 26.80 + types.findDescriptorSymbol((TypeSymbol)cs); 26.81 + } catch (Types.FunctionDescriptorLookupError ex) { 26.82 + DiagnosticPosition pos = tree.pos(); 26.83 + for (JCAnnotation a : tree.getModifiers().annotations) { 26.84 + if (a.annotationType.type.tsym == syms.functionalInterfaceType.tsym) { 26.85 + pos = a.pos(); 26.86 + break; 26.87 + } 26.88 + } 26.89 + log.error(pos, "bad.functional.intf.anno.1", ex.getDiagnostic()); 26.90 + } 26.91 + } 26.92 + } 26.93 }
27.1 --- a/src/share/classes/com/sun/tools/javac/comp/Flow.java Fri Oct 11 19:05:18 2013 +0100 27.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Flow.java Tue Oct 15 14:17:11 2013 +0100 27.3 @@ -1718,9 +1718,9 @@ 27.4 if (tree.body == null) { 27.5 return; 27.6 } 27.7 - /* MemberEnter can generate synthetic methods, ignore them 27.8 + /* Ignore synthetic methods, except for translated lambda methods. 27.9 */ 27.10 - if ((tree.sym.flags() & SYNTHETIC) != 0) { 27.11 + if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) { 27.12 return; 27.13 } 27.14
28.1 --- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Fri Oct 11 19:05:18 2013 +0100 28.2 +++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Tue Oct 15 14:17:11 2013 +0100 28.3 @@ -30,6 +30,7 @@ 28.4 import com.sun.tools.javac.tree.TreeMaker; 28.5 import com.sun.tools.javac.tree.TreeTranslator; 28.6 import com.sun.tools.javac.code.Attribute; 28.7 +import com.sun.tools.javac.code.Flags; 28.8 import com.sun.tools.javac.code.Kinds; 28.9 import com.sun.tools.javac.code.Scope; 28.10 import com.sun.tools.javac.code.Symbol; 28.11 @@ -1755,7 +1756,7 @@ 28.12 ((VarSymbol)ret).pos = ((VarSymbol)sym).pos; 28.13 break; 28.14 case CAPTURED_VAR: 28.15 - ret = new VarSymbol(SYNTHETIC | FINAL, name, types.erasure(sym.type), translatedSym) { 28.16 + ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) { 28.17 @Override 28.18 public Symbol baseSymbol() { 28.19 //keep mapping with original captured symbol 28.20 @@ -1763,6 +1764,13 @@ 28.21 } 28.22 }; 28.23 break; 28.24 + case LOCAL_VAR: 28.25 + ret = new VarSymbol(FINAL, name, types.erasure(sym.type), translatedSym); 28.26 + break; 28.27 + case PARAM: 28.28 + ret = new VarSymbol(FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym); 28.29 + ((VarSymbol) ret).adr = ((VarSymbol) sym).adr; 28.30 + break; 28.31 default: 28.32 ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym); 28.33 } 28.34 @@ -1845,7 +1853,7 @@ 28.35 // If instance access isn't needed, make it static. 28.36 // Interface instance methods must be default methods. 28.37 // Lambda methods are private synthetic. 28.38 - translatedSym.flags_field = SYNTHETIC | 28.39 + translatedSym.flags_field = SYNTHETIC | LAMBDA_METHOD | 28.40 PRIVATE | 28.41 (thisReferenced? (inInterface? DEFAULT : 0) : STATIC); 28.42
29.1 --- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Fri Oct 11 19:05:18 2013 +0100 29.2 +++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java Tue Oct 15 14:17:11 2013 +0100 29.3 @@ -871,6 +871,18 @@ 29.4 } 29.5 } 29.6 }); 29.7 + 29.8 + annotate.validate(new Annotate.Annotator() { //validate annotations 29.9 + @Override 29.10 + public void enterAnnotation() { 29.11 + JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile); 29.12 + try { 29.13 + chk.validateAnnotations(annotations, s); 29.14 + } finally { 29.15 + log.useSource(prev); 29.16 + } 29.17 + } 29.18 + }); 29.19 } 29.20 29.21 /** 29.22 @@ -951,6 +963,19 @@ 29.23 } 29.24 } 29.25 }); 29.26 + annotate.validate(new Annotate.Annotator() { //validate annotations 29.27 + @Override 29.28 + public void enterAnnotation() { 29.29 + JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile); 29.30 + try { 29.31 + // if default value is an annotation, check it is a well-formed 29.32 + // annotation value (e.g. no duplicate values, no missing values, etc.) 29.33 + chk.validateAnnotationTree(defaultValue); 29.34 + } finally { 29.35 + log.useSource(prev); 29.36 + } 29.37 + } 29.38 + }); 29.39 } 29.40 29.41 /** Enter a default value for an attribute method. */ 29.42 @@ -1157,15 +1182,17 @@ 29.43 if (wasFirst) { 29.44 try { 29.45 while (halfcompleted.nonEmpty()) { 29.46 - finish(halfcompleted.next()); 29.47 + Env<AttrContext> toFinish = halfcompleted.next(); 29.48 + finish(toFinish); 29.49 + if (allowTypeAnnos) { 29.50 + typeAnnotations.organizeTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree); 29.51 + typeAnnotations.validateTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree); 29.52 + } 29.53 } 29.54 } finally { 29.55 isFirst = true; 29.56 } 29.57 } 29.58 - if (allowTypeAnnos) { 29.59 - typeAnnotations.organizeTypeAnnotationsSignatures(env, tree); 29.60 - } 29.61 } 29.62 29.63 /*
30.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java Fri Oct 11 19:05:18 2013 +0100 30.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java Tue Oct 15 14:17:11 2013 +0100 30.3 @@ -2892,7 +2892,8 @@ 30.4 30.5 @Override 30.6 public void visitMethodDef(JCMethodDecl tree) { 30.7 - if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0) { 30.8 + if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0 30.9 + && (tree.sym.flags() & LAMBDA_METHOD) == 0) { 30.10 return; 30.11 } 30.12 if (tree.name.equals(names.clinit)) { 30.13 @@ -2906,6 +2907,7 @@ 30.14 return; 30.15 } 30.16 currentMethod = tree.sym; 30.17 + 30.18 super.visitMethodDef(tree); 30.19 } 30.20
31.1 --- a/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Fri Oct 11 19:05:18 2013 +0100 31.2 +++ b/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Tue Oct 15 14:17:11 2013 +0100 31.3 @@ -619,8 +619,10 @@ 31.4 Names names = tsym.name.table.names; 31.5 List<MethodDocImpl> methods = List.nil(); 31.6 for (Scope.Entry e = tsym.members().elems; e != null; e = e.sibling) { 31.7 - if (e.sym != null && 31.8 - e.sym.kind == Kinds.MTH && e.sym.name != names.init) { 31.9 + if (e.sym != null 31.10 + && e.sym.kind == Kinds.MTH 31.11 + && e.sym.name != names.init 31.12 + && e.sym.name != names.clinit) { 31.13 MethodSymbol s = (MethodSymbol)e.sym; 31.14 if (!filter || env.shouldDocument(s)) { 31.15 methods = methods.prepend(env.getMethodDoc(s));
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 32.2 +++ b/src/share/classes/com/sun/tools/javap/package-info.java Tue Oct 15 14:17:11 2013 +0100 32.3 @@ -0,0 +1,35 @@ 32.4 +/* 32.5 + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 32.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 32.7 + * 32.8 + * This code is free software; you can redistribute it and/or modify it 32.9 + * under the terms of the GNU General Public License version 2 only, as 32.10 + * published by the Free Software Foundation. Oracle designates this 32.11 + * particular file as subject to the "Classpath" exception as provided 32.12 + * by Oracle in the LICENSE file that accompanied this code. 32.13 + * 32.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 32.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 32.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 32.17 + * version 2 for more details (a copy is included in the LICENSE file that 32.18 + * accompanied this code). 32.19 + * 32.20 + * You should have received a copy of the GNU General Public License version 32.21 + * 2 along with this work; if not, write to the Free Software Foundation, 32.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 32.23 + * 32.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 32.25 + * or visit www.oracle.com if you need additional information or have any 32.26 + * questions. 32.27 + */ 32.28 + 32.29 +/** 32.30 + Classes to dump class files in text format. 32.31 + 32.32 + <p><b>This is NOT part of any supported API. 32.33 + If you write code that depends on this, you do so at your own risk. 32.34 + This code and its internal interfaces are subject to change or 32.35 + deletion without notice.</b> 32.36 +*/ 32.37 +@jdk.Exported(false) 32.38 +package com.sun.tools.javap;
33.1 --- a/src/share/classes/com/sun/tools/javap/package.html Fri Oct 11 19:05:18 2013 +0100 33.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 33.3 @@ -1,10 +0,0 @@ 33.4 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 33.5 -<html> 33.6 - <head> 33.7 - <title></title> 33.8 - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 33.9 - </head> 33.10 - <body> 33.11 - Classes to dump class files in text format. 33.12 - </body> 33.13 -</html>
34.1 --- a/src/share/classes/javax/lang/model/overview.html Fri Oct 11 19:05:18 2013 +0100 34.2 +++ b/src/share/classes/javax/lang/model/overview.html Tue Oct 15 14:17:11 2013 +0100 34.3 @@ -1,8 +1,6 @@ 34.4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 34.5 -<html> 34.6 -<head> 34.7 <!-- 34.8 -Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 34.9 +Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 34.10 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.11 34.12 This code is free software; you can redistribute it and/or modify it 34.13 @@ -25,7 +23,9 @@ 34.14 or visit www.oracle.com if you need additional information or have any 34.15 questions. 34.16 --> 34.17 - 34.18 +<html> 34.19 +<head> 34.20 +<title>javax.lang.model</title> 34.21 </head> 34.22 34.23 <body bgcolor="white">
35.1 --- a/src/share/classes/javax/tools/overview.html Fri Oct 11 19:05:18 2013 +0100 35.2 +++ b/src/share/classes/javax/tools/overview.html Tue Oct 15 14:17:11 2013 +0100 35.3 @@ -1,3 +1,33 @@ 35.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 35.5 +<!-- 35.6 +Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. 35.7 +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 35.8 + 35.9 +This code is free software; you can redistribute it and/or modify it 35.10 +under the terms of the GNU General Public License version 2 only, as 35.11 +published by the Free Software Foundation. Oracle designates this 35.12 +particular file as subject to the "Classpath" exception as provided 35.13 +by Oracle in the LICENSE file that accompanied this code. 35.14 + 35.15 +This code is distributed in the hope that it will be useful, but WITHOUT 35.16 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 35.17 +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 35.18 +version 2 for more details (a copy is included in the LICENSE file that 35.19 +accompanied this code). 35.20 + 35.21 +You should have received a copy of the GNU General Public License version 35.22 +2 along with this work; if not, write to the Free Software Foundation, 35.23 +Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 35.24 + 35.25 +Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 35.26 +or visit www.oracle.com if you need additional information or have any 35.27 +questions. 35.28 +--> 35.29 + 35.30 +<html> 35.31 +<head> 35.32 +<title>javax.tools</title> 35.33 +</head> 35.34 <body> 35.35 35.36 <p> 35.37 @@ -21,3 +51,4 @@ 35.38 </ul> 35.39 35.40 </body> 35.41 +</html>
36.1 --- a/test/tools/doclint/HtmlAttrsTest.java Fri Oct 11 19:05:18 2013 +0100 36.2 +++ b/test/tools/doclint/HtmlAttrsTest.java Tue Oct 15 14:17:11 2013 +0100 36.3 @@ -10,7 +10,7 @@ 36.4 /** */ 36.5 public class HtmlAttrsTest { 36.6 /** 36.7 - * <p xyz> 36.8 + * <p xyz> text </p> 36.9 */ 36.10 public void unknown() { } 36.11
37.1 --- a/test/tools/doclint/HtmlAttrsTest.out Fri Oct 11 19:05:18 2013 +0100 37.2 +++ b/test/tools/doclint/HtmlAttrsTest.out Tue Oct 15 14:17:11 2013 +0100 37.3 @@ -1,5 +1,5 @@ 37.4 HtmlAttrsTest.java:13: error: unknown attribute: xyz 37.5 - * <p xyz> 37.6 + * <p xyz> text </p> 37.7 ^ 37.8 HtmlAttrsTest.java:18: warning: attribute obsolete: name 37.9 * <img name="x" alt="alt">
38.1 --- a/test/tools/doclint/tidy/BadEnd.out Fri Oct 11 19:05:18 2013 +0100 38.2 +++ b/test/tools/doclint/tidy/BadEnd.out Tue Oct 15 14:17:11 2013 +0100 38.3 @@ -1,6 +1,9 @@ 38.4 BadEnd.java:14: warning: nested tag not allowed: <code> 38.5 * <code> text <code> 38.6 ^ 38.7 +BadEnd.java:14: warning: empty <code> tag 38.8 + * <code> text <code> 38.9 + ^ 38.10 BadEnd.java:14: error: element not closed: code 38.11 * <code> text <code> 38.12 ^ 38.13 @@ -14,4 +17,4 @@ 38.14 * <a name="here"> text <a> 38.15 ^ 38.16 4 errors 38.17 -1 warning 38.18 +2 warnings
39.1 --- a/test/tools/doclint/tidy/TrimmingEmptyTag.java Fri Oct 11 19:05:18 2013 +0100 39.2 +++ b/test/tools/doclint/tidy/TrimmingEmptyTag.java Tue Oct 15 14:17:11 2013 +0100 39.3 @@ -1,6 +1,6 @@ 39.4 /* 39.5 * @test /nodynamiccopyright/ 39.6 - * @bug 8004832 39.7 + * @bug 8004832 8026368 39.8 * @summary Add new doclint package 39.9 * @library .. 39.10 * @build DocLintTester 39.11 @@ -26,4 +26,9 @@ 39.12 * <ul></ul> 39.13 * <ul><li></li></ul> 39.14 */ 39.15 -public class TrimmingEmptyTag { } 39.16 +public class TrimmingEmptyTag { 39.17 + /** <p> */ 39.18 + public void implicitParaEnd_endOfComment() { } 39.19 + /** <p> <ul><li>text</ul> */ 39.20 + public void implicitParaEnd_nextBlockTag() { } 39.21 +}
40.1 --- a/test/tools/doclint/tidy/TrimmingEmptyTag.out Fri Oct 11 19:05:18 2013 +0100 40.2 +++ b/test/tools/doclint/tidy/TrimmingEmptyTag.out Tue Oct 15 14:17:11 2013 +0100 40.3 @@ -43,4 +43,10 @@ 40.4 TrimmingEmptyTag.java:26: warning: empty <ul> tag 40.5 * <ul></ul> 40.6 ^ 40.7 -15 warnings 40.8 +TrimmingEmptyTag.java:30: warning: empty <p> tag 40.9 + /** <p> */ 40.10 + ^ 40.11 +TrimmingEmptyTag.java:32: warning: empty <p> tag 40.12 + /** <p> <ul><li>text</ul> */ 40.13 + ^ 40.14 +17 warnings
41.1 --- a/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.out Fri Oct 11 19:05:18 2013 +0100 41.2 +++ b/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.out Tue Oct 15 14:17:11 2013 +0100 41.3 @@ -1,10 +1,10 @@ 41.4 CantAnnotateStaticClass.java:22:20: compiler.err.cant.annotate.static.class 41.5 CantAnnotateStaticClass.java:23:13: compiler.err.cant.annotate.static.class 41.6 CantAnnotateStaticClass.java:24:29: compiler.err.cant.annotate.static.class 41.7 -CantAnnotateStaticClass.java:26:29: compiler.err.cant.annotate.static.class 41.8 CantAnnotateStaticClass.java:29:26: compiler.err.cant.annotate.static.class 41.9 CantAnnotateStaticClass.java:30:9: compiler.err.cant.annotate.static.class 41.10 CantAnnotateStaticClass.java:31:35: compiler.err.cant.annotate.static.class 41.11 +CantAnnotateStaticClass.java:26:29: compiler.err.cant.annotate.static.class 41.12 - compiler.note.unchecked.filename: CantAnnotateStaticClass.java 41.13 - compiler.note.unchecked.recompile 41.14 -7 errors 41.15 +7 errors 41.16 \ No newline at end of file
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 42.2 +++ b/test/tools/javac/lambda/LocalVariableTable.java Tue Oct 15 14:17:11 2013 +0100 42.3 @@ -0,0 +1,206 @@ 42.4 +/* 42.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 42.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 42.7 + * 42.8 + * This code is free software; you can redistribute it and/or modify it 42.9 + * under the terms of the GNU General Public License version 2 only, as 42.10 + * published by the Free Software Foundation. 42.11 + * 42.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 42.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 42.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42.15 + * version 2 for more details (a copy is included in the LICENSE file that 42.16 + * accompanied this code). 42.17 + * 42.18 + * You should have received a copy of the GNU General Public License version 42.19 + * 2 along with this work; if not, write to the Free Software Foundation, 42.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 42.21 + * 42.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 42.23 + * or visit www.oracle.com if you need additional information or have any 42.24 + * questions. 42.25 + */ 42.26 + 42.27 +/* 42.28 + * @test 42.29 + * @bug 8025998 42.30 + * @summary Missing LV table in lambda bodies 42.31 + * @compile -g LocalVariableTable.java 42.32 + * @run main LocalVariableTable 42.33 + */ 42.34 + 42.35 +import java.lang.annotation.*; 42.36 +import java.util.*; 42.37 +import com.sun.tools.classfile.*; 42.38 + 42.39 +/* 42.40 + * The test checks that a LocalVariableTable attribute is generated for the 42.41 + * method bodies representing lambda expressions, and checks that the expected 42.42 + * set of entries is found in the attribute. 42.43 + * 42.44 + * Since the bug was about missing entries in the LVT, not malformed entries, 42.45 + * the test is not intended to be a detailed test of the contents of each 42.46 + * LocalVariableTable entry: it is assumed that if a entry is present, it 42.47 + * will have the correct contents. 42.48 + * 42.49 + * The test looks for test cases represented by nested classes whose 42.50 + * name begins with "Lambda". Each such class contains a lambda expression 42.51 + * that will mapped into a lambda method, and because the test is compiled 42.52 + * with -g, these methods should have a LocalVariableTable. The set of 42.53 + * expected names in the LVT is provided in an annotation on the class for 42.54 + * the test case. 42.55 + */ 42.56 +public class LocalVariableTable { 42.57 + public static void main(String... args) throws Exception { 42.58 + new LocalVariableTable().run(); 42.59 + } 42.60 + 42.61 + void run() throws Exception { 42.62 + // the declared classes are returned in an unspecified order, 42.63 + // so for neatness, sort them by name before processing them 42.64 + Class<?>[] classes = getClass().getDeclaredClasses(); 42.65 + Arrays.sort(classes, (c1, c2) -> c1.getName().compareTo(c2.getName())); 42.66 + 42.67 + for (Class<?> c : classes) { 42.68 + if (c.getSimpleName().startsWith("Lambda")) 42.69 + check(c); 42.70 + } 42.71 + if (errors > 0) 42.72 + throw new Exception(errors + " errors found"); 42.73 + } 42.74 + 42.75 + /** Check an individual test case. */ 42.76 + void check(Class<?> c) throws Exception { 42.77 + System.err.println("Checking " + c.getSimpleName()); 42.78 + 42.79 + Expect expect = c.getAnnotation(Expect.class); 42.80 + if (expect == null) { 42.81 + error("@Expect not found for class " + c.getSimpleName()); 42.82 + return; 42.83 + } 42.84 + 42.85 + ClassFile cf = ClassFile.read(getClass().getResource(c.getName() + ".class").openStream()); 42.86 + Method m = getLambdaMethod(cf); 42.87 + if (m == null) { 42.88 + error("lambda method not found"); 42.89 + return; 42.90 + } 42.91 + 42.92 + Code_attribute code = (Code_attribute) m.attributes.get(Attribute.Code); 42.93 + if (code == null) { 42.94 + error("Code attribute not found"); 42.95 + return; 42.96 + } 42.97 + 42.98 + LocalVariableTable_attribute lvt = 42.99 + (LocalVariableTable_attribute) code.attributes.get(Attribute.LocalVariableTable); 42.100 + if (lvt == null) { 42.101 + error("LocalVariableTable attribute not found"); 42.102 + return; 42.103 + } 42.104 + 42.105 + Set<String> foundNames = new LinkedHashSet<>(); 42.106 + for (LocalVariableTable_attribute.Entry e: lvt.local_variable_table) { 42.107 + foundNames.add(cf.constant_pool.getUTF8Value(e.name_index)); 42.108 + } 42.109 + 42.110 + Set<String> expectNames = new LinkedHashSet<>(Arrays.asList(expect.value())); 42.111 + if (!foundNames.equals(expectNames)) { 42.112 + Set<String> foundOnly = new LinkedHashSet<>(foundNames); 42.113 + foundOnly.removeAll(expectNames); 42.114 + for (String s: foundOnly) 42.115 + error("Unexpected name found: " + s); 42.116 + Set<String> expectOnly = new LinkedHashSet<>(expectNames); 42.117 + expectOnly.removeAll(foundNames); 42.118 + for (String s: expectOnly) 42.119 + error("Expected name not found: " + s); 42.120 + } 42.121 + } 42.122 + 42.123 + /** Get a method whose name begins "lambda$...". */ 42.124 + Method getLambdaMethod(ClassFile cf) throws ConstantPoolException { 42.125 + for (Method m: cf.methods) { 42.126 + if (m.getName(cf.constant_pool).startsWith("lambda$")) 42.127 + return m; 42.128 + } 42.129 + return null; 42.130 + } 42.131 + 42.132 + /** Report an error. */ 42.133 + void error(String msg) { 42.134 + System.err.println("Error: " + msg); 42.135 + errors++; 42.136 + } 42.137 + 42.138 + int errors; 42.139 + 42.140 + /** 42.141 + * Annotation used to provide the set of names expected in the LVT attribute. 42.142 + */ 42.143 + @Retention(RetentionPolicy.RUNTIME) 42.144 + @interface Expect { 42.145 + String[] value(); 42.146 + } 42.147 + 42.148 + /** Functional interface with nullary method. */ 42.149 + interface Run0 { 42.150 + public void run(); 42.151 + } 42.152 + 42.153 + /** Functional interface with 1-ary method. */ 42.154 + interface Run1 { 42.155 + public void run(int a0); 42.156 + } 42.157 + 42.158 + /** Functional interface with 2-ary method. */ 42.159 + interface Run2 { 42.160 + public void run(int a0, int a1); 42.161 + } 42.162 + 42.163 + /* 42.164 + * ---------- Test cases --------------------------------------------------- 42.165 + */ 42.166 + 42.167 + @Expect({ "x" }) 42.168 + static class Lambda_Args0_Local1 { 42.169 + Run0 r = () -> { int x = 0; }; 42.170 + } 42.171 + 42.172 + @Expect({ "x", "this" }) 42.173 + static class Lambda_Args0_Local1_this { 42.174 + int v; 42.175 + Run0 r = () -> { int x = v; }; 42.176 + } 42.177 + 42.178 + @Expect({ "a" }) 42.179 + static class Lambda_Args1_Local0 { 42.180 + Run1 r = (a) -> { }; 42.181 + } 42.182 + 42.183 + @Expect({ "a", "x" }) 42.184 + static class Lambda_Args1_Local1 { 42.185 + Run1 r = (a) -> { int x = a; }; 42.186 + } 42.187 + 42.188 + @Expect({ "a", "x" }) 42.189 + static class Lambda_Args1_Local1_Captured1 { 42.190 + void m() { 42.191 + int v = 0; 42.192 + Run1 r = (a) -> { int x = a + v; }; 42.193 + } 42.194 + } 42.195 + 42.196 + @Expect({ "a1", "a2", "x1", "x2", "this" }) 42.197 + static class Lambda_Args2_Local2_Captured2_this { 42.198 + int v; 42.199 + void m() { 42.200 + int v1 = 0; 42.201 + int v2 = 0; 42.202 + Run2 r = (a1, a2) -> { 42.203 + int x1 = a1 + v1 + v; 42.204 + int x2 = a2 + v2 + v; 42.205 + }; 42.206 + } 42.207 + } 42.208 +} 42.209 +
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 43.2 +++ b/test/tools/javac/processing/errors/StopOnInapplicableAnnotations/GenerateFunctionalInterface.java Tue Oct 15 14:17:11 2013 +0100 43.3 @@ -0,0 +1,38 @@ 43.4 +/* 43.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 43.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 43.7 + * 43.8 + * This code is free software; you can redistribute it and/or modify it 43.9 + * under the terms of the GNU General Public License version 2 only, as 43.10 + * published by the Free Software Foundation. 43.11 + * 43.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 43.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 43.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 43.15 + * version 2 for more details (a copy is included in the LICENSE file that 43.16 + * accompanied this code). 43.17 + * 43.18 + * You should have received a copy of the GNU General Public License version 43.19 + * 2 along with this work; if not, write to the Free Software Foundation, 43.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 43.21 + * 43.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 43.23 + * or visit www.oracle.com if you need additional information or have any 43.24 + * questions. 43.25 + */ 43.26 + 43.27 +/* 43.28 + * @test 43.29 + * @bug 8014016 43.30 + * @summary Ensure that an annotation processor can generate a super-interface 43.31 + * which will make the current interface functional 43.32 + * @build GenerateSuperInterfaceProcessor 43.33 + * @compile -processor GenerateSuperInterfaceProcessor GenerateFunctionalInterface.java 43.34 + */ 43.35 + 43.36 +import java.lang.FunctionalInterface; 43.37 + 43.38 +@FunctionalInterface 43.39 +@Generate(fileName="SuperInterface.java", content="interface SuperInterface { public void run(); }") 43.40 +interface GenerateFunctionalInterface extends SuperInterface { 43.41 +}
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 44.2 +++ b/test/tools/javac/processing/errors/StopOnInapplicableAnnotations/GenerateSuperInterfaceProcessor.java Tue Oct 15 14:17:11 2013 +0100 44.3 @@ -0,0 +1,60 @@ 44.4 +/* 44.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 44.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 44.7 + * 44.8 + * This code is free software; you can redistribute it and/or modify it 44.9 + * under the terms of the GNU General Public License version 2 only, as 44.10 + * published by the Free Software Foundation. 44.11 + * 44.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 44.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 44.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 44.15 + * version 2 for more details (a copy is included in the LICENSE file that 44.16 + * accompanied this code). 44.17 + * 44.18 + * You should have received a copy of the GNU General Public License version 44.19 + * 2 along with this work; if not, write to the Free Software Foundation, 44.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 44.21 + * 44.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 44.23 + * or visit www.oracle.com if you need additional information or have any 44.24 + * questions. 44.25 + */ 44.26 + 44.27 +import com.sun.tools.javac.util.Assert; 44.28 +import java.io.IOException; 44.29 +import java.io.OutputStream; 44.30 +import java.util.Set; 44.31 +import javax.annotation.processing.AbstractProcessor; 44.32 +import javax.annotation.processing.RoundEnvironment; 44.33 +import javax.annotation.processing.SupportedAnnotationTypes; 44.34 +import javax.lang.model.element.Element; 44.35 +import javax.lang.model.element.TypeElement; 44.36 + 44.37 +@SupportedAnnotationTypes("*") 44.38 +public class GenerateSuperInterfaceProcessor extends AbstractProcessor { 44.39 + 44.40 + @Override 44.41 + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { 44.42 + for (Element el : roundEnv.getElementsAnnotatedWith(Generate.class)) { 44.43 + Generate g = el.getAnnotation(Generate.class); 44.44 + 44.45 + Assert.checkNonNull(g); 44.46 + 44.47 + try (OutputStream out = 44.48 + processingEnv.getFiler().createSourceFile(g.fileName()).openOutputStream()) { 44.49 + out.write(g.content().getBytes()); 44.50 + } catch (IOException ex) { 44.51 + throw new IllegalStateException(ex); 44.52 + } 44.53 + } 44.54 + 44.55 + return false; 44.56 + } 44.57 + 44.58 +} 44.59 + 44.60 +@interface Generate { 44.61 + String fileName(); 44.62 + String content(); 44.63 +} 44.64 \ No newline at end of file
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 45.2 +++ b/test/tools/javac/processing/errors/StopOnInapplicableAnnotations/Processor.java Tue Oct 15 14:17:11 2013 +0100 45.3 @@ -0,0 +1,170 @@ 45.4 +/* 45.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 45.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 45.7 + * 45.8 + * This code is free software; you can redistribute it and/or modify it 45.9 + * under the terms of the GNU General Public License version 2 only, as 45.10 + * published by the Free Software Foundation. 45.11 + * 45.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 45.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 45.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 45.15 + * version 2 for more details (a copy is included in the LICENSE file that 45.16 + * accompanied this code). 45.17 + * 45.18 + * You should have received a copy of the GNU General Public License version 45.19 + * 2 along with this work; if not, write to the Free Software Foundation, 45.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 45.21 + * 45.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 45.23 + * or visit www.oracle.com if you need additional information or have any 45.24 + * questions. 45.25 + */ 45.26 + 45.27 +import com.sun.source.tree.AnnotationTree; 45.28 +import com.sun.source.tree.CompilationUnitTree; 45.29 +import com.sun.source.util.JavacTask; 45.30 +import com.sun.source.util.TreeScanner; 45.31 +import com.sun.source.util.Trees; 45.32 +import com.sun.tools.javac.api.JavacTool; 45.33 +import com.sun.tools.javac.file.JavacFileManager; 45.34 +import com.sun.tools.javac.util.Assert; 45.35 +import java.io.File; 45.36 +import java.io.IOException; 45.37 +import java.net.URI; 45.38 +import java.net.URISyntaxException; 45.39 +import java.util.ArrayList; 45.40 +import java.util.Arrays; 45.41 +import java.util.Collections; 45.42 +import java.util.Comparator; 45.43 +import java.util.List; 45.44 +import java.util.Set; 45.45 +import javax.annotation.processing.AbstractProcessor; 45.46 +import javax.annotation.processing.RoundEnvironment; 45.47 +import javax.annotation.processing.SupportedAnnotationTypes; 45.48 +import javax.lang.model.element.TypeElement; 45.49 +import javax.tools.Diagnostic; 45.50 +import javax.tools.DiagnosticListener; 45.51 +import javax.tools.FileObject; 45.52 +import javax.tools.ForwardingJavaFileManager; 45.53 +import javax.tools.JavaFileManager; 45.54 +import javax.tools.JavaFileObject; 45.55 +import javax.tools.SimpleJavaFileObject; 45.56 + 45.57 +@SupportedAnnotationTypes("*") 45.58 +public class Processor extends AbstractProcessor { 45.59 + 45.60 + @Override 45.61 + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { 45.62 + throw new IllegalStateException("Should not be invoked."); 45.63 + } 45.64 + 45.65 + public static void main(String... args) throws IOException, URISyntaxException { 45.66 + if (args.length != 1) throw new IllegalStateException("Must provide class name!"); 45.67 + String testContent = null; 45.68 + List<File> sourcePath = new ArrayList<>(); 45.69 + for (String sourcePaths : System.getProperty("test.src.path").split(":")) { 45.70 + sourcePath.add(new File(sourcePaths)); 45.71 + } 45.72 + JavacFileManager fm = JavacTool.create().getStandardFileManager(null, null, null); 45.73 + for (File sp : sourcePath) { 45.74 + File inp = new File(sp, args[0]); 45.75 + 45.76 + if (inp.canRead()) { 45.77 + testContent = fm.getRegularFile(inp).getCharContent(true).toString(); 45.78 + } 45.79 + } 45.80 + if (testContent == null) throw new IllegalStateException(); 45.81 + DiagnosticListener<JavaFileObject> devNull = new DiagnosticListener<JavaFileObject>() { 45.82 + @Override public void report(Diagnostic<? extends JavaFileObject> diagnostic) { } 45.83 + }; 45.84 + JavaFileObject testFile = new TestFO(new URI("mem://" + args[0]), testContent); 45.85 + JavacTask task = JavacTool.create().getTask(null, 45.86 + new TestFM(fm), 45.87 + devNull, 45.88 + Arrays.asList("-Xjcov"), 45.89 + null, 45.90 + Arrays.asList(testFile)); 45.91 + final Trees trees = Trees.instance(task); 45.92 + final CompilationUnitTree cut = task.parse().iterator().next(); 45.93 + task.analyze(); 45.94 + 45.95 + final List<int[]> annotations = new ArrayList<>(); 45.96 + 45.97 + new TreeScanner<Void, Void>() { 45.98 + @Override 45.99 + public Void visitAnnotation(AnnotationTree node, Void p) { 45.100 + int endPos = (int) trees.getSourcePositions().getEndPosition(cut, node); 45.101 + 45.102 + Assert.check(endPos >= 0); 45.103 + 45.104 + annotations.add(new int[] {(int) trees.getSourcePositions().getStartPosition(cut, node), endPos}); 45.105 + return super.visitAnnotation(node, p); 45.106 + } 45.107 + }.scan(cut.getTypeDecls().get(0), null); 45.108 + 45.109 + Collections.sort(annotations, new Comparator<int[]>() { 45.110 + @Override public int compare(int[] o1, int[] o2) { 45.111 + return o2[0] - o1[0]; 45.112 + } 45.113 + }); 45.114 + 45.115 + for (final int[] annotation : annotations) { 45.116 + StringBuilder updatedContent = new StringBuilder(); 45.117 + int last = testContent.length(); 45.118 + 45.119 + for (int[] toRemove : annotations) { 45.120 + if (toRemove == annotation) continue; 45.121 + updatedContent.insert(0, testContent.substring(toRemove[1], last)); 45.122 + last = toRemove[0]; 45.123 + } 45.124 + 45.125 + updatedContent.insert(0, testContent.substring(0, last)); 45.126 + 45.127 + JavaFileObject updatedFile = new TestFO(new URI("mem://" + args[0]), updatedContent.toString()); 45.128 + JavacTask testTask = JavacTool.create().getTask(null, 45.129 + new TestFM(fm), 45.130 + devNull, 45.131 + Arrays.asList("-processor", "Processor"), 45.132 + null, 45.133 + Arrays.asList(updatedFile)); 45.134 + 45.135 + try { 45.136 + testTask.analyze(); 45.137 + } catch (Throwable e) { 45.138 + System.out.println("error while processing:"); 45.139 + System.out.println(updatedContent); 45.140 + throw e; 45.141 + } 45.142 + } 45.143 + } 45.144 + 45.145 + private static final class TestFO extends SimpleJavaFileObject { 45.146 + private final String content; 45.147 + public TestFO(URI uri, String content) { 45.148 + super(uri, Kind.SOURCE); 45.149 + this.content = content; 45.150 + } 45.151 + 45.152 + @Override public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { 45.153 + return content; 45.154 + } 45.155 + 45.156 + @Override public boolean isNameCompatible(String simpleName, Kind kind) { 45.157 + return true; 45.158 + } 45.159 + } 45.160 + 45.161 + private static final class TestFM extends ForwardingJavaFileManager<JavaFileManager> { 45.162 + 45.163 + public TestFM(JavaFileManager fileManager) { 45.164 + super(fileManager); 45.165 + } 45.166 + 45.167 + @Override 45.168 + public boolean isSameFile(FileObject a, FileObject b) { 45.169 + return a.equals(b); 45.170 + } 45.171 + 45.172 + } 45.173 +} 45.174 \ No newline at end of file
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 46.2 +++ b/test/tools/javac/processing/errors/StopOnInapplicableAnnotations/Source.java Tue Oct 15 14:17:11 2013 +0100 46.3 @@ -0,0 +1,59 @@ 46.4 +/* 46.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 46.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 46.7 + * 46.8 + * This code is free software; you can redistribute it and/or modify it 46.9 + * under the terms of the GNU General Public License version 2 only, as 46.10 + * published by the Free Software Foundation. 46.11 + * 46.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 46.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 46.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 46.15 + * version 2 for more details (a copy is included in the LICENSE file that 46.16 + * accompanied this code). 46.17 + * 46.18 + * You should have received a copy of the GNU General Public License version 46.19 + * 2 along with this work; if not, write to the Free Software Foundation, 46.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 46.21 + * 46.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 46.23 + * or visit www.oracle.com if you need additional information or have any 46.24 + * questions. 46.25 + */ 46.26 + 46.27 +/* 46.28 + * @test 46.29 + * @bug 8014016 46.30 + * @summary Verify that annotation processors do not get invalid annotations 46.31 + * @build Processor 46.32 + * @run main Processor Source.java 46.33 + */ 46.34 + 46.35 +import java.lang.annotation.ElementType; 46.36 +import java.lang.annotation.Target; 46.37 + 46.38 +@OnMethod 46.39 +@OnField 46.40 +class Class<@OnType @OnMethod @OnField T extends @OnType @OnMethod @OnField CharSequence & @OnType @OnMethod @OnField Runnable> extends @OnType @OnMethod @OnField Object { 46.41 + 46.42 + @OnType 46.43 + @OnTypeUse 46.44 + @OnField 46.45 + private void testMethod(@OnType @OnField @OnMethod int i) { } 46.46 + 46.47 + @OnType 46.48 + @OnMethod 46.49 + private java.lang.@OnType @OnMethod @OnField String testField; 46.50 +} 46.51 + 46.52 +@Target(ElementType.TYPE) 46.53 +@interface OnType {} 46.54 + 46.55 +@Target(ElementType.METHOD) 46.56 +@interface OnMethod {} 46.57 + 46.58 +@Target(ElementType.TYPE_USE) 46.59 +@interface OnTypeUse {} 46.60 + 46.61 +@Target(ElementType.FIELD) 46.62 +@interface OnField {}
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 47.2 +++ b/test/tools/javadoc/8025693/Test.java Tue Oct 15 14:17:11 2013 +0100 47.3 @@ -0,0 +1,91 @@ 47.4 +/* 47.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 47.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 47.7 + * 47.8 + * This code is free software; you can redistribute it and/or modify it 47.9 + * under the terms of the GNU General Public License version 2 only, as 47.10 + * published by the Free Software Foundation. 47.11 + * 47.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 47.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 47.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 47.15 + * version 2 for more details (a copy is included in the LICENSE file that 47.16 + * accompanied this code). 47.17 + * 47.18 + * You should have received a copy of the GNU General Public License version 47.19 + * 2 along with this work; if not, write to the Free Software Foundation, 47.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 47.21 + * 47.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 47.23 + * or visit www.oracle.com if you need additional information or have any 47.24 + * questions. 47.25 + */ 47.26 + 47.27 +/* 47.28 + * @test 47.29 + * @bug 8025693 47.30 + * @summary javadoc should ignore <clinit> methods found in classes on classpath 47.31 + */ 47.32 + 47.33 +import java.io.*; 47.34 + 47.35 +public class Test { 47.36 + public static void main(String[] args) throws Exception { 47.37 + new Test().run(); 47.38 + } 47.39 + 47.40 + final File baseFile = new File("src/Base.java"); 47.41 + final String baseText = 47.42 + "package p;\n" + 47.43 + "public class Base { static { } }\n"; 47.44 + 47.45 + final File srcFile = new File("src/C.java"); 47.46 + final String srcText = 47.47 + "package p;\n" + 47.48 + "/** comment */\n" + 47.49 + "public abstract class C extends Base { }\n"; 47.50 + 47.51 + void run() throws Exception { 47.52 + File classesDir = new File("classes"); 47.53 + classesDir.mkdirs(); 47.54 + writeFile(baseFile, baseText); 47.55 + String[] javacArgs = { 47.56 + "-d", classesDir.getPath(), 47.57 + baseFile.getPath() 47.58 + }; 47.59 + com.sun.tools.javac.Main.compile(javacArgs); 47.60 + 47.61 + writeFile(srcFile, srcText); 47.62 + String[] args = { 47.63 + "-d", "api", 47.64 + "-classpath", classesDir.getPath(), 47.65 + "-package", "p", 47.66 + srcFile.getPath() 47.67 + }; 47.68 + 47.69 + ByteArrayOutputStream baos = new ByteArrayOutputStream(); 47.70 + PrintStream ps = new PrintStream(baos); 47.71 + PrintStream prev = System.err; 47.72 + System.setErr(ps); 47.73 + try { 47.74 + int rc = com.sun.tools.javadoc.Main.execute(args); 47.75 + } finally { 47.76 + System.err.flush(); 47.77 + System.setErr(prev); 47.78 + } 47.79 + String out = baos.toString(); 47.80 + System.out.println(out); 47.81 + 47.82 + String errorMessage = "java.lang.IllegalArgumentException: <clinit>"; 47.83 + if (out.contains(errorMessage)) 47.84 + throw new Exception("error message found: " + errorMessage); 47.85 + } 47.86 + 47.87 + void writeFile(File file, String body) throws IOException { 47.88 + file.getParentFile().mkdirs(); 47.89 + try (FileWriter out = new FileWriter(file)) { 47.90 + out.write(body); 47.91 + } 47.92 + } 47.93 +} 47.94 +