# HG changeset patch
# User chegar
# Date 1380824887 -3600
# Node ID 2c13a5da68546dc89acf42eddb447fb957585369
# Parent a6901af8a2e48497b172b321df49620510d9c737# Parent af6244ba81b6b8d1bf4ab06587a2067e021e4570
Merge
diff -r a6901af8a2e4 -r 2c13a5da6854 .hgtags
--- a/.hgtags Sat Sep 14 20:46:37 2013 +0100
+++ b/.hgtags Thu Oct 03 19:28:07 2013 +0100
@@ -229,3 +229,6 @@
375834b5cf086dd7ce9e49f602d81bb51d3e0fa9 jdk8-b105
fcd768844b9926c5f994292ec6350c20cc7c0f76 jdk8-b106
3f274927ec1863544b8214262ab02b7de2970da6 jdk8-b107
+252f872b8a2f81a416f9127e77924ca56a4578b0 jdk8-b108
+985abf1cd327169a317d4ff4f318a8162a5cd47d jdk8-b109
+41541097533aa3933a018c8c1c426c1871dfd76e jdk8-b110
diff -r a6901af8a2e4 -r 2c13a5da6854 README
--- a/README Sat Sep 14 20:46:37 2013 +0100
+++ b/README Thu Oct 03 19:28:07 2013 +0100
@@ -32,7 +32,7 @@
JLS and JVMS.
In addition, there is a substantial collection of regression and unit
-tests for all the tools in the maain langtools test/ directory.
+tests for all the tools in the main langtools test/ directory.
Finally, there is a small set of tests to do basic validation of a build
of the langtools workspace for use by JDK. These tests check the contents
diff -r a6901af8a2e4 -r 2c13a5da6854 make/jprt.properties
--- a/make/jprt.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/make/jprt.properties Thu Oct 03 19:28:07 2013 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,8 @@
linux_i586_2.6-{product|fastdebug}, \
linux_x64_2.6-{product|fastdebug}, \
macosx_x64_10.7-{product|fastdebug}, \
- windows_i586_5.1-{product|fastdebug}, \
- windows_x64_5.2-{product|fastdebug}
+ windows_i586_6.1-{product|fastdebug}, \
+ windows_x64_6.1-{product|fastdebug}
# Test target list (no fastdebug & limited c2 testing)
jprt.my.test.target.set= \
@@ -52,8 +52,8 @@
linux_i586_2.6-product-{c1|c2}-TESTNAME, \
linux_x64_2.6-product-c2-TESTNAME, \
macosx_x64_10.7-product-c2-TESTNAME, \
- windows_i586_5.1-product-c1-TESTNAME, \
- windows_x64_5.2-product-c2-TESTNAME
+ windows_i586_6.1-product-c1-TESTNAME, \
+ windows_x64_6.1-product-c2-TESTNAME
# Default test targets
jprt.make.rule.test.targets= \
@@ -71,8 +71,8 @@
linux_i586_2.6-product-{c1|c2}-TESTNAME, \
linux_x64_2.6-product-c2-TESTNAME, \
macosx_x64_10.7-product-c2-TESTNAME, \
- windows_i586_5.1-product-c1-TESTNAME, \
- windows_x64_5.2-product-c2-TESTNAME
+ windows_i586_6.1-product-c1-TESTNAME, \
+ windows_x64_6.1-product-c2-TESTNAME
# Default test targets
jprt.make.rule.test.targets= \
diff -r a6901af8a2e4 -r 2c13a5da6854 make/netbeans/langtools/build.xml
--- a/make/netbeans/langtools/build.xml Sat Sep 14 20:46:37 2013 +0100
+++ b/make/netbeans/langtools/build.xml Thu Oct 03 19:28:07 2013 +0100
@@ -1,6 +1,6 @@
@@ -136,9 +144,9 @@
-
+
-
+
@@ -207,6 +215,7 @@
@@ -216,6 +225,7 @@
@@ -226,10 +236,12 @@
+
+
-
+
diff -r a6901af8a2e4 -r 2c13a5da6854 make/tools/anttasks/SelectToolTask.java
--- a/make/tools/anttasks/SelectToolTask.java Sat Sep 14 20:46:37 2013 +0100
+++ b/make/tools/anttasks/SelectToolTask.java Thu Oct 03 19:28:07 2013 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,6 +43,7 @@
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.EnumSet;
import java.util.List;
import java.util.Properties;
import javax.swing.JButton;
@@ -71,6 +72,32 @@
* is invoked to allow the user to set or reset values for use in property mode.
*/
public class SelectToolTask extends Task {
+
+ enum ToolChoices {
+ NONE(""),
+ JAVAC("javac"),
+ JAVADOC("javadoc"),
+ JAVAH("javah"),
+ JAVAP("javap");
+
+ String toolName;
+ boolean bootstrap;
+
+ ToolChoices(String toolName) {
+ this(toolName, false);
+ }
+
+ ToolChoices(String toolName, boolean bootstrap) {
+ this.toolName = toolName;
+ this.bootstrap = bootstrap;
+ }
+
+ @Override
+ public String toString() {
+ return toolName;
+ }
+ }
+
/**
* Set the location of the private properties file used to keep the retain
* user preferences for this repository.
@@ -97,6 +124,14 @@
}
/**
+ * Set the name of the property which will be set to the execution args of the
+ * selected tool, if any. The args default to an empty string.
+ */
+ public void setBootstrapProperty(String bootstrapProperty) {
+ this.bootstrapProperty = bootstrapProperty;
+ }
+
+ /**
* Specify whether or not to pop up a dialog if the user has not specified
* a default value for a property.
*/
@@ -110,6 +145,7 @@
Properties props = readProperties(propertyFile);
toolName = props.getProperty("tool.name");
+ toolBootstrap = props.getProperty("tool.bootstrap") != null;
if (toolName != null) {
toolArgs = props.getProperty(toolName + ".args", "");
}
@@ -123,6 +159,8 @@
// finally, return required values, if any
if (toolProperty != null && !(toolName == null || toolName.equals(""))) {
p.setProperty(toolProperty, toolName);
+ if (toolBootstrap)
+ p.setProperty(bootstrapProperty, "true");
if (argsProperty != null && toolArgs != null)
p.setProperty(argsProperty, toolArgs);
@@ -134,14 +172,20 @@
JOptionPane p = createPane(guiProps);
p.createDialog("Select Tool").setVisible(true);
- toolName = (String) toolChoice.getSelectedItem();
+ toolName = ((ToolChoices)toolChoice.getSelectedItem()).toolName;
toolArgs = argsField.getText();
-
+ toolBootstrap = bootstrapCheckbox.isSelected();
if (defaultCheck.isSelected()) {
if (toolName.equals("")) {
fileProps.remove("tool.name");
+ fileProps.remove("tool.bootstrap");
} else {
fileProps.put("tool.name", toolName);
+ if (toolBootstrap) {
+ fileProps.put("tool.bootstrap", "true");
+ } else {
+ fileProps.remove("tool.bootstrap");
+ }
fileProps.put(toolName + ".args", toolArgs);
}
writeProperties(propertyFile, fileProps);
@@ -154,32 +198,38 @@
lc.insets.right = 10;
lc.insets.bottom = 3;
GridBagConstraints fc = new GridBagConstraints();
- fc.anchor = GridBagConstraints.WEST;
fc.gridx = 1;
- fc.gridwidth = GridBagConstraints.REMAINDER;
+ fc.gridwidth = GridBagConstraints.NONE;
fc.insets.bottom = 3;
+ JPanel toolPane = new JPanel(new GridBagLayout());
+
JLabel toolLabel = new JLabel("Tool:");
body.add(toolLabel, lc);
- String[] toolChoices = { "apt", "javac", "javadoc", "javah", "javap" };
- if (true || toolProperty == null) {
- // include empty value in setup mode
- List l = new ArrayList(Arrays.asList(toolChoices));
- l.add(0, "");
- toolChoices = l.toArray(new String[l.size()]);
- }
- toolChoice = new JComboBox(toolChoices);
+ EnumSet toolChoices = toolProperty == null ?
+ EnumSet.allOf(ToolChoices.class) : EnumSet.range(ToolChoices.JAVAC, ToolChoices.JAVAP);
+ toolChoice = new JComboBox(toolChoices.toArray());
if (toolName != null)
- toolChoice.setSelectedItem(toolName);
+ toolChoice.setSelectedItem(ToolChoices.valueOf(toolName.toUpperCase()));
toolChoice.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
- String tn = (String) e.getItem();
+ String tn = ((ToolChoices)e.getItem()).toolName;
argsField.setText(getDefaultArgsForTool(props, tn));
if (toolProperty != null)
okButton.setEnabled(!tn.equals(""));
}
});
- body.add(toolChoice, fc);
+ GridBagConstraints checkConstraint = new GridBagConstraints();
+ fc.anchor = GridBagConstraints.EAST;
+
+ GridBagConstraints toolConstraint = new GridBagConstraints();
+ fc.anchor = GridBagConstraints.WEST;
+
+ toolPane.add(toolChoice, toolConstraint);
+ bootstrapCheckbox = new JCheckBox("bootstrap", toolBootstrap);
+ toolPane.add(bootstrapCheckbox, checkConstraint);
+
+ body.add(toolPane, fc);
argsField = new JTextField(getDefaultArgsForTool(props, toolName), 40);
if (toolProperty == null || argsProperty != null) {
@@ -190,7 +240,7 @@
public void focusGained(FocusEvent e) {
}
public void focusLost(FocusEvent e) {
- String toolName = (String) toolChoice.getSelectedItem();
+ String toolName = ((ToolChoices)toolChoice.getSelectedItem()).toolName;
if (toolName.length() > 0)
props.put(toolName + ".args", argsField.getText());
}
@@ -271,16 +321,19 @@
// Ant task parameters
private boolean askIfUnset;
private String toolProperty;
+ private String bootstrapProperty;
private String argsProperty;
private File propertyFile;
// GUI components
private JComboBox toolChoice;
+ private JCheckBox bootstrapCheckbox;
private JTextField argsField;
private JCheckBox defaultCheck;
private JButton okButton;
// Result values for the client
private String toolName;
+ private boolean toolBootstrap;
private String toolArgs;
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/classfile/Code_attribute.java
--- a/src/share/classes/com/sun/tools/classfile/Code_attribute.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/classfile/Code_attribute.java Thu Oct 03 19:28:07 2013 +0100
@@ -61,9 +61,9 @@
code_length = cr.readInt();
code = new byte[code_length];
cr.readFully(code);
- exception_table_langth = cr.readUnsignedShort();
- exception_table = new Exception_data[exception_table_langth];
- for (int i = 0; i < exception_table_langth; i++)
+ exception_table_length = cr.readUnsignedShort();
+ exception_table = new Exception_data[exception_table_length];
+ for (int i = 0; i < exception_table_length; i++)
exception_table[i] = new Exception_data(cr);
attributes = new Attributes(cr);
}
@@ -139,7 +139,7 @@
public final int max_locals;
public final int code_length;
public final byte[] code;
- public final int exception_table_langth;
+ public final int exception_table_length;
public final Exception_data[] exception_table;
public final Attributes attributes;
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -157,7 +157,7 @@
addAllProfilesLink(div);
}
body.addContent(div);
- if (configuration.showProfiles) {
+ if (configuration.showProfiles && configuration.profilePackages.size() > 0) {
Content profileSummary = configuration.getResource("doclet.Profiles");
addProfilesList(profileSummary, body);
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java Thu Oct 03 19:28:07 2013 +0100
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html;
+
+import java.io.*;
+
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+
+/**
+ * Writes annotation type field documentation in HTML format.
+ *
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.
+ *
+ * @author Bhavesh Patel
+ */
+public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter
+ implements AnnotationTypeFieldWriter, MemberSummaryWriter {
+
+ /**
+ * Construct a new AnnotationTypeFieldWriterImpl.
+ *
+ * @param writer the writer that will write the output.
+ * @param annotationType the AnnotationType that holds this member.
+ */
+ public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer,
+ AnnotationTypeDoc annotationType) {
+ super(writer, annotationType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getMemberSummaryHeader(ClassDoc classDoc,
+ Content memberSummaryTree) {
+ memberSummaryTree.addContent(
+ HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
+ Content memberTree = writer.getMemberTreeHeader();
+ writer.addSummaryHeader(this, classDoc, memberTree);
+ return memberTree;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getMemberTreeHeader() {
+ return writer.getMemberTreeHeader();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addAnnotationFieldDetailsMarker(Content memberDetails) {
+ memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
+ Content memberDetailsTree) {
+ if (!writer.printedAnnotationFieldHeading) {
+ memberDetailsTree.addContent(writer.getMarkerAnchor(
+ "annotation_type_field_detail"));
+ Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+ writer.fieldDetailsLabel);
+ memberDetailsTree.addContent(heading);
+ writer.printedAnnotationFieldHeading = true;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getAnnotationDocTreeHeader(MemberDoc member,
+ Content annotationDetailsTree) {
+ annotationDetailsTree.addContent(
+ writer.getMarkerAnchor(member.name()));
+ Content annotationDocTree = writer.getMemberTreeHeader();
+ Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+ heading.addContent(member.name());
+ annotationDocTree.addContent(heading);
+ return annotationDocTree;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getSignature(MemberDoc member) {
+ Content pre = new HtmlTree(HtmlTag.PRE);
+ writer.addAnnotationInfo(member, pre);
+ addModifiers(member, pre);
+ Content link =
+ writer.getLink(new LinkInfoImpl(configuration,
+ LinkInfoImpl.Kind.MEMBER, getType(member)));
+ pre.addContent(link);
+ pre.addContent(writer.getSpace());
+ if (configuration.linksource) {
+ Content memberName = new StringContent(member.name());
+ writer.addSrcLink(member, memberName, pre);
+ } else {
+ addName(member.name(), pre);
+ }
+ return pre;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addDeprecated(MemberDoc member, Content annotationDocTree) {
+ addDeprecatedInfo(member, annotationDocTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addComments(MemberDoc member, Content annotationDocTree) {
+ addComment(member, annotationDocTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addTags(MemberDoc member, Content annotationDocTree) {
+ writer.addTagsInfo(member, annotationDocTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getAnnotationDetails(Content annotationDetailsTree) {
+ return getMemberTree(annotationDetailsTree);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getAnnotationDoc(Content annotationDocTree,
+ boolean isLastContent) {
+ return getMemberTree(annotationDocTree, isLastContent);
+ }
+
+ /**
+ * Close the writer.
+ */
+ public void close() throws IOException {
+ writer.close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addSummaryLabel(Content memberTree) {
+ Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+ writer.getResource("doclet.Field_Summary"));
+ memberTree.addContent(label);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getTableSummary() {
+ return configuration.getText("doclet.Member_Table_Summary",
+ configuration.getText("doclet.Field_Summary"),
+ configuration.getText("doclet.fields"));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Content getCaption() {
+ return configuration.getResource("doclet.Fields");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String[] getSummaryTableHeader(ProgramElementDoc member) {
+ String[] header = new String[] {
+ writer.getModifierTypeHeader(),
+ configuration.getText("doclet.0_and_1",
+ configuration.getText("doclet.Fields"),
+ configuration.getText("doclet.Description"))
+ };
+ return header;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+ memberTree.addContent(writer.getMarkerAnchor(
+ "annotation_type_field_summary"));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member,
+ Content tdSummary) {
+ Content strong = HtmlTree.SPAN(HtmlStyle.strong,
+ writer.getDocLink(context, (MemberDoc) member, member.name(), false));
+ Content code = HtmlTree.CODE(strong);
+ tdSummary.addContent(code);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void addInheritedSummaryLink(ClassDoc cd,
+ ProgramElementDoc member, Content linksTree) {
+ //Not applicable.
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
+ MemberDoc m = (MemberDoc)member;
+ addModifierAndType(m, getType(m), tdSummaryType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Content getDeprecatedLink(ProgramElementDoc member) {
+ return writer.getDocLink(LinkInfoImpl.Kind.MEMBER,
+ (MemberDoc) member, ((MemberDoc)member).qualifiedName());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
+ if (link) {
+ return writer.getHyperLink("annotation_type_field_summary",
+ writer.getResource("doclet.navField"));
+ } else {
+ return writer.getResource("doclet.navField");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void addNavDetailLink(boolean link, Content liNav) {
+ if (link) {
+ liNav.addContent(writer.getHyperLink("annotation_type_field_detail",
+ writer.getResource("doclet.navField")));
+ } else {
+ liNav.addContent(writer.getResource("doclet.navField"));
+ }
+ }
+
+ private Type getType(MemberDoc member) {
+ if (member instanceof FieldDoc) {
+ return ((FieldDoc) member).type();
+ } else {
+ return ((MethodDoc) member).returnType();
+ }
+ }
+}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Thu Oct 03 19:28:07 2013 +0100
@@ -71,6 +71,20 @@
/**
* {@inheritDoc}
*/
+ public Content getMemberTreeHeader() {
+ return writer.getMemberTreeHeader();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addAnnotationDetailsMarker(Content memberDetails) {
+ memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
Content memberDetailsTree) {
if (!writer.printedAnnotationHeading) {
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Thu Oct 03 19:28:07 2013 +0100
@@ -118,7 +118,7 @@
if (prev != null) {
Content prevLink = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS, prev.asClassDoc())
- .label(configuration.getText("doclet.Prev_Class")).strong(true));
+ .label(prevclassLabel).strong(true));
li = HtmlTree.LI(prevLink);
}
else
@@ -136,7 +136,7 @@
if (next != null) {
Content nextLink = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS, next.asClassDoc())
- .label(configuration.getText("doclet.Next_Class")).strong(true));
+ .label(nextclassLabel).strong(true));
li = HtmlTree.LI(nextLink);
}
else
@@ -278,13 +278,6 @@
/**
* {@inheritDoc}
*/
- public void addAnnotationDetailsMarker(Content memberDetails) {
- memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
- }
-
- /**
- * {@inheritDoc}
- */
protected Content getNavLinkTree() {
Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
treeLabel, "", "");
@@ -319,6 +312,12 @@
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
configuration.getBuilderFactory().getMemberSummaryBuilder(this);
+ Content liNavField = new HtmlTree(HtmlTag.LI);
+ addNavSummaryLink(memberSummaryBuilder,
+ "doclet.navField",
+ VisibleMemberMap.ANNOTATION_TYPE_FIELDS, liNavField);
+ addNavGap(liNavField);
+ ulNav.addContent(liNavField);
Content liNavReq = new HtmlTree(HtmlTag.LI);
addNavSummaryLink(memberSummaryBuilder,
"doclet.navAnnotationTypeRequiredMember",
@@ -364,12 +363,23 @@
Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
configuration.getBuilderFactory().getMemberSummaryBuilder(this);
+ AbstractMemberWriter writerField =
+ ((AbstractMemberWriter) memberSummaryBuilder.
+ getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_FIELDS));
AbstractMemberWriter writerOptional =
((AbstractMemberWriter) memberSummaryBuilder.
getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL));
AbstractMemberWriter writerRequired =
((AbstractMemberWriter) memberSummaryBuilder.
getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED));
+ Content liNavField = new HtmlTree(HtmlTag.LI);
+ if (writerField != null){
+ writerField.addNavDetailLink(annotationType.fields().length > 0, liNavField);
+ } else {
+ liNavField.addContent(getResource("doclet.navField"));
+ }
+ addNavGap(liNavField);
+ ulNav.addContent(liNavField);
if (writerOptional != null){
Content liNavOpt = new HtmlTree(HtmlTag.LI);
writerOptional.addNavDetailLink(annotationType.elements().length > 0, liNavOpt);
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Thu Oct 03 19:28:07 2013 +0100
@@ -126,7 +126,7 @@
if (prev != null) {
Content prevLink = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS, prev)
- .label(configuration.getText("doclet.Prev_Class")).strong(true));
+ .label(prevclassLabel).strong(true));
li = HtmlTree.LI(prevLink);
}
else
@@ -144,7 +144,7 @@
if (next != null) {
Content nextLink = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS, next)
- .label(configuration.getText("doclet.Next_Class")).strong(true));
+ .label(nextclassLabel).strong(true));
li = HtmlTree.LI(nextLink);
}
else
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Thu Oct 03 19:28:07 2013 +0100
@@ -205,13 +205,20 @@
* {@inheritDoc}
*/
protected void generateProfileFiles() throws Exception {
- if (configuration.showProfiles) {
+ if (configuration.showProfiles && configuration.profilePackages.size() > 0) {
ProfileIndexFrameWriter.generate(configuration);
Profile prevProfile = null, nextProfile;
+ String profileName;
for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
- ProfilePackageIndexFrameWriter.generate(configuration, Profile.lookup(i).name);
+ profileName = Profile.lookup(i).name;
+ // Generate profile package pages only if there are any packages
+ // in a profile to be documented. The profilePackages map will not
+ // contain an entry for the profile if there are no packages to be documented.
+ if (!configuration.shouldDocumentProfile(profileName))
+ continue;
+ ProfilePackageIndexFrameWriter.generate(configuration, profileName);
PackageDoc[] packages = configuration.profilePackages.get(
- Profile.lookup(i).name);
+ profileName);
PackageDoc prev = null, next;
for (int j = 0; j < packages.length; j++) {
// if -nodeprecated option is set and the package is marked as
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -85,6 +85,11 @@
protected boolean printedAnnotationHeading = false;
/**
+ * To check whether annotation field heading is printed or not.
+ */
+ protected boolean printedAnnotationFieldHeading = false;
+
+ /**
* To check whether the repeated annotations is documented or not.
*/
private boolean isAnnotationDocumented = false;
@@ -406,10 +411,7 @@
Content htmlDocType = DocType.TRANSITIONAL;
Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
Content head = new HtmlTree(HtmlTag.HEAD);
- if (!configuration.notimestamp) {
- Content headComment = new Comment(getGeneratedByString());
- head.addContent(headComment);
- }
+ head.addContent(getGeneratedBy(!configuration.notimestamp));
if (configuration.charset.length() > 0) {
Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE,
configuration.charset);
@@ -502,16 +504,17 @@
if (!configuration.nonavbar) {
String allClassesId = "allclasses_";
HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
+ Content skipNavLinks = configuration.getResource("doclet.Skip_navigation_links");
if (header) {
body.addContent(HtmlConstants.START_OF_TOP_NAVBAR);
navDiv.addStyle(HtmlStyle.topNav);
allClassesId += "navbar_top";
Content a = getMarkerAnchor("navbar_top");
+ //WCAG - Hyperlinks should contain text or an image with alt text - for AT tools
navDiv.addContent(a);
- Content skipLinkContent = getHyperLink(DocLink.fragment("skip-navbar_top"),
- HtmlTree.EMPTY,
- configuration.getText("doclet.Skip_navigation_links"),
- "");
+ Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink(
+ DocLink.fragment("skip-navbar_top"), skipNavLinks,
+ skipNavLinks.toString(), ""));
navDiv.addContent(skipLinkContent);
} else {
body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
@@ -519,10 +522,9 @@
allClassesId += "navbar_bottom";
Content a = getMarkerAnchor("navbar_bottom");
navDiv.addContent(a);
- Content skipLinkContent = getHyperLink(DocLink.fragment("skip-navbar_bottom"),
- HtmlTree.EMPTY,
- configuration.getText("doclet.Skip_navigation_links"),
- "");
+ Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink(
+ DocLink.fragment("skip-navbar_bottom"), skipNavLinks,
+ skipNavLinks.toString(), ""));
navDiv.addContent(skipLinkContent);
}
if (header) {
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -130,10 +130,14 @@
String profileName;
for (int i = 1; i < configuration.profiles.getProfileCount(); i++) {
profileName = Profile.lookup(i).name;
- Content profileLinkContent = getTargetProfileLink("classFrame",
- new StringContent(profileName), profileName);
- Content li = HtmlTree.LI(profileLinkContent);
- ul.addContent(li);
+ // If the profile has valid packages to be documented, add it to the
+ // profiles list on overview-summary.html page.
+ if (configuration.shouldDocumentProfile(profileName)) {
+ Content profileLinkContent = getTargetProfileLink("classFrame",
+ new StringContent(profileName), profileName);
+ Content li = HtmlTree.LI(profileLinkContent);
+ ul.addContent(li);
+ }
}
profilesDiv.addContent(ul);
Content div = HtmlTree.DIV(HtmlStyle.contentContainer, profilesDiv);
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -88,8 +88,13 @@
Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setTitle(profilesLabel);
+ String profileName;
for (int i = 1; i < profiles.getProfileCount(); i++) {
- ul.addContent(getProfile(i));
+ profileName = (Profile.lookup(i)).name;
+ // If the profile has valid packages to be documented, add it to the
+ // left-frame generated for profile index.
+ if (configuration.shouldDocumentProfile(profileName))
+ ul.addContent(getProfile(profileName));
}
div.addContent(ul);
body.addContent(div);
@@ -98,13 +103,12 @@
/**
* Gets each profile name as a separate link.
*
- * @param profile the profile being documented
+ * @param profileName the profile being documented
* @return content for the profile link
*/
- protected Content getProfile(int profile) {
+ protected Content getProfile(String profileName) {
Content profileLinkContent;
Content profileLabel;
- String profileName = (Profile.lookup(profile)).name;
profileLabel = new StringContent(profileName);
profileLinkContent = getHyperLink(DocPaths.profileFrame(profileName), profileLabel, "",
"packageListFrame");
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java Thu Oct 03 19:28:07 2013 +0100
@@ -138,6 +138,7 @@
"classFrame", new StringContent(pkg.name()), profile.name);
Content heading = HtmlTree.HEADING(HtmlTag.H3, pkgName);
HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, heading);
+ addPackageDeprecationInfo(li, pkg);
return li;
}
@@ -175,6 +176,30 @@
}
/**
+ * Add the profile package deprecation information to the documentation tree.
+ *
+ * @param li the content tree to which the deprecation information will be added
+ * @param pkg the PackageDoc that is added
+ */
+ public void addPackageDeprecationInfo(Content li, PackageDoc pkg) {
+ Tag[] deprs;
+ if (Util.isDeprecated(pkg)) {
+ deprs = pkg.tags("deprecated");
+ HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV);
+ deprDiv.addStyle(HtmlStyle.deprecatedContent);
+ Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
+ deprDiv.addContent(deprPhrase);
+ if (deprs.length > 0) {
+ Tag[] commentTags = deprs[0].inlineTags();
+ if (commentTags.length > 0) {
+ addInlineDeprecatedComment(pkg, deprs[0], deprDiv);
+ }
+ }
+ li.addContent(deprDiv);
+ }
+ }
+
+ /**
* Get "PREV PROFILE" link in the navigation bar.
*
* @return a content tree for the previous link
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java Thu Oct 03 19:28:07 2013 +0100
@@ -107,6 +107,16 @@
/**
* {@inheritDoc}
*/
+ public AnnotationTypeFieldWriter
+ getAnnotationTypeFieldWriter(AnnotationTypeWriter annotationTypeWriter) throws Exception {
+ return new AnnotationTypeFieldWriterImpl(
+ (SubWriterHolderWriter) annotationTypeWriter,
+ annotationTypeWriter.getAnnotationTypeDoc());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public AnnotationTypeOptionalMemberWriter
getAnnotationTypeOptionalMemberWriter(
AnnotationTypeWriter annotationTypeWriter) throws Exception {
@@ -202,6 +212,9 @@
AnnotationTypeWriter annotationTypeWriter, int memberType)
throws Exception {
switch (memberType) {
+ case VisibleMemberMap.ANNOTATION_TYPE_FIELDS:
+ return (AnnotationTypeFieldWriterImpl)
+ getAnnotationTypeFieldWriter(annotationTypeWriter);
case VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL:
return (AnnotationTypeOptionalMemberWriterImpl)
getAnnotationTypeOptionalMemberWriter(annotationTypeWriter);
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java Thu Oct 03 19:28:07 2013 +0100
@@ -94,6 +94,12 @@
new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ===========");
/**
+ * Marker to identify start of annotation type required member summary.
+ */
+ public static final Content START_OF_ANNOTATION_TYPE_FIELD_SUMMARY =
+ new Comment("=========== ANNOTATION TYPE FIELD SUMMARY ===========");
+
+ /**
* Marker to identify start of constructor summary.
*/
public static final Content START_OF_CONSTRUCTOR_SUMMARY =
@@ -130,6 +136,12 @@
new Comment("============ ANNOTATION TYPE MEMBER DETAIL ===========");
/**
+ * Marker to identify start of annotation type field details.
+ */
+ public static final Content START_OF_ANNOTATION_TYPE_FIELD_DETAILS =
+ new Comment("============ ANNOTATION TYPE FIELD DETAIL ===========");
+
+ /**
* Marker to identify start of method details.
*/
public static final Content START_OF_METHOD_DETAILS =
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -191,10 +191,7 @@
Content htmlDocType = DocType.FRAMESET;
Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
Content head = new HtmlTree(HtmlTag.HEAD);
- if (! noTimeStamp) {
- Content headComment = new Comment(getGeneratedByString());
- head.addContent(headComment);
- }
+ head.addContent(getGeneratedBy(!noTimeStamp));
if (configuration.charset.length() > 0) {
Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE,
configuration.charset);
@@ -210,9 +207,13 @@
write(htmlDocument);
}
- protected String getGeneratedByString() {
- Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
- Date today = calendar.getTime();
- return "Generated by javadoc ("+ ConfigurationImpl.BUILD_DATE + ") on " + today;
+ protected Comment getGeneratedBy(boolean timestamp) {
+ String text = "Generated by javadoc"; // marker string, deliberately not localized
+ if (timestamp) {
+ Calendar calendar = new GregorianCalendar(TimeZone.getDefault());
+ Date today = calendar.getTime();
+ text += " ("+ ConfigurationImpl.BUILD_DATE + ") on " + today;
+ }
+ return new Comment(text);
}
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java Thu Oct 03 19:28:07 2013 +0100
@@ -68,6 +68,7 @@
packageSummary,
rowColor,
serializedFormContainer,
+ skipNav,
sourceContainer,
sourceLineNo,
strong,
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java Thu Oct 03 19:28:07 2013 +0100
@@ -28,6 +28,7 @@
import java.io.IOException;
import java.io.Writer;
import java.util.*;
+import java.nio.charset.*;
import com.sun.tools.doclets.internal.toolkit.Content;
import com.sun.tools.doclets.internal.toolkit.util.*;
@@ -164,6 +165,46 @@
}
/**
+ * A set of ASCII URI characters to be left unencoded.
+ */
+ public static final BitSet NONENCODING_CHARS = new BitSet(256);
+
+ static {
+ // alphabetic characters
+ for (int i = 'a'; i <= 'z'; i++) {
+ NONENCODING_CHARS.set(i);
+ }
+ for (int i = 'A'; i <= 'Z'; i++) {
+ NONENCODING_CHARS.set(i);
+ }
+ // numeric characters
+ for (int i = '0'; i <= '9'; i++) {
+ NONENCODING_CHARS.set(i);
+ }
+ // Reserved characters as per RFC 3986. These are set of delimiting characters.
+ String noEnc = ":/?#[]@!$&'()*+,;=";
+ // Unreserved characters as per RFC 3986 which should not be percent encoded.
+ noEnc += "-._~";
+ for (int i = 0; i < noEnc.length(); i++) {
+ NONENCODING_CHARS.set(noEnc.charAt(i));
+ }
+ }
+
+ private static String encodeURL(String url) {
+ byte[] urlBytes = url.getBytes(Charset.forName("UTF-8"));
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < urlBytes.length; i++) {
+ int c = urlBytes[i];
+ if (NONENCODING_CHARS.get(c & 0xFF)) {
+ sb.append((char) c);
+ } else {
+ sb.append(String.format("%%%02X", c & 0xFF));
+ }
+ }
+ return sb.toString();
+ }
+
+ /**
* Generates an HTML anchor tag.
*
* @param ref reference url for the anchor tag
@@ -172,7 +213,7 @@
*/
public static HtmlTree A(String ref, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body));
- htmltree.addAttr(HtmlAttr.HREF, ref);
+ htmltree.addAttr(HtmlAttr.HREF, encodeURL(ref));
return htmltree;
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -203,27 +203,27 @@
useLabel = getResource("doclet.navClassUse");
prevLabel = getResource("doclet.Prev");
nextLabel = getResource("doclet.Next");
- prevclassLabel = getResource("doclet.Prev_Class");
- nextclassLabel = getResource("doclet.Next_Class");
+ prevclassLabel = getNonBreakResource("doclet.Prev_Class");
+ nextclassLabel = getNonBreakResource("doclet.Next_Class");
summaryLabel = getResource("doclet.Summary");
detailLabel = getResource("doclet.Detail");
framesLabel = getResource("doclet.Frames");
- noframesLabel = getResource("doclet.No_Frames");
+ noframesLabel = getNonBreakResource("doclet.No_Frames");
treeLabel = getResource("doclet.Tree");
classLabel = getResource("doclet.Class");
deprecatedLabel = getResource("doclet.navDeprecated");
deprecatedPhrase = getResource("doclet.Deprecated");
- allclassesLabel = getResource("doclet.All_Classes");
- allpackagesLabel = getResource("doclet.All_Packages");
- allprofilesLabel = getResource("doclet.All_Profiles");
+ allclassesLabel = getNonBreakResource("doclet.All_Classes");
+ allpackagesLabel = getNonBreakResource("doclet.All_Packages");
+ allprofilesLabel = getNonBreakResource("doclet.All_Profiles");
indexLabel = getResource("doclet.Index");
helpLabel = getResource("doclet.Help");
seeLabel = getResource("doclet.See");
descriptionLabel = getResource("doclet.Description");
- prevpackageLabel = getResource("doclet.Prev_Package");
- nextpackageLabel = getResource("doclet.Next_Package");
- prevprofileLabel = getResource("doclet.Prev_Profile");
- nextprofileLabel = getResource("doclet.Next_Profile");
+ prevpackageLabel = getNonBreakResource("doclet.Prev_Package");
+ nextpackageLabel = getNonBreakResource("doclet.Next_Package");
+ prevprofileLabel = getNonBreakResource("doclet.Prev_Profile");
+ nextprofileLabel = getNonBreakResource("doclet.Next_Profile");
packagesLabel = getResource("doclet.Packages");
profilesLabel = getResource("doclet.Profiles");
methodDetailsLabel = getResource("doclet.Method_Detail");
@@ -257,6 +257,27 @@
}
/**
+ * Get the configuration string as a content, replacing spaces
+ * with non-breaking spaces.
+ *
+ * @param key the key to look for in the configuration file
+ * @return a content tree for the text
+ */
+ public Content getNonBreakResource(String key) {
+ String text = configuration.getText(key);
+ Content c = configuration.newContent();
+ int start = 0;
+ int p;
+ while ((p = text.indexOf(" ", start)) != -1) {
+ c.addContent(text.substring(start, p));
+ c.addContent(RawHtml.nbsp);
+ start = p + 1;
+ }
+ c.addContent(text.substring(start));
+ return c;
+ }
+
+ /**
* Get the configuration string as a content.
*
* @param key the key to look for in the configuration file
@@ -361,6 +382,12 @@
" if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL +
" targetPage = \"undefined\";" + DocletConstants.NL +
" function validURL(url) {" + DocletConstants.NL +
+ " try {" + DocletConstants.NL +
+ " url = decodeURIComponent(url);" + DocletConstants.NL +
+ " }" + DocletConstants.NL +
+ " catch (error) {" + DocletConstants.NL +
+ " return false;" + DocletConstants.NL +
+ " }" + DocletConstants.NL +
" var pos = url.indexOf(\".html\");" + DocletConstants.NL +
" if (pos == -1 || pos != url.length - 5)" + DocletConstants.NL +
" return false;" + DocletConstants.NL +
@@ -372,7 +399,8 @@
" if ('a' <= ch && ch <= 'z' ||" + DocletConstants.NL +
" 'A' <= ch && ch <= 'Z' ||" + DocletConstants.NL +
" ch == '$' ||" + DocletConstants.NL +
- " ch == '_') {" + DocletConstants.NL +
+ " ch == '_' ||" + DocletConstants.NL +
+ " ch.charCodeAt(0) > 127) {" + DocletConstants.NL +
" allowNumber = true;" + DocletConstants.NL +
" allowSep = true;" + DocletConstants.NL +
" } else if ('0' <= ch && ch <= '9'" + DocletConstants.NL +
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties
--- a/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties Thu Oct 03 19:28:07 2013 +0100
@@ -185,9 +185,9 @@
doclet.Groupname_already_used=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u304A\u3044\u3066\u3001\u3059\u3067\u306B\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
doclet.Same_package_name_used=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u5F62\u5F0F\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0}
doclet.exception_encountered={1}\u306E\u51E6\u7406\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n{0}
-doclet.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n-d \u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n-use \u30AF\u30E9\u30B9\u3068\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F7F\u7528\u30DA\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\n-version @version\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-author @author\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-docfilessubdirs doc-file\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u518D\u5E30\u7684\u306B\u30B3\u30D4\u30FC\u3059\u308B\n-splitindex 1\u5B57\u3054\u3068\u306B1\u30D5\u30A1\u30A4\u30EB\u306B\u7D22\u5F15\u3092\u5206\u5272\u3059\u308B\n-windowtitle \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u7528\u306E\u30D6\u30E9\u30A6\u30B6\u30FB\u30A6\u30A3\u30F3\u30C9\u30A6\u30FB\u30BF\u30A4\u30C8\u30EB\n-doctitle \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link \u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline \u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir :.. \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308B\n-group :.. \u6307\u5B9A\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6982\u8981\u30DA\u30FC\u30B8\u306B\u304A\u3044\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\n-nocomment \u8A18\u8FF0\u304A\u3088\u3073\u30BF\u30B0\u3092\u6291\u5236\u3057\u3066\u5BA3\u8A00\u306E\u307F\u3092\u751F\u6210\u3059\u308B\n-nodeprecated @deprecated\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-noqualifier ::... \u51FA\u529B\u304B\u3089\u4FEE\u98FE\u5B50\u306E\u30EA\u30B9\u30C8\u3092\u9664\u5916\u3059\u308B\n-nosince @since\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-notimestamp \u975E\u8868\u793A\u306E\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3092\u9664\u5916\u3059\u308B\n-nodeprecatedlist \u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u306A\u3044\n-notree \u30AF\u30E9\u30B9\u968E\u5C64\u3092\u751F\u6210\u3057\u306A\u3044\n-noindex \u7D22\u5F15\u3092\u751F\u6210\u3057\u306A\u3044\n-nohelp \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u3092\u751F\u6210\u3057\u306A\u3044\n-nonavbar \u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u3092\u751F\u6210\u3057\u306A\u3044\n-serialwarn @serial\u30BF\u30B0\u306B\u95A2\u3059\u308B\u8B66\u544A\u3092\u751F\u6210\u3059\u308B\n-tag :: \u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3059\u308B\n-taglet \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3059\u308B\n-tagletpath \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u30D1\u30B9\n-Xdocrootparent \
- \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B3\u30E1\u30F3\u30C8\u5185\u306E@docRoot(\u3053\u306E\u5F8C\u306B\u306F/..\u304C\u7D9A\u304F)\u306E\u3059\u3079\u3066\u306E\u51FA\u73FE\u7B87\u6240\u3092\u3067\u7F6E\u63DB\u3059\u308B\n-charset \u751F\u6210\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\n-helpfile \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u306E\u30EA\u30F3\u30AF\u5148\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B\n-linksource HTML\u5F62\u5F0F\u3067\u30BD\u30FC\u30B9\u3092\u751F\u6210\u3059\u308B\n-sourcetab \u30BD\u30FC\u30B9\u5185\u306E\u30BF\u30D6\u306E\u7A7A\u767D\u6587\u5B57\u306E\u6570\u3092\u6307\u5B9A\u3059\u308B\n-keywords HTML\u306Emeta\u30BF\u30B0\u306B\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u60C5\u5831\u3092\u542B\u3081\u308B\n-stylesheetfile \u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B9\u30BF\u30A4\u30EB\u5909\u66F4\u7528\u30D5\u30A1\u30A4\u30EB\n-docencoding \u51FA\u529B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D
+doclet.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n-d \u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n-use \u30AF\u30E9\u30B9\u3068\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F7F\u7528\u30DA\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\n-version @version\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-author @author\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n-docfilessubdirs doc-file\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u518D\u5E30\u7684\u306B\u30B3\u30D4\u30FC\u3059\u308B\n-splitindex 1\u5B57\u3054\u3068\u306B1\u30D5\u30A1\u30A4\u30EB\u306B\u7D22\u5F15\u3092\u5206\u5272\u3059\u308B\n-windowtitle \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u7528\u306E\u30D6\u30E9\u30A6\u30B6\u30FB\u30A6\u30A3\u30F3\u30C9\u30A6\u30FB\u30BF\u30A4\u30C8\u30EB\n-doctitle \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link \u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline \u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir :.. \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308B\n-group :.. \u6307\u5B9A\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6982\u8981\u30DA\u30FC\u30B8\u306B\u304A\u3044\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\n-nocomment \u8A18\u8FF0\u304A\u3088\u3073\u30BF\u30B0\u3092\u6291\u5236\u3057\u3066\u5BA3\u8A00\u306E\u307F\u3092\u751F\u6210\u3059\u308B\n-nodeprecated @deprecated\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-noqualifier ::... \u51FA\u529B\u304B\u3089\u4FEE\u98FE\u5B50\u306E\u30EA\u30B9\u30C8\u3092\u9664\u5916\u3059\u308B\n-nosince @since\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n-notimestamp \u975E\u8868\u793A\u306E\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3092\u9664\u5916\u3059\u308B\n-nodeprecatedlist \u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u306A\u3044\n-notree \u30AF\u30E9\u30B9\u968E\u5C64\u3092\u751F\u6210\u3057\u306A\u3044\n-noindex \u7D22\u5F15\u3092\u751F\u6210\u3057\u306A\u3044\n-nohelp \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u3092\u751F\u6210\u3057\u306A\u3044\n-nonavbar \u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u3092\u751F\u6210\u3057\u306A\u3044\n-serialwarn @serial\u30BF\u30B0\u306B\u95A2\u3059\u308B\u8B66\u544A\u3092\u751F\u6210\u3059\u308B\n-tag :: \u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3059\u308B\n-taglet \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3059\u308B\n-tagletpath \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u30D1\u30B9\n-charset \
+ \u751F\u6210\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\n-helpfile \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u306E\u30EA\u30F3\u30AF\u5148\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B\n-linksource HTML\u5F62\u5F0F\u3067\u30BD\u30FC\u30B9\u3092\u751F\u6210\u3059\u308B\n-sourcetab \u30BD\u30FC\u30B9\u5185\u306E\u30BF\u30D6\u306E\u7A7A\u767D\u6587\u5B57\u306E\u6570\u3092\u6307\u5B9A\u3059\u308B\n-keywords HTML\u306Emeta\u30BF\u30B0\u306B\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u60C5\u5831\u3092\u542B\u3081\u308B\n-stylesheetfile \u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B9\u30BF\u30A4\u30EB\u5909\u66F4\u7528\u30D5\u30A1\u30A4\u30EB\n-docencoding \u51FA\u529B\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B
-
-
+# L10N: do not localize these words: all none accessibility html missing reference syntax
+doclet.X.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n -Xdocrootparent doc\u30B3\u30E1\u30F3\u30C8\u5185\u306E/..\u304C\u5F8C\u306B\u7D9A\u304F@docRoot\u306E\u3059\u3079\u3066\u3092\n \u3067\u7F6E\u63DB\u3057\u307E\u3059\n -Xdoclint javadoc\u30B3\u30E1\u30F3\u30C8\u5185\u306E\u554F\u984C\u306B\u5BFE\u3059\u308B\u63A8\u5968\u3055\u308C\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3057\u307E\u3059\n -Xdoclint:(all|none|[-]) \n javadoc\u30B3\u30E1\u30F3\u30C8\u5185\u306E\u554F\u984C\u306B\u5BFE\u3059\u308B\u7279\u5B9A\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\n \u3053\u3053\u3067\u3001\u306Fhtml\u3001missing\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002\n
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties
--- a/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties Thu Oct 03 19:28:07 2013 +0100
@@ -185,8 +185,8 @@
doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4E2D, groupname \u5DF2\u4F7F\u7528: {0}
doclet.Same_package_name_used=\u7A0B\u5E8F\u5305\u540D\u79F0\u5F62\u5F0F\u4F7F\u7528\u4E86\u4E24\u6B21: {0}
doclet.exception_encountered=\u5904\u7406{1}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\n{0}
-doclet.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n-d \u8F93\u51FA\u6587\u4EF6\u7684\u76EE\u6807\u76EE\u5F55\n-use \u521B\u5EFA\u7C7B\u548C\u7A0B\u5E8F\u5305\u7528\u6CD5\u9875\u9762\n-version \u5305\u542B @version \u6BB5\n-author \u5305\u542B @author \u6BB5\n-docfilessubdirs \u9012\u5F52\u590D\u5236\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\n-splitindex \u5C06\u7D22\u5F15\u5206\u4E3A\u6BCF\u4E2A\u5B57\u6BCD\u5BF9\u5E94\u4E00\u4E2A\u6587\u4EF6\n-windowtitle \u6587\u6863\u7684\u6D4F\u89C8\u5668\u7A97\u53E3\u6807\u9898\n-doctitle \u5305\u542B\u6982\u89C8\u9875\u9762\u7684\u6807\u9898\n-header \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u7709\u6587\u672C\n-footer \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u811A\u6587\u672C\n-top \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9876\u90E8\u6587\u672C\n-bottom \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u5E95\u90E8\u6587\u672C\n-link \u521B\u5EFA\u6307\u5411\u4F4D\u4E8E \u7684 javadoc \u8F93\u51FA\u7684\u94FE\u63A5\n-linkoffline \u5229\u7528\u4F4D\u4E8E \u7684\u7A0B\u5E8F\u5305\u5217\u8868\u94FE\u63A5\u81F3\u4F4D\u4E8E \u7684\u6587\u6863\n-excludedocfilessubdir :.. \u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\u3002\n-group :.. \u5728\u6982\u89C8\u9875\u9762\u4E2D, \u5C06\u6307\u5B9A\u7684\u7A0B\u5E8F\u5305\u5206\u7EC4\n-nocomment \u4E0D\u751F\u6210\u8BF4\u660E\u548C\u6807\u8BB0, \u53EA\u751F\u6210\u58F0\u660E\u3002\n-nodeprecated \u4E0D\u5305\u542B @deprecated \u4FE1\u606F\n-noqualifier ::... \u8F93\u51FA\u4E2D\u4E0D\u5305\u62EC\u9650\u5B9A\u7B26\u7684\u5217\u8868\u3002\n-nosince \u4E0D\u5305\u542B @since \u4FE1\u606F\n-notimestamp \u4E0D\u5305\u542B\u9690\u85CF\u65F6\u95F4\u6233\n-nodeprecatedlist \u4E0D\u751F\u6210\u5DF2\u8FC7\u65F6\u7684\u5217\u8868\n-notree \u4E0D\u751F\u6210\u7C7B\u5206\u5C42\u7ED3\u6784\n-noindex \u4E0D\u751F\u6210\u7D22\u5F15\n-nohelp \u4E0D\u751F\u6210\u5E2E\u52A9\u94FE\u63A5\n-nonavbar \u4E0D\u751F\u6210\u5BFC\u822A\u680F\n-serialwarn \u751F\u6210\u6709\u5173 @serial \u6807\u8BB0\u7684\u8B66\u544A\n-tag :: \u6307\u5B9A\u5355\u4E2A\u53C2\u6570\u5B9A\u5236\u6807\u8BB0\n-taglet \u8981\u6CE8\u518C\u7684 Taglet \u7684\u5168\u9650\u5B9A\u540D\u79F0\n-tagletpath Taglet \u7684\u8DEF\u5F84\n-Xdocrootparent \u5C06\u6587\u6863\u6CE8\u91CA\u4E2D\u51FA\u73B0\u7684\u6240\u6709\u540E\u8DDF /.. \u7684 @docRoot \u66FF\u6362\u4E3A \n-charset \u7528\u4E8E\u8DE8\u5E73\u53F0\u67E5\u770B\u751F\u6210\u7684\u6587\u6863\u7684\u5B57\u7B26\u96C6\u3002\n-helpfile \u5305\u542B\u5E2E\u52A9\u94FE\u63A5\u6240\u94FE\u63A5\u5230\u7684\u6587\u4EF6\n-linksource \u4EE5 HTML \u683C\u5F0F\u751F\u6210\u6E90\u6587\u4EF6\n-sourcetab \u6307\u5B9A\u6E90\u4E2D\u6BCF\u4E2A\u5236\u8868\u7B26\u5360\u636E\u7684\u7A7A\u683C\u6570\n-keywords \u4F7F\u7A0B\u5E8F\u5305, \u7C7B\u548C\u6210\u5458\u4FE1\u606F\u9644\u5E26 HTML \u5143\u6807\u8BB0\n-stylesheetfile \u7528\u4E8E\u66F4\u6539\u751F\u6210\u6587\u6863\u7684\u6837\u5F0F\u7684\u6587\u4EF6\n-docencoding \u8F93\u51FA\u7F16\u7801\u540D\u79F0
+doclet.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n -d \u8F93\u51FA\u6587\u4EF6\u7684\u76EE\u6807\u76EE\u5F55\n -use \u521B\u5EFA\u7C7B\u548C\u7A0B\u5E8F\u5305\u7528\u6CD5\u9875\u9762\n -version \u5305\u542B @version \u6BB5\n -author \u5305\u542B @author \u6BB5\n -docfilessubdirs \u9012\u5F52\u590D\u5236\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\n -splitindex \u5C06\u7D22\u5F15\u5206\u4E3A\u6BCF\u4E2A\u5B57\u6BCD\u5BF9\u5E94\u4E00\u4E2A\u6587\u4EF6\n -windowtitle \u6587\u6863\u7684\u6D4F\u89C8\u5668\u7A97\u53E3\u6807\u9898\n -doctitle \u5305\u542B\u6982\u89C8\u9875\u9762\u7684\u6807\u9898\n -header \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u7709\u6587\u672C\n -footer \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u811A\u6587\u672C\n -top \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9876\u90E8\u6587\u672C\n -bottom \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u5E95\u90E8\u6587\u672C\n -link \u521B\u5EFA\u6307\u5411\u4F4D\u4E8E \u7684 javadoc \u8F93\u51FA\u7684\u94FE\u63A5\n -linkoffline \u5229\u7528\u4F4D\u4E8E \u7684\u7A0B\u5E8F\u5305\u5217\u8868\u94FE\u63A5\u81F3\u4F4D\u4E8E \u7684\u6587\u6863\n -excludedocfilessubdir :.. \u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\u3002\n -group :.. \u5728\u6982\u89C8\u9875\u9762\u4E2D, \u5C06\u6307\u5B9A\u7684\u7A0B\u5E8F\u5305\u5206\u7EC4\n -nocomment \u4E0D\u751F\u6210\u8BF4\u660E\u548C\u6807\u8BB0, \u53EA\u751F\u6210\u58F0\u660E\u3002\n -nodeprecated \u4E0D\u5305\u542B @deprecated \u4FE1\u606F\n -noqualifier ::... \u8F93\u51FA\u4E2D\u4E0D\u5305\u62EC\u6307\u5B9A\u9650\u5B9A\u7B26\u7684\u5217\u8868\u3002\n -nosince \u4E0D\u5305\u542B @since \u4FE1\u606F\n -notimestamp \u4E0D\u5305\u542B\u9690\u85CF\u65F6\u95F4\u6233\n -nodeprecatedlist \u4E0D\u751F\u6210\u5DF2\u8FC7\u65F6\u7684\u5217\u8868\n -notree \u4E0D\u751F\u6210\u7C7B\u5206\u5C42\u7ED3\u6784\n -noindex \u4E0D\u751F\u6210\u7D22\u5F15\n -nohelp \u4E0D\u751F\u6210\u5E2E\u52A9\u94FE\u63A5\n -nonavbar \u4E0D\u751F\u6210\u5BFC\u822A\u680F\n -serialwarn \u751F\u6210\u6709\u5173 @serial \u6807\u8BB0\u7684\u8B66\u544A\n -tag :: \u6307\u5B9A\u5355\u4E2A\u53C2\u6570\u5B9A\u5236\u6807\u8BB0\n -taglet \u8981\u6CE8\u518C\u7684 Taglet \u7684\u5168\u9650\u5B9A\u540D\u79F0\n -tagletpath Taglet \u7684\u8DEF\u5F84\n -charset \u7528\u4E8E\u8DE8\u5E73\u53F0\u67E5\u770B\u751F\u6210\u7684\u6587\u6863\u7684\u5B57\u7B26\u96C6\u3002\n -helpfile \u5305\u542B\u5E2E\u52A9\u94FE\u63A5\u6240\u94FE\u63A5\u5230\u7684\u6587\u4EF6\n -linksource \u4EE5 HTML \u683C\u5F0F\u751F\u6210\u6E90\u6587\u4EF6\n -sourcetab \u6307\u5B9A\u6E90\u4E2D\u6BCF\u4E2A\u5236\u8868\u7B26\u5360\u636E\u7684\u7A7A\u683C\u6570\n -keywords \u4F7F\u7A0B\u5E8F\u5305, \u7C7B\u548C\u6210\u5458\u4FE1\u606F\u9644\u5E26 HTML \u5143\u6807\u8BB0\n -stylesheetfile \u7528\u4E8E\u66F4\u6539\u751F\u6210\u6587\u6863\u7684\u6837\u5F0F\u7684\u6587\u4EF6\n -docencoding \u6307\u5B9A\u8F93\u51FA\u7684\u5B57\u7B26\u7F16\u7801
-
-
+# L10N: do not localize these words: all none accessibility html missing reference syntax
+doclet.X.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n -Xdocrootparent \u4F7F\u7528 \u66FF\u6362\u6587\u6863\u6CE8\u91CA\u4E2D\u51FA\u73B0\u7684\n \u6240\u6709\u5176\u540E\u8DDF\u968F /.. \u7684 @docRoot\n -Xdoclint \u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u5EFA\u8BAE\u7684\u68C0\u67E5\n -Xdoclint:(all|none|[-]) \n \u5BF9 javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5\u3002\n \u5176\u4E2D \u662F accessibility, html, missing, reference \u6216 syntax \u4E4B\u4E00\u3002\n
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeFieldWriter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeFieldWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit;
+
+import java.io.*;
+import com.sun.javadoc.*;
+
+/**
+ * The interface for writing annotation type field output.
+ *
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.
+ *
+ *
+ * @author Bhavesh Patel
+ * @since 1.8
+ */
+
+public interface AnnotationTypeFieldWriter {
+
+ /**
+ * Add the annotation type member tree header.
+ *
+ * @return content tree for the member tree header
+ */
+ public Content getMemberTreeHeader();
+
+ /**
+ * Add the annotation type field details marker.
+ *
+ * @param memberDetails the content tree representing field details marker
+ */
+ public void addAnnotationFieldDetailsMarker(Content memberDetails);
+
+ /**
+ * Add the annotation type details tree header.
+ *
+ * @param classDoc the annotation type being documented
+ * @param memberDetailsTree the content tree representing member details
+ */
+ public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
+ Content memberDetailsTree);
+
+ /**
+ * Get the annotation type documentation tree header.
+ *
+ * @param member the annotation type being documented
+ * @param annotationDetailsTree the content tree representing annotation type details
+ * @return content tree for the annotation type documentation header
+ */
+ public Content getAnnotationDocTreeHeader(MemberDoc member,
+ Content annotationDetailsTree);
+
+ /**
+ * Get the annotation type details tree.
+ *
+ * @param annotationDetailsTree the content tree representing annotation type details
+ * @return content tree for the annotation type details
+ */
+ public Content getAnnotationDetails(Content annotationDetailsTree);
+
+ /**
+ * Get the annotation type documentation.
+ *
+ * @param annotationDocTree the content tree representing annotation type documentation
+ * @param isLastContent true if the content to be added is the last content
+ * @return content tree for the annotation type documentation
+ */
+ public Content getAnnotationDoc(Content annotationDocTree, boolean isLastContent);
+
+ /**
+ * Get the signature for the given member.
+ *
+ * @param member the member being documented
+ * @return content tree for the annotation type signature
+ */
+ public Content getSignature(MemberDoc member);
+
+ /**
+ * Add the deprecated output for the given member.
+ *
+ * @param member the member being documented
+ * @param annotationDocTree content tree to which the deprecated information will be added
+ */
+ public void addDeprecated(MemberDoc member, Content annotationDocTree);
+
+ /**
+ * Add the comments for the given member.
+ *
+ * @param member the member being documented
+ * @param annotationDocTree the content tree to which the comments will be added
+ */
+ public void addComments(MemberDoc member, Content annotationDocTree);
+
+ /**
+ * Add the tags for the given member.
+ *
+ * @param member the member being documented
+ * @param annotationDocTree the content tree to which the tags will be added
+ */
+ public void addTags(MemberDoc member, Content annotationDocTree);
+
+ /**
+ * Close the writer.
+ */
+ public void close() throws IOException;
+}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,20 @@
public interface AnnotationTypeRequiredMemberWriter {
/**
+ * Add the annotation type member tree header.
+ *
+ * @return content tree for the member tree header
+ */
+ public Content getMemberTreeHeader();
+
+ /**
+ * Add the annotation type details marker.
+ *
+ * @param memberDetails the content tree representing details marker
+ */
+ public void addAnnotationDetailsMarker(Content memberDetails);
+
+ /**
* Add the annotation type details tree header.
*
* @param classDoc the annotation type being documented
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java Thu Oct 03 19:28:07 2013 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -104,13 +104,6 @@
public void addAnnotationTypeDeprecationInfo (Content annotationInfoTree);
/**
- * Add the annotation type details marker.
- *
- * @param memberDetails the content tree representing member details marker
- */
- public void addAnnotationDetailsMarker(Content memberDetails);
-
- /**
* Get the member tree header for the annotation type.
*
* @return a content tree for the member tree header
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Thu Oct 03 19:28:07 2013 +0100
@@ -383,35 +383,52 @@
DocErrorReporter reporter);
private void initProfiles() throws IOException {
+ if (profilespath.isEmpty())
+ return;
+
profiles = Profiles.read(new File(profilespath));
- // Generate profiles documentation only is profilespath is set and if
- // profiles is not null and profiles count is 1 or more.
- showProfiles = (!profilespath.isEmpty() && profiles != null &&
- profiles.getProfileCount() > 0);
- }
+
+ // Group the packages to be documented by the lowest profile (if any)
+ // in which each appears
+ Map> interimResults =
+ new EnumMap>(Profile.class);
+ for (Profile p: Profile.values())
+ interimResults.put(p, new ArrayList());
- private void initProfilePackages() throws IOException {
- profilePackages = new HashMap();
- ArrayList results;
- Map packageIndex = new HashMap();
- for (int i = 0; i < packages.length; i++) {
- PackageDoc pkg = packages[i];
- packageIndex.put(pkg.name(), pkg);
+ for (PackageDoc pkg: packages) {
+ if (nodeprecated && Util.isDeprecated(pkg)) {
+ continue;
+ }
+ // the getProfile method takes a type name, not a package name,
+ // but isn't particularly fussy about the simple name -- so just use *
+ int i = profiles.getProfile(pkg.name().replace(".", "/") + "/*");
+ Profile p = Profile.lookup(i);
+ if (p != null) {
+ List pkgs = interimResults.get(p);
+ pkgs.add(pkg);
+ }
}
- for (int i = 1; i < profiles.getProfileCount(); i++) {
- Set profPkgs = profiles.getPackages(i);
- results = new ArrayList();
- for (String packageName : profPkgs) {
- packageName = packageName.replace("/", ".");
- PackageDoc profPkg = packageIndex.get(packageName);
- if (profPkg != null) {
- results.add(profPkg);
- }
- }
- Collections.sort(results);
- PackageDoc[] profilePkgs = results.toArray(new PackageDoc[]{});
- profilePackages.put(Profile.lookup(i).name, profilePkgs);
+
+ // Build the profilePackages structure used by the doclet
+ profilePackages = new HashMap();
+ List prev = Collections.emptyList();
+ int size;
+ for (Map.Entry> e: interimResults.entrySet()) {
+ Profile p = e.getKey();
+ List pkgs = e.getValue();
+ pkgs.addAll(prev); // each profile contains all lower profiles
+ Collections.sort(pkgs);
+ size = pkgs.size();
+ // For a profile, if there are no packages to be documented, do not add
+ // it to profilePackages map.
+ if (size > 0)
+ profilePackages.put(p.name, pkgs.toArray(new PackageDoc[pkgs.size()]));
+ prev = pkgs;
}
+
+ // Generate profiles documentation if any profile contains any
+ // of the packages to be documented.
+ showProfiles = !prev.isEmpty();
}
private void initPackageArray() {
@@ -534,13 +551,10 @@
public void setOptions() throws Fault {
initPackageArray();
setOptions(root.options());
- if (!profilespath.isEmpty()) {
- try {
- initProfiles();
- initProfilePackages();
- } catch (Exception e) {
- throw new DocletAbortException(e);
- }
+ try {
+ initProfiles();
+ } catch (Exception e) {
+ throw new DocletAbortException(e);
}
setSpecificDocletOptions(root.options());
}
@@ -713,6 +727,17 @@
}
/**
+ * Check the validity of the given profile. Return false if there are no
+ * valid packages to be documented for the profile.
+ *
+ * @param profileName the profile that needs to be validated.
+ * @return true if the profile has valid packages to be documented.
+ */
+ public boolean shouldDocumentProfile(String profileName) {
+ return profilePackages.containsKey(profileName);
+ }
+
+ /**
* Check the validity of the given Source or Output File encoding on this
* platform.
*
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java Thu Oct 03 19:28:07 2013 +0100
@@ -130,6 +130,18 @@
throws Exception;
/**
+ * Return the annotation type field writer for a given annotation type.
+ *
+ * @param annotationTypeWriter the writer for the annotation type
+ * being documented.
+ * @return the member writer for the given annotation type. Return null if
+ * this writer is not supported by the doclet.
+ */
+ public abstract AnnotationTypeFieldWriter
+ getAnnotationTypeFieldWriter(
+ AnnotationTypeWriter annotationTypeWriter) throws Exception;
+
+ /**
* Return the annotation type optional member writer for a given annotation
* type.
*
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java Thu Oct 03 19:28:07 2013 +0100
@@ -223,14 +223,23 @@
Content memberDetailsTree = writer.getMemberTreeHeader();
buildChildren(node, memberDetailsTree);
if (memberDetailsTree.isValid()) {
- Content memberDetails = writer.getMemberTreeHeader();
- writer.addAnnotationDetailsMarker(memberDetails);
- memberDetails.addContent(writer.getMemberTree(memberDetailsTree));
- annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetails));
+ annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree));
}
}
/**
+ * Build the annotation type field documentation.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param memberDetailsTree the content tree to which the documentation will be added
+ */
+ public void buildAnnotationTypeFieldDetails(XMLNode node, Content memberDetailsTree)
+ throws Exception {
+ configuration.getBuilderFactory().
+ getAnnotationTypeFieldsBuilder(writer).buildChildren(node, memberDetailsTree);
+ }
+
+ /**
* Build the annotation type optional member documentation.
*
* @param node the XML element that specifies which components to document
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeFieldBuilder.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeFieldBuilder.java Thu Oct 03 19:28:07 2013 +0100
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit.builders;
+
+import java.util.*;
+
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * Builds documentation for annotation type fields.
+ *
+ *
This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.
+ *
+ * @author Bhavesh Patel
+ * @since 1.8
+ */
+public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder {
+
+ /**
+ * The annotation type whose members are being documented.
+ */
+ protected ClassDoc classDoc;
+
+ /**
+ * The visible members for the given class.
+ */
+ protected VisibleMemberMap visibleMemberMap;
+
+ /**
+ * The writer to output the member documentation.
+ */
+ protected AnnotationTypeFieldWriter writer;
+
+ /**
+ * The list of members being documented.
+ */
+ protected List members;
+
+ /**
+ * The index of the current member that is being documented at this point
+ * in time.
+ */
+ protected int currentMemberIndex;
+
+ /**
+ * Construct a new AnnotationTypeFieldsBuilder.
+ *
+ * @param context the build context.
+ * @param classDoc the class whose members are being documented.
+ * @param writer the doclet specific writer.
+ * @param memberType the type of member that is being documented.
+ */
+ protected AnnotationTypeFieldBuilder(Context context,
+ ClassDoc classDoc,
+ AnnotationTypeFieldWriter writer,
+ int memberType) {
+ super(context);
+ this.classDoc = classDoc;
+ this.writer = writer;
+ this.visibleMemberMap = new VisibleMemberMap(classDoc, memberType,
+ configuration);
+ this.members = new ArrayList(
+ this.visibleMemberMap.getMembersFor(classDoc));
+ if (configuration.getMemberComparator() != null) {
+ Collections.sort(this.members, configuration.getMemberComparator());
+ }
+ }
+
+
+ /**
+ * Construct a new AnnotationTypeFieldBuilder.
+ *
+ * @param context the build context.
+ * @param classDoc the class whose members are being documented.
+ * @param writer the doclet specific writer.
+ */
+ public static AnnotationTypeFieldBuilder getInstance(
+ Context context, ClassDoc classDoc,
+ AnnotationTypeFieldWriter writer) {
+ return new AnnotationTypeFieldBuilder(context, classDoc,
+ writer, VisibleMemberMap.ANNOTATION_TYPE_FIELDS);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getName() {
+ return "AnnotationTypeFieldDetails";
+ }
+
+ /**
+ * Returns a list of members that will be documented for the given class.
+ * This information can be used for doclet specific documentation
+ * generation.
+ *
+ * @param classDoc the {@link ClassDoc} we want to check.
+ * @return a list of members that will be documented.
+ */
+ public List members(ClassDoc classDoc) {
+ return visibleMemberMap.getMembersFor(classDoc);
+ }
+
+ /**
+ * Returns the visible member map for the members of this class.
+ *
+ * @return the visible member map for the members of this class.
+ */
+ public VisibleMemberMap getVisibleMemberMap() {
+ return visibleMemberMap;
+ }
+
+ /**
+ * summaryOrder.size()
+ */
+ public boolean hasMembersToDocument() {
+ return members.size() > 0;
+ }
+
+ /**
+ * Build the annotation type field documentation.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param memberDetailsTree the content tree to which the documentation will be added
+ */
+ public void buildAnnotationTypeField(XMLNode node, Content memberDetailsTree) {
+ buildAnnotationTypeMember(node, memberDetailsTree);
+ }
+
+ /**
+ * Build the member documentation.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param memberDetailsTree the content tree to which the documentation will be added
+ */
+ public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) {
+ if (writer == null) {
+ return;
+ }
+ int size = members.size();
+ if (size > 0) {
+ writer.addAnnotationFieldDetailsMarker(memberDetailsTree);
+ for (currentMemberIndex = 0; currentMemberIndex < size;
+ currentMemberIndex++) {
+ Content detailsTree = writer.getMemberTreeHeader();
+ writer.addAnnotationDetailsTreeHeader(classDoc, detailsTree);
+ Content annotationDocTree = writer.getAnnotationDocTreeHeader(
+ (MemberDoc) members.get(currentMemberIndex),
+ detailsTree);
+ buildChildren(node, annotationDocTree);
+ detailsTree.addContent(writer.getAnnotationDoc(
+ annotationDocTree, (currentMemberIndex == size - 1)));
+ memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree));
+ }
+ }
+ }
+
+ /**
+ * Build the signature.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param annotationDocTree the content tree to which the documentation will be added
+ */
+ public void buildSignature(XMLNode node, Content annotationDocTree) {
+ annotationDocTree.addContent(
+ writer.getSignature((MemberDoc) members.get(currentMemberIndex)));
+ }
+
+ /**
+ * Build the deprecation information.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param annotationDocTree the content tree to which the documentation will be added
+ */
+ public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) {
+ writer.addDeprecated((MemberDoc) members.get(currentMemberIndex),
+ annotationDocTree);
+ }
+
+ /**
+ * Build the comments for the member. Do nothing if
+ * {@link Configuration#nocomment} is set to true.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param annotationDocTree the content tree to which the documentation will be added
+ */
+ public void buildMemberComments(XMLNode node, Content annotationDocTree) {
+ if(! configuration.nocomment){
+ writer.addComments((MemberDoc) members.get(currentMemberIndex),
+ annotationDocTree);
+ }
+ }
+
+ /**
+ * Build the tag information.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param annotationDocTree the content tree to which the documentation will be added
+ */
+ public void buildTagInfo(XMLNode node, Content annotationDocTree) {
+ writer.addTags((MemberDoc) members.get(currentMemberIndex),
+ annotationDocTree);
+ }
+
+ /**
+ * Return the annotation type field writer for this builder.
+ *
+ * @return the annotation type field writer for this builder.
+ */
+ public AnnotationTypeFieldWriter getWriter() {
+ return writer;
+ }
+}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java Thu Oct 03 19:28:07 2013 +0100
@@ -167,16 +167,17 @@
}
int size = members.size();
if (size > 0) {
- writer.addAnnotationDetailsTreeHeader(
- classDoc, memberDetailsTree);
+ writer.addAnnotationDetailsMarker(memberDetailsTree);
for (currentMemberIndex = 0; currentMemberIndex < size;
- currentMemberIndex++) {
+ currentMemberIndex++) {
+ Content detailsTree = writer.getMemberTreeHeader();
+ writer.addAnnotationDetailsTreeHeader(classDoc, detailsTree);
Content annotationDocTree = writer.getAnnotationDocTreeHeader(
- (MemberDoc) members.get(currentMemberIndex),
- memberDetailsTree);
+ (MemberDoc) members.get(currentMemberIndex), detailsTree);
buildChildren(node, annotationDocTree);
- memberDetailsTree.addContent(writer.getAnnotationDoc(
+ detailsTree.addContent(writer.getAnnotationDoc(
annotationDocTree, (currentMemberIndex == size - 1)));
+ memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree));
}
}
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java Thu Oct 03 19:28:07 2013 +0100
@@ -174,10 +174,26 @@
}
/**
+ * Return an instance of the annotation type fields builder for the given
+ * class.
+ *
+ * @return an instance of the annotation type field builder for the given
+ * annotation type.
+ */
+ public AbstractBuilder getAnnotationTypeFieldsBuilder(
+ AnnotationTypeWriter annotationTypeWriter)
+ throws Exception {
+ return AnnotationTypeFieldBuilder.getInstance(context,
+ annotationTypeWriter.getAnnotationTypeDoc(),
+ writerFactory.getAnnotationTypeFieldWriter(
+ annotationTypeWriter));
+ }
+
+ /**
* Return an instance of the annotation type member builder for the given
* class.
*
- * @return an instance of the annotation type memebr builder for the given
+ * @return an instance of the annotation type member builder for the given
* annotation type.
*/
public AbstractBuilder getAnnotationTypeOptionalMemberBuilder(
@@ -193,7 +209,7 @@
* Return an instance of the annotation type member builder for the given
* class.
*
- * @return an instance of the annotation type memebr builder for the given
+ * @return an instance of the annotation type member builder for the given
* annotation type.
*/
public AbstractBuilder getAnnotationTypeRequiredMemberBuilder(
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java Thu Oct 03 19:28:07 2013 +0100
@@ -213,6 +213,20 @@
}
/**
+ * Build the summary for fields.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param memberSummaryTree the content tree to which the documentation will be added
+ */
+ public void buildAnnotationTypeFieldsSummary(XMLNode node, Content memberSummaryTree) {
+ MemberSummaryWriter writer =
+ memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_FIELDS];
+ VisibleMemberMap visibleMemberMap =
+ visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_FIELDS];
+ addSummary(writer, visibleMemberMap, false, memberSummaryTree);
+ }
+
+ /**
* Build the summary for the optional members.
*
* @param node the XML element that specifies which components to document
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Thu Oct 03 19:28:07 2013 +0100
@@ -66,10 +66,19 @@
+
+
+
+
+
+
+
+
+
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Thu Oct 03 19:28:07 2013 +0100
@@ -136,6 +136,7 @@
doclet.Groupname_already_used=In -group option, groupname already used: {0}
doclet.value_tag_invalid_reference={0} (referenced by @value tag) is an unknown reference.
doclet.value_tag_invalid_constant=@value tag (which references {0}) can only be used in constants.
+doclet.value_tag_invalid_use=@value tag cannot be used here.
doclet.dest_dir_create=Creating destination directory: "{0}"
doclet.in={0} in {1}
doclet.Use_Table_Summary=Use table, listing {0}, and an explanation
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties Thu Oct 03 19:28:07 2013 +0100
@@ -174,6 +174,16 @@
doclet.0_and_1={0}\u3068{1}
#Documentation for Enums
-doclet.enum_values_doc=\n\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u914D\u5217\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u8FD4\u3057\u307E\u3059\u3002\n\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u6B21\u306E\u3088\u3046\u306B\u3057\u3066\u5B9A\u6570\u3092\u53CD\u5FA9\u3059\u308B\u305F\u3081\u306B\n\u4F7F\u7528\u3067\u304D\u307E\u3059:\n
\nfor ({0} c : {0}.values())\n System.out.println(c);\n
+
+doclet.enum_values_doc.return=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F\u8FD4\u56DE\u7684\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4
+
+doclet.enum_valueof_doc.main=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26\u5B8C\u5168\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)
-doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26\u5B8C\u5168\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@return \u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@throws \u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@throws \u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException
+doclet.enum_valueof_doc.param_name=\u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002
+
+doclet.enum_valueof_doc.return=\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF
+
+doclet.enum_valueof_doc.throws_ila=\u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF
+
+doclet.enum_valueof_doc.throws_npe=\u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Thu Oct 03 19:28:07 2013 +0100
@@ -180,6 +180,12 @@
margin: auto 5px;
border:1px solid #c9aa44;
}
+.skipNav {
+ position:absolute;
+ top:auto;
+ left:-9999px;
+ overflow:hidden;
+ }
/*
Page header and footer styles
*/
@@ -372,7 +378,6 @@
overflow:hidden;
padding:0px;
margin:0px;
- white-space:pre;
}
caption a:link, caption a:hover, caption a:active, caption a:visited {
color:#FFFFFF;
@@ -381,35 +386,32 @@
white-space:nowrap;
padding-top:8px;
padding-left:8px;
- display:block;
+ display:inline-block;
float:left;
background-image:url(resources/titlebar.gif);
- height:18px;
}
.contentContainer ul.blockList li.blockList caption span.activeTableTab span {
white-space:nowrap;
padding-top:8px;
padding-left:8px;
- display:block;
+ display:inline-block;
float:left;
background-image:url(resources/activetitlebar.gif);
- height:18px;
}
.contentContainer ul.blockList li.blockList caption span.tableTab span {
white-space:nowrap;
padding-top:8px;
padding-left:8px;
- display:block;
+ display:inline-block;
float:left;
background-image:url(resources/titlebar.gif);
- height:18px;
}
.contentContainer ul.blockList li.blockList caption span.tableTab, .contentContainer ul.blockList li.blockList caption span.activeTableTab {
padding-top:0px;
padding-left:0px;
background-image:none;
float:none;
- display:inline;
+ display:inline-block;
}
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
width:10px;
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LegacyTaglet.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LegacyTaglet.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LegacyTaglet.java Thu Oct 03 19:28:07 2013 +0100
@@ -130,7 +130,13 @@
public Content getTagletOutput(Doc holder, TagletWriter writer)
throws IllegalArgumentException {
Content output = writer.getOutputInstance();
- output.addContent(new RawHtml(legacyTaglet.toString(holder.tags(getName()))));
+ Tag[] tags = holder.tags(getName());
+ if (tags.length > 0) {
+ String tagString = legacyTaglet.toString(tags);
+ if (tagString != null) {
+ output.addContent(new RawHtml(tagString));
+ }
+ }
return output;
}
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java Thu Oct 03 19:28:07 2013 +0100
@@ -105,7 +105,9 @@
}
/**
- * Given the name of the field, return the corresponding FieldDoc.
+ * Given the name of the field, return the corresponding FieldDoc. Return null
+ * due to invalid use of value tag if the name is null or empty string and if
+ * the value tag is not used on a field.
*
* @param config the current configuration of the doclet.
* @param tag the value tag.
@@ -114,10 +116,8 @@
* it is assumed that the field is in the current class.
*
* @return the corresponding FieldDoc. If the name is null or empty string,
- * return field that the value tag was used in.
- *
- * @throws DocletAbortException if the value tag does not specify a name to
- * a value field and it is not used within the comments of a valid field.
+ * return field that the value tag was used in. Return null if the name is null
+ * or empty string and if the value tag is not used on a field.
*/
private FieldDoc getFieldDoc(Configuration config, Tag tag, String name) {
if (name == null || name.length() == 0) {
@@ -125,8 +125,9 @@
if (tag.holder() instanceof FieldDoc) {
return (FieldDoc) tag.holder();
} else {
- //This should never ever happen.
- throw new DocletAbortException("should not happen");
+ // If the value tag does not specify a parameter which is a valid field and
+ // it is not used within the comments of a valid field, return null.
+ return null;
}
}
StringTokenizer st = new StringTokenizer(name, "#");
@@ -165,9 +166,15 @@
FieldDoc field = getFieldDoc(
writer.configuration(), tag, tag.text());
if (field == null) {
- //Reference is unknown.
- writer.getMsgRetriever().warning(tag.holder().position(),
- "doclet.value_tag_invalid_reference", tag.text());
+ if (tag.text().isEmpty()) {
+ //Invalid use of @value
+ writer.getMsgRetriever().warning(tag.holder().position(),
+ "doclet.value_tag_invalid_use");
+ } else {
+ //Reference is unknown.
+ writer.getMsgRetriever().warning(tag.holder().position(),
+ "doclet.value_tag_invalid_reference", tag.text());
+ }
} else if (field.constantValue() != null) {
return writer.valueTagOutput(field,
field.constantValueExpression(),
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PathDocFileFactory.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PathDocFileFactory.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PathDocFileFactory.java Thu Oct 03 19:28:07 2013 +0100
@@ -34,6 +34,7 @@
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
+import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -221,8 +222,10 @@
/** If the file is a directory, list its contents. */
public Iterable list() throws IOException {
List files = new ArrayList();
- for (Path f: Files.newDirectoryStream(file)) {
- files.add(new StandardDocFile(f));
+ try (DirectoryStream ds = Files.newDirectoryStream(file)) {
+ for (Path f: ds) {
+ files.add(new StandardDocFile(f));
+ }
}
return files;
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java Thu Oct 03 19:28:07 2013 +0100
@@ -55,14 +55,15 @@
public static final int FIELDS = 2;
public static final int CONSTRUCTORS = 3;
public static final int METHODS = 4;
- public static final int ANNOTATION_TYPE_MEMBER_OPTIONAL = 5;
- public static final int ANNOTATION_TYPE_MEMBER_REQUIRED = 6;
- public static final int PROPERTIES = 7;
+ public static final int ANNOTATION_TYPE_FIELDS = 5;
+ public static final int ANNOTATION_TYPE_MEMBER_OPTIONAL = 6;
+ public static final int ANNOTATION_TYPE_MEMBER_REQUIRED = 7;
+ public static final int PROPERTIES = 8;
/**
* The total number of member types is {@value}.
*/
- public static final int NUM_MEMBER_TYPES = 8;
+ public static final int NUM_MEMBER_TYPES = 9;
public static final String STARTLEVEL = "start";
@@ -433,6 +434,9 @@
}
ProgramElementDoc[] members = null;
switch (kind) {
+ case ANNOTATION_TYPE_FIELDS:
+ members = cd.fields(filter);
+ break;
case ANNOTATION_TYPE_MEMBER_OPTIONAL:
members = cd.isAnnotationType() ?
filter((AnnotationTypeDoc) cd, false) :
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclint/Checker.java
--- a/src/share/classes/com/sun/tools/doclint/Checker.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/Checker.java Thu Oct 03 19:28:07 2013 +0100
@@ -44,6 +44,7 @@
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Name;
+import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.tools.Diagnostic.Kind;
@@ -93,7 +94,7 @@
Set foundParams = new HashSet<>();
Set foundThrows = new HashSet<>();
- Map> foundAnchors = new HashMap<>();
+ Map> foundAnchors = new HashMap<>();
boolean foundInheritDoc = false;
boolean foundReturn = false;
@@ -576,13 +577,30 @@
}
private boolean checkAnchor(String name) {
- JavaFileObject fo = env.currPath.getCompilationUnit().getSourceFile();
- Set set = foundAnchors.get(fo);
+ Element e = getEnclosingPackageOrClass(env.currElement);
+ if (e == null)
+ return true;
+ Set set = foundAnchors.get(e);
if (set == null)
- foundAnchors.put(fo, set = new HashSet<>());
+ foundAnchors.put(e, set = new HashSet<>());
return set.add(name);
}
+ private Element getEnclosingPackageOrClass(Element e) {
+ while (e != null) {
+ switch (e.getKind()) {
+ case CLASS:
+ case ENUM:
+ case INTERFACE:
+ case PACKAGE:
+ return e;
+ default:
+ e = e.getEnclosingElement();
+ }
+ }
+ return e;
+ }
+
// http://www.w3.org/TR/html401/types.html#type-name
private static final Pattern validName = Pattern.compile("[A-Za-z][A-Za-z0-9-_:.]*");
@@ -712,6 +730,10 @@
@Override
public Void visitReference(ReferenceTree tree, Void ignore) {
+ String sig = tree.getSignature();
+ if (sig.contains("<") || sig.contains(">"))
+ env.messages.error(REFERENCE, tree, "dc.type.arg.not.allowed");
+
Element e = env.trees.getElement(getCurrentPath());
if (e == null)
env.messages.error(REFERENCE, tree, "dc.ref.not.found");
@@ -805,10 +827,33 @@
@Override
public Void visitValue(ValueTree tree, Void ignore) {
+ ReferenceTree ref = tree.getReference();
+ if (ref == null || ref.getSignature().isEmpty()) {
+ if (!isConstant(env.currElement))
+ env.messages.error(REFERENCE, tree, "dc.value.not.allowed.here");
+ } else {
+ Element e = env.trees.getElement(new DocTreePath(getCurrentPath(), ref));
+ if (!isConstant(e))
+ env.messages.error(REFERENCE, tree, "dc.value.not.a.constant");
+ }
+
markEnclosingTag(Flag.HAS_INLINE_TAG);
return super.visitValue(tree, ignore);
}
+ private boolean isConstant(Element e) {
+ if (e == null)
+ return false;
+
+ switch (e.getKind()) {
+ case FIELD:
+ Object value = ((VariableElement) e).getConstantValue();
+ return (value != null); // can't distinguish "not a constant" from "constant is null"
+ default:
+ return false;
+ }
+ }
+
@Override
public Void visitVersion(VersionTree tree, Void ignore) {
warnIfEmpty(tree, tree.getBody());
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclint/DocLint.java
--- a/src/share/classes/com/sun/tools/doclint/DocLint.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/DocLint.java Thu Oct 03 19:28:07 2013 +0100
@@ -29,9 +29,14 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
+import java.util.Queue;
+import java.util.Set;
import javax.lang.model.element.Name;
+import javax.tools.JavaFileObject;
import javax.tools.StandardLocation;
import com.sun.source.doctree.DocCommentTree;
@@ -278,15 +283,25 @@
TaskListener tl = new TaskListener() {
@Override
public void started(TaskEvent e) {
+ switch (e.getKind()) {
+ case ANALYZE:
+ CompilationUnitTree tree;
+ while ((tree = todo.poll()) != null)
+ ds.scan(tree, null);
+ break;
+ }
}
@Override
public void finished(TaskEvent e) {
switch (e.getKind()) {
- case ENTER:
- ds.scan(e.getCompilationUnit(), null);
+ case PARSE:
+ todo.add(e.getCompilationUnit());
+ break;
}
}
+
+ Queue todo = new LinkedList();
};
task.addTaskListener(tl);
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclint/HtmlTag.java
--- a/src/share/classes/com/sun/tools/doclint/HtmlTag.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/HtmlTag.java Thu Oct 03 19:28:07 2013 +0100
@@ -86,6 +86,9 @@
DD(BlockType.LIST_ITEM, EndKind.OPTIONAL,
EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE, Flag.EXPECT_CONTENT)),
+ DFN(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
DIV(BlockType.BLOCK, EndKind.REQUIRED,
EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclint/resources/doclint.properties
--- a/src/share/classes/com/sun/tools/doclint/resources/doclint.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/resources/doclint.properties Thu Oct 03 19:28:07 2013 +0100
@@ -67,7 +67,10 @@
dc.tag.start.unmatched = end tag missing: {0}>
dc.tag.unknown = unknown tag: {0}
dc.text.not.allowed = text not allowed in <{0}> element
+dc.type.arg.not.allowed = type arguments not allowed here
dc.unexpected.comment=documentation comment not expected here
+dc.value.not.allowed.here='{@value}' not allowed here
+dc.value.not.a.constant=value does not refer to a constant
dc.main.ioerror=IO error: {0}
dc.main.no.files.given=No files given
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties
--- a/src/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/resources/doclint_ja.properties Thu Oct 03 19:28:07 2013 +0100
@@ -26,6 +26,7 @@
dc.anchor.already.defined = \u30A2\u30F3\u30AB\u30FC\u304C\u3059\u3067\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059: {0}
dc.anchor.value.missing = \u30A2\u30F3\u30AB\u30FC\u306B\u5024\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
dc.attr.lacks.value = \u5C5E\u6027\u306B\u5024\u304C\u3042\u308A\u307E\u305B\u3093
+dc.attr.not.number = \u5C5E\u6027\u5024\u304C\u6570\u5B57\u3067\u306F\u3042\u308A\u307E\u305B\u3093
dc.attr.obsolete = \u5C5E\u6027\u306F\u5EC3\u6B62\u3055\u308C\u3066\u3044\u307E\u3059: {0}
dc.attr.obsolete.use.css = \u5C5E\u6027\u306F\u5EC3\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u304B\u308F\u308A\u306BCSS\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044: {0}
dc.attr.repeated = \u7E70\u308A\u8FD4\u3055\u308C\u305F\u5C5E\u6027: {0}
@@ -46,7 +47,7 @@
dc.missing.throws = {0}\u306E@throws\u304C\u3042\u308A\u307E\u305B\u3093
dc.no.alt.attr.for.image = \u30A4\u30E1\u30FC\u30B8\u306E"alt"\u5C5E\u6027\u304C\u3042\u308A\u307E\u305B\u3093
dc.no.summary.or.caption.for.table=\u8868\u306E\u8981\u7D04\u307E\u305F\u306F\u30AD\u30E3\u30D7\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u305B\u3093
-dc.param.name.not.found = @param\u540D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
+dc.param.name.not.found = @param name\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
dc.ref.not.found = \u53C2\u7167\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
dc.tag.code.within.code = \u5185\u306E'{@code'}
dc.tag.empty = \u7A7A\u306E<{0}>\u30BF\u30B0
@@ -66,3 +67,9 @@
dc.tag.start.unmatched = \u7D42\u4E86\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093: {0}>
dc.tag.unknown = \u4E0D\u660E\u306A\u30BF\u30B0: {0}
dc.text.not.allowed = <{0}>\u8981\u7D20\u3067\u306F\u30C6\u30AD\u30B9\u30C8\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
+dc.unexpected.comment=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u30FB\u30B3\u30E1\u30F3\u30C8\u306F\u3053\u3053\u3067\u306F\u5FC5\u8981\u3042\u308A\u307E\u305B\u3093
+
+dc.main.ioerror=IO\u30A8\u30E9\u30FC: {0}
+dc.main.no.files.given=\u30D5\u30A1\u30A4\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
+dc.main.usage=\u4F7F\u7528\u65B9\u6CD5:\n doclint [options] source-files...\n\n\u30AA\u30D7\u30B7\u30E7\u30F3:\n -Xmsgs \n -Xmsgs:all\u3068\u540C\u3058\n -Xmsgs:values\n \u30C1\u30A7\u30C3\u30AF\u3059\u308B\u554F\u984C\u306E\u30AB\u30C6\u30B4\u30EA\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002\u3053\u3053\u3067\u306E''values''\u306F\u3001\n \u30AB\u30F3\u30DE\u3067\u533A\u5207\u3089\u308C\u305F\u6B21\u306E\u5024\u306E\u30EA\u30B9\u30C8\u3067\u3059:\n reference Java\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9\u8981\u7D20\u3078\u306E\u4E0D\u6B63\u306A\u53C2\u7167\u3092\u542B\u3080\u30B3\u30E1\u30F3\u30C8\u306E\n \u5834\u6240\u3092\u8868\u793A\u3057\u307E\u3059\n syntax \u30B3\u30E1\u30F3\u30C8\u5185\u306E\u57FA\u672C\u69CB\u6587\u30A8\u30E9\u30FC\u3092\u8868\u793A\u3057\u307E\u3059\n html HTML\u30BF\u30D6\u304A\u3088\u3073\u5C5E\u6027\u306E\u554F\u984C\u3092\u8868\u793A\u3057\u307E\u3059\n accessibility \u30A2\u30AF\u30BB\u30B7\u30D3\u30EA\u30C6\u30A3\u306E\u554F\u984C\u3092\u8868\u793A\u3057\u307E\u3059\n missing \u6B20\u843D\u3057\u3066\u3044\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u554F\u984C\u3092\u8868\u793A\u3057\u307E\u3059\n all \u524D\u8FF0\u306E\u3059\u3079\u3066\n \u3053\u308C\u3092\u5426\u5B9A\u3059\u308B\u306B\u306F\u3001\u5024\u306E\u524D\u306B''-''\u3092\u6307\u5B9A\u3057\u307E\u3059\n \u30AB\u30C6\u30B4\u30EA\u306F\u3001\u6B21\u306E\u3044\u305A\u308C\u304B\u3067\u4FEE\u98FE\u3067\u304D\u307E\u3059:\n /public /protected /package /private\n \u6B63\u306E\u30AB\u30C6\u30B4\u30EA(''-''\u3067\u59CB\u307E\u3089\u306A\u3044)\u306E\u5834\u5408\n \u4FEE\u98FE\u5B50\u306F\u3001\u305D\u306E\u30A2\u30AF\u30BB\u30B9\u30FB\u30EC\u30D9\u30EB\u4EE5\u4E0A\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002\n \u8CA0\u306E\u30AB\u30C6\u30B4\u30EA(''-''\u3067\u59CB\u307E\u308B)\u306E\u5834\u5408\n \u4FEE\u98FE\u5B50\u306F\u3001\u305D\u306E\u30A2\u30AF\u30BB\u30B9\u30FB\u30EC\u30D9\u30EB\u4EE5\u4E0B\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002\n \u4FEE\u98FE\u5B50\u304C\u306A\u3044\u5834\u5408\u3001\u30AB\u30C6\u30B4\u30EA\u306F\u3059\u3079\u3066\u306E\u30A2\u30AF\u30BB\u30B9\u30FB\u30EC\u30D9\u30EB\u306B\n \u9069\u7528\u3055\u308C\u307E\u3059\u3002\n \u4F8B: -Xmsgs:all,-syntax/private\n \u3053\u306E\u5834\u5408\u3001private\u30E1\u30BD\u30C3\u30C9\u306Edoc\u30B3\u30E1\u30F3\u30C8\u5185\u306E\u69CB\u6587\u30A8\u30E9\u30FC\u3092\u9664\u304D\u3001\n \u3059\u3079\u3066\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u6709\u52B9\u5316\u3055\u308C\u307E\u3059\u3002\n -Xmsgs\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u306A\u3044\u5834\u5408\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u3001\n -Xmsgs:all/protected\u3068\u540C\u7B49\u306B\u306A\u308A\u3001\u3053\u308C\u306F\n \u3059\u3079\u3066\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u3001protected\u304A\u3088\u3073public\u306E\u5BA3\u8A00\u306E\u307F\u306B\u5831\u544A\u3055\u308C\u308B\u3053\u3068\u3092\n \u610F\u5473\u3057\u307E\u3059\u3002\n -stats\n \u5831\u544A\u3055\u308C\u305F\u554F\u984C\u306B\u5BFE\u3057\u3066\u7D71\u8A08\u3092\u5831\u544A\u3057\u307E\u3059\u3002\n -h -help --help -usage -?\n \u3053\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\n\n\u6B21\u306Ejavac\u30AA\u30D7\u30B7\u30E7\u30F3\u3082\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u3059\n \
+-bootclasspath\u3001-classpath\u3001-cp\u3001-sourcepath\u3001-Xmaxerrs\u3001-Xmaxwarns\n\n\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u4E00\u90E8\u306B\u5BFE\u3057\u3066doclint\u3092\u5B9F\u884C\u3059\u308B\u306B\u306F\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3055\u308C\u305F\u30AF\u30E9\u30B9\u3092\n\u30AF\u30E9\u30B9\u30D1\u30B9(\u307E\u305F\u306F\u30D6\u30FC\u30C8\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9)\u306B\u6307\u5B9A\u3057\u3001\u30B3\u30DE\u30F3\u30C9\u30FB\u30E9\u30A4\u30F3\u3067\n\u30C1\u30A7\u30C3\u30AF\u3059\u308B\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u6307\u5B9A\u3057\u307E\u3059\u3002
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties
--- a/src/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclint/resources/doclint_zh_CN.properties Thu Oct 03 19:28:07 2013 +0100
@@ -26,6 +26,7 @@
dc.anchor.already.defined = \u951A\u5B9A\u70B9\u5DF2\u5B9A\u4E49: {0}
dc.anchor.value.missing = \u6CA1\u6709\u4E3A\u951A\u5B9A\u70B9\u6307\u5B9A\u503C
dc.attr.lacks.value = \u5C5E\u6027\u7F3A\u5C11\u503C
+dc.attr.not.number = \u5C5E\u6027\u503C\u4E0D\u662F\u6570\u5B57
dc.attr.obsolete = \u5C5E\u6027\u5DF2\u8FC7\u65F6: {0}
dc.attr.obsolete.use.css = \u5C5E\u6027\u5DF2\u8FC7\u65F6, \u8BF7\u6539\u7528 CSS: {0}
dc.attr.repeated = \u5C5E\u6027\u91CD\u590D: {0}
@@ -46,7 +47,7 @@
dc.missing.throws = {0}\u6CA1\u6709 @throws
dc.no.alt.attr.for.image = \u56FE\u50CF\u6CA1\u6709 "alt" \u5C5E\u6027
dc.no.summary.or.caption.for.table=\u8868\u6CA1\u6709\u6982\u8981\u6216\u6807\u9898
-dc.param.name.not.found = \u627E\u4E0D\u5230 @param \u540D\u79F0
+dc.param.name.not.found = @param name \u672A\u627E\u5230
dc.ref.not.found = \u627E\u4E0D\u5230\u5F15\u7528
dc.tag.code.within.code = '{@code'} \u5728 \u4E2D
dc.tag.empty = <{0}> \u6807\u8BB0\u4E3A\u7A7A
@@ -66,3 +67,8 @@
dc.tag.start.unmatched = \u7F3A\u5C11\u7ED3\u675F\u6807\u8BB0: {0}>
dc.tag.unknown = \u672A\u77E5\u6807\u8BB0: {0}
dc.text.not.allowed = <{0}> \u5143\u7D20\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u6587\u672C
+dc.unexpected.comment=\u6B64\u5904\u672A\u9884\u671F\u6587\u6863\u6CE8\u91CA
+
+dc.main.ioerror=IO \u9519\u8BEF: {0}
+dc.main.no.files.given=\u672A\u6307\u5B9A\u6587\u4EF6
+dc.main.usage=\u7528\u6CD5:\n doclint [options] source-files...\n\n\u9009\u9879:\n -Xmsgs \n \u4E0E -Xmsgs:all \u76F8\u540C\n -Xmsgs:values\n \u6307\u5B9A\u8981\u68C0\u67E5\u7684\u95EE\u9898\u7684\u7C7B\u522B, \u5176\u4E2D ''values''\n \u662F\u4EFB\u610F\u4EE5\u4E0B\u5185\u5BB9\u7684\u4EE5\u9017\u53F7\u5206\u9694\u7684\u5217\u8868:\n reference \u663E\u793A\u5305\u542B\u5BF9 Java \u6E90\u4EE3\u7801\u5143\u7D20\n \u9519\u8BEF\u5F15\u7528\u7684\u6CE8\u91CA\u7684\u4F4D\u7F6E\n syntax \u663E\u793A\u6CE8\u91CA\u4E2D\u7684\u57FA\u672C\u8BED\u6CD5\u9519\u8BEF\n html \u663E\u793A HTML \u6807\u8BB0\u548C\u5C5E\u6027\u95EE\u9898\n accessibility \u663E\u793A\u53EF\u8BBF\u95EE\u6027\u7684\u95EE\u9898\n missing \u663E\u793A\u7F3A\u5C11\u6587\u6863\u7684\u95EE\u9898\n all \u6240\u6709\u4EE5\u4E0A\u5185\u5BB9\n \u5728\u503C\u4E4B\u524D\u4F7F\u7528 ''-'' \u53EF\u4F7F\u7528\u5176\u53CD\u503C\n \u53EF\u4EE5\u4F7F\u7528\u4EE5\u4E0B\u4E00\u9879\u6765\u9650\u5B9A\u7C7B\u522B:\n /public /protected /package /private\n \u5BF9\u4E8E\u6B63\u7C7B\u522B (\u4E0D\u4EE5 ''-'' \u5F00\u5934)\n \u9650\u5B9A\u7B26\u9002\u7528\u4E8E\u8BE5\u8BBF\u95EE\u7EA7\u522B\u53CA\u66F4\u9AD8\u7EA7\u522B\u3002\n \u5BF9\u4E8E\u8D1F\u7C7B\u522B (\u4EE5 ''-'' \u5F00\u5934)\n \u9650\u5B9A\u7B26\u9002\u7528\u4E8E\u8BE5\u8BBF\u95EE\u7EA7\u522B\u53CA\u66F4\u4F4E\u7EA7\u522B\u3002\n \u5982\u679C\u6CA1\u6709\u9650\u5B9A\u7B26, \u5219\u8BE5\u7C7B\u522B\u9002\u7528\u4E8E\n \u6240\u6709\u8BBF\u95EE\u7EA7\u522B\u3002\n \u4F8B\u5982, -Xmsgs:all,-syntax/private\n \u8FD9\u5C06\u5728\u4E13\u7528\u65B9\u6CD5\u7684\u6587\u6863\u6CE8\u91CA\u4E2D\n \u542F\u7528\u9664\u8BED\u6CD5\u9519\u8BEF\u4E4B\u5916\u7684\u6240\u6709\u6D88\u606F\u3002\n \u5982\u679C\u672A\u63D0\u4F9B -Xmsgs \u9009\u9879, \u5219\u9ED8\u8BA4\u503C\n \u7B49\u540C\u4E8E -Xmsgs:all/protected, \u8868\u793A\n \u4EC5\u62A5\u544A\u53D7\u4FDD\u62A4\u548C\u516C\u5171\u58F0\u660E\u4E2D\u7684\n \u6240\u6709\u6D88\u606F\n -stats\n \u62A5\u544A\u6240\u62A5\u544A\u95EE\u9898\u7684\u7EDF\u8BA1\u4FE1\u606F\u3002\n -h -help --help -usage -?\n \u663E\u793A\u6B64\u6D88\u606F\u3002\n\n\u8FD8\u652F\u6301\u4EE5\u4E0B javac \u9009\u9879\n -bootclasspath, -classpath, -cp, -sourcepath, -Xmaxerrs, -Xmaxwarns\n\n\u8981\u5728\u9879\u76EE\u7684\u4E00\u90E8\u5206\u4E0A\u8FD0\u884C doclint, \u8BF7\u5C06\u9879\u76EE\u4E2D\u5DF2\u7F16\u8BD1\u7684\u7C7B\n\u653E\u5728\u7C7B\u8DEF\u5F84 (\u6216\u5F15\u5BFC\u7C7B\u8DEF\u5F84) \u4E0A, \u7136\u540E\u5728\u547D\u4EE4\u884C\u4E0A\u6307\u5B9A\n\u8981\u68C0\u67E5\u7684\u6E90\u6587\u4EF6\u3002
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/Main.java
--- a/src/share/classes/com/sun/tools/javac/Main.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/Main.java Thu Oct 03 19:28:07 2013 +0100
@@ -30,14 +30,6 @@
/**
* The programmatic interface for the Java Programming Language
* compiler, javac.
- *
- *
Except for the two methods
- * {@link #compile(java.lang.String[])}
- * {@link #compile(java.lang.String[],java.io.PrintWriter)},
- * nothing described in this source file is part of any supported
- * API. If you write code that depends on this, you do so at your own
- * risk. This code and its internal interfaces are subject to change
- * or deletion without notice.
*/
@jdk.Supported
public class Main {
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
--- a/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Thu Oct 03 19:28:07 2013 +0100
@@ -472,7 +472,7 @@
for (TypeElement item: classes)
set.add(item);
- ListBuffer> defer = ListBuffer.>lb();
+ ListBuffer> defer = new ListBuffer<>();
while (list.peek() != null) {
Env env = list.remove();
ClassSymbol csym = env.enclClass.sym;
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/code/Annotations.java
--- a/src/share/classes/com/sun/tools/javac/code/Annotations.java Sat Sep 14 20:46:37 2013 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,451 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.javac.code;
-
-import java.util.Map;
-
-import javax.tools.JavaFileObject;
-
-import com.sun.tools.javac.comp.Annotate;
-import com.sun.tools.javac.comp.AttrContext;
-import com.sun.tools.javac.comp.Env;
-import com.sun.tools.javac.util.*;
-import com.sun.tools.javac.util.Assert;
-import com.sun.tools.javac.util.List;
-import com.sun.tools.javac.util.Log;
-import com.sun.tools.javac.util.Pair;
-import static com.sun.tools.javac.code.Kinds.PCK;
-
-/**
- * Container for all annotations (attributes in javac) on a Symbol.
- *
- * This class is explicitly mutable. Its contents will change when attributes
- * are annotated onto the Symbol. However this class depends on the facts that
- * List (in javac) is immutable.
- *
- * An instance of this class can be in one of three states:
- *
- * NOT_STARTED indicates that the Symbol this instance belongs to has not been
- * annotated (yet). Specifically if the declaration is not annotated this
- * instance will never move past NOT_STARTED. You can never go back to
- * NOT_STARTED.
- *
- * IN_PROGRESS annotations have been found on the declaration. Will be processed
- * later. You can reset to IN_PROGRESS. While IN_PROGRESS you can set the list
- * of attributes (and this moves out of the IN_PROGRESS state).
- *
- * "unnamed" this Annotations contains some attributes, possibly the final set.
- * While in this state you can only prepend or append to the attributes not set
- * it directly. You can also move back to the IN_PROGRESS state using reset().
- *
- *
This is NOT part of any supported API. If you write code that depends
- * on this, you do so at your own risk. This code and its internal interfaces
- * are subject to change or deletion without notice.
- */
-public class Annotations {
-
- private static final List DECL_NOT_STARTED = List.of(null);
- private static final List DECL_IN_PROGRESS = List.of(null);
-
- /*
- * This field should never be null
- */
- private List attributes = DECL_NOT_STARTED;
-
- /*
- * Type attributes for this symbol.
- * This field should never be null.
- */
- private List type_attributes = List.nil();
-
- /*
- * Type attributes of initializers in this class.
- * Unused if the current symbol is not a ClassSymbol.
- */
- private List init_type_attributes = List.nil();
-
- /*
- * Type attributes of class initializers in this class.
- * Unused if the current symbol is not a ClassSymbol.
- */
- private List clinit_type_attributes = List.nil();
-
- /*
- * The Symbol this Annotations instance belongs to
- */
- private final Symbol sym;
-
- public Annotations(Symbol sym) {
- this.sym = sym;
- }
-
- public List getDeclarationAttributes() {
- return filterDeclSentinels(attributes);
- }
-
- public List getTypeAttributes() {
- return type_attributes;
- }
-
- public List getInitTypeAttributes() {
- return init_type_attributes;
- }
-
- public List getClassInitTypeAttributes() {
- return clinit_type_attributes;
- }
-
- public void setDeclarationAttributes(List a) {
- Assert.check(pendingCompletion() || !isStarted());
- if (a == null) {
- throw new NullPointerException();
- }
- attributes = a;
- }
-
- public void setTypeAttributes(List a) {
- if (a == null) {
- throw new NullPointerException();
- }
- type_attributes = a;
- }
-
- public void setInitTypeAttributes(List a) {
- if (a == null) {
- throw new NullPointerException();
- }
- init_type_attributes = a;
- }
-
- public void setClassInitTypeAttributes(List a) {
- if (a == null) {
- throw new NullPointerException();
- }
- clinit_type_attributes = a;
- }
-
- public void setAttributes(Annotations other) {
- if (other == null) {
- throw new NullPointerException();
- }
- setDeclarationAttributes(other.getDeclarationAttributes());
- setTypeAttributes(other.getTypeAttributes());
- setInitTypeAttributes(other.getInitTypeAttributes());
- setClassInitTypeAttributes(other.getClassInitTypeAttributes());
- }
-
- public void setDeclarationAttributesWithCompletion(final Annotate.AnnotateRepeatedContext ctx) {
- Assert.check(pendingCompletion() || (!isStarted() && sym.kind == PCK));
- this.setDeclarationAttributes(getAttributesForCompletion(ctx));
- }
-
- public void appendTypeAttributesWithCompletion(final Annotate.AnnotateRepeatedContext ctx) {
- this.appendUniqueTypes(getAttributesForCompletion(ctx));
- }
-
- private List getAttributesForCompletion(
- final Annotate.AnnotateRepeatedContext ctx) {
-
- Map> annotated = ctx.annotated;
- boolean atLeastOneRepeated = false;
- List buf = List.nil();
- for (ListBuffer lb : annotated.values()) {
- if (lb.size() == 1) {
- buf = buf.prepend(lb.first());
- } else { // repeated
- // This will break when other subtypes of Attributs.Compound
- // are introduced, because PlaceHolder is a subtype of TypeCompound.
- T res;
- @SuppressWarnings("unchecked")
- T ph = (T) new Placeholder(ctx, lb.toList(), sym);
- res = ph;
- buf = buf.prepend(res);
- atLeastOneRepeated = true;
- }
- }
-
- if (atLeastOneRepeated) {
- // The Symbol s is now annotated with a combination of
- // finished non-repeating annotations and placeholders for
- // repeating annotations.
- //
- // We need to do this in two passes because when creating
- // a container for a repeating annotation we must
- // guarantee that the @Repeatable on the
- // contained annotation is fully annotated
- //
- // The way we force this order is to do all repeating
- // annotations in a pass after all non-repeating are
- // finished. This will work because @Repeatable
- // is non-repeating and therefore will be annotated in the
- // fist pass.
-
- // Queue a pass that will replace Attribute.Placeholders
- // with Attribute.Compound (made from synthesized containers).
- ctx.annotateRepeated(new Annotate.Annotator() {
- @Override
- public String toString() {
- return "repeated annotation pass of: " + sym + " in: " + sym.owner;
- }
-
- @Override
- public void enterAnnotation() {
- complete(ctx);
- }
- });
- }
- // Add non-repeating attributes
- return buf.reverse();
- }
-
- public Annotations reset() {
- attributes = DECL_IN_PROGRESS;
- return this;
- }
-
- public boolean isEmpty() {
- return !isStarted()
- || pendingCompletion()
- || attributes.isEmpty();
- }
-
- public boolean isTypesEmpty() {
- return type_attributes.isEmpty();
- }
-
- public boolean pendingCompletion() {
- return attributes == DECL_IN_PROGRESS;
- }
-
- public Annotations append(List l) {
- attributes = filterDeclSentinels(attributes);
-
- if (l.isEmpty()) {
- ; // no-op
- } else if (attributes.isEmpty()) {
- attributes = l;
- } else {
- attributes = attributes.appendList(l);
- }
- return this;
- }
-
- public Annotations appendUniqueTypes(List l) {
- if (l.isEmpty()) {
- ; // no-op
- } else if (type_attributes.isEmpty()) {
- type_attributes = l;
- } else {
- // TODO: in case we expect a large number of annotations, this
- // might be inefficient.
- for (Attribute.TypeCompound tc : l) {
- if (!type_attributes.contains(tc))
- type_attributes = type_attributes.append(tc);
- }
- }
- return this;
- }
-
- public Annotations appendInitTypeAttributes(List l) {
- if (l.isEmpty()) {
- ; // no-op
- } else if (init_type_attributes.isEmpty()) {
- init_type_attributes = l;
- } else {
- init_type_attributes = init_type_attributes.appendList(l);
- }
- return this;
- }
-
- public Annotations appendClassInitTypeAttributes(List l) {
- if (l.isEmpty()) {
- ; // no-op
- } else if (clinit_type_attributes.isEmpty()) {
- clinit_type_attributes = l;
- } else {
- clinit_type_attributes = clinit_type_attributes.appendList(l);
- }
- return this;
- }
-
- public Annotations prepend(List l) {
- attributes = filterDeclSentinels(attributes);
-
- if (l.isEmpty()) {
- ; // no-op
- } else if (attributes.isEmpty()) {
- attributes = l;
- } else {
- attributes = attributes.prependList(l);
- }
- return this;
- }
-
- private List filterDeclSentinels(List a) {
- return (a == DECL_IN_PROGRESS || a == DECL_NOT_STARTED)
- ? List.nil()
- : a;
- }
-
- private boolean isStarted() {
- return attributes != DECL_NOT_STARTED;
- }
-
- private List getPlaceholders() {
- List res = List.nil();
- for (Attribute.Compound a : filterDeclSentinels(attributes)) {
- if (a instanceof Placeholder) {
- res = res.prepend(a);
- }
- }
- return res.reverse();
- }
-
- private List getTypePlaceholders() {
- List res = List.nil();
- for (Attribute.TypeCompound a : type_attributes) {
- if (a instanceof Placeholder) {
- res = res.prepend(a);
- }
- }
- return res.reverse();
- }
-
- /*
- * Replace Placeholders for repeating annotations with their containers
- */
- private void complete(Annotate.AnnotateRepeatedContext ctx) {
- Log log = ctx.log;
- Env env = ctx.env;
- JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
- try {
- // TODO: can we reduce duplication in the following branches?
- if (ctx.isTypeCompound) {
- Assert.check(!isTypesEmpty());
-
- if (isTypesEmpty()) {
- return;
- }
-
- List result = List.nil();
- for (Attribute.TypeCompound a : getTypeAttributes()) {
- if (a instanceof Placeholder) {
- @SuppressWarnings("unchecked")
- Placeholder ph = (Placeholder) a;
- Attribute.TypeCompound replacement = replaceOne(ph, ph.getRepeatedContext());
-
- if (null != replacement) {
- result = result.prepend(replacement);
- }
- } else {
- result = result.prepend(a);
- }
- }
-
- type_attributes = result.reverse();
-
- Assert.check(Annotations.this.getTypePlaceholders().isEmpty());
- } else {
- Assert.check(!pendingCompletion());
-
- if (isEmpty()) {
- return;
- }
-
- List result = List.nil();
- for (Attribute.Compound a : getDeclarationAttributes()) {
- if (a instanceof Placeholder) {
- @SuppressWarnings("unchecked")
- Attribute.Compound replacement = replaceOne((Placeholder) a, ctx);
-
- if (null != replacement) {
- result = result.prepend(replacement);
- }
- } else {
- result = result.prepend(a);
- }
- }
-
- attributes = result.reverse();
-
- Assert.check(Annotations.this.getPlaceholders().isEmpty());
- }
- } finally {
- log.useSource(oldSource);
- }
- }
-
- private T replaceOne(Placeholder placeholder, Annotate.AnnotateRepeatedContext ctx) {
- Log log = ctx.log;
-
- // Process repeated annotations
- T validRepeated = ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor(), sym);
-
- if (validRepeated != null) {
- // Check that the container isn't manually
- // present along with repeated instances of
- // its contained annotation.
- ListBuffer manualContainer = ctx.annotated.get(validRepeated.type.tsym);
- if (manualContainer != null) {
- log.error(ctx.pos.get(manualContainer.first()), "invalid.repeatable.annotation.repeated.and.container.present",
- manualContainer.first().type.tsym);
- }
- }
-
- // A null return will delete the Placeholder
- return validRepeated;
- }
-
- private static class Placeholder extends Attribute.TypeCompound {
-
- private final Annotate.AnnotateRepeatedContext ctx;
- private final List placeholderFor;
- private final Symbol on;
-
- public Placeholder(Annotate.AnnotateRepeatedContext ctx, List placeholderFor, Symbol on) {
- super(on.type, List.>nil(),
- ctx.isTypeCompound ?
- ((Attribute.TypeCompound)placeholderFor.head).position :
- null);
- this.ctx = ctx;
- this.placeholderFor = placeholderFor;
- this.on = on;
- }
-
- @Override
- public String toString() {
- return "";
- }
-
- public List getPlaceholderFor() {
- return placeholderFor;
- }
-
- public Annotate.AnnotateRepeatedContext getRepeatedContext() {
- return ctx;
- }
- }
-}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/code/DeferredLintHandler.java
--- a/src/share/classes/com/sun/tools/javac/code/DeferredLintHandler.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/DeferredLintHandler.java Thu Oct 03 19:28:07 2013 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
import java.util.HashMap;
import java.util.Map;
+import com.sun.tools.javac.tree.EndPosTable;
+import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.util.Assert;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
@@ -53,10 +55,13 @@
protected DeferredLintHandler(Context context) {
context.put(deferredLintHandlerKey, this);
+ this.currentPos = IMMEDIATE_POSITION;
}
- private DeferredLintHandler() {}
-
+ /**An interface for deferred lint reporting - loggers passed to
+ * {@link #report(LintLogger) } will be called when
+ * {@link #flush(DiagnosticPosition) } is invoked.
+ */
public interface LintLogger {
void report();
}
@@ -64,12 +69,26 @@
private DiagnosticPosition currentPos;
private Map> loggersQueue = new HashMap>();
+ /**Associate the given logger with the current position as set by {@link #setPos(DiagnosticPosition) }.
+ * Will be invoked when {@link #flush(DiagnosticPosition) } will be invoked with the same position.
+ *
+ * Will invoke the logger synchronously if {@link #immediate() } was called
+ * instead of {@link #setPos(DiagnosticPosition) }.
+ */
public void report(LintLogger logger) {
- ListBuffer loggers = loggersQueue.get(currentPos);
- Assert.checkNonNull(loggers);
- loggers.append(logger);
+ if (currentPos == IMMEDIATE_POSITION) {
+ logger.report();
+ } else {
+ ListBuffer loggers = loggersQueue.get(currentPos);
+ if (loggers == null) {
+ loggersQueue.put(currentPos, loggers = new ListBuffer<>());
+ }
+ loggers.append(logger);
+ }
}
+ /**Invoke all {@link LintLogger}s that were associated with the provided {@code pos}.
+ */
public void flush(DiagnosticPosition pos) {
ListBuffer loggers = loggersQueue.get(pos);
if (loggers != null) {
@@ -80,16 +99,46 @@
}
}
- public DeferredLintHandler setPos(DiagnosticPosition currentPos) {
+ /**Sets the current position to the provided {@code currentPos}. {@link LintLogger}s
+ * passed to subsequent invocations of {@link #report(LintLogger) } will be associated
+ * with the given position.
+ */
+ public DiagnosticPosition setPos(DiagnosticPosition currentPos) {
+ DiagnosticPosition prevPosition = this.currentPos;
this.currentPos = currentPos;
- loggersQueue.put(currentPos, ListBuffer.lb());
- return this;
+ return prevPosition;
+ }
+
+ /**{@link LintLogger}s passed to subsequent invocations of
+ * {@link #report(LintLogger) } will be invoked immediately.
+ */
+ public DiagnosticPosition immediate() {
+ return setPos(IMMEDIATE_POSITION);
}
- public static final DeferredLintHandler immediateHandler = new DeferredLintHandler() {
+ private static final DiagnosticPosition IMMEDIATE_POSITION = new DiagnosticPosition() {
+ @Override
+ public JCTree getTree() {
+ Assert.error();
+ return null;
+ }
+
@Override
- public void report(LintLogger logger) {
- logger.report();
+ public int getStartPosition() {
+ Assert.error();
+ return -1;
+ }
+
+ @Override
+ public int getPreferredPosition() {
+ Assert.error();
+ return -1;
+ }
+
+ @Override
+ public int getEndPosition(EndPosTable endPosTable) {
+ Assert.error();
+ return -1;
}
};
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/code/Flags.java
--- a/src/share/classes/com/sun/tools/javac/code/Flags.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Flags.java Thu Oct 03 19:28:07 2013 +0100
@@ -97,7 +97,6 @@
public static final int MANDATED = 1<<15;
public static final int StandardFlags = 0x0fff;
- public static final int ModifierFlags = StandardFlags & ~INTERFACE;
// Because the following access flags are overloaded with other
// bit positions, we translate them when reading and writing class
@@ -262,10 +261,15 @@
public static final long SIGNATURE_POLYMORPHIC = 1L<<46;
/**
- * Flag that marks inference variables used in a 'throws' clause
+ * Flag that indicates that an inference variable is used in a 'throws' clause.
*/
public static final long THROWS = 1L<<47;
+ /**
+ * Flag that marks potentially ambiguous overloads
+ */
+ public static final long POTENTIALLY_AMBIGUOUS = 1L<<48;
+
/** Modifier masks.
*/
public static final int
@@ -282,7 +286,9 @@
SYNCHRONIZED | FINAL | STRICTFP;
public static final long
ExtendedStandardFlags = (long)StandardFlags | DEFAULT,
+ ModifierFlags = ((long)StandardFlags & ~INTERFACE) | DEFAULT,
InterfaceMethodMask = ABSTRACT | STATIC | PUBLIC | STRICTFP | DEFAULT,
+ AnnotationTypeElementMask = FINAL | ABSTRACT | PUBLIC | STRICTFP,
LocalVarFlags = FINAL | PARAMETER;
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/code/Lint.java
--- a/src/share/classes/com/sun/tools/javac/code/Lint.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Lint.java Thu Oct 03 19:28:07 2013 +0100
@@ -33,9 +33,6 @@
import com.sun.tools.javac.util.Options;
import com.sun.tools.javac.util.Pair;
-import static com.sun.tools.javac.code.Flags.*;
-
-
/**
* A class for handling -Xlint suboptions and @SuppresssWarnings.
*
@@ -81,7 +78,6 @@
return l;
}
-
private final AugmentVisitor augmentor;
private final EnumSet values;
@@ -90,7 +86,6 @@
private static final Map map =
new java.util.concurrent.ConcurrentHashMap(20);
-
protected Lint(Context context) {
// initialize values according to the lint options
Options options = Options.instance(context);
@@ -175,6 +170,11 @@
OPTIONS("options"),
/**
+ * Warn about issues regarding method overloads.
+ */
+ OVERLOADS("overloads"),
+
+ /**
* Warn about issues regarding method overrides.
*/
OVERRIDES("overrides"),
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/code/Printer.java
--- a/src/share/classes/com/sun/tools/javac/code/Printer.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Printer.java Thu Oct 03 19:28:07 2013 +0100
@@ -103,7 +103,7 @@
* @return localized string representation
*/
public String visitTypes(List ts, Locale locale) {
- ListBuffer sbuf = ListBuffer.lb();
+ ListBuffer sbuf = new ListBuffer<>();
for (Type t : ts) {
sbuf.append(visit(t, locale));
}
@@ -118,7 +118,7 @@
* @return localized string representation
*/
public String visitSymbols(List ts, Locale locale) {
- ListBuffer sbuf = ListBuffer.lb();
+ ListBuffer sbuf = new ListBuffer<>();
for (Symbol t : ts) {
sbuf.append(visit(t, locale));
}
diff -r a6901af8a2e4 -r 2c13a5da6854 src/share/classes/com/sun/tools/javac/code/Symbol.java
--- a/src/share/classes/com/sun/tools/javac/code/Symbol.java Sat Sep 14 20:46:37 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java Thu Oct 03 19:28:07 2013 +0100
@@ -46,6 +46,7 @@
import static com.sun.tools.javac.code.TypeTag.CLASS;
import static com.sun.tools.javac.code.TypeTag.FORALL;
import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
+import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
/** Root class for Java symbols. It contains subclasses
* for specific sorts of symbols, such as variables, methods and operators,
@@ -98,9 +99,9 @@
//
/** The attributes of this symbol are contained in this
- * Annotations. The Annotations instance is NOT immutable.
+ * SymbolMetadata. The SymbolMetadata instance is NOT immutable.
*/
- protected Annotations annotations;
+ protected SymbolMetadata annotations;
/** An accessor method for the attributes of this symbol.
* Attributes of class symbols should be accessed through the accessor
@@ -217,19 +218,19 @@
public void setTypeAttributes(List a) {
if (annotations != null || a.nonEmpty()) {
if (annotations == null)
- annotations = new Annotations(this);
+ annotations = new SymbolMetadata(this);
annotations.setTypeAttributes(a);
}
}
- private Annotations initedAnnos() {
+ private SymbolMetadata initedAnnos() {
if (annotations == null)
- annotations = new Annotations(this);
+ annotations = new SymbolMetadata(this);
return annotations;
}
/** This method is intended for debugging only. */
- public Annotations getAnnotations() {
+ public SymbolMetadata getAnnotations() {
return annotations;
}
@@ -613,7 +614,7 @@
}
public List getTypeParameters() {
- ListBuffer l = ListBuffer.lb();
+ ListBuffer l = new ListBuffer<>();
for (Type t : type.getTypeArguments()) {
Assert.check(t.tsym.getKind() == ElementKind.TYPE_PARAMETER);
l.append((TypeVariableSymbol)t.tsym);
@@ -852,7 +853,7 @@
private void mergeAttributes() {
if (annotations == null &&
package_info.annotations != null) {
- annotations = new Annotations(this);
+ annotations = new SymbolMetadata(this);
annotations.setAttributes(package_info.annotations);
}
}
@@ -1167,11 +1168,11 @@
public void setLazyConstValue(final Env env,
final Attr attr,
- final JCTree.JCExpression initializer)
+ final JCVariableDecl variable)
{
setData(new Callable