Merge
This commit is contained in:
commit
87d0ea84c1
@ -55,18 +55,17 @@
|
||||
description="Build one or all langtools tools"
|
||||
/>
|
||||
|
||||
<condition property="bootstrap" value="bootstrap-" else="">
|
||||
<condition property="use_bootstrap" value="bootstrap-" else="">
|
||||
<isset property="langtools.tool.bootstrap"/>
|
||||
</condition>
|
||||
|
||||
<condition property="bcp" value="${build.bootstrap.dir}/classes" else="${build.classes.dir}">
|
||||
<condition property="with_bootclasspath" value="${build.bootstrap.dir}/classes" else="${build.classes.dir}">
|
||||
<isset property="langtools.tool.bootstrap"/>
|
||||
</condition>
|
||||
|
||||
<target name="-build-tool" if="langtools.tool.name">
|
||||
<echo level="info" message="Building ${bootstrap}${langtools.tool.name}"/>
|
||||
<echo level="info" message="Building ${use_bootstrap}${langtools.tool.name}"/>
|
||||
<echo level="verbose" message="(Unset langtools.tool.name to build all tools)"/>
|
||||
<antcall target="build-${bootstrap}${langtools.tool.name}"/>
|
||||
<antcall target="build-${use_bootstrap}${langtools.tool.name}"/>
|
||||
</target>
|
||||
|
||||
<target name="-build-all" unless="langtools.tool.name">
|
||||
@ -97,9 +96,9 @@
|
||||
|
||||
<target name="run" depends="-check-target.java.home,build,-def-run,-get-tool-and-args"
|
||||
description="run tool">
|
||||
<echo level="info" message="${bcp}"/>
|
||||
<echo level="info" message="Run ${bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
|
||||
<run bcp="${bcp}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}"/>
|
||||
<echo level="info" message="${with_bootclasspath}"/>
|
||||
<echo level="info" message="Run ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
|
||||
<run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}"/>
|
||||
</target>
|
||||
|
||||
<!-- Run a selected class. (action: run.single; shift-F6) -->
|
||||
@ -145,9 +144,9 @@
|
||||
<!-- Debug tool in NetBeans. -->
|
||||
|
||||
<target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,build" if="netbeans.home">
|
||||
<echo level="info" message="Debug ${boostrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
|
||||
<echo level="info" message="Debug ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/>
|
||||
<start-debugger/>
|
||||
<run bcp="${bcp}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/>
|
||||
<run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/>
|
||||
</target>
|
||||
|
||||
<!-- Debug a selected class . -->
|
||||
@ -237,12 +236,12 @@
|
||||
<macrodef name="run">
|
||||
<attribute name="mainclass"/>
|
||||
<attribute name="args" default=""/>
|
||||
<attribute name="bcp" default="${build.classes.dir}"/>
|
||||
<attribute name="bcp" default="${with_bootclasspath}"/>
|
||||
<attribute name="jpda.jvmargs" default=""/>
|
||||
|
||||
<sequential>
|
||||
<java fork="true" jvm="${target.java}" classname="@{mainclass}">
|
||||
<jvmarg line="-Xbootclasspath/p:${bcp}"/>
|
||||
<jvmarg line="-Xbootclasspath/p:@{bcp}"/>
|
||||
<jvmarg line="@{jpda.jvmargs}"/>
|
||||
<arg line="@{args}"/>
|
||||
</java>
|
||||
|
@ -87,8 +87,9 @@ public class SelectToolTask extends Task {
|
||||
this(toolName, false);
|
||||
}
|
||||
|
||||
ToolChoices(String toolName, boolean boostrap) {
|
||||
ToolChoices(String toolName, boolean bootstrap) {
|
||||
this.toolName = toolName;
|
||||
this.bootstrap = bootstrap;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,9 +61,9 @@ public class Code_attribute extends Attribute {
|
||||
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 class Code_attribute extends Attribute {
|
||||
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;
|
||||
|
||||
|
@ -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.
|
||||
*
|
||||
* <p><b>This is NOT part of any supported API.
|
||||
* If you write code that depends on this, you do so at your own risk.
|
||||
* This code and its internal interfaces are subject to change or
|
||||
* deletion without notice.</b>
|
||||
*
|
||||
* @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();
|
||||
}
|
||||
}
|
||||
}
|
@ -68,6 +68,20 @@ public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
|
||||
return memberTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Content getMemberTreeHeader() {
|
||||
return writer.getMemberTreeHeader();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void addAnnotationDetailsMarker(Content memberDetails) {
|
||||
memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -275,13 +275,6 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void addAnnotationDetailsMarker(Content memberDetails) {
|
||||
memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -319,6 +312,12 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
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 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
|
||||
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);
|
||||
|
@ -84,6 +84,11 @@ public class HtmlDocletWriter extends HtmlDocWriter {
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
|
@ -104,6 +104,16 @@ public class WriterFactoryImpl implements WriterFactory {
|
||||
annotationType, prevType, nextType);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public AnnotationTypeFieldWriter
|
||||
getAnnotationTypeFieldWriter(AnnotationTypeWriter annotationTypeWriter) throws Exception {
|
||||
return new AnnotationTypeFieldWriterImpl(
|
||||
(SubWriterHolderWriter) annotationTypeWriter,
|
||||
annotationTypeWriter.getAnnotationTypeDoc());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -202,6 +212,9 @@ public class WriterFactoryImpl implements WriterFactory {
|
||||
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);
|
||||
|
@ -93,6 +93,12 @@ public class HtmlConstants {
|
||||
public static final Content START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY =
|
||||
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.
|
||||
*/
|
||||
@ -129,6 +135,12 @@ public class HtmlConstants {
|
||||
public static final Content START_OF_ANNOTATION_TYPE_DETAILS =
|
||||
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.
|
||||
*/
|
||||
|
@ -28,6 +28,7 @@ package com.sun.tools.doclets.formats.html.markup;
|
||||
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.*;
|
||||
@ -163,6 +164,46 @@ public class HtmlTree extends Content {
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@ -172,7 +213,7 @@ public class HtmlTree extends Content {
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -335,6 +335,12 @@ public class HtmlWriter {
|
||||
" 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 +
|
||||
@ -346,7 +352,8 @@ public class HtmlWriter {
|
||||
" 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 +
|
||||
|
@ -185,9 +185,9 @@ doclet.Error_in_packagelist=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u75
|
||||
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 <directory> \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 <text> \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 <html-code> \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link <url> <url>\u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline <url> <url2> <url2>\u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066<url>\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir <name1>:.. \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 <name> <p1>:<p2>.. \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 <name1>:<name2>:... \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 <name>:<locations>:<header> \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 \
|
||||
<url> \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<url>\u3067\u7F6E\u63DB\u3059\u308B\n-charset <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 <file> \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 <tab length> \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 <path> \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 <name> \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 <directory> \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 <text> \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 <html-code> \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n-header <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n-footer <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n-top <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-bottom <html-code> \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n-link <url> <url>\u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n-linkoffline <url> <url2> <url2>\u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066<url>\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n-excludedocfilessubdir <name1>:.. \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 <name> <p1>:<p2>.. \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 <name1>:<name2>:... \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 <name>:<locations>:<header> \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 \
|
||||
<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 <file> \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 <tab length> \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 <path> \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 <name> \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 <url> doc\u30B3\u30E1\u30F3\u30C8\u5185\u306E/..\u304C\u5F8C\u306B\u7D9A\u304F@docRoot\u306E\u3059\u3079\u3066\u3092\n <url>\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|[-]<group>) \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<group>\u306Fhtml\u3001missing\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002\n
|
||||
|
@ -185,8 +185,8 @@ doclet.Error_in_packagelist=\u4F7F\u7528 -group \u9009\u9879\u65F6\u51FA\u9519:
|
||||
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 <directory> \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 <text> \u6587\u6863\u7684\u6D4F\u89C8\u5668\u7A97\u53E3\u6807\u9898\n-doctitle <html-code> \u5305\u542B\u6982\u89C8\u9875\u9762\u7684\u6807\u9898\n-header <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u7709\u6587\u672C\n-footer <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u811A\u6587\u672C\n-top <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9876\u90E8\u6587\u672C\n-bottom <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u5E95\u90E8\u6587\u672C\n-link <url> \u521B\u5EFA\u6307\u5411\u4F4D\u4E8E <url> \u7684 javadoc \u8F93\u51FA\u7684\u94FE\u63A5\n-linkoffline <url> <url2> \u5229\u7528\u4F4D\u4E8E <url2> \u7684\u7A0B\u5E8F\u5305\u5217\u8868\u94FE\u63A5\u81F3\u4F4D\u4E8E <url> \u7684\u6587\u6863\n-excludedocfilessubdir <name1>:.. \u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\u3002\n-group <name> <p1>:<p2>.. \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 <name1>:<name2>:... \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 <name>:<locations>:<header> \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 <url> \u5C06\u6587\u6863\u6CE8\u91CA\u4E2D\u51FA\u73B0\u7684\u6240\u6709\u540E\u8DDF /.. \u7684 @docRoot \u66FF\u6362\u4E3A <url>\n-charset <charset> \u7528\u4E8E\u8DE8\u5E73\u53F0\u67E5\u770B\u751F\u6210\u7684\u6587\u6863\u7684\u5B57\u7B26\u96C6\u3002\n-helpfile <file> \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 <tab length> \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 <path> \u7528\u4E8E\u66F4\u6539\u751F\u6210\u6587\u6863\u7684\u6837\u5F0F\u7684\u6587\u4EF6\n-docencoding <name> \u8F93\u51FA\u7F16\u7801\u540D\u79F0
|
||||
|
||||
|
||||
doclet.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n -d <directory> \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 <text> \u6587\u6863\u7684\u6D4F\u89C8\u5668\u7A97\u53E3\u6807\u9898\n -doctitle <html-code> \u5305\u542B\u6982\u89C8\u9875\u9762\u7684\u6807\u9898\n -header <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u7709\u6587\u672C\n -footer <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u811A\u6587\u672C\n -top <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9876\u90E8\u6587\u672C\n -bottom <html-code> \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u5E95\u90E8\u6587\u672C\n -link <url> \u521B\u5EFA\u6307\u5411\u4F4D\u4E8E <url> \u7684 javadoc \u8F93\u51FA\u7684\u94FE\u63A5\n -linkoffline <url> <url2> \u5229\u7528\u4F4D\u4E8E <url2> \u7684\u7A0B\u5E8F\u5305\u5217\u8868\u94FE\u63A5\u81F3\u4F4D\u4E8E <url> \u7684\u6587\u6863\n -excludedocfilessubdir <name1>:.. \u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\u3002\n -group <name> <p1>:<p2>.. \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 <name1>:<name2>:... \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 <name>:<locations>:<header> \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 <charset> \u7528\u4E8E\u8DE8\u5E73\u53F0\u67E5\u770B\u751F\u6210\u7684\u6587\u6863\u7684\u5B57\u7B26\u96C6\u3002\n -helpfile <file> \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 <tab length> \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 <path> \u7528\u4E8E\u66F4\u6539\u751F\u6210\u6587\u6863\u7684\u6837\u5F0F\u7684\u6587\u4EF6\n -docencoding <name> \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 <url> \u4F7F\u7528 <url> \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|[-]<group>) \n \u5BF9 javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5\u3002\n \u5176\u4E2D <group> \u662F accessibility, html, missing, reference \u6216 syntax \u4E4B\u4E00\u3002\n
|
||||
|
@ -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.
|
||||
*
|
||||
* <p><b>This is NOT part of any supported API.
|
||||
* If you write code that depends on this, you do so at your own risk.
|
||||
* This code and its internal interfaces are subject to change or
|
||||
* deletion without notice.</b>
|
||||
*
|
||||
*
|
||||
* @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;
|
||||
}
|
@ -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
|
||||
@ -44,6 +44,20 @@ import com.sun.javadoc.*;
|
||||
|
||||
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.
|
||||
*
|
||||
|
@ -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
|
||||
@ -103,13 +103,6 @@ public interface AnnotationTypeWriter {
|
||||
*/
|
||||
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.
|
||||
*
|
||||
|
@ -129,6 +129,18 @@ public interface WriterFactory {
|
||||
public abstract MethodWriter getMethodWriter(ClassWriter classWriter)
|
||||
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.
|
||||
|
@ -223,13 +223,22 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
|
||||
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.
|
||||
*
|
||||
|
@ -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.
|
||||
*
|
||||
* <p><b>This is NOT part of any supported API.
|
||||
* If you write code that depends on this, you do so at your own risk.
|
||||
* This code and its internal interfaces are subject to change or
|
||||
* deletion without notice.</b>
|
||||
*
|
||||
* @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<ProgramElementDoc> 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<ProgramElementDoc>(
|
||||
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<ProgramElementDoc> 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;
|
||||
}
|
||||
}
|
@ -167,16 +167,17 @@ public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
|
||||
}
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,11 +173,27 @@ public class BuilderFactory {
|
||||
writerFactory.getMethodWriter(classWriter));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 @@ public class BuilderFactory {
|
||||
* 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(
|
||||
|
@ -212,6 +212,20 @@ public class MemberSummaryBuilder extends AbstractMemberBuilder {
|
||||
addSummary(writer, visibleMemberMap, false, memberSummaryTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
@ -66,10 +66,19 @@
|
||||
<AnnotationTypeTagInfo/>
|
||||
</AnnotationTypeInfo>
|
||||
<MemberSummary>
|
||||
<AnnotationTypeFieldsSummary/>
|
||||
<AnnotationTypeRequiredMemberSummary/>
|
||||
<AnnotationTypeOptionalMemberSummary/>
|
||||
</MemberSummary>
|
||||
<AnnotationTypeMemberDetails>
|
||||
<AnnotationTypeFieldDetails>
|
||||
<AnnotationTypeField>
|
||||
<Signature/>
|
||||
<DeprecationInfo/>
|
||||
<MemberComments/>
|
||||
<TagInfo/>
|
||||
</AnnotationTypeField>
|
||||
</AnnotationTypeFieldDetails>
|
||||
<AnnotationTypeRequiredMemberDetails>
|
||||
<AnnotationTypeRequiredMember>
|
||||
<Signature/>
|
||||
|
@ -136,6 +136,7 @@ doclet.Deprecated=Deprecated.
|
||||
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
|
||||
|
@ -174,6 +174,16 @@ doclet.Value=\u5024
|
||||
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<pre>\nfor({0} c: {0}.values())\n System.out.println(c);\n</pre>\n@return\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\n\u542B\u3080\u914D\u5217
|
||||
doclet.enum_values_doc.main=\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<pre>\nfor({0} c: {0}.values())\n System.out.println(c);\n</pre>\n
|
||||
|
||||
doclet.enum_valueof_doc=\n\u6307\u5B9A\u3057\u305F\u540D\u524D\u3092\u6301\u3064\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u8FD4\u3057\u307E\u3059\u3002\n\u6587\u5B57\u5217\u306F\u3001\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u5BA3\u8A00\u3059\u308B\u306E\u306B\u4F7F\u7528\u3057\u305F\u8B58\u5225\u5B50\u3068<i>\u6B63\u78BA\u306B</i>\n\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n(\u4F59\u5206\u306A\u7A7A\u767D\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002)\n\n@param name\u8FD4\u3055\u308C\u308B\u5217\u6319\u578B\u5B9A\u6570\u306E\u540D\u524D\n@return\u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u3092\u6301\u3064\u5217\u6319\u578B\u5B9A\u6570\n@throws IllegalArgumentException\u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u3092\u6301\u3064\u5B9A\u6570\u3092\n\u3053\u306E\u5217\u6319\u578B\u304C\u6301\u3063\u3066\u3044\u306A\u3044\u5834\u5408\n@throws NullPointerException\u5F15\u6570\u304Cnull\u306E\u5834\u5408
|
||||
doclet.enum_values_doc.return=\n\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u306E\u914D\u5217
|
||||
|
||||
doclet.enum_valueof_doc.main=\n\u6307\u5B9A\u3057\u305F\u540D\u524D\u3092\u6301\u3064\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u8FD4\u3057\u307E\u3059\u3002\n\u6587\u5B57\u5217\u306F\u3001\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u5BA3\u8A00\u3059\u308B\u306E\u306B\u4F7F\u7528\u3057\u305F\u8B58\u5225\u5B50\u3068<i>\u6B63\u78BA\u306B</i>\n\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n(\u4F59\u5206\u306A\u7A7A\u767D\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002)\n
|
||||
|
||||
doclet.enum_valueof_doc.param_name=\u8FD4\u3055\u308C\u308B\u5217\u6319\u578B\u5B9A\u6570\u306E\u540D\u524D\u3002
|
||||
|
||||
doclet.enum_valueof_doc.return=\u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u5217\u6319\u578B\u5B9A\u6570
|
||||
|
||||
doclet.enum_valueof_doc.throws_ila=\u3053\u306E\u5217\u6319\u578B\u306B\u3001\u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u5B9A\u6570\u304C\u306A\u3044\u5834\u5408
|
||||
|
||||
doclet.enum_valueof_doc.throws_npe=\u5F15\u6570\u304Cnull\u306E\u5834\u5408
|
||||
|
@ -174,6 +174,16 @@ doclet.Value=\u503C
|
||||
doclet.0_and_1={0}\u548C{1}
|
||||
|
||||
#Documentation for Enums
|
||||
doclet.enum_values_doc=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n<pre>\nfor ({0} c : {0}.values())\n System.out.println(c);\n</pre>\n@return \u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4
|
||||
doclet.enum_values_doc.main=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n<pre>\nfor ({0} c : {0}.values())\n System.out.println(c);\n</pre>
|
||||
|
||||
doclet.enum_valueof_doc=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26<i>\u5B8C\u5168</i>\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)\n\n@param name \u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002\n@return \u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF\n@throws \u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF, \n\u5219\u629B\u51FA IllegalArgumentException\n@throws \u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C, \u5219\u629B\u51FA NullPointerException
|
||||
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<i>\u5B8C\u5168</i>\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002)
|
||||
|
||||
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
|
||||
|
@ -105,7 +105,9 @@ public class ValueTaglet extends BaseInlineTaglet {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 @@ public class ValueTaglet extends BaseInlineTaglet {
|
||||
* 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 @@ public class ValueTaglet extends BaseInlineTaglet {
|
||||
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 @@ public class ValueTaglet extends BaseInlineTaglet {
|
||||
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(),
|
||||
|
@ -55,14 +55,15 @@ public class VisibleMemberMap {
|
||||
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 @@ public class VisibleMemberMap {
|
||||
}
|
||||
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) :
|
||||
|
@ -44,6 +44,7 @@ import javax.lang.model.element.Element;
|
||||
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 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
|
||||
Set<Element> foundParams = new HashSet<>();
|
||||
Set<TypeMirror> foundThrows = new HashSet<>();
|
||||
Map<JavaFileObject, Set<String>> foundAnchors = new HashMap<>();
|
||||
Map<Element, Set<String>> foundAnchors = new HashMap<>();
|
||||
boolean foundInheritDoc = false;
|
||||
boolean foundReturn = false;
|
||||
|
||||
@ -576,13 +577,30 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
}
|
||||
|
||||
private boolean checkAnchor(String name) {
|
||||
JavaFileObject fo = env.currPath.getCompilationUnit().getSourceFile();
|
||||
Set<String> set = foundAnchors.get(fo);
|
||||
Element e = getEnclosingPackageOrClass(env.currElement);
|
||||
if (e == null)
|
||||
return true;
|
||||
Set<String> 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 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
|
||||
@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 @@ public class Checker extends DocTreePathScanner<Void, Void> {
|
||||
|
||||
@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());
|
||||
|
@ -29,9 +29,14 @@ import java.io.File;
|
||||
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 @@ public class DocLint implements Plugin {
|
||||
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<CompilationUnitTree> todo = new LinkedList<CompilationUnitTree>();
|
||||
};
|
||||
|
||||
task.addTaskListener(tl);
|
||||
|
@ -86,6 +86,9 @@ public enum HtmlTag {
|
||||
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)),
|
||||
|
||||
|
@ -67,7 +67,10 @@ dc.tag.self.closing = self-closing element not allowed
|
||||
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
|
||||
|
@ -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.return = @return\u304C\u3042\u308A\u307E\u305B\u3093
|
||||
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 = <code>\u5185\u306E'{@code'}
|
||||
dc.tag.empty = \u7A7A\u306E<{0}>\u30BF\u30B0
|
||||
@ -66,3 +67,9 @@ dc.tag.self.closing = \u81EA\u5DF1\u7D42\u4E86\u8981\u7D20\u306F\u4F7F\u7528\u30
|
||||
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
|
||||
|
@ -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.return = \u6CA1\u6709 @return
|
||||
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 <code> \u4E2D
|
||||
dc.tag.empty = <{0}> \u6807\u8BB0\u4E3A\u7A7A
|
||||
@ -66,3 +67,8 @@ dc.tag.self.closing = \u4E0D\u5141\u8BB8\u4F7F\u7528\u81EA\u5173\u95ED\u5143\u7D
|
||||
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
|
||||
|
@ -472,7 +472,7 @@ public class JavacTaskImpl extends BasicJavacTask {
|
||||
for (TypeElement item: classes)
|
||||
set.add(item);
|
||||
|
||||
ListBuffer<Env<AttrContext>> defer = ListBuffer.<Env<AttrContext>>lb();
|
||||
ListBuffer<Env<AttrContext>> defer = new ListBuffer<>();
|
||||
while (list.peek() != null) {
|
||||
Env<AttrContext> env = list.remove();
|
||||
ClassSymbol csym = env.enclClass.sym;
|
||||
|
@ -81,7 +81,7 @@ public class DeferredLintHandler {
|
||||
} else {
|
||||
ListBuffer<LintLogger> loggers = loggersQueue.get(currentPos);
|
||||
if (loggers == null) {
|
||||
loggersQueue.put(currentPos, loggers = ListBuffer.<LintLogger>lb());
|
||||
loggersQueue.put(currentPos, loggers = new ListBuffer<>());
|
||||
}
|
||||
loggers.append(logger);
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ public class Flags {
|
||||
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;
|
||||
|
||||
|
@ -103,7 +103,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
|
||||
* @return localized string representation
|
||||
*/
|
||||
public String visitTypes(List<Type> ts, Locale locale) {
|
||||
ListBuffer<String> sbuf = ListBuffer.lb();
|
||||
ListBuffer<String> sbuf = new ListBuffer<>();
|
||||
for (Type t : ts) {
|
||||
sbuf.append(visit(t, locale));
|
||||
}
|
||||
@ -118,7 +118,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
|
||||
* @return localized string representation
|
||||
*/
|
||||
public String visitSymbols(List<Symbol> ts, Locale locale) {
|
||||
ListBuffer<String> sbuf = ListBuffer.lb();
|
||||
ListBuffer<String> sbuf = new ListBuffer<>();
|
||||
for (Symbol t : ts) {
|
||||
sbuf.append(visit(t, locale));
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ public abstract class Symbol implements Element {
|
||||
}
|
||||
|
||||
public List<TypeVariableSymbol> getTypeParameters() {
|
||||
ListBuffer<TypeVariableSymbol> l = ListBuffer.lb();
|
||||
ListBuffer<TypeVariableSymbol> l = new ListBuffer<>();
|
||||
for (Type t : type.getTypeArguments()) {
|
||||
Assert.check(t.tsym.getKind() == ElementKind.TYPE_PARAMETER);
|
||||
l.append((TypeVariableSymbol)t.tsym);
|
||||
|
@ -433,7 +433,7 @@ public abstract class Type implements TypeMirror {
|
||||
}
|
||||
|
||||
public static List<Type> filter(List<Type> ts, Filter<Type> tf) {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type t : ts) {
|
||||
if (tf.accepts(t)) {
|
||||
buf.append(t);
|
||||
@ -977,7 +977,7 @@ public abstract class Type implements TypeMirror {
|
||||
}
|
||||
|
||||
public java.util.List<? extends TypeMirror> getBounds() {
|
||||
return Collections.unmodifiableList(getComponents());
|
||||
return Collections.unmodifiableList(getExplicitComponents());
|
||||
}
|
||||
|
||||
public List<Type> getComponents() {
|
||||
@ -1496,7 +1496,7 @@ public abstract class Type implements TypeMirror {
|
||||
|
||||
/** get all bounds of a given kind */
|
||||
public List<Type> getBounds(InferenceBound... ibs) {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (InferenceBound ib : ibs) {
|
||||
buf.appendList(bounds.get(ib));
|
||||
}
|
||||
@ -1505,7 +1505,7 @@ public abstract class Type implements TypeMirror {
|
||||
|
||||
/** get the list of declared (upper) bounds */
|
||||
public List<Type> getDeclaredBounds() {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
int count = 0;
|
||||
for (Type b : getBounds(InferenceBound.UPPER)) {
|
||||
if (count++ == declaredCount) break;
|
||||
@ -1565,8 +1565,8 @@ public abstract class Type implements TypeMirror {
|
||||
for (Map.Entry<InferenceBound, List<Type>> _entry : bounds.entrySet()) {
|
||||
InferenceBound ib = _entry.getKey();
|
||||
List<Type> prevBounds = _entry.getValue();
|
||||
ListBuffer<Type> newBounds = ListBuffer.lb();
|
||||
ListBuffer<Type> deps = ListBuffer.lb();
|
||||
ListBuffer<Type> newBounds = new ListBuffer<>();
|
||||
ListBuffer<Type> deps = new ListBuffer<>();
|
||||
//step 1 - re-add bounds that are not dependent on ivars
|
||||
for (Type t : prevBounds) {
|
||||
if (!t.containsAny(instVars)) {
|
||||
|
@ -304,7 +304,7 @@ public class TypeAnnotationPosition {
|
||||
* @param list The bytecode representation of the type path.
|
||||
*/
|
||||
public static List<TypePathEntry> getTypePathFromBinary(java.util.List<Integer> list) {
|
||||
ListBuffer<TypePathEntry> loc = ListBuffer.lb();
|
||||
ListBuffer<TypePathEntry> loc = new ListBuffer<>();
|
||||
Iterator<Integer> iter = list.iterator();
|
||||
while (iter.hasNext()) {
|
||||
Integer fst = iter.next();
|
||||
@ -316,7 +316,7 @@ public class TypeAnnotationPosition {
|
||||
}
|
||||
|
||||
public static List<Integer> getBinaryFromTypePath(java.util.List<TypePathEntry> locs) {
|
||||
ListBuffer<Integer> loc = ListBuffer.lb();
|
||||
ListBuffer<Integer> loc = new ListBuffer<>();
|
||||
for (TypePathEntry tpe : locs) {
|
||||
loc = loc.append(tpe.tag.tag);
|
||||
loc = loc.append(tpe.arg);
|
||||
|
@ -31,10 +31,7 @@ import javax.lang.model.type.TypeKind;
|
||||
|
||||
import javax.tools.JavaFileObject;
|
||||
|
||||
import com.sun.tools.javac.code.Attribute;
|
||||
import com.sun.tools.javac.code.Attribute.TypeCompound;
|
||||
import com.sun.tools.javac.code.Flags;
|
||||
import com.sun.tools.javac.code.Kinds;
|
||||
import com.sun.tools.javac.code.Type.AnnotatedType;
|
||||
import com.sun.tools.javac.code.Type.ArrayType;
|
||||
import com.sun.tools.javac.code.Type.CapturedType;
|
||||
@ -49,7 +46,6 @@ import com.sun.tools.javac.code.Type.Visitor;
|
||||
import com.sun.tools.javac.code.Type.WildcardType;
|
||||
import com.sun.tools.javac.code.TypeAnnotationPosition.TypePathEntry;
|
||||
import com.sun.tools.javac.code.TypeAnnotationPosition.TypePathEntryKind;
|
||||
import com.sun.tools.javac.code.TypeTag;
|
||||
import com.sun.tools.javac.code.Symbol.VarSymbol;
|
||||
import com.sun.tools.javac.code.Symbol.MethodSymbol;
|
||||
import com.sun.tools.javac.comp.Annotate;
|
||||
@ -70,6 +66,7 @@ import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
|
||||
import com.sun.tools.javac.tree.TreeScanner;
|
||||
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.List;
|
||||
import com.sun.tools.javac.util.ListBuffer;
|
||||
import com.sun.tools.javac.util.Log;
|
||||
@ -83,8 +80,28 @@ import com.sun.tools.javac.util.Names;
|
||||
* and determine the TypeAnnotationPositions for all type annotations.
|
||||
*/
|
||||
public class TypeAnnotations {
|
||||
// Class cannot be instantiated.
|
||||
private TypeAnnotations() {}
|
||||
protected static final Context.Key<TypeAnnotations> typeAnnosKey =
|
||||
new Context.Key<TypeAnnotations>();
|
||||
|
||||
public static TypeAnnotations instance(Context context) {
|
||||
TypeAnnotations instance = context.get(typeAnnosKey);
|
||||
if (instance == null)
|
||||
instance = new TypeAnnotations(context);
|
||||
return instance;
|
||||
}
|
||||
|
||||
final Log log;
|
||||
final Names names;
|
||||
final Symtab syms;
|
||||
final Annotate annotate;
|
||||
|
||||
protected TypeAnnotations(Context context) {
|
||||
context.put(typeAnnosKey, this);
|
||||
names = Names.instance(context);
|
||||
log = Log.instance(context);
|
||||
syms = Symtab.instance(context);
|
||||
annotate = Annotate.instance(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Separate type annotations from declaration annotations and
|
||||
@ -95,15 +112,14 @@ public class TypeAnnotations {
|
||||
* adds an Annotator to the correct Annotate queue for
|
||||
* later processing.
|
||||
*/
|
||||
public static void organizeTypeAnnotationsSignatures(final Symtab syms, final Names names,
|
||||
final Log log, final Env<AttrContext> env, final JCClassDecl tree, final Annotate annotate) {
|
||||
public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
|
||||
annotate.afterRepeated( new Annotator() {
|
||||
@Override
|
||||
public void enterAnnotation() {
|
||||
JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
|
||||
|
||||
try {
|
||||
new TypeAnnotationPositions(syms, names, log, true).scan(tree);
|
||||
new TypeAnnotationPositions(true).scan(tree);
|
||||
} finally {
|
||||
log.useSource(oldSource);
|
||||
}
|
||||
@ -115,8 +131,8 @@ public class TypeAnnotations {
|
||||
* This version only visits types in bodies, that is, field initializers,
|
||||
* top-level blocks, and method bodies, and should be called from Attr.
|
||||
*/
|
||||
public static void organizeTypeAnnotationsBodies(Symtab syms, Names names, Log log, JCClassDecl tree) {
|
||||
new TypeAnnotationPositions(syms, names, log, false).scan(tree);
|
||||
public void organizeTypeAnnotationsBodies(JCClassDecl tree) {
|
||||
new TypeAnnotationPositions(false).scan(tree);
|
||||
}
|
||||
|
||||
public enum AnnotationType { DECLARATION, TYPE, BOTH };
|
||||
@ -125,8 +141,7 @@ public class TypeAnnotations {
|
||||
* Determine whether an annotation is a declaration annotation,
|
||||
* a type annotation, or both.
|
||||
*/
|
||||
public static AnnotationType annotationType(Symtab syms, Names names,
|
||||
Attribute.Compound a, Symbol s) {
|
||||
public AnnotationType annotationType(Attribute.Compound a, Symbol s) {
|
||||
Attribute.Compound atTarget =
|
||||
a.type.tsym.attribute(syms.annotationTargetType.tsym);
|
||||
if (atTarget == null) {
|
||||
@ -215,17 +230,11 @@ public class TypeAnnotations {
|
||||
}
|
||||
|
||||
|
||||
private static class TypeAnnotationPositions extends TreeScanner {
|
||||
private class TypeAnnotationPositions extends TreeScanner {
|
||||
|
||||
private final Symtab syms;
|
||||
private final Names names;
|
||||
private final Log log;
|
||||
private final boolean sigOnly;
|
||||
|
||||
private TypeAnnotationPositions(Symtab syms, Names names, Log log, boolean sigOnly) {
|
||||
this.syms = syms;
|
||||
this.names = names;
|
||||
this.log = log;
|
||||
TypeAnnotationPositions(boolean sigOnly) {
|
||||
this.sigOnly = sigOnly;
|
||||
}
|
||||
|
||||
@ -233,7 +242,7 @@ public class TypeAnnotations {
|
||||
* When traversing the AST we keep the "frames" of visited
|
||||
* trees in order to determine the position of annotations.
|
||||
*/
|
||||
private ListBuffer<JCTree> frames = ListBuffer.lb();
|
||||
private ListBuffer<JCTree> frames = new ListBuffer<>();
|
||||
|
||||
protected void push(JCTree t) { frames = frames.prepend(t); }
|
||||
protected JCTree pop() { return frames.next(); }
|
||||
@ -265,7 +274,7 @@ public class TypeAnnotations {
|
||||
ListBuffer<Attribute.TypeCompound> typeAnnos = new ListBuffer<Attribute.TypeCompound>();
|
||||
|
||||
for (Attribute.Compound a : annotations) {
|
||||
switch (annotationType(syms, names, a, sym)) {
|
||||
switch (annotationType(a, sym)) {
|
||||
case DECLARATION:
|
||||
declAnnos.append(a);
|
||||
break;
|
||||
@ -301,7 +310,7 @@ public class TypeAnnotations {
|
||||
}
|
||||
|
||||
// type is non-null and annotations are added to that type
|
||||
type = typeWithAnnotations(typetree, type, typeAnnotations, log);
|
||||
type = typeWithAnnotations(typetree, type, typeAnnotations);
|
||||
|
||||
if (sym.getKind() == ElementKind.METHOD) {
|
||||
sym.type.asMethodType().restype = type;
|
||||
@ -352,8 +361,8 @@ public class TypeAnnotations {
|
||||
//
|
||||
// As a side effect the method sets the type annotation position of "annotations".
|
||||
// Note that it is assumed that all annotations share the same position.
|
||||
private static Type typeWithAnnotations(final JCTree typetree, final Type type,
|
||||
final List<Attribute.TypeCompound> annotations, Log log) {
|
||||
private Type typeWithAnnotations(final JCTree typetree, final Type type,
|
||||
final List<Attribute.TypeCompound> annotations) {
|
||||
// System.out.printf("typeWithAnnotations(typetree: %s, type: %s, annotations: %s)%n",
|
||||
// typetree, type, annotations);
|
||||
if (annotations.isEmpty()) {
|
||||
@ -381,7 +390,7 @@ public class TypeAnnotations {
|
||||
}
|
||||
JCArrayTypeTree arTree = arrayTypeTree(typetree);
|
||||
|
||||
ListBuffer<TypePathEntry> depth = ListBuffer.lb();
|
||||
ListBuffer<TypePathEntry> depth = new ListBuffer<>();
|
||||
depth = depth.append(TypePathEntry.ARRAY);
|
||||
while (arType.elemtype.hasTag(TypeTag.ARRAY)) {
|
||||
if (arType.elemtype.isAnnotated()) {
|
||||
@ -400,7 +409,7 @@ public class TypeAnnotations {
|
||||
arTree = arrayTypeTree(arTree.elemtype);
|
||||
depth = depth.append(TypePathEntry.ARRAY);
|
||||
}
|
||||
Type arelemType = typeWithAnnotations(arTree.elemtype, arType.elemtype, annotations, log);
|
||||
Type arelemType = typeWithAnnotations(arTree.elemtype, arType.elemtype, annotations);
|
||||
tomodify.elemtype = arelemType;
|
||||
{
|
||||
// All annotations share the same position; modify the first one.
|
||||
@ -417,7 +426,7 @@ public class TypeAnnotations {
|
||||
// There is a TypeKind, but no TypeTag.
|
||||
JCTypeUnion tutree = (JCTypeUnion) typetree;
|
||||
JCExpression fst = tutree.alternatives.get(0);
|
||||
Type res = typeWithAnnotations(fst, fst.type, annotations, log);
|
||||
Type res = typeWithAnnotations(fst, fst.type, annotations);
|
||||
fst.type = res;
|
||||
// TODO: do we want to set res as first element in uct.alternatives?
|
||||
// UnionClassType uct = (com.sun.tools.javac.code.Type.UnionClassType)type;
|
||||
@ -473,7 +482,7 @@ public class TypeAnnotations {
|
||||
// the correct nesting.
|
||||
|
||||
// The genericLocation for the annotation.
|
||||
ListBuffer<TypePathEntry> depth = ListBuffer.lb();
|
||||
ListBuffer<TypePathEntry> depth = new ListBuffer<>();
|
||||
|
||||
Type topTy = enclTy;
|
||||
while (enclEl != null &&
|
||||
@ -505,7 +514,7 @@ public class TypeAnnotations {
|
||||
}
|
||||
}
|
||||
|
||||
private static JCArrayTypeTree arrayTypeTree(JCTree typetree) {
|
||||
private JCArrayTypeTree arrayTypeTree(JCTree typetree) {
|
||||
if (typetree.getKind() == JCTree.Kind.ARRAY_TYPE) {
|
||||
return (JCArrayTypeTree) typetree;
|
||||
} else if (typetree.getKind() == JCTree.Kind.ANNOTATED_TYPE) {
|
||||
@ -532,7 +541,7 @@ public class TypeAnnotations {
|
||||
* @param annotations The annotations to insert.
|
||||
* @return A copy of type that contains the annotations.
|
||||
*/
|
||||
private static Type typeWithAnnotations(final Type type,
|
||||
private Type typeWithAnnotations(final Type type,
|
||||
final Type stopAt,
|
||||
final List<Attribute.TypeCompound> annotations) {
|
||||
Visitor<Type, List<TypeCompound>> visitor =
|
||||
@ -619,7 +628,7 @@ public class TypeAnnotations {
|
||||
return type.accept(visitor, annotations);
|
||||
}
|
||||
|
||||
private static Attribute.TypeCompound toTypeCompound(Attribute.Compound a, TypeAnnotationPosition p) {
|
||||
private Attribute.TypeCompound toTypeCompound(Attribute.Compound a, TypeAnnotationPosition p) {
|
||||
// It is safe to alias the position.
|
||||
return new Attribute.TypeCompound(a, p);
|
||||
}
|
||||
@ -793,7 +802,7 @@ public class TypeAnnotations {
|
||||
}
|
||||
|
||||
case ARRAY_TYPE: {
|
||||
ListBuffer<TypePathEntry> index = ListBuffer.lb();
|
||||
ListBuffer<TypePathEntry> index = new ListBuffer<>();
|
||||
index = index.append(TypePathEntry.ARRAY);
|
||||
List<JCTree> newPath = path.tail;
|
||||
while (true) {
|
||||
@ -953,10 +962,10 @@ public class TypeAnnotations {
|
||||
}
|
||||
}
|
||||
|
||||
private static void locateNestedTypes(Type type, TypeAnnotationPosition p) {
|
||||
private void locateNestedTypes(Type type, TypeAnnotationPosition p) {
|
||||
// The number of "steps" to get from the full type to the
|
||||
// left-most outer type.
|
||||
ListBuffer<TypePathEntry> depth = ListBuffer.lb();
|
||||
ListBuffer<TypePathEntry> depth = new ListBuffer<>();
|
||||
|
||||
Type encl = type.getEnclosingType();
|
||||
while (encl != null &&
|
||||
@ -970,7 +979,7 @@ public class TypeAnnotations {
|
||||
}
|
||||
}
|
||||
|
||||
private static int methodParamIndex(List<JCTree> path, JCTree param) {
|
||||
private int methodParamIndex(List<JCTree> path, JCTree param) {
|
||||
List<JCTree> curr = path;
|
||||
while (curr.head.getTag() != Tag.METHODDEF &&
|
||||
curr.head.getTag() != Tag.LAMBDA) {
|
||||
@ -1226,7 +1235,7 @@ public class TypeAnnotations {
|
||||
public void visitNewArray(JCNewArray tree) {
|
||||
findPosition(tree, tree, tree.annotations);
|
||||
int dimAnnosCount = tree.dimAnnotations.size();
|
||||
ListBuffer<TypePathEntry> depth = ListBuffer.lb();
|
||||
ListBuffer<TypePathEntry> depth = new ListBuffer<>();
|
||||
|
||||
// handle annotations associated with dimensions
|
||||
for (int i = 0; i < dimAnnosCount; ++i) {
|
||||
@ -1284,7 +1293,7 @@ public class TypeAnnotations {
|
||||
}
|
||||
}
|
||||
|
||||
private static void setTypeAnnotationPos(List<JCAnnotation> annotations,
|
||||
private void setTypeAnnotationPos(List<JCAnnotation> annotations,
|
||||
TypeAnnotationPosition position) {
|
||||
for (JCAnnotation anno : annotations) {
|
||||
// attribute might be null during DeferredAttr;
|
||||
|
@ -51,7 +51,6 @@ import static com.sun.tools.javac.code.Symbol.*;
|
||||
import static com.sun.tools.javac.code.Type.*;
|
||||
import static com.sun.tools.javac.code.TypeTag.*;
|
||||
import static com.sun.tools.javac.jvm.ClassFile.externalize;
|
||||
import static com.sun.tools.javac.util.ListBuffer.lb;
|
||||
|
||||
/**
|
||||
* Utility class containing various operations on types.
|
||||
@ -411,7 +410,7 @@ public class Types {
|
||||
throw failure("not.a.functional.intf", origin);
|
||||
}
|
||||
|
||||
final ListBuffer<Symbol> abstracts = ListBuffer.lb();
|
||||
final ListBuffer<Symbol> abstracts = new ListBuffer<>();
|
||||
for (Symbol sym : membersCache.getElements(new DescriptorFilter(origin))) {
|
||||
Type mtype = memberType(origin.type, sym);
|
||||
if (abstracts.isEmpty() ||
|
||||
@ -434,7 +433,7 @@ public class Types {
|
||||
FunctionDescriptor descRes = mergeDescriptors(origin, abstracts.toList());
|
||||
if (descRes == null) {
|
||||
//we can get here if the functional interface is ill-formed
|
||||
ListBuffer<JCDiagnostic> descriptors = ListBuffer.lb();
|
||||
ListBuffer<JCDiagnostic> descriptors = new ListBuffer<>();
|
||||
for (Symbol desc : abstracts) {
|
||||
String key = desc.type.getThrownTypes().nonEmpty() ?
|
||||
"descriptor.throws" : "descriptor";
|
||||
@ -596,7 +595,7 @@ public class Types {
|
||||
Type capturedSite = capture(site);
|
||||
if (capturedSite != site) {
|
||||
Type formalInterface = site.tsym.type;
|
||||
ListBuffer<Type> typeargs = ListBuffer.lb();
|
||||
ListBuffer<Type> typeargs = new ListBuffer<>();
|
||||
List<Type> actualTypeargs = site.getTypeArguments();
|
||||
List<Type> capturedTypeargs = capturedSite.getTypeArguments();
|
||||
//simply replace the wildcards with its bound
|
||||
@ -662,7 +661,7 @@ public class Types {
|
||||
Assert.check(isFunctionalInterface(origin));
|
||||
Symbol descSym = findDescriptorSymbol(origin);
|
||||
CompoundScope members = membersClosure(origin.type, false);
|
||||
ListBuffer<Symbol> overridden = ListBuffer.lb();
|
||||
ListBuffer<Symbol> overridden = new ListBuffer<>();
|
||||
outer: for (Symbol m2 : members.getElementsByName(descSym.name, bridgeFilter)) {
|
||||
if (m2 == descSym) continue;
|
||||
else if (descSym.overrides(m2, origin, Types.this, false)) {
|
||||
@ -885,12 +884,12 @@ public class Types {
|
||||
private Type rewriteSupers(Type t) {
|
||||
if (!t.isParameterized())
|
||||
return t;
|
||||
ListBuffer<Type> from = lb();
|
||||
ListBuffer<Type> to = lb();
|
||||
ListBuffer<Type> from = new ListBuffer<>();
|
||||
ListBuffer<Type> to = new ListBuffer<>();
|
||||
adaptSelf(t, from, to);
|
||||
if (from.isEmpty())
|
||||
return t;
|
||||
ListBuffer<Type> rewrite = lb();
|
||||
ListBuffer<Type> rewrite = new ListBuffer<>();
|
||||
boolean changed = false;
|
||||
for (Type orig : to.toList()) {
|
||||
Type s = rewriteSupers(orig);
|
||||
@ -2415,6 +2414,29 @@ public class Types {
|
||||
}
|
||||
};
|
||||
|
||||
public List<Type> directSupertypes(Type t) {
|
||||
return directSupertypes.visit(t);
|
||||
}
|
||||
// where
|
||||
private final UnaryVisitor<List<Type>> directSupertypes = new UnaryVisitor<List<Type>>() {
|
||||
|
||||
public List<Type> visitType(final Type type, final Void ignored) {
|
||||
if (!type.isCompound()) {
|
||||
final Type sup = supertype(type);
|
||||
return (sup == Type.noType || sup == type || sup == null)
|
||||
? interfaces(type)
|
||||
: interfaces(type).prepend(sup);
|
||||
} else {
|
||||
return visitIntersectionType((IntersectionClassType) type);
|
||||
}
|
||||
}
|
||||
|
||||
private List<Type> visitIntersectionType(final IntersectionClassType it) {
|
||||
return it.getExplicitComponents();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
public boolean isDirectSuperInterface(TypeSymbol isym, TypeSymbol origin) {
|
||||
for (Type i2 : interfaces(origin.type)) {
|
||||
if (isym == i2.tsym) return true;
|
||||
@ -2744,7 +2766,7 @@ public class Types {
|
||||
}
|
||||
|
||||
public List<MethodSymbol> prune(List<MethodSymbol> methods) {
|
||||
ListBuffer<MethodSymbol> methodsMin = ListBuffer.lb();
|
||||
ListBuffer<MethodSymbol> methodsMin = new ListBuffer<>();
|
||||
for (MethodSymbol m1 : methods) {
|
||||
boolean isMin_m1 = true;
|
||||
for (MethodSymbol m2 : methods) {
|
||||
@ -3001,7 +3023,7 @@ public class Types {
|
||||
List<Type> to) {
|
||||
if (tvars.isEmpty())
|
||||
return tvars;
|
||||
ListBuffer<Type> newBoundsBuf = lb();
|
||||
ListBuffer<Type> newBoundsBuf = new ListBuffer<>();
|
||||
boolean changed = false;
|
||||
// calculate new bounds
|
||||
for (Type t : tvars) {
|
||||
@ -3013,7 +3035,7 @@ public class Types {
|
||||
}
|
||||
if (!changed)
|
||||
return tvars;
|
||||
ListBuffer<Type> newTvars = lb();
|
||||
ListBuffer<Type> newTvars = new ListBuffer<>();
|
||||
// create new type variables without bounds
|
||||
for (Type t : tvars) {
|
||||
newTvars.append(new TypeVar(t.tsym, null, syms.botType));
|
||||
@ -3440,15 +3462,15 @@ public class Types {
|
||||
* compoundMin or glb.
|
||||
*/
|
||||
private List<Type> closureMin(List<Type> cl) {
|
||||
ListBuffer<Type> classes = lb();
|
||||
ListBuffer<Type> interfaces = lb();
|
||||
ListBuffer<Type> classes = new ListBuffer<>();
|
||||
ListBuffer<Type> interfaces = new ListBuffer<>();
|
||||
while (!cl.isEmpty()) {
|
||||
Type current = cl.head;
|
||||
if (current.isInterface())
|
||||
interfaces.append(current);
|
||||
else
|
||||
classes.append(current);
|
||||
ListBuffer<Type> candidates = lb();
|
||||
ListBuffer<Type> candidates = new ListBuffer<>();
|
||||
for (Type t : cl.tail) {
|
||||
if (!isSubtypeNoCapture(current, t))
|
||||
candidates.append(t);
|
||||
@ -3564,7 +3586,7 @@ public class Types {
|
||||
}
|
||||
// where
|
||||
List<Type> erasedSupertypes(Type t) {
|
||||
ListBuffer<Type> buf = lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type sup : closure(t)) {
|
||||
if (sup.hasTag(TYPEVAR)) {
|
||||
buf.append(sup);
|
||||
@ -3914,7 +3936,7 @@ public class Types {
|
||||
}
|
||||
// where
|
||||
public List<Type> freshTypeVariables(List<Type> types) {
|
||||
ListBuffer<Type> result = lb();
|
||||
ListBuffer<Type> result = new ListBuffer<>();
|
||||
for (Type t : types) {
|
||||
if (t.hasTag(WILDCARD)) {
|
||||
t = t.unannotatedType();
|
||||
|
@ -93,6 +93,7 @@ public class Attr extends JCTree.Visitor {
|
||||
final Types types;
|
||||
final JCDiagnostic.Factory diags;
|
||||
final Annotate annotate;
|
||||
final TypeAnnotations typeAnnotations;
|
||||
final DeferredLintHandler deferredLintHandler;
|
||||
|
||||
public static Attr instance(Context context) {
|
||||
@ -121,6 +122,7 @@ public class Attr extends JCTree.Visitor {
|
||||
types = Types.instance(context);
|
||||
diags = JCDiagnostic.Factory.instance(context);
|
||||
annotate = Annotate.instance(context);
|
||||
typeAnnotations = TypeAnnotations.instance(context);
|
||||
deferredLintHandler = DeferredLintHandler.instance(context);
|
||||
|
||||
Options options = Options.instance(context);
|
||||
@ -1724,7 +1726,7 @@ public class Attr extends JCTree.Visitor {
|
||||
boolean isConstructorCall =
|
||||
methName == names._this || methName == names._super;
|
||||
|
||||
ListBuffer<Type> argtypesBuf = ListBuffer.lb();
|
||||
ListBuffer<Type> argtypesBuf = new ListBuffer<>();
|
||||
if (isConstructorCall) {
|
||||
// We are seeing a ...this(...) or ...super(...) call.
|
||||
// Check that this is the first statement in a constructor.
|
||||
@ -1989,7 +1991,7 @@ public class Attr extends JCTree.Visitor {
|
||||
}
|
||||
|
||||
// Attribute constructor arguments.
|
||||
ListBuffer<Type> argtypesBuf = ListBuffer.lb();
|
||||
ListBuffer<Type> argtypesBuf = new ListBuffer<>();
|
||||
int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
|
||||
List<Type> argtypes = argtypesBuf.toList();
|
||||
List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
|
||||
@ -2228,7 +2230,7 @@ public class Attr extends JCTree.Visitor {
|
||||
// empty annotations, if only declaration annotations were given.
|
||||
// This method will raise an error for such a type.
|
||||
for (JCAnnotation ai : annotations) {
|
||||
if (TypeAnnotations.annotationType(syms, names, ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
|
||||
if (typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
|
||||
log.error(ai.pos(), "annotation.type.not.applicable");
|
||||
}
|
||||
}
|
||||
@ -2476,8 +2478,8 @@ public class Attr extends JCTree.Visitor {
|
||||
}
|
||||
|
||||
private TypeSymbol makeNotionalInterface(IntersectionClassType ict) {
|
||||
ListBuffer<Type> targs = ListBuffer.lb();
|
||||
ListBuffer<Type> supertypes = ListBuffer.lb();
|
||||
ListBuffer<Type> targs = new ListBuffer<>();
|
||||
ListBuffer<Type> supertypes = new ListBuffer<>();
|
||||
for (Type i : ict.interfaces_field) {
|
||||
if (i.isParameterized()) {
|
||||
targs.appendList(i.tsym.type.allparams());
|
||||
@ -2907,7 +2909,7 @@ public class Attr extends JCTree.Visitor {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ListBuffer<Type> targets = ListBuffer.lb();
|
||||
ListBuffer<Type> targets = new ListBuffer<>();
|
||||
if (pt.hasTag(CLASS)) {
|
||||
if (pt.isCompound()) {
|
||||
targets.append(types.removeWildcards(primaryTarget)); //this goes first
|
||||
@ -3102,8 +3104,14 @@ public class Attr extends JCTree.Visitor {
|
||||
public void visitTypeTest(JCInstanceOf tree) {
|
||||
Type exprtype = chk.checkNullOrRefType(
|
||||
tree.expr.pos(), attribExpr(tree.expr, env));
|
||||
Type clazztype = chk.checkReifiableReferenceType(
|
||||
tree.clazz.pos(), attribType(tree.clazz, env));
|
||||
Type clazztype = attribType(tree.clazz, env);
|
||||
if (!clazztype.hasTag(TYPEVAR)) {
|
||||
clazztype = chk.checkClassOrArrayType(tree.clazz.pos(), clazztype);
|
||||
}
|
||||
if (!clazztype.isErroneous() && !types.isReifiable(clazztype)) {
|
||||
log.error(tree.clazz.pos(), "illegal.generic.type.for.instof");
|
||||
clazztype = types.createErrorType(clazztype);
|
||||
}
|
||||
chk.validate(tree.clazz, env, false);
|
||||
chk.checkCastable(tree.expr.pos(), exprtype, clazztype);
|
||||
result = check(tree, syms.booleanType, VAL, resultInfo);
|
||||
@ -3903,7 +3911,7 @@ public class Attr extends JCTree.Visitor {
|
||||
}
|
||||
|
||||
public void visitTypeUnion(JCTypeUnion tree) {
|
||||
ListBuffer<Type> multicatchTypes = ListBuffer.lb();
|
||||
ListBuffer<Type> multicatchTypes = new ListBuffer<>();
|
||||
ListBuffer<Type> all_multicatchTypes = null; // lazy, only if needed
|
||||
for (JCExpression typeTree : tree.alternatives) {
|
||||
Type ctype = attribType(typeTree, env);
|
||||
@ -3930,7 +3938,7 @@ public class Attr extends JCTree.Visitor {
|
||||
all_multicatchTypes.append(ctype);
|
||||
} else {
|
||||
if (all_multicatchTypes == null) {
|
||||
all_multicatchTypes = ListBuffer.lb();
|
||||
all_multicatchTypes = new ListBuffer<>();
|
||||
all_multicatchTypes.appendList(multicatchTypes);
|
||||
}
|
||||
all_multicatchTypes.append(ctype);
|
||||
@ -4085,7 +4093,7 @@ public class Attr extends JCTree.Visitor {
|
||||
if (annotations.isEmpty())
|
||||
return List.nil();
|
||||
|
||||
ListBuffer<Attribute.TypeCompound> buf = ListBuffer.lb();
|
||||
ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
|
||||
for (JCAnnotation anno : annotations) {
|
||||
if (anno.attribute != null) {
|
||||
// TODO: this null-check is only needed for an obscure
|
||||
@ -4333,7 +4341,7 @@ public class Attr extends JCTree.Visitor {
|
||||
}
|
||||
if (allowTypeAnnos) {
|
||||
// Correctly organize the postions of the type annotations
|
||||
TypeAnnotations.organizeTypeAnnotationsBodies(this.syms, this.names, this.log, tree);
|
||||
typeAnnotations.organizeTypeAnnotationsBodies(tree);
|
||||
|
||||
// Check type annotations applicability rules
|
||||
validateTypeAnnotations(tree);
|
||||
|
@ -706,20 +706,6 @@ public class Check {
|
||||
return t;
|
||||
}
|
||||
|
||||
/** Check that type is a reifiable class, interface or array type.
|
||||
* @param pos Position to be used for error reporting.
|
||||
* @param t The type to be checked.
|
||||
*/
|
||||
Type checkReifiableReferenceType(DiagnosticPosition pos, Type t) {
|
||||
t = checkClassOrArrayType(pos, t);
|
||||
if (!t.isErroneous() && !types.isReifiable(t)) {
|
||||
log.error(pos, "illegal.generic.type.for.instof");
|
||||
return types.createErrorType(t);
|
||||
} else {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
/** Check that type is a reference type, i.e. a class, interface or array type
|
||||
* or a type variable.
|
||||
* @param pos Position to be used for error reporting.
|
||||
@ -1245,6 +1231,7 @@ public class Check {
|
||||
*/
|
||||
class Validator extends JCTree.Visitor {
|
||||
|
||||
boolean checkRaw;
|
||||
boolean isOuter;
|
||||
Env<AttrContext> env;
|
||||
|
||||
@ -1254,7 +1241,7 @@ public class Check {
|
||||
|
||||
@Override
|
||||
public void visitTypeArray(JCArrayTypeTree tree) {
|
||||
tree.elemtype.accept(this);
|
||||
validateTree(tree.elemtype, checkRaw, isOuter);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1345,15 +1332,20 @@ public class Check {
|
||||
}
|
||||
|
||||
public void validateTree(JCTree tree, boolean checkRaw, boolean isOuter) {
|
||||
try {
|
||||
if (tree != null) {
|
||||
this.isOuter = isOuter;
|
||||
if (tree != null) {
|
||||
boolean prevCheckRaw = this.checkRaw;
|
||||
this.checkRaw = checkRaw;
|
||||
this.isOuter = isOuter;
|
||||
|
||||
try {
|
||||
tree.accept(this);
|
||||
if (checkRaw)
|
||||
checkRaw(tree, env);
|
||||
} catch (CompletionFailure ex) {
|
||||
completionError(tree.pos(), ex);
|
||||
} finally {
|
||||
this.checkRaw = prevCheckRaw;
|
||||
}
|
||||
} catch (CompletionFailure ex) {
|
||||
completionError(tree.pos(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2446,8 +2438,8 @@ public class Check {
|
||||
Assert.check(m.kind == MTH);
|
||||
List<MethodSymbol> prov = types.interfaceCandidates(site, (MethodSymbol)m);
|
||||
if (prov.size() > 1) {
|
||||
ListBuffer<Symbol> abstracts = ListBuffer.lb();
|
||||
ListBuffer<Symbol> defaults = ListBuffer.lb();
|
||||
ListBuffer<Symbol> abstracts = new ListBuffer<>();
|
||||
ListBuffer<Symbol> defaults = new ListBuffer<>();
|
||||
for (MethodSymbol provSym : prov) {
|
||||
if ((provSym.flags() & DEFAULT) != 0) {
|
||||
defaults = defaults.append(provSym);
|
||||
|
@ -637,7 +637,7 @@ public class DeferredAttr extends JCTree.Visitor {
|
||||
Env<AttrContext> localEnv = env.dup(tree);
|
||||
JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
|
||||
attr.memberReferenceQualifierResult(tree));
|
||||
ListBuffer<Type> argtypes = ListBuffer.lb();
|
||||
ListBuffer<Type> argtypes = new ListBuffer<>();
|
||||
for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
|
||||
argtypes.append(Type.noType);
|
||||
}
|
||||
|
@ -288,7 +288,9 @@ public class Enter extends JCTree.Visitor {
|
||||
JavaFileObject.Kind.SOURCE);
|
||||
if (tree.pid != null) {
|
||||
tree.packge = reader.enterPackage(TreeInfo.fullName(tree.pid));
|
||||
if (tree.packageAnnotations.nonEmpty() || pkginfoOpt == PkgInfo.ALWAYS) {
|
||||
if (tree.packageAnnotations.nonEmpty()
|
||||
|| pkginfoOpt == PkgInfo.ALWAYS
|
||||
|| tree.docComments != null) {
|
||||
if (isPkgInfo) {
|
||||
addEnv = true;
|
||||
} else if (tree.packageAnnotations.nonEmpty()){
|
||||
|
@ -713,7 +713,7 @@ public class Flow {
|
||||
ListBuffer<PendingExit> prevPending = pendingExits;
|
||||
boolean prevAlive = alive;
|
||||
try {
|
||||
pendingExits = ListBuffer.lb();
|
||||
pendingExits = new ListBuffer<>();
|
||||
alive = true;
|
||||
scanStat(tree.body);
|
||||
tree.canCompleteNormally = alive;
|
||||
@ -1265,7 +1265,7 @@ public class Flow {
|
||||
List<Type> prevThrown = thrown;
|
||||
ListBuffer<FlowPendingExit> prevPending = pendingExits;
|
||||
try {
|
||||
pendingExits = ListBuffer.lb();
|
||||
pendingExits = new ListBuffer<>();
|
||||
caught = tree.getDescriptorType(types).getThrownTypes();
|
||||
thrown = List.nil();
|
||||
scan(tree.body);
|
||||
@ -1338,7 +1338,7 @@ public class Flow {
|
||||
ListBuffer<FlowPendingExit> prevPending = pendingExits;
|
||||
inLambda = true;
|
||||
try {
|
||||
pendingExits = ListBuffer.lb();
|
||||
pendingExits = new ListBuffer<>();
|
||||
caught = List.of(syms.throwableType);
|
||||
thrown = List.nil();
|
||||
scan(tree.body);
|
||||
@ -2030,7 +2030,7 @@ public class Flow {
|
||||
void reportWarning(Lint.LintCategory lc, DiagnosticPosition pos, String key, Object ... args) {}
|
||||
|
||||
public void visitTry(JCTry tree) {
|
||||
ListBuffer<JCVariableDecl> resourceVarDecls = ListBuffer.lb();
|
||||
ListBuffer<JCVariableDecl> resourceVarDecls = new ListBuffer<>();
|
||||
final Bits uninitsTryPrev = new Bits(uninitsTry);
|
||||
ListBuffer<P> prevPendingExits = pendingExits;
|
||||
pendingExits = new ListBuffer<>();
|
||||
|
@ -277,7 +277,7 @@ public class Infer {
|
||||
* Infer cyclic inference variables as described in 15.12.2.8.
|
||||
*/
|
||||
private void instantiateAsUninferredVars(List<Type> vars, InferenceContext inferenceContext) {
|
||||
ListBuffer<Type> todo = ListBuffer.lb();
|
||||
ListBuffer<Type> todo = new ListBuffer<>();
|
||||
//step 1 - create fresh tvars
|
||||
for (Type t : vars) {
|
||||
UndetVar uv = (UndetVar)inferenceContext.asFree(t);
|
||||
@ -1832,7 +1832,7 @@ public class Infer {
|
||||
}
|
||||
|
||||
private List<Type> filterVars(Filter<UndetVar> fu) {
|
||||
ListBuffer<Type> res = ListBuffer.lb();
|
||||
ListBuffer<Type> res = new ListBuffer<>();
|
||||
for (Type t : undetvars) {
|
||||
UndetVar uv = (UndetVar)t;
|
||||
if (fu.accepts(uv)) {
|
||||
@ -1860,7 +1860,7 @@ public class Infer {
|
||||
* Returns a list of free variables in a given type
|
||||
*/
|
||||
final List<Type> freeVarsIn(Type t) {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type iv : inferenceVars()) {
|
||||
if (t.contains(iv)) {
|
||||
buf.add(iv);
|
||||
@ -1870,11 +1870,11 @@ public class Infer {
|
||||
}
|
||||
|
||||
final List<Type> freeVarsIn(List<Type> ts) {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type t : ts) {
|
||||
buf.appendList(freeVarsIn(t));
|
||||
}
|
||||
ListBuffer<Type> buf2 = ListBuffer.lb();
|
||||
ListBuffer<Type> buf2 = new ListBuffer<>();
|
||||
for (Type t : buf) {
|
||||
if (!buf2.contains(t)) {
|
||||
buf2.add(t);
|
||||
@ -1893,7 +1893,7 @@ public class Infer {
|
||||
}
|
||||
|
||||
final List<Type> asFree(List<Type> ts) {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type t : ts) {
|
||||
buf.append(asFree(t));
|
||||
}
|
||||
@ -1901,7 +1901,7 @@ public class Infer {
|
||||
}
|
||||
|
||||
List<Type> instTypes() {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type t : undetvars) {
|
||||
UndetVar uv = (UndetVar)t;
|
||||
buf.append(uv.inst != null ? uv.inst : uv.qtype);
|
||||
@ -1919,7 +1919,7 @@ public class Infer {
|
||||
}
|
||||
|
||||
List<Type> asInstTypes(List<Type> ts) {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type t : ts) {
|
||||
buf.append(asInstType(t));
|
||||
}
|
||||
@ -1967,7 +1967,7 @@ public class Infer {
|
||||
* Save the state of this inference context
|
||||
*/
|
||||
List<Type> save() {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (Type t : undetvars) {
|
||||
UndetVar uv = (UndetVar)t;
|
||||
UndetVar uv2 = new UndetVar((TypeVar)uv.qtype, types);
|
||||
|
@ -126,7 +126,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
private final VarSymbol deserParamSym;
|
||||
|
||||
private KlassInfo(Symbol kSym) {
|
||||
appendedMethodList = ListBuffer.lb();
|
||||
appendedMethodList = new ListBuffer<>();
|
||||
deserializeCases = new HashMap<String, ListBuffer<JCStatement>>();
|
||||
long flags = PRIVATE | STATIC | SYNTHETIC;
|
||||
MethodType type = new MethodType(List.of(syms.serializedLambdaType), syms.objectType,
|
||||
@ -153,6 +153,8 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private Attr attr;
|
||||
|
||||
private LambdaToMethod(Context context) {
|
||||
diags = JCDiagnostic.Factory.instance(context);
|
||||
log = Log.instance(context);
|
||||
@ -166,6 +168,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
analyzer = new LambdaAnalyzerPreprocessor();
|
||||
Options options = Options.instance(context);
|
||||
dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
|
||||
attr = Attr.instance(context);
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
@ -188,7 +191,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
|
||||
<T extends JCTree> List<T> translate(List<T> trees, TranslationContext<?> newContext) {
|
||||
ListBuffer<T> buf = ListBuffer.lb();
|
||||
ListBuffer<T> buf = new ListBuffer<>();
|
||||
for (T tree : trees) {
|
||||
buf.append(translate(tree, newContext));
|
||||
}
|
||||
@ -301,7 +304,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
// * the "this" argument if it is an instance method
|
||||
// * enclosing locals captured by the lambda expression
|
||||
|
||||
ListBuffer<JCExpression> syntheticInits = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> syntheticInits = new ListBuffer<>();
|
||||
|
||||
if (!sym.isStatic()) {
|
||||
syntheticInits.append(makeThis(
|
||||
@ -368,6 +371,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
|
||||
case BOUND: /** Expr :: instMethod */
|
||||
init = tree.getQualifierExpression();
|
||||
init = attr.makeNullCheck(init);
|
||||
break;
|
||||
|
||||
case UNBOUND: /** Type :: instMethod */
|
||||
@ -465,7 +469,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
} else if (isLambda_void && isTarget_Void) {
|
||||
//void to Void conversion:
|
||||
// BODY; return null;
|
||||
ListBuffer<JCStatement> stats = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> stats = new ListBuffer<>();
|
||||
stats.append(make.Exec(expr));
|
||||
stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
|
||||
return make.Block(0, stats.toList());
|
||||
@ -527,8 +531,8 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
|
||||
private JCMethodDecl makeDeserializeMethod(Symbol kSym) {
|
||||
ListBuffer<JCCase> cases = ListBuffer.lb();
|
||||
ListBuffer<JCBreak> breaks = ListBuffer.lb();
|
||||
ListBuffer<JCCase> cases = new ListBuffer<>();
|
||||
ListBuffer<JCBreak> breaks = new ListBuffer<>();
|
||||
for (Map.Entry<String, ListBuffer<JCStatement>> entry : kInfo.deserializeCases.entrySet()) {
|
||||
JCBreak br = make.Break(null);
|
||||
breaks.add(br);
|
||||
@ -590,11 +594,11 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
String implMethodSignature = methodSig(types.erasure(refSym.type));
|
||||
|
||||
JCExpression kindTest = eqTest(syms.intType, deserGetter("getImplMethodKind", syms.intType), make.Literal(implMethodKind));
|
||||
ListBuffer<JCExpression> serArgs = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> serArgs = new ListBuffer<>();
|
||||
int i = 0;
|
||||
for (Type t : indyType.getParameterTypes()) {
|
||||
List<JCExpression> indexAsArg = ListBuffer.<JCExpression>lb().append(make.Literal(i)).toList();
|
||||
List<Type> argTypes = ListBuffer.<Type>lb().append(syms.intType).toList();
|
||||
List<JCExpression> indexAsArg = new ListBuffer<JCExpression>().append(make.Literal(i)).toList();
|
||||
List<Type> argTypes = new ListBuffer<Type>().append(syms.intType).toList();
|
||||
serArgs.add(make.TypeCast(types.erasure(t), deserGetter("getCapturedArg", syms.objectType, argTypes, indexAsArg)));
|
||||
++i;
|
||||
}
|
||||
@ -614,7 +618,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
null);
|
||||
ListBuffer<JCStatement> stmts = kInfo.deserializeCases.get(implMethodName);
|
||||
if (stmts == null) {
|
||||
stmts = ListBuffer.lb();
|
||||
stmts = new ListBuffer<>();
|
||||
kInfo.deserializeCases.put(implMethodName, stmts);
|
||||
}
|
||||
/****
|
||||
@ -724,8 +728,8 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
|
||||
private final JCMemberReference tree;
|
||||
private final ReferenceTranslationContext localContext;
|
||||
private final ListBuffer<JCExpression> args = ListBuffer.lb();
|
||||
private final ListBuffer<JCVariableDecl> params = ListBuffer.lb();
|
||||
private final ListBuffer<JCExpression> args = new ListBuffer<>();
|
||||
private final ListBuffer<JCVariableDecl> params = new ListBuffer<>();
|
||||
|
||||
MemberReferenceBridger(JCMemberReference tree, ReferenceTranslationContext localContext) {
|
||||
this.tree = tree;
|
||||
@ -930,7 +934,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
typeToMethodType(tree.getDescriptorType(types)));
|
||||
|
||||
//computed indy arg types
|
||||
ListBuffer<Type> indy_args_types = ListBuffer.lb();
|
||||
ListBuffer<Type> indy_args_types = new ListBuffer<>();
|
||||
for (JCExpression arg : indy_args) {
|
||||
indy_args_types.append(arg.type);
|
||||
}
|
||||
@ -945,7 +949,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
names.altMetafactory : names.metafactory;
|
||||
|
||||
if (context.needsAltMetafactory()) {
|
||||
ListBuffer<Object> markers = ListBuffer.lb();
|
||||
ListBuffer<Object> markers = new ListBuffer<>();
|
||||
for (Type t : tree.targets.tail) {
|
||||
if (t.tsym != syms.serializableType.tsym) {
|
||||
markers.append(t.tsym);
|
||||
@ -1023,7 +1027,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
}
|
||||
//where
|
||||
private List<Type> bsmStaticArgToTypes(List<Object> args) {
|
||||
ListBuffer<Type> argtypes = ListBuffer.lb();
|
||||
ListBuffer<Type> argtypes = new ListBuffer<>();
|
||||
for (Object arg : args) {
|
||||
argtypes.append(bsmStaticArgToType(arg));
|
||||
}
|
||||
@ -1847,7 +1851,7 @@ public class LambdaToMethod extends TreeTranslator {
|
||||
(thisReferenced? (inInterface? DEFAULT : 0) : STATIC);
|
||||
|
||||
//compute synthetic params
|
||||
ListBuffer<JCVariableDecl> params = ListBuffer.lb();
|
||||
ListBuffer<JCVariableDecl> params = new ListBuffer<>();
|
||||
|
||||
// The signature of the method is augmented with the following
|
||||
// synthetic parameters:
|
||||
|
@ -3725,7 +3725,7 @@ public class Lower extends TreeTranslator {
|
||||
(JCVariableDecl)make.VarDef(dollar_tmp, make.Literal(INT, -1)).setType(dollar_tmp.type);
|
||||
dollar_tmp_def.init.type = dollar_tmp.type = syms.intType;
|
||||
stmtList.append(dollar_tmp_def);
|
||||
ListBuffer<JCCase> caseBuffer = ListBuffer.lb();
|
||||
ListBuffer<JCCase> caseBuffer = new ListBuffer<>();
|
||||
// hashCode will trigger nullcheck on original switch expression
|
||||
JCMethodInvocation hashCodeCall = makeCall(make.Ident(dollar_s),
|
||||
names.hashCode,
|
||||
@ -3749,7 +3749,7 @@ public class Lower extends TreeTranslator {
|
||||
elsepart);
|
||||
}
|
||||
|
||||
ListBuffer<JCStatement> lb = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> lb = new ListBuffer<>();
|
||||
JCBreak breakStmt = make.Break(null);
|
||||
breakStmt.target = switch1;
|
||||
lb.append(elsepart).append(breakStmt);
|
||||
@ -3764,7 +3764,7 @@ public class Lower extends TreeTranslator {
|
||||
// with corresponding integer ones from the label to
|
||||
// position map.
|
||||
|
||||
ListBuffer<JCCase> lb = ListBuffer.lb();
|
||||
ListBuffer<JCCase> lb = new ListBuffer<>();
|
||||
JCSwitch switch2 = make.Switch(make.Ident(dollar_tmp), lb.toList());
|
||||
for(JCCase oneCase : caseList ) {
|
||||
// Rewire up old unlabeled break statements to the
|
||||
|
@ -79,6 +79,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
|
||||
private final ClassReader reader;
|
||||
private final Todo todo;
|
||||
private final Annotate annotate;
|
||||
private final TypeAnnotations typeAnnotations;
|
||||
private final Types types;
|
||||
private final JCDiagnostic.Factory diags;
|
||||
private final Source source;
|
||||
@ -105,6 +106,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
|
||||
reader = ClassReader.instance(context);
|
||||
todo = Todo.instance(context);
|
||||
annotate = Annotate.instance(context);
|
||||
typeAnnotations = TypeAnnotations.instance(context);
|
||||
types = Types.instance(context);
|
||||
diags = JCDiagnostic.Factory.instance(context);
|
||||
source = Source.instance(context);
|
||||
@ -1164,7 +1166,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
|
||||
}
|
||||
}
|
||||
if (allowTypeAnnos) {
|
||||
TypeAnnotations.organizeTypeAnnotationsSignatures(syms, names, log, env, tree, annotate);
|
||||
typeAnnotations.organizeTypeAnnotationsSignatures(env, tree);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class Resolve {
|
||||
|
||||
int pos = 0;
|
||||
int mostSpecificPos = -1;
|
||||
ListBuffer<JCDiagnostic> subDiags = ListBuffer.lb();
|
||||
ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
|
||||
for (Candidate c : currentResolutionContext.candidates) {
|
||||
if (currentResolutionContext.step != c.step ||
|
||||
(c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
|
||||
@ -783,7 +783,7 @@ public class Resolve {
|
||||
};
|
||||
|
||||
List<Type> dummyArgs(int length) {
|
||||
ListBuffer<Type> buf = ListBuffer.lb();
|
||||
ListBuffer<Type> buf = new ListBuffer<>();
|
||||
for (int i = 0 ; i < length ; i++) {
|
||||
buf.append(Type.noType);
|
||||
}
|
||||
@ -3173,7 +3173,7 @@ public class Resolve {
|
||||
}
|
||||
//where
|
||||
private List<Type> pruneInterfaces(Type t) {
|
||||
ListBuffer<Type> result = ListBuffer.lb();
|
||||
ListBuffer<Type> result = new ListBuffer<>();
|
||||
for (Type t1 : types.interfaces(t)) {
|
||||
boolean shouldAdd = true;
|
||||
for (Type t2 : types.interfaces(t)) {
|
||||
@ -3286,7 +3286,7 @@ public class Resolve {
|
||||
if (argtypes == null || argtypes.isEmpty()) {
|
||||
return noArgs;
|
||||
} else {
|
||||
ListBuffer<Object> diagArgs = ListBuffer.lb();
|
||||
ListBuffer<Object> diagArgs = new ListBuffer<>();
|
||||
for (Type t : argtypes) {
|
||||
if (t.hasTag(DEFERRED)) {
|
||||
diagArgs.append(((DeferredAttr.DeferredType)t).tree);
|
||||
|
@ -887,7 +887,7 @@ public class TransTypes extends TreeTranslator {
|
||||
|
||||
private List<JCTree> addOverrideBridgesIfNeeded(DiagnosticPosition pos,
|
||||
final ClassSymbol c) {
|
||||
ListBuffer<JCTree> buf = ListBuffer.lb();
|
||||
ListBuffer<JCTree> buf = new ListBuffer<>();
|
||||
if (c.isInterface() || !boundsRestricted(c))
|
||||
return buf.toList();
|
||||
Type t = types.supertype(c.type);
|
||||
|
@ -40,6 +40,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import javax.tools.JavaFileObject;
|
||||
import java.text.Normalizer;
|
||||
|
||||
/**
|
||||
* A subclass of JavaFileObject representing regular files.
|
||||
@ -57,6 +58,7 @@ class RegularFileObject extends BaseFileObject {
|
||||
private String name;
|
||||
final File file;
|
||||
private Reference<File> absFileRef;
|
||||
final static boolean isMacOS = System.getProperty("os.name", "").contains("OS X");
|
||||
|
||||
public RegularFileObject(JavacFileManager fileManager, File f) {
|
||||
this(fileManager, f.getName(), f);
|
||||
@ -180,7 +182,19 @@ class RegularFileObject extends BaseFileObject {
|
||||
if (name.equals(n)) {
|
||||
return true;
|
||||
}
|
||||
if (name.equalsIgnoreCase(n)) {
|
||||
if (isMacOS && Normalizer.isNormalized(name, Normalizer.Form.NFD)
|
||||
&& Normalizer.isNormalized(n, Normalizer.Form.NFC)) {
|
||||
// On Mac OS X it is quite possible to file name and class
|
||||
// name normalized in a different way - in that case we have to normalize file name
|
||||
// to the Normal Form Compised (NFC)
|
||||
String normName = Normalizer.normalize(name, Normalizer.Form.NFC);
|
||||
if (normName.equals(n)) {
|
||||
this.name = normName;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (name.equalsIgnoreCase(n)) {
|
||||
try {
|
||||
// allow for Windows
|
||||
return file.getCanonicalFile().getName().equals(n);
|
||||
|
@ -56,6 +56,7 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
|
||||
import static com.sun.tools.javac.code.Flags.*;
|
||||
import static com.sun.tools.javac.code.Kinds.*;
|
||||
import static com.sun.tools.javac.code.TypeTag.CLASS;
|
||||
import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
|
||||
import static com.sun.tools.javac.jvm.ClassFile.*;
|
||||
import static com.sun.tools.javac.jvm.ClassFile.Version.*;
|
||||
|
||||
@ -703,6 +704,12 @@ public class ClassReader {
|
||||
sigp++;
|
||||
thrown = thrown.prepend(sigToType());
|
||||
}
|
||||
// if there is a typevar in the throws clause we should state it.
|
||||
for (List<Type> l = thrown; l.nonEmpty(); l = l.tail) {
|
||||
if (l.head.hasTag(TYPEVAR)) {
|
||||
l.head.tsym.flags_field |= THROWS;
|
||||
}
|
||||
}
|
||||
return new MethodType(argtypes,
|
||||
restype,
|
||||
thrown.reverse(),
|
||||
@ -1439,8 +1446,7 @@ public class ClassReader {
|
||||
void attachTypeAnnotations(final Symbol sym) {
|
||||
int numAttributes = nextChar();
|
||||
if (numAttributes != 0) {
|
||||
ListBuffer<TypeAnnotationProxy> proxies =
|
||||
ListBuffer.lb();
|
||||
ListBuffer<TypeAnnotationProxy> proxies = new ListBuffer<>();
|
||||
for (int i = 0; i < numAttributes; i++)
|
||||
proxies.append(readTypeAnnotation());
|
||||
annotate.normal(new TypeAnnotationCompleter(sym, proxies.toList()));
|
||||
@ -1589,7 +1595,7 @@ public class ClassReader {
|
||||
|
||||
{ // See whether there is location info and read it
|
||||
int len = nextByte();
|
||||
ListBuffer<Integer> loc = ListBuffer.lb();
|
||||
ListBuffer<Integer> loc = new ListBuffer<>();
|
||||
for (int i = 0; i < len * TypeAnnotationPosition.TypePathEntry.bytesPerEntry; ++i)
|
||||
loc = loc.append(nextByte());
|
||||
position.location = TypeAnnotationPosition.getTypePathFromBinary(loc.toList());
|
||||
@ -1939,7 +1945,7 @@ public class ClassReader {
|
||||
}
|
||||
|
||||
List<Attribute.TypeCompound> deproxyTypeCompoundList(List<TypeAnnotationProxy> proxies) {
|
||||
ListBuffer<Attribute.TypeCompound> buf = ListBuffer.lb();
|
||||
ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
|
||||
for (TypeAnnotationProxy proxy: proxies) {
|
||||
Attribute.Compound compound = deproxyCompound(proxy.compound);
|
||||
Attribute.TypeCompound typeCompound = new Attribute.TypeCompound(compound, proxy.position);
|
||||
@ -2026,7 +2032,7 @@ public class ClassReader {
|
||||
boolean isVarargs = (flags & VARARGS) != 0;
|
||||
if (isVarargs) {
|
||||
Type varargsElem = args.last();
|
||||
ListBuffer<Type> adjustedArgs = ListBuffer.lb();
|
||||
ListBuffer<Type> adjustedArgs = new ListBuffer<>();
|
||||
for (Type t : args) {
|
||||
adjustedArgs.append(t != varargsElem ?
|
||||
t :
|
||||
|
@ -766,8 +766,8 @@ public class ClassWriter extends ClassFile {
|
||||
int writeTypeAnnotations(List<Attribute.TypeCompound> typeAnnos, boolean inCode) {
|
||||
if (typeAnnos.isEmpty()) return 0;
|
||||
|
||||
ListBuffer<Attribute.TypeCompound> visibles = ListBuffer.lb();
|
||||
ListBuffer<Attribute.TypeCompound> invisibles = ListBuffer.lb();
|
||||
ListBuffer<Attribute.TypeCompound> visibles = new ListBuffer<>();
|
||||
ListBuffer<Attribute.TypeCompound> invisibles = new ListBuffer<>();
|
||||
|
||||
for (Attribute.TypeCompound tc : typeAnnos) {
|
||||
if (tc.hasUnknownPosition()) {
|
||||
|
@ -1595,7 +1595,7 @@ public class Code {
|
||||
|
||||
|
||||
public void compressCatchTable() {
|
||||
ListBuffer<char[]> compressedCatchInfo = ListBuffer.lb();
|
||||
ListBuffer<char[]> compressedCatchInfo = new ListBuffer<>();
|
||||
List<Integer> handlerPcs = List.nil();
|
||||
for (char[] catchEntry : catchInfo) {
|
||||
handlerPcs = handlerPcs.prepend((int)catchEntry[2]);
|
||||
|
@ -67,7 +67,6 @@ import com.sun.tools.javac.util.Log.WriterKind;
|
||||
import static com.sun.tools.javac.code.TypeTag.CLASS;
|
||||
import static com.sun.tools.javac.main.Option.*;
|
||||
import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
|
||||
import static com.sun.tools.javac.util.ListBuffer.lb;
|
||||
|
||||
|
||||
/** This class could be the main entry point for GJC when GJC is used as a
|
||||
@ -586,7 +585,7 @@ public class JavaCompiler {
|
||||
}
|
||||
|
||||
protected final <T> Queue<T> stopIfError(CompileState cs, Queue<T> queue) {
|
||||
return shouldStop(cs) ? ListBuffer.<T>lb() : queue;
|
||||
return shouldStop(cs) ? new ListBuffer<T>() : queue;
|
||||
}
|
||||
|
||||
protected final <T> List<T> stopIfError(CompileState cs, List<T> list) {
|
||||
@ -952,7 +951,7 @@ public class JavaCompiler {
|
||||
return List.nil();
|
||||
|
||||
//parse all files
|
||||
ListBuffer<JCCompilationUnit> trees = lb();
|
||||
ListBuffer<JCCompilationUnit> trees = new ListBuffer<>();
|
||||
Set<JavaFileObject> filesSoFar = new HashSet<JavaFileObject>();
|
||||
for (JavaFileObject fileObject : fileObjects) {
|
||||
if (!filesSoFar.contains(fileObject)) {
|
||||
@ -1002,7 +1001,7 @@ public class JavaCompiler {
|
||||
// then remember the classes declared in
|
||||
// the original compilation units listed on the command line.
|
||||
if (needRootClasses || sourceOutput || stubOutput) {
|
||||
ListBuffer<JCClassDecl> cdefs = lb();
|
||||
ListBuffer<JCClassDecl> cdefs = new ListBuffer<>();
|
||||
for (JCCompilationUnit unit : roots) {
|
||||
for (List<JCTree> defs = unit.defs;
|
||||
defs.nonEmpty();
|
||||
@ -1226,7 +1225,7 @@ public class JavaCompiler {
|
||||
* @returns a list of environments for attributd classes.
|
||||
*/
|
||||
public Queue<Env<AttrContext>> attribute(Queue<Env<AttrContext>> envs) {
|
||||
ListBuffer<Env<AttrContext>> results = lb();
|
||||
ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
|
||||
while (!envs.isEmpty())
|
||||
results.append(attribute(envs.remove()));
|
||||
return stopIfError(CompileState.ATTR, results);
|
||||
@ -1291,7 +1290,7 @@ public class JavaCompiler {
|
||||
* @returns the list of attributed parse trees
|
||||
*/
|
||||
public Queue<Env<AttrContext>> flow(Queue<Env<AttrContext>> envs) {
|
||||
ListBuffer<Env<AttrContext>> results = lb();
|
||||
ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
|
||||
for (Env<AttrContext> env: envs) {
|
||||
flow(env, results);
|
||||
}
|
||||
@ -1302,7 +1301,7 @@ public class JavaCompiler {
|
||||
* Perform dataflow checks on an attributed parse tree.
|
||||
*/
|
||||
public Queue<Env<AttrContext>> flow(Env<AttrContext> env) {
|
||||
ListBuffer<Env<AttrContext>> results = lb();
|
||||
ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
|
||||
flow(env, results);
|
||||
return stopIfError(CompileState.FLOW, results);
|
||||
}
|
||||
@ -1356,7 +1355,7 @@ public class JavaCompiler {
|
||||
* @returns a list containing the classes to be generated
|
||||
*/
|
||||
public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
|
||||
ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = lb();
|
||||
ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = new ListBuffer<>();
|
||||
for (Env<AttrContext> env: envs)
|
||||
desugar(env, results);
|
||||
return stopIfError(CompileState.FLOW, results);
|
||||
@ -1605,7 +1604,7 @@ public class JavaCompiler {
|
||||
}
|
||||
@Override
|
||||
public void visitClassDef(JCClassDecl tree) {
|
||||
ListBuffer<JCTree> newdefs = lb();
|
||||
ListBuffer<JCTree> newdefs = new ListBuffer<>();
|
||||
for (List<JCTree> it = tree.defs; it.tail != null; it = it.tail) {
|
||||
JCTree t = it.head;
|
||||
switch (t.getTag()) {
|
||||
|
@ -207,7 +207,7 @@ public class JavacAnnoConstructs {
|
||||
Attribute[] contained0 = null;
|
||||
if (container != null)
|
||||
contained0 = unpackAttributes(container);
|
||||
ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
|
||||
ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
|
||||
if (contained0 != null) {
|
||||
for (Attribute a : contained0)
|
||||
if (a instanceof Attribute.Compound)
|
||||
@ -328,7 +328,7 @@ public class JavacAnnoConstructs {
|
||||
Attribute[] contained0 = null;
|
||||
if (container != null)
|
||||
contained0 = unpackAttributes(container);
|
||||
ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
|
||||
ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
|
||||
if (contained0 != null) {
|
||||
for (Attribute a : contained0)
|
||||
if (a instanceof Attribute.Compound)
|
||||
|
@ -116,11 +116,7 @@ public class JavacTypes implements javax.lang.model.util.Types {
|
||||
|
||||
public List<Type> directSupertypes(TypeMirror t) {
|
||||
validateTypeNotIn(t, EXEC_OR_PKG);
|
||||
Type type = (Type) t;
|
||||
Type sup = types.supertype(type);
|
||||
return (sup == Type.noType || sup == type || sup == null)
|
||||
? types.interfaces(type)
|
||||
: types.interfaces(type).prepend(sup);
|
||||
return types.directSupertypes((Type) t);
|
||||
}
|
||||
|
||||
public TypeMirror erasure(TypeMirror t) {
|
||||
|
@ -48,7 +48,6 @@ import static com.sun.tools.javac.parser.Tokens.TokenKind.GT;
|
||||
import static com.sun.tools.javac.parser.Tokens.TokenKind.IMPORT;
|
||||
import static com.sun.tools.javac.parser.Tokens.TokenKind.LT;
|
||||
import static com.sun.tools.javac.tree.JCTree.Tag.*;
|
||||
import static com.sun.tools.javac.util.ListBuffer.lb;
|
||||
|
||||
/** The parser maps a token sequence into an abstract syntax
|
||||
* tree. It operates by recursive descent, with code derived
|
||||
@ -1767,7 +1766,7 @@ public class JavacParser implements Parser {
|
||||
/** Arguments = "(" [Expression { COMMA Expression }] ")"
|
||||
*/
|
||||
List<JCExpression> arguments() {
|
||||
ListBuffer<JCExpression> args = lb();
|
||||
ListBuffer<JCExpression> args = new ListBuffer<>();
|
||||
if (token.kind == LPAREN) {
|
||||
nextToken();
|
||||
if (token.kind != RPAREN) {
|
||||
@ -1834,7 +1833,7 @@ public class JavacParser implements Parser {
|
||||
nextToken();
|
||||
return List.nil();
|
||||
} else {
|
||||
ListBuffer<JCExpression> args = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> args = new ListBuffer<>();
|
||||
args.append(((mode & EXPR) == 0) ? typeArgument() : parseType());
|
||||
while (token.kind == COMMA) {
|
||||
nextToken();
|
||||
@ -2175,7 +2174,7 @@ public class JavacParser implements Parser {
|
||||
ListBuffer<JCExpression> dims = new ListBuffer<JCExpression>();
|
||||
|
||||
// maintain array dimension type annotations
|
||||
ListBuffer<List<JCAnnotation>> dimAnnotations = ListBuffer.lb();
|
||||
ListBuffer<List<JCAnnotation>> dimAnnotations = new ListBuffer<>();
|
||||
dimAnnotations.append(annos);
|
||||
|
||||
dims.append(parseExpression());
|
||||
@ -2626,7 +2625,7 @@ public class JavacParser implements Parser {
|
||||
}
|
||||
|
||||
List<JCExpression> catchTypes() {
|
||||
ListBuffer<JCExpression> catchTypes = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> catchTypes = new ListBuffer<>();
|
||||
catchTypes.add(parseType());
|
||||
while (token.kind == BAR) {
|
||||
checkMulticatch();
|
||||
@ -2708,7 +2707,7 @@ public class JavacParser implements Parser {
|
||||
* | { FINAL | '@' Annotation } Type VariableDeclarators
|
||||
*/
|
||||
List<JCStatement> forInit() {
|
||||
ListBuffer<JCStatement> stats = lb();
|
||||
ListBuffer<JCStatement> stats = new ListBuffer<>();
|
||||
int pos = token.pos;
|
||||
if (token.kind == FINAL || token.kind == MONKEYS_AT) {
|
||||
return variableDeclarators(optFinal(0), parseType(), stats).toList();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 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
|
||||
@ -402,7 +402,7 @@ public class Tokens {
|
||||
if (comments == null) {
|
||||
return List.nil();
|
||||
} else {
|
||||
ListBuffer<Comment> buf = ListBuffer.lb();
|
||||
ListBuffer<Comment> buf = new ListBuffer<>();
|
||||
for (Comment c : comments) {
|
||||
if (c.getStyle() == style) {
|
||||
buf.add(c);
|
||||
|
@ -524,9 +524,6 @@ compiler.misc.incompatible.ret.type.in.lambda=\u30E9\u30E0\u30C0\u5F0F\u306E\u62
|
||||
# 0: type
|
||||
compiler.misc.incompatible.ret.type.in.mref=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u623B\u308A\u578B\u304C\u4E0D\u6B63\u3067\u3059\n{0}
|
||||
|
||||
# 0: list of type
|
||||
compiler.err.incompatible.thrown.types.in.lambda=\u30E9\u30E0\u30C0\u5F0F\u3067\u30B9\u30ED\u30FC\u3055\u308C\u305F\u30BF\u30A4\u30D7{0}\u306F\u4E0D\u9069\u5408\u3067\u3059
|
||||
|
||||
# 0: list of type
|
||||
compiler.err.incompatible.thrown.types.in.mref=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u30B9\u30ED\u30FC\u3055\u308C\u305F\u30BF\u30A4\u30D7{0}\u306F\u4E0D\u9069\u5408\u3067\u3059
|
||||
|
||||
@ -642,12 +639,18 @@ compiler.err.repeated.modifier=\u4FEE\u98FE\u5B50\u304C\u7E70\u308A\u8FD4\u3055\
|
||||
# 0: symbol, 1: set of modifier, 2: symbol
|
||||
compiler.err.report.access={0}\u306F{2}\u3067{1}\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u307E\u3059
|
||||
|
||||
# 0: symbol, 1: set of modifier, 2: symbol
|
||||
compiler.misc.report.access={0}\u306F{2}\u3067{1}\u30A2\u30AF\u30BB\u30B9\u3055\u308C\u307E\u3059
|
||||
|
||||
compiler.err.ret.outside.meth=\u30E1\u30BD\u30C3\u30C9\u306E\u5916\u306Ereturn\u6587\u3067\u3059
|
||||
|
||||
compiler.err.signature.doesnt.match.supertype=\u30B7\u30B0\u30CD\u30C1\u30E3\u304C{0}\u306B\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u4E0D\u9069\u5408\u306A\u30B9\u30FC\u30D1\u30FC\u30BF\u30A4\u30D7\u3067\u3059
|
||||
|
||||
compiler.err.signature.doesnt.match.intf=\u30B7\u30B0\u30CD\u30C1\u30E3\u304C{0}\u306B\u4E00\u81F4\u3057\u307E\u305B\u3093\u3002\u4E0D\u9069\u5408\u306A\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3067\u3059
|
||||
|
||||
# 0: number, 1: number
|
||||
compiler.err.method.invoked.with.incorrect.number.arguments=\u30E1\u30BD\u30C3\u30C9\u3092\u8D77\u52D5\u3057\u305F\u5F15\u6570\u306E\u6570\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002\u4E88\u671F\u3055\u308C\u308B\u6570\u306F{0}\u3067\u3059\u304C\u3001{1}\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F
|
||||
|
||||
# 0: symbol, 1: symbol, 2: symbol
|
||||
compiler.err.does.not.override.abstract={0}\u306Fabstract\u3067\u306A\u304F\u3001{2}\u5185\u306Eabstract\u30E1\u30BD\u30C3\u30C9{1}\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3057\u307E\u305B\u3093
|
||||
|
||||
@ -755,6 +758,9 @@ compiler.err.var.might.already.be.assigned=\u5909\u6570{0}\u306F\u3059\u3067\u30
|
||||
# 0: symbol
|
||||
compiler.err.var.might.not.have.been.initialized=\u5909\u6570{0}\u306F\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059
|
||||
|
||||
# 0: symbol
|
||||
compiler.err.var.not.initialized.in.default.constructor=\u5909\u6570{0}\u306F\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3067\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u305B\u3093
|
||||
|
||||
# 0: symbol
|
||||
compiler.err.var.might.be.assigned.in.loop=\u5909\u6570{0}\u306F\u30EB\u30FC\u30D7\u5185\u3067\u4EE3\u5165\u3055\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059
|
||||
|
||||
@ -829,6 +835,14 @@ compiler.note.compressed.diags=\u4E00\u90E8\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\
|
||||
|
||||
compiler.note.potential.lambda.found=\u3053\u306E\u533F\u540D\u5185\u90E8\u30AF\u30E9\u30B9\u3092\u30E9\u30E0\u30C0\u5F0F\u306B\u5909\u63DB\u3067\u304D\u307E\u3059\u3002
|
||||
|
||||
# 0: boolean, 1: symbol
|
||||
compiler.note.lambda.stat=\u30E9\u30E0\u30C0\u5F0F\u3092\u5909\u63DB\u3057\u3066\u3044\u307E\u3059\n\u4EE3\u66FFmetafactory = {0}\n\u5408\u6210\u30E1\u30BD\u30C3\u30C9 = {1}
|
||||
|
||||
# 0: boolean, 1: unused
|
||||
compiler.note.mref.stat=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u3092\u5909\u63DB\u3057\u3066\u3044\u307E\u3059\n\u4EE3\u66FFmetafactory = {0}\n
|
||||
# 0: boolean, 1: symbol
|
||||
compiler.note.mref.stat.1=\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u3092\u5909\u63DB\u3057\u3066\u3044\u307E\u3059\n\u4EE3\u66FFmetafactory = {0}\n\u30D6\u30EA\u30C3\u30B8\u30FB\u30E1\u30BD\u30C3\u30C9 = {1}
|
||||
|
||||
compiler.note.note=\u6CE8\u610F:
|
||||
|
||||
# 0: file name
|
||||
@ -1015,6 +1029,14 @@ compiler.warn.static.not.qualified.by.type=static {0}\u306F\u5F0F\u3067\u306F\u3
|
||||
# 0: string
|
||||
compiler.warn.source.no.bootclasspath=\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9\u304C-source {0}\u3068\u4E00\u7DD2\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
|
||||
|
||||
# 0: string
|
||||
compiler.warn.option.obsolete.source=\u30BD\u30FC\u30B9\u5024{0}\u306F\u5EC3\u6B62\u3055\u308C\u3066\u3044\u3066\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3059
|
||||
|
||||
# 0: string
|
||||
compiler.warn.option.obsolete.target=\u30BF\u30FC\u30B2\u30C3\u30C8\u5024{0}\u306F\u5EC3\u6B62\u3055\u308C\u3066\u3044\u3066\u3001\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u524A\u9664\u3055\u308C\u308B\u4E88\u5B9A\u3067\u3059
|
||||
|
||||
compiler.warn.option.obsolete.suppression=\u5EC3\u6B62\u3055\u308C\u305F\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u3064\u3044\u3066\u306E\u8B66\u544A\u3092\u8868\u793A\u3057\u306A\u3044\u3088\u3046\u306B\u3059\u308B\u306B\u306F\u3001-Xlint:\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
|
||||
|
||||
# 0: name, 1: number, 2: number, 3: number, 4: number
|
||||
compiler.warn.future.attr=\u30D0\u30FC\u30B8\u30E7\u30F3{1}.{2}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3067\u5C0E\u5165\u3055\u308C\u305F{0}\u5C5E\u6027\u306F\u3001\u30D0\u30FC\u30B8\u30E7\u30F3{3}.{4}\u306E\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3067\u306F\u7121\u8996\u3055\u308C\u307E\u3059
|
||||
|
||||
@ -1550,7 +1572,7 @@ compiler.warn.enum.as.identifier=\u30EA\u30EA\u30FC\u30B95\u304B\u3089''enum''\u
|
||||
|
||||
compiler.warn.assert.as.identifier=\u30EA\u30EA\u30FC\u30B91.4\u304B\u3089''assert''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u3001\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n(''assert''\u3092\u30AD\u30FC\u30EF\u30FC\u30C9\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u306B\u306F\u3001-source 1.4\u4EE5\u964D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
|
||||
|
||||
compiler.warn.underscore.as.identifier=\u8B58\u5225\u5B50\u3068\u3057\u3066''_''\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\n(\u8B58\u5225\u5B50\u3068\u3057\u3066\u306E''_''\u306E\u4F7F\u7528\u306F\u3001\u5C06\u6765\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)
|
||||
compiler.warn.underscore.as.identifier=\u8B58\u5225\u5B50\u3068\u3057\u3066''_''\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F\n(\u8B58\u5225\u5B50\u3068\u3057\u3066\u306E''_''\u306E\u4F7F\u7528\u306F\u3001Java SE 8\u3088\u308A\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059)
|
||||
|
||||
compiler.err.enum.as.identifier=\u30EA\u30EA\u30FC\u30B95\u304B\u3089''enum''\u306F\u30AD\u30FC\u30EF\u30FC\u30C9\u306A\u306E\u3067\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\n(''enum''\u3092\u8B58\u5225\u5B50\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u306B\u306F-source 1.4\u4EE5\u524D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044)
|
||||
|
||||
@ -1567,7 +1589,7 @@ compiler.err.cant.annotate.static.class=\u5305\u542B\u3059\u308Bstatic\u306E\u30
|
||||
|
||||
# TODO 308: make a better error message
|
||||
# 0: unused
|
||||
compiler.err.cant.annotate.nested.type=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306F\u6CE8\u91C8\u4ED8\u3051\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
|
||||
compiler.err.cant.annotate.nested.type=static\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30BF\u30A4\u30D7\u306E\u30B9\u30B3\u30FC\u30D7\u30FB\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30C8\u306B\u306F\u6CE8\u91C8\u4ED8\u3051\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093
|
||||
|
||||
# 0: type, 1: type
|
||||
compiler.err.incorrect.receiver.name=\u53D7\u53D6\u308A\u5074\u306E\u540D\u524D\u304C\u3001\u5305\u542B\u3059\u308B\u30AF\u30E9\u30B9\u30FB\u30BF\u30A4\u30D7\u3068\u4E00\u81F4\u3057\u307E\u305B\u3093\n\u5FC5\u9808: {0}\n\u691C\u51FA: {1}
|
||||
|
@ -524,9 +524,6 @@ compiler.misc.incompatible.ret.type.in.lambda=lambda \u8868\u8FBE\u5F0F\u4E2D\u7
|
||||
# 0: type
|
||||
compiler.misc.incompatible.ret.type.in.mref=\u65B9\u6CD5\u5F15\u7528\u4E2D\u7684\u8FD4\u56DE\u7C7B\u578B\u9519\u8BEF\n{0}
|
||||
|
||||
# 0: list of type
|
||||
compiler.err.incompatible.thrown.types.in.lambda=lambda \u8868\u8FBE\u5F0F\u4E2D\u629B\u51FA\u7684\u7C7B\u578B{0}\u4E0D\u517C\u5BB9
|
||||
|
||||
# 0: list of type
|
||||
compiler.err.incompatible.thrown.types.in.mref=\u65B9\u6CD5\u5F15\u7528\u4E2D\u629B\u51FA\u7684\u7C7B\u578B{0}\u4E0D\u517C\u5BB9
|
||||
|
||||
@ -642,12 +639,18 @@ compiler.err.repeated.modifier=\u4FEE\u9970\u7B26\u91CD\u590D
|
||||
# 0: symbol, 1: set of modifier, 2: symbol
|
||||
compiler.err.report.access={0}\u53EF\u4EE5\u5728{2}\u4E2D\u8BBF\u95EE{1}
|
||||
|
||||
# 0: symbol, 1: set of modifier, 2: symbol
|
||||
compiler.misc.report.access={0}\u53EF\u4EE5\u5728{2}\u4E2D\u8BBF\u95EE{1}
|
||||
|
||||
compiler.err.ret.outside.meth=\u8FD4\u56DE\u5916\u90E8\u65B9\u6CD5
|
||||
|
||||
compiler.err.signature.doesnt.match.supertype=\u7B7E\u540D\u4E0E{0}\u4E0D\u5339\u914D; \u4E0D\u517C\u5BB9\u7684\u8D85\u7C7B\u578B
|
||||
|
||||
compiler.err.signature.doesnt.match.intf=\u7B7E\u540D\u4E0E{0}\u4E0D\u5339\u914D; \u4E0D\u517C\u5BB9\u7684\u63A5\u53E3
|
||||
|
||||
# 0: number, 1: number
|
||||
compiler.err.method.invoked.with.incorrect.number.arguments=\u4F7F\u7528\u4E0D\u6B63\u786E\u6570\u91CF\u7684\u53C2\u6570\u8C03\u7528\u4E86\u65B9\u6CD5; \u9884\u671F\u4E3A {0} \u4E2A, \u627E\u5230 {1} \u4E2A
|
||||
|
||||
# 0: symbol, 1: symbol, 2: symbol
|
||||
compiler.err.does.not.override.abstract={0}\u4E0D\u662F\u62BD\u8C61\u7684, \u5E76\u4E14\u672A\u8986\u76D6{2}\u4E2D\u7684\u62BD\u8C61\u65B9\u6CD5{1}
|
||||
|
||||
@ -755,6 +758,9 @@ compiler.err.var.might.already.be.assigned=\u53EF\u80FD\u5DF2\u5206\u914D\u53D8\
|
||||
# 0: symbol
|
||||
compiler.err.var.might.not.have.been.initialized=\u53EF\u80FD\u5C1A\u672A\u521D\u59CB\u5316\u53D8\u91CF{0}
|
||||
|
||||
# 0: symbol
|
||||
compiler.err.var.not.initialized.in.default.constructor=\u53D8\u91CF {0} \u672A\u5728\u9ED8\u8BA4\u6784\u9020\u5668\u4E2D\u521D\u59CB\u5316
|
||||
|
||||
# 0: symbol
|
||||
compiler.err.var.might.be.assigned.in.loop=\u53EF\u80FD\u5728 loop \u4E2D\u5206\u914D\u4E86\u53D8\u91CF{0}
|
||||
|
||||
@ -829,6 +835,14 @@ compiler.note.compressed.diags=\u67D0\u4E9B\u6D88\u606F\u5DF2\u7ECF\u8FC7\u7B80\
|
||||
|
||||
compiler.note.potential.lambda.found=\u53EF\u5C06\u6B64\u533F\u540D\u5185\u90E8\u7C7B\u521B\u5EFA\u8F6C\u6362\u4E3A lambda \u8868\u8FBE\u5F0F\u3002
|
||||
|
||||
# 0: boolean, 1: symbol
|
||||
compiler.note.lambda.stat=\u8F6C\u6362 lambda \u8868\u8FBE\u5F0F\n\u66FF\u4EE3 metafactory = {0}\n\u5408\u6210\u65B9\u6CD5 = {1}
|
||||
|
||||
# 0: boolean, 1: unused
|
||||
compiler.note.mref.stat=\u8F6C\u6362\u65B9\u6CD5\u5F15\u7528\n\u66FF\u4EE3 metafactory = {0}\n
|
||||
# 0: boolean, 1: symbol
|
||||
compiler.note.mref.stat.1=\u8F6C\u6362\u65B9\u6CD5\u5F15\u7528\n\u66FF\u4EE3 metafactory = {0}\nbridge \u65B9\u6CD5 = {1}
|
||||
|
||||
compiler.note.note=\u6CE8:
|
||||
|
||||
# 0: file name
|
||||
@ -1015,6 +1029,14 @@ compiler.warn.static.not.qualified.by.type=static {0}\u5E94\u7531\u7C7B\u578B\u5
|
||||
# 0: string
|
||||
compiler.warn.source.no.bootclasspath=\u672A\u4E0E -source {0} \u4E00\u8D77\u8BBE\u7F6E\u5F15\u5BFC\u7C7B\u8DEF\u5F84
|
||||
|
||||
# 0: string
|
||||
compiler.warn.option.obsolete.source=\u6E90\u503C{0}\u5DF2\u8FC7\u65F6, \u5C06\u5728\u672A\u6765\u6240\u6709\u53D1\u884C\u7248\u4E2D\u5220\u9664
|
||||
|
||||
# 0: string
|
||||
compiler.warn.option.obsolete.target=\u76EE\u6807\u503C{0}\u5DF2\u8FC7\u65F6, \u5C06\u5728\u672A\u6765\u6240\u6709\u53D1\u884C\u7248\u4E2D\u5220\u9664
|
||||
|
||||
compiler.warn.option.obsolete.suppression=\u8981\u9690\u85CF\u6709\u5173\u5DF2\u8FC7\u65F6\u9009\u9879\u7684\u8B66\u544A, \u8BF7\u4F7F\u7528 -Xlint:-options\u3002
|
||||
|
||||
# 0: name, 1: number, 2: number, 3: number, 4: number
|
||||
compiler.warn.future.attr={1}.{2} \u7248\u7C7B\u6587\u4EF6\u4E2D\u5F15\u5165\u7684 {0} \u5C5E\u6027\u5728 {3}.{4} \u7248\u7C7B\u6587\u4EF6\u4E2D\u88AB\u5FFD\u7565
|
||||
|
||||
@ -1550,7 +1572,7 @@ compiler.warn.enum.as.identifier=\u4ECE\u53D1\u884C\u7248 5 \u5F00\u59CB, ''enum
|
||||
|
||||
compiler.warn.assert.as.identifier=\u4ECE\u53D1\u884C\u7248 1.4 \u5F00\u59CB, ''assert'' \u662F\u4E00\u4E2A\u5173\u952E\u5B57, \u4F46\u4E0D\u80FD\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u8BF7\u4F7F\u7528 -source 1.4 \u6216\u66F4\u9AD8\u7248\u672C\u4EE5\u5C06 ''assert'' \u7528\u4F5C\u5173\u952E\u5B57)
|
||||
|
||||
compiler.warn.underscore.as.identifier=''_'' \u5DF2\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u4EE5\u540E\u7684\u53D1\u884C\u7248\u53EF\u80FD\u4E0D\u652F\u6301\u5C06 ''_'' \u7528\u4F5C\u6807\u8BC6\u7B26)
|
||||
compiler.warn.underscore.as.identifier=''_'' \u7528\u4F5C\u6807\u8BC6\u7B26\n(Java SE 8 \u4E4B\u540E\u7684\u53D1\u884C\u7248\u4E2D\u53EF\u80FD\u4E0D\u652F\u6301\u4F7F\u7528 ''_'' \u4F5C\u4E3A\u6807\u8BC6\u7B26)
|
||||
|
||||
compiler.err.enum.as.identifier=\u4ECE\u53D1\u884C\u7248 5 \u5F00\u59CB, ''enum'' \u4E3A\u5173\u952E\u5B57, \u800C\u4E0D\u7528\u4F5C\u6807\u8BC6\u7B26\n(\u8BF7\u4F7F\u7528 -source 1.4 \u6216\u66F4\u4F4E\u7248\u672C\u4EE5\u5C06 ''enum'' \u7528\u4F5C\u6807\u8BC6\u7B26)
|
||||
|
||||
@ -1567,7 +1589,7 @@ compiler.err.cant.annotate.static.class=\u65E0\u6CD5\u5BF9\u5C01\u95ED\u9759\u60
|
||||
|
||||
# TODO 308: make a better error message
|
||||
# 0: unused
|
||||
compiler.err.cant.annotate.nested.type=\u65E0\u6CD5\u5BF9\u5D4C\u5957\u7C7B\u578B\u8FDB\u884C\u6CE8\u91CA
|
||||
compiler.err.cant.annotate.nested.type=\u65E0\u6CD5\u6CE8\u91CA\u7528\u4E8E\u9759\u6001\u5D4C\u5957\u7C7B\u578B\u7684\u786E\u5B9A\u4F5C\u7528\u57DF\u7ED3\u6784
|
||||
|
||||
# 0: type, 1: type
|
||||
compiler.err.incorrect.receiver.name=\u63A5\u6536\u65B9\u540D\u79F0\u4E0E\u5C01\u95ED\u7C7B\u7C7B\u578B\u4E0D\u5339\u914D\n\u9700\u8981: {0}\n\u627E\u5230: {1}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 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
|
||||
@ -87,8 +87,12 @@ javac.opt.arg.file=<filename>
|
||||
javac.opt.Xlint=\u63A8\u5968\u306E\u8B66\u544A\u3092\u6709\u52B9\u306B\u3059\u308B
|
||||
javac.opt.Xlint.suboptlist=\u7279\u5B9A\u306E\u8B66\u544A\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3059\u308B
|
||||
javac.opt.Xdoclint=javadoc\u30B3\u30E1\u30F3\u30C8\u306E\u554F\u984C\u306B\u95A2\u3059\u308B\u63A8\u5968\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B
|
||||
javac.opt.Xdoclint.subopts = (all|[-]<group>)[/<access>]
|
||||
javac.opt.Xdoclint.custom=\n javadoc\u30B3\u30E1\u30F3\u30C8\u306E\u554F\u984C\u306B\u95A2\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<group>\u306Faccessibility\u3001html\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3001\n <access>\u306Fpublic\u3001protected\u3001package\u307E\u305F\u306Fprivate\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002
|
||||
# L10N: do not localize: all none
|
||||
javac.opt.Xdoclint.subopts = (all|none|[-]<group>)[/<access>]
|
||||
|
||||
# L10N: do not localize: accessibility html missing reference syntax
|
||||
# L10N: do not localize: public protected package private
|
||||
javac.opt.Xdoclint.custom=\n javadoc\u30B3\u30E1\u30F3\u30C8\u306E\u554F\u984C\u306B\u95A2\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<group>\u306Faccessibility\u3001html\u3001missing\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3001\n <access>\u306Fpublic\u3001protected\u3001package\u307E\u305F\u306Fprivate\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002
|
||||
javac.opt.Xstdout=\u6A19\u6E96\u51FA\u529B\u3092\u30EA\u30C0\u30A4\u30EC\u30AF\u30C8\u3059\u308B
|
||||
javac.opt.X=\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B
|
||||
javac.opt.help=\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B
|
||||
@ -105,6 +109,7 @@ javac.err.empty.A.argument=-A\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3
|
||||
javac.err.invalid.arg={0}\u306F\u7121\u52B9\u306A\u5F15\u6570\u3067\u3059
|
||||
javac.err.invalid.A.key=\u6CE8\u91C8\u30D7\u30ED\u30BB\u30C3\u30B5\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3''{0}''\u306E\u30AD\u30FC\u306B\u6307\u5B9A\u3055\u308C\u3066\u3044\u308B\u4E00\u9023\u306E\u8B58\u5225\u5B50\u304C\u3001\u30C9\u30C3\u30C8\u3067\u533A\u5207\u3089\u308C\u3066\u3044\u307E\u305B\u3093
|
||||
javac.err.invalid.flag={0}\u306F\u7121\u52B9\u306A\u30D5\u30E9\u30B0\u3067\u3059
|
||||
javac.err.profile.bootclasspath.conflict=profile\u3068bootclasspath\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u540C\u6642\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
|
||||
javac.err.invalid.profile=\u7121\u52B9\u306A\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB: {0}
|
||||
javac.err.invalid.target={0}\u306F\u7121\u52B9\u306A\u30BF\u30FC\u30B2\u30C3\u30C8\u30FB\u30EA\u30EA\u30FC\u30B9\u3067\u3059
|
||||
javac.err.no.source.files=\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 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
|
||||
@ -87,8 +87,12 @@ javac.opt.arg.file=<\u6587\u4EF6\u540D>
|
||||
javac.opt.Xlint=\u542F\u7528\u5EFA\u8BAE\u7684\u8B66\u544A
|
||||
javac.opt.Xlint.suboptlist=\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u7684\u8B66\u544A
|
||||
javac.opt.Xdoclint=\u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u5EFA\u8BAE\u7684\u68C0\u67E5
|
||||
javac.opt.Xdoclint.subopts = (all|[-]<group>)[/<access>]
|
||||
javac.opt.Xdoclint.custom=\n \u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5,\n \u5176\u4E2D <group> \u4E3A\u53EF\u8BBF\u95EE\u6027, html, \u5F15\u7528\u6216\u8BED\u6CD5\u4E4B\u4E00,\n <access> \u4E3A public, protected, package \u6216 private \u4E4B\u4E00\u3002
|
||||
# L10N: do not localize: all none
|
||||
javac.opt.Xdoclint.subopts = (all|none|[-]<group>)[/<access>]
|
||||
|
||||
# L10N: do not localize: accessibility html missing reference syntax
|
||||
# L10N: do not localize: public protected package private
|
||||
javac.opt.Xdoclint.custom=\n \u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5,\n \u5176\u4E2D <group> \u4E3A accessibility, html, missing, reference \u6216 syntax \u4E4B\u4E00\u3002\n <access> \u4E3A public, protected, package \u6216 private \u4E4B\u4E00\u3002
|
||||
javac.opt.Xstdout=\u91CD\u5B9A\u5411\u6807\u51C6\u8F93\u51FA
|
||||
javac.opt.X=\u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981
|
||||
javac.opt.help=\u8F93\u51FA\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981
|
||||
@ -105,6 +109,7 @@ javac.err.empty.A.argument=-A \u9700\u8981\u4E00\u4E2A\u53C2\u6570; \u4F7F\u7528
|
||||
javac.err.invalid.arg=\u65E0\u6548\u7684\u53C2\u6570: {0}
|
||||
javac.err.invalid.A.key=\u6CE8\u91CA\u5904\u7406\u7A0B\u5E8F\u9009\u9879 ''{0}'' \u4E2D\u7684\u5173\u952E\u5B57\u4E0D\u662F\u4EE5\u70B9\u5206\u9694\u7684\u6807\u8BC6\u7B26\u5E8F\u5217
|
||||
javac.err.invalid.flag=\u65E0\u6548\u7684\u6807\u8BB0: {0}
|
||||
javac.err.profile.bootclasspath.conflict=\u6982\u8981\u4FE1\u606F\u548C\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u9009\u9879\u4E0D\u80FD\u540C\u65F6\u4F7F\u7528
|
||||
javac.err.invalid.profile=\u914D\u7F6E\u6587\u4EF6\u65E0\u6548: {0}
|
||||
javac.err.invalid.target=\u65E0\u6548\u7684\u76EE\u6807\u53D1\u884C\u7248: {0}
|
||||
javac.err.no.source.files=\u65E0\u6E90\u6587\u4EF6
|
||||
|
@ -234,7 +234,7 @@ public class TreeCopier<P> implements TreeVisitor<JCTree,P> {
|
||||
public JCTree visitLabeledStatement(LabeledStatementTree node, P p) {
|
||||
JCLabeledStatement t = (JCLabeledStatement) node;
|
||||
JCStatement body = copy(t.body, p);
|
||||
return M.at(t.pos).Labelled(t.label, t.body);
|
||||
return M.at(t.pos).Labelled(t.label, body);
|
||||
}
|
||||
|
||||
public JCTree visitLiteral(LiteralTree node, P p) {
|
||||
|
@ -946,6 +946,7 @@ public class TreeMaker implements JCTree.Factory {
|
||||
boolean isUnqualifiable(Symbol sym) {
|
||||
if (sym.name == names.empty ||
|
||||
sym.owner == null ||
|
||||
sym.owner == syms.rootPackage ||
|
||||
sym.owner.kind == MTH || sym.owner.kind == VAR) {
|
||||
return true;
|
||||
} else if (sym.kind == TYP && toplevel != null) {
|
||||
|
@ -103,8 +103,8 @@ public class GraphUtils {
|
||||
* directed graph in linear time. Works on TarjanNode.
|
||||
*/
|
||||
public static <D, N extends TarjanNode<D>> List<? extends List<? extends N>> tarjan(Iterable<? extends N> nodes) {
|
||||
ListBuffer<List<N>> cycles = ListBuffer.lb();
|
||||
ListBuffer<N> stack = ListBuffer.lb();
|
||||
ListBuffer<List<N>> cycles = new ListBuffer<>();
|
||||
ListBuffer<N> stack = new ListBuffer<>();
|
||||
int index = 0;
|
||||
for (N node: nodes) {
|
||||
if (node.index == -1) {
|
||||
@ -132,7 +132,7 @@ public class GraphUtils {
|
||||
}
|
||||
if (v.lowlink == v.index) {
|
||||
N n;
|
||||
ListBuffer<N> cycle = ListBuffer.lb();
|
||||
ListBuffer<N> cycle = new ListBuffer<>();
|
||||
do {
|
||||
n = stack.remove();
|
||||
n.active = false;
|
||||
|
@ -97,7 +97,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
|
||||
}
|
||||
|
||||
public List<A> intersect(List<A> that) {
|
||||
ListBuffer<A> buf = ListBuffer.lb();
|
||||
ListBuffer<A> buf = new ListBuffer<>();
|
||||
for (A el : this) {
|
||||
if (that.contains(el)) {
|
||||
buf.append(el);
|
||||
@ -107,7 +107,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
|
||||
}
|
||||
|
||||
public List<A> diff(List<A> that) {
|
||||
ListBuffer<A> buf = ListBuffer.lb();
|
||||
ListBuffer<A> buf = new ListBuffer<>();
|
||||
for (A el : this) {
|
||||
if (!that.contains(el)) {
|
||||
buf.append(el);
|
||||
@ -120,7 +120,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
|
||||
* Create a new list from the first {@code n} elements of this list
|
||||
*/
|
||||
public List<A> take(int n) {
|
||||
ListBuffer<A> buf = ListBuffer.lb();
|
||||
ListBuffer<A> buf = new ListBuffer<>();
|
||||
int count = 0;
|
||||
for (A el : this) {
|
||||
if (count++ == n) break;
|
||||
@ -167,7 +167,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
|
||||
}
|
||||
|
||||
public static <A> List<A> from(Iterable<? extends A> coll) {
|
||||
ListBuffer<A> xs = ListBuffer.lb();
|
||||
ListBuffer<A> xs = new ListBuffer<>();
|
||||
for (A a : coll) {
|
||||
xs.append(a);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 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,10 +40,6 @@ import java.util.NoSuchElementException;
|
||||
*/
|
||||
public class ListBuffer<A> extends AbstractQueue<A> {
|
||||
|
||||
public static <T> ListBuffer<T> lb() {
|
||||
return new ListBuffer<T>();
|
||||
}
|
||||
|
||||
public static <T> ListBuffer<T> of(T x) {
|
||||
ListBuffer<T> lb = new ListBuffer<T>();
|
||||
lb.add(x);
|
||||
|
@ -123,7 +123,7 @@ public class Log extends AbstractLog {
|
||||
* active diagnostic handler.
|
||||
*/
|
||||
public static class DeferredDiagnosticHandler extends DiagnosticHandler {
|
||||
private Queue<JCDiagnostic> deferred = ListBuffer.lb();
|
||||
private Queue<JCDiagnostic> deferred = new ListBuffer<>();
|
||||
private final Filter<JCDiagnostic> filter;
|
||||
|
||||
public DeferredDiagnosticHandler(Log log) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 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
|
||||
@ -27,8 +27,13 @@ main.errors=\u30A8\u30E9\u30FC{0}\u500B
|
||||
main.error=\u30A8\u30E9\u30FC{0}\u500B
|
||||
main.warnings=\u8B66\u544A{0}\u500B
|
||||
main.warning=\u8B66\u544A{0}\u500B
|
||||
main.usage=\u4F7F\u7528\u65B9\u6CD5: javadoc [options] [packagenames] [sourcefiles] [@files]\n-overview <file> HTML\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u6982\u8981\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u3080\n-public public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u306E\u307F\u3092\u793A\u3059\n-protected protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059(\u30C7\u30D5\u30A9\u30EB\u30C8)\n-package package/protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n-private \u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n-help \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n-doclet <class> \u4EE3\u66FFdoclet\u3092\u4ECB\u3057\u3066\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n-docletpath <path> doclet\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u63A2\u3059\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-sourcepath <pathlist> \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-classpath <pathlist> \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n-exclude <pkglist> \u9664\u5916\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u6307\u5B9A\u3059\u308B\n-subpackages <subpkglist> \u518D\u5E30\u7684\u306B\u30ED\u30FC\u30C9\u3059\u308B\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6307\u5B9A\u3059\u308B\n-breakiterator BreakIterator\u3067\u6700\u521D\u306E\u6587\u3092\u8A08\u7B97\u3059\u308B\n-bootclasspath <pathlist> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u306B\u3088\u308A\u30ED\u30FC\u30C9\u3055\u308C\u305F\n\t\t\t \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n-source <release> \u6307\u5B9A\u3055\u308C\u305F\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u63D0\u4F9B\u3059\u308B\n-extdirs <dirlist> \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u305F\u62E1\u5F35\u6A5F\u80FD\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n-verbose Javadoc\u306E\u52D5\u4F5C\u306B\u3064\u3044\u3066\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n-locale <name> en_US\u3084en_US_WIN\u306A\u3069\u306E\u4F7F\u7528\u3059\u308B\u30ED\u30B1\u30FC\u30EB\n-encoding <name> \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D\n-quiet \u72B6\u614B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u306A\u3044\n-J<flag> <flag>\u3092\u5B9F\u884C\u6642\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059\n-X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3059\u308B\n
|
||||
main.Xusage=-Xmaxerrs <number> \u51FA\u529B\u3059\u308B\u30A8\u30E9\u30FC\u306E\u6700\u5927\u6570\u3092\u8A2D\u5B9A\u3059\u308B\n-Xmaxwarns <number> \u51FA\u529B\u3059\u308B\u8B66\u544A\u306E\u6700\u5927\u6570\u3092\u8A2D\u5B9A\u3059\u308B\n\n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
|
||||
main.usage=\u4F7F\u7528\u65B9\u6CD5: javadoc [options] [packagenames] [sourcefiles] [@files]\n -overview <file> HTML\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u6982\u8981\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u8AAD\u307F\u8FBC\u3080\n -public public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u306E\u307F\u3092\u793A\u3059\n -protected protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -package package/protected/public\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n -private \u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3068\u30E1\u30F3\u30D0\u30FC\u3092\u793A\u3059\n -help \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30FB\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n -doclet <class> \u4EE3\u66FFdoclet\u3092\u4ECB\u3057\u3066\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n -docletpath <path> doclet\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u63A2\u3059\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n -sourcepath <pathlist> \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n -classpath <pathlist> \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\n -cp <pathlist> \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u3042\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B\r\n -exclude <pkglist> \u9664\u5916\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u6307\u5B9A\u3059\u308B\n -subpackages <subpkglist> \u518D\u5E30\u7684\u306B\u30ED\u30FC\u30C9\u3059\u308B\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6307\u5B9A\u3059\u308B\n -breakiterator BreakIterator\u3067\u6700\u521D\u306E\u6587\u3092\u8A08\u7B97\u3059\u308B\n -bootclasspath <pathlist> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30ED\u30FC\u30C0\u30FC\u306B\u3088\u308A\u30ED\u30FC\u30C9\u3055\u308C\u305F\n \u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -source <release> \u6307\u5B9A\u3055\u308C\u305F\u30EA\u30EA\u30FC\u30B9\u3068\u30BD\u30FC\u30B9\u306E\u4E92\u63DB\u6027\u3092\u63D0\u4F9B\u3059\u308B\n -extdirs <dirlist> \u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u305F\u62E1\u5F35\u6A5F\u80FD\u306E\u5834\u6240\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -verbose Javadoc\u306E\u52D5\u4F5C\u306B\u3064\u3044\u3066\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u51FA\u529B\u3059\u308B\n -locale <name> en_US\u3084en_US_WIN\u306A\u3069\u306E\u4F7F\u7528\u3059\u308B\u30ED\u30B1\u30FC\u30EB\n -encoding <name> \u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u540D\n -quiet \u72B6\u614B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u306A\u3044\n -J<flag> <flag>\u3092\u5B9F\u884C\u6642\u30B7\u30B9\u30C6\u30E0\u306B\u76F4\u63A5\u6E21\u3059\n -X \u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u6982\u8981\u3092\u51FA\u529B\u3057\u7D42\u4E86\u3059\u308B\n
|
||||
|
||||
main.Xusage=\ -Xmaxerrs <number> \u51FA\u529B\u3059\u308B\u30A8\u30E9\u30FC\u306E\u6700\u5927\u6570\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmaxwarns <number> \u51FA\u529B\u3059\u308B\u8B66\u544A\u306E\u6700\u5927\u6570\u3092\u8A2D\u5B9A\u3059\u308B\n
|
||||
|
||||
main.Xusage.foot=\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
|
||||
main.option.already.seen={0}\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u8907\u6570\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002
|
||||
main.requires_argument=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u306B\u306F\u5F15\u6570\u304C\u5FC5\u8981\u3067\u3059\u3002
|
||||
main.locale_first=\u30AA\u30D7\u30B7\u30E7\u30F3-locale\u306F\u3001\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u306E\u6700\u521D\u306B\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 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
|
||||
@ -27,8 +27,13 @@ main.errors={0} \u4E2A\u9519\u8BEF
|
||||
main.error={0} \u4E2A\u9519\u8BEF
|
||||
main.warnings={0} \u4E2A\u8B66\u544A
|
||||
main.warning={0} \u4E2A\u8B66\u544A
|
||||
main.usage=\u7528\u6CD5: javadoc [options] [packagenames] [sourcefiles] [@files]\n-overview <file> \u4ECE HTML \u6587\u4EF6\u8BFB\u53D6\u6982\u89C8\u6587\u6863\n-public \u4EC5\u663E\u793A public \u7C7B\u548C\u6210\u5458\n-protected \u663E\u793A protected/public \u7C7B\u548C\u6210\u5458 (\u9ED8\u8BA4\u503C)\n-package \u663E\u793A package/protected/public \u7C7B\u548C\u6210\u5458\n-private \u663E\u793A\u6240\u6709\u7C7B\u548C\u6210\u5458\n-help \u663E\u793A\u547D\u4EE4\u884C\u9009\u9879\u5E76\u9000\u51FA\n-doclet <class> \u901A\u8FC7\u66FF\u4EE3 doclet \u751F\u6210\u8F93\u51FA\n-docletpath <path> \u6307\u5B9A\u67E5\u627E doclet \u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n-sourcepath <pathlist> \u6307\u5B9A\u67E5\u627E\u6E90\u6587\u4EF6\u7684\u4F4D\u7F6E\n-classpath <pathlist> \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n-exclude <pkglist> \u6307\u5B9A\u8981\u6392\u9664\u7684\u7A0B\u5E8F\u5305\u5217\u8868\n-subpackages <subpkglist> \u6307\u5B9A\u8981\u9012\u5F52\u52A0\u8F7D\u7684\u5B50\u7A0B\u5E8F\u5305\n-breakiterator \u8BA1\u7B97\u5E26\u6709 BreakIterator \u7684\u7B2C\u4E00\u4E2A\u8BED\u53E5\n-bootclasspath <pathlist> \u8986\u76D6\u7531\u5F15\u5BFC\u7C7B\u52A0\u8F7D\u5668\u6240\u52A0\u8F7D\u7684\n\t\t\t \u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n-source <release> \u63D0\u4F9B\u4E0E\u6307\u5B9A\u53D1\u884C\u7248\u7684\u6E90\u517C\u5BB9\u6027\n-extdirs <dirlist> \u8986\u76D6\u6240\u5B89\u88C5\u6269\u5C55\u7684\u4F4D\u7F6E\n-verbose \u8F93\u51FA\u6709\u5173 Javadoc \u6B63\u5728\u6267\u884C\u7684\u64CD\u4F5C\u7684\u4FE1\u606F\n-locale <name> \u8981\u4F7F\u7528\u7684\u533A\u57DF\u8BBE\u7F6E, \u4F8B\u5982 en_US \u6216 en_US_WIN\n-encoding <name> \u6E90\u6587\u4EF6\u7F16\u7801\u540D\u79F0\n-quiet \u4E0D\u663E\u793A\u72B6\u6001\u6D88\u606F\n-J<flag> \u76F4\u63A5\u5C06 <flag> \u4F20\u9012\u5230\u8FD0\u884C\u65F6\u7CFB\u7EDF\n-X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981\n
|
||||
main.Xusage=-Xmaxerrs <number> \u8BBE\u7F6E\u8981\u8F93\u51FA\u7684\u6700\u5927\u9519\u8BEF\u6570\n-Xmaxwarns <number> \u8BBE\u7F6E\u8981\u8F93\u51FA\u7684\u6700\u5927\u8B66\u544A\u6570\n\n\u8FD9\u4E9B\u9009\u9879\u90FD\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002
|
||||
|
||||
main.usage=\u7528\u6CD5: javadoc [options] [packagenames] [sourcefiles] [@files]\n -overview <file> \u4ECE HTML \u6587\u4EF6\u8BFB\u53D6\u6982\u89C8\u6587\u6863\n -public \u4EC5\u663E\u793A public \u7C7B\u548C\u6210\u5458\n -protected \u663E\u793A protected/public \u7C7B\u548C\u6210\u5458 (\u9ED8\u8BA4\u503C)\n -package \u663E\u793A package/protected/public \u7C7B\u548C\u6210\u5458\n -private \u663E\u793A\u6240\u6709\u7C7B\u548C\u6210\u5458\n -help \u663E\u793A\u547D\u4EE4\u884C\u9009\u9879\u5E76\u9000\u51FA\n -doclet <class> \u901A\u8FC7\u66FF\u4EE3 doclet \u751F\u6210\u8F93\u51FA\n -docletpath <path> \u6307\u5B9A\u67E5\u627E doclet \u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n -sourcepath <pathlist> \u6307\u5B9A\u67E5\u627E\u6E90\u6587\u4EF6\u7684\u4F4D\u7F6E\n -classpath <pathlist> \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n -cp <pathlist> \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n -exclude <pkglist> \u6307\u5B9A\u8981\u6392\u9664\u7684\u7A0B\u5E8F\u5305\u5217\u8868\n -subpackages <subpkglist> \u6307\u5B9A\u8981\u9012\u5F52\u52A0\u8F7D\u7684\u5B50\u7A0B\u5E8F\u5305\n -breakiterator \u8BA1\u7B97\u5E26\u6709 BreakIterator \u7684\u7B2C\u4E00\u4E2A\u8BED\u53E5\n -bootclasspath <pathlist> \u8986\u76D6\u7531\u5F15\u5BFC\u7C7B\u52A0\u8F7D\u5668\u6240\u52A0\u8F7D\u7684\n \u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n -source <release> \u63D0\u4F9B\u4E0E\u6307\u5B9A\u53D1\u884C\u7248\u7684\u6E90\u517C\u5BB9\u6027\n -extdirs <dirlist> \u8986\u76D6\u6240\u5B89\u88C5\u6269\u5C55\u7684\u4F4D\u7F6E\n -verbose \u8F93\u51FA\u6709\u5173 Javadoc \u6B63\u5728\u6267\u884C\u7684\u64CD\u4F5C\u7684\u4FE1\u606F\n -locale <name> \u8981\u4F7F\u7528\u7684\u533A\u57DF\u8BBE\u7F6E, \u4F8B\u5982 en_US \u6216 en_US_WIN\n -encoding <name> \u6E90\u6587\u4EF6\u7F16\u7801\u540D\u79F0\n -quiet \u4E0D\u663E\u793A\u72B6\u6001\u6D88\u606F\n -J<flag> \u76F4\u63A5\u5C06 <flag> \u4F20\u9012\u5230\u8FD0\u884C\u65F6\u7CFB\u7EDF\n -X \u8F93\u51FA\u975E\u6807\u51C6\u9009\u9879\u7684\u63D0\u8981\n
|
||||
|
||||
main.Xusage=\ -Xmaxerrs <number> \u8BBE\u7F6E\u8981\u8F93\u51FA\u7684\u6700\u5927\u9519\u8BEF\u6570\n -Xmaxwarns <number> \u8BBE\u7F6E\u8981\u8F93\u51FA\u7684\u6700\u5927\u8B66\u544A\u6570\n
|
||||
|
||||
main.Xusage.foot=\u8FD9\u4E9B\u9009\u9879\u90FD\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002
|
||||
|
||||
main.option.already.seen={0}\u9009\u9879\u53EA\u80FD\u6307\u5B9A\u4E00\u6B21\u3002
|
||||
main.requires_argument=\u9009\u9879{0}\u9700\u8981\u53C2\u6570\u3002
|
||||
main.locale_first=\u5728\u547D\u4EE4\u884C\u4E2D, \u9009\u9879 -locale \u5FC5\u987B\u4E3A\u7B2C\u4E00\u4E2A\u9009\u9879\u3002
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1998, 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
|
||||
@ -49,7 +49,7 @@ tracing.not.supported=\u8B66\u544A: \u30C8\u30EC\u30FC\u30B9\u306F\u73FE\u5728\u
|
||||
#
|
||||
# Usage message.
|
||||
#
|
||||
usage=\u4F7F\u7528\u65B9\u6CD5: javah [options] <classes>\n\n[options]\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n\n\t-help \u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n\t-classpath <path> \u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9\n\t-bootclasspath <path> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9\n\t-d<dir> \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n\t-o <file> \u51FA\u529B\u30D5\u30A1\u30A4\u30EB(-d\u304B-o\u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u4F7F\u7528\u3059\u308B)\n\t-jni JNI\u5F62\u5F0F\u306E\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n\t-version \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3059\u308B\n\t-verbose \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n\t-force \u5E38\u306B\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u3092\u66F8\u304D\u8FBC\u3080\n\n<classes> \u306F\u5B8C\u5168\u6307\u5B9A\u306E\u540D\u524D\u3067\u6307\u5B9A\u3057\u307E\u3059\n(java.lang.Object\u306A\u3069)\u3002\n
|
||||
usage=\u4F7F\u7528\u65B9\u6CD5: javah [options] <classes>\n\n[options]\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n\n\t-help \u30D8\u30EB\u30D7\u30FB\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u3066\u7D42\u4E86\u3059\u308B\n\t-classpath <path> \u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9\n\t-cp <path> \u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9\r\n\t-bootclasspath <path> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9\n\t-d<dir> \u51FA\u529B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n\t-o <file> \u51FA\u529B\u30D5\u30A1\u30A4\u30EB(-d\u304B-o\u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u4F7F\u7528\u3059\u308B)\n\t-jni JNI\u5F62\u5F0F\u306E\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n\t-version \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3059\u308B\n\t-verbose \u8A73\u7D30\u306A\u51FA\u529B\u3092\u884C\u3046\n\t-force \u5E38\u306B\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u3092\u66F8\u304D\u8FBC\u3080\n\n<classes>\u306F\u5B8C\u5168\u6307\u5B9A\u306E\u540D\u524D\u3067\u6307\u5B9A\u3057\u307E\u3059\n(java.lang.Object\u306A\u3069)\u3002\n
|
||||
|
||||
main.usage=\u4F7F\u7528\u65B9\u6CD5: \n javah [options] <classes>\n[options]\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
main.opt.o=\ -o <file> \u51FA\u529B\u30D5\u30A1\u30A4\u30EB(-d\u304B-o\u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u3092\u4F7F\u7528\u3059\u308B)
|
||||
@ -60,6 +60,7 @@ main.opt.version=\ -version \u30D0\u30FC\u30B8\u30E7\u30F3\u60C
|
||||
main.opt.jni=\ -jni JNI\u5F62\u5F0F\u306E\u30D8\u30C3\u30C0\u30FC\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)
|
||||
main.opt.force=\ -force \u5E38\u306B\u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u3092\u66F8\u304D\u8FBC\u3080
|
||||
main.opt.classpath=\ -classpath <path> \u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9
|
||||
main.opt.cp=\ -cp <path> \u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9
|
||||
main.opt.bootclasspath=\ -bootclasspath <path> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u3092\u30ED\u30FC\u30C9\u3059\u308B\u30D1\u30B9
|
||||
main.usage.foot=<classes>\u306F\u5B8C\u5168\u6307\u5B9A\u306E\u540D\u524D\u3067\u6307\u5B9A\u3057\u307E\u3059\n(java.lang.Object\u306A\u3069)\u3002
|
||||
|
||||
@ -90,7 +91,7 @@ unknown.type.in.method.signature=\u53E4\u3044\u5F62\u5F0F\u306E\u30B9\u30BF\u30D
|
||||
err.prefix=\u30A8\u30E9\u30FC:
|
||||
err.cant.use.option.for.fm=\u6307\u5B9A\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u3067{0}\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
|
||||
err.internal.error=\u5185\u90E8\u30A8\u30E9\u30FC: {0}
|
||||
err.ioerror=\u5165\u51FA\u529B\u30A8\u30E9\u30FC: {0}
|
||||
err.ioerror=IO\u30A8\u30E9\u30FC: {0}
|
||||
err.missing.arg={0}\u306E\u5024\u304C\u3042\u308A\u307E\u305B\u3093
|
||||
err.no.classes.specified=\u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093
|
||||
err.unknown.option=\u4E0D\u660E\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1998, 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
|
||||
@ -49,7 +49,7 @@ tracing.not.supported=\u8B66\u544A: \u4E0D\u518D\u652F\u6301\u8DDF\u8E2A\u3002\u
|
||||
#
|
||||
# Usage message.
|
||||
#
|
||||
usage=\u7528\u6CD5: javah [options] <classes>\n\n\u5176\u4E2D, [options] \u5305\u62EC:\n\n\t-help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\u5E76\u9000\u51FA\n\t-classpath <path> \u4ECE\u4E2D\u52A0\u8F7D\u7C7B\u7684\u8DEF\u5F84\n\t-bootclasspath <path> \u4ECE\u4E2D\u52A0\u8F7D\u5F15\u5BFC\u7C7B\u7684\u8DEF\u5F84\n\t-d <dir> \u8F93\u51FA\u76EE\u5F55\n\t-o <file> \u8F93\u51FA\u6587\u4EF6 (\u53EA\u80FD\u4F7F\u7528 -d \u6216 -o \u4E4B\u4E00)\n\t-jni \u751F\u6210 JNI \u6837\u5F0F\u7684\u6807\u5934\u6587\u4EF6 (\u9ED8\u8BA4\u503C)\n\t-version \u8F93\u51FA\u7248\u672C\u4FE1\u606F\n\t-verbose \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n\t-force \u59CB\u7EC8\u5199\u5165\u8F93\u51FA\u6587\u4EF6\n\n<classes> \u662F\u4F7F\u7528\u5176\u5168\u9650\u5B9A\u540D\u79F0\u6307\u5B9A\u7684,\n(\u4F8B\u5982 java.lang.Object)\u3002\n
|
||||
usage=\u7528\u6CD5: javah [options] <classes>\n\n\u5176\u4E2D, [options] \u5305\u62EC:\n\n\t-help \u8F93\u51FA\u6B64\u5E2E\u52A9\u6D88\u606F\u5E76\u9000\u51FA\n\t-classpath <path> \u4ECE\u4E2D\u52A0\u8F7D\u7C7B\u7684\u8DEF\u5F84\n\t-cp <path> \u4ECE\u4E2D\u52A0\u8F7D\u7C7B\u7684\u8DEF\u5F84\n\t-bootclasspath <path> \u4ECE\u4E2D\u52A0\u8F7D\u5F15\u5BFC\u7C7B\u7684\u8DEF\u5F84\n\t-d <dir> \u8F93\u51FA\u76EE\u5F55\n\t-o <file> \u8F93\u51FA\u6587\u4EF6 (\u53EA\u80FD\u4F7F\u7528 -d \u6216 -o \u4E4B\u4E00)\n\t-jni \u751F\u6210 JNI \u6837\u5F0F\u7684\u6807\u5934\u6587\u4EF6 (\u9ED8\u8BA4\u503C)\n\t-version \u8F93\u51FA\u7248\u672C\u4FE1\u606F\n\t-verbose \u542F\u7528\u8BE6\u7EC6\u8F93\u51FA\n\t-force \u59CB\u7EC8\u5199\u5165\u8F93\u51FA\u6587\u4EF6\n\n<classes> \u662F\u4F7F\u7528\u5176\u5168\u9650\u5B9A\u540D\u79F0\u6307\u5B9A\u7684,\n(\u4F8B\u5982, java.lang.Object)\u3002\n
|
||||
|
||||
main.usage=\u7528\u6CD5: \n javah [options] <classes>\n\u5176\u4E2D, [options] \u5305\u62EC:
|
||||
main.opt.o=\ -o <file> \u8F93\u51FA\u6587\u4EF6 (\u53EA\u80FD\u4F7F\u7528 -d \u6216 -o \u4E4B\u4E00)
|
||||
@ -60,6 +60,7 @@ main.opt.version=\ -version \u8F93\u51FA\u7248\u672C\u4FE1\u606
|
||||
main.opt.jni=\ -jni \u751F\u6210 JNI \u6837\u5F0F\u7684\u6807\u5934\u6587\u4EF6 (\u9ED8\u8BA4\u503C)
|
||||
main.opt.force=\ -force \u59CB\u7EC8\u5199\u5165\u8F93\u51FA\u6587\u4EF6
|
||||
main.opt.classpath=\ -classpath <path> \u4ECE\u4E2D\u52A0\u8F7D\u7C7B\u7684\u8DEF\u5F84
|
||||
main.opt.cp=\ -cp <path> \u4ECE\u4E2D\u52A0\u8F7D\u7C7B\u7684\u8DEF\u5F84
|
||||
main.opt.bootclasspath=\ -bootclasspath <path> \u4ECE\u4E2D\u52A0\u8F7D\u5F15\u5BFC\u7C7B\u7684\u8DEF\u5F84
|
||||
main.usage.foot=<classes> \u662F\u4F7F\u7528\u5176\u5168\u9650\u5B9A\u540D\u79F0\u6307\u5B9A\u7684\n(\u4F8B\u5982, java.lang.Object)\u3002
|
||||
|
||||
|
@ -208,7 +208,7 @@ public class CodeWriter extends BasicWriter {
|
||||
|
||||
|
||||
public void writeExceptionTable(Code_attribute attr) {
|
||||
if (attr.exception_table_langth > 0) {
|
||||
if (attr.exception_table_length > 0) {
|
||||
println("Exception table:");
|
||||
indent(+1);
|
||||
println(" from to target type");
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
err.prefix=\u30A8\u30E9\u30FC:
|
||||
err.prefix=\u30A8\u30E9\u30FC:
|
||||
|
||||
err.bad.constant.pool={0}\u306E\u5B9A\u6570\u30D7\u30FC\u30EB\u306E\u8AAD\u53D6\u308A\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {1}
|
||||
err.class.not.found=\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}
|
||||
@ -55,6 +55,8 @@ main.opt.s=\ -s \u5185\u90E8\u30BF\u30A4\u30D7\u7F72\u540
|
||||
|
||||
main.opt.classpath=\ -classpath <path> \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B
|
||||
|
||||
main.opt.cp=\ -cp <path> \u30E6\u30FC\u30B6\u30FC\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u5834\u6240\u3092\u6307\u5B9A\u3059\u308B
|
||||
|
||||
main.opt.bootclasspath=\ -bootclasspath <path> \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u306E\u4F4D\u7F6E\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B
|
||||
|
||||
main.opt.constants=\ -constants \u9759\u7684final\u5B9A\u6570\u3092\u8868\u793A\u3059\u308B
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
err.prefix=\u9519\u8BEF:
|
||||
err.prefix=\u9519\u8BEF:
|
||||
|
||||
err.bad.constant.pool=\u8BFB\u53D6{0}\u7684\u5E38\u91CF\u6C60\u65F6\u51FA\u9519: {1}
|
||||
err.class.not.found=\u627E\u4E0D\u5230\u7C7B: {0}
|
||||
@ -55,6 +55,8 @@ main.opt.s=\ -s \u8F93\u51FA\u5185\u90E8\u7C7B\u578B\u7B7
|
||||
|
||||
main.opt.classpath=\ -classpath <path> \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E
|
||||
|
||||
main.opt.cp=\ -cp <path> \u6307\u5B9A\u67E5\u627E\u7528\u6237\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E
|
||||
|
||||
main.opt.bootclasspath=\ -bootclasspath <path> \u8986\u76D6\u5F15\u5BFC\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E
|
||||
|
||||
main.opt.constants=\ -constants \u663E\u793A\u9759\u6001\u6700\u7EC8\u5E38\u91CF
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -81,12 +81,13 @@ public class BuildState {
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect all packages, sources and artifacts for all modules
|
||||
* into the build state.
|
||||
* Store references to all packages, sources and artifacts for all modules
|
||||
* into the build state. I.e. flatten the module tree structure
|
||||
* into global maps stored in the BuildState for easy access.
|
||||
*
|
||||
* @param m The set of modules.
|
||||
*/
|
||||
public void collectPackagesSourcesAndArtifacts(Map<String,Module> m) {
|
||||
public void flattenPackagesSourcesAndArtifacts(Map<String,Module> m) {
|
||||
modules = m;
|
||||
// Extract all the found packages.
|
||||
for (Module i : modules.values()) {
|
||||
@ -121,11 +122,12 @@ public class BuildState {
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect all the artifacts of all modules and packages.
|
||||
* Store references to all artifacts found in the module tree into the maps
|
||||
* stored in the build state.
|
||||
*
|
||||
* @param m The set of modules.
|
||||
*/
|
||||
public void collectArtifacts(Map<String,Module> m) {
|
||||
public void flattenArtifacts(Map<String,Module> m) {
|
||||
modules = m;
|
||||
// Extract all the found packages.
|
||||
for (Module i : modules.values()) {
|
||||
@ -270,6 +272,8 @@ public class BuildState {
|
||||
Module mnew = findModuleFromPackageName(pkg);
|
||||
Package pprev = prev.packages().get(pkg);
|
||||
mnew.addPackage(pprev);
|
||||
// Do not forget to update the flattened data.
|
||||
packages.put(pkg, pprev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ public class Main {
|
||||
// findFiles(args, "-modulepath", Util.set(".class"), modules_to_link_to, modules, current_module, true);
|
||||
|
||||
// Add the set of sources to the build database.
|
||||
javac_state.now().collectPackagesSourcesAndArtifacts(modules);
|
||||
javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
|
||||
javac_state.now().checkInternalState("checking sources", false, sources);
|
||||
javac_state.now().checkInternalState("checking linked sources", true, sources_to_link_to);
|
||||
javac_state.setVisibleSources(sources_to_link_to);
|
||||
@ -311,7 +311,7 @@ public class Main {
|
||||
Map<String,Source> generated_sources = new HashMap<String,Source>();
|
||||
Source.scanRoot(gensrc_dir, Util.set(".java"), null, null, null, null,
|
||||
generated_sources, modules, current_module, false, true, false);
|
||||
javac_state.now().collectPackagesSourcesAndArtifacts(modules);
|
||||
javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
|
||||
// Recheck the the source files and their timestamps again.
|
||||
javac_state.checkSourceStatus(true);
|
||||
|
||||
@ -336,8 +336,8 @@ public class Main {
|
||||
// Only update the state if the compile went well.
|
||||
if (rc[0]) {
|
||||
javac_state.save();
|
||||
// Collect all the artifacts.
|
||||
javac_state.now().collectArtifacts(modules);
|
||||
// Reflatten only the artifacts.
|
||||
javac_state.now().flattenArtifacts(modules);
|
||||
// Remove artifacts that were generated during the last compile, but not this one.
|
||||
javac_state.removeSuperfluousArtifacts(recently_compiled);
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ public class JavacServer {
|
||||
PrintStream err) {
|
||||
int rc = -3;
|
||||
try {
|
||||
int port = portFile.getPort();
|
||||
int port = portFile.containsPortInfo() ? portFile.getPort() : 0;
|
||||
if (port == 0) {
|
||||
return ERROR_BUT_TRY_AGAIN;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -57,6 +57,7 @@ public abstract class JavadocTester {
|
||||
protected static final String SRC_DIR = System.getProperty("test.src", ".");
|
||||
protected static final String JAVA_VERSION = System.getProperty("java.version");
|
||||
protected static final String[][] NO_TEST = new String[][] {};
|
||||
protected static final String[] NO_FILE_TEST = new String[] {};
|
||||
|
||||
/**
|
||||
* Use this as the file name in the test array when you want to search
|
||||
@ -165,6 +166,26 @@ public abstract class JavadocTester {
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the tests.
|
||||
*
|
||||
* @param tester the tester to execute
|
||||
* @param args the arguments to pass to Javadoc
|
||||
* @param testArray the array of tests
|
||||
* @param negatedTestArray the array of negated tests
|
||||
* @param fileTestArray the array of file tests
|
||||
* @param negatedFileTestArray the array of negated file tests
|
||||
* @return the return code for the execution of Javadoc
|
||||
*/
|
||||
public static int run(JavadocTester tester, String[] args,
|
||||
String[][] testArray, String[][] negatedTestArray, String[] fileTestArray,
|
||||
String[] negatedFileTestArray) {
|
||||
int returnCode = tester.runJavadoc(args);
|
||||
tester.runTestsOnHTML(testArray, negatedTestArray);
|
||||
tester.runTestsOnFile(fileTestArray, negatedFileTestArray);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute Javadoc using the default doclet.
|
||||
*
|
||||
@ -243,6 +264,19 @@ public abstract class JavadocTester {
|
||||
runTestsOnHTML(negatedTestArray, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run array of tests on the generated files.
|
||||
* This method accepts a fileTestArray for testing if a file is generated
|
||||
* and a negatedFileTestArray for testing if a file is not found.
|
||||
*
|
||||
* @param testArray the array of file tests
|
||||
* @param negatedTestArray the array of negated file tests
|
||||
*/
|
||||
public void runTestsOnFile(String[] fileTestArray, String[] negatedFileTestArray) {
|
||||
runTestsOnFile(fileTestArray, false);
|
||||
runTestsOnFile(negatedFileTestArray, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the array of tests on the resulting HTML.
|
||||
*
|
||||
@ -265,9 +299,11 @@ public abstract class JavadocTester {
|
||||
fileString = readFileToString(testArray[i][0]);
|
||||
} catch (Error e) {
|
||||
if (isNegated) {
|
||||
numTestsPassed += 1;
|
||||
System.out.println("Passed\n not found:\n"
|
||||
+ stringToFind + " in non-existent " + testArray[i][0] + "\n");
|
||||
System.out.println( "FAILED" + "\n"
|
||||
+ "for bug " + getBugId()
|
||||
+ " (" + getBugName() + ") "
|
||||
+ "due to "
|
||||
+ e + "\n");
|
||||
continue;
|
||||
}
|
||||
throw e;
|
||||
@ -290,6 +326,39 @@ public abstract class JavadocTester {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the array of file tests on the generated files.
|
||||
*
|
||||
* @param testArray the array of file tests
|
||||
* @param isNegated true if test is negated; false otherwise
|
||||
*/
|
||||
private void runTestsOnFile(String[] testArray, boolean isNegated) {
|
||||
String fileName;
|
||||
String failedString;
|
||||
String passedString;
|
||||
for (int i = 0; i < testArray.length; i++) {
|
||||
numTestsRun++;
|
||||
fileName = testArray[i];
|
||||
failedString = "FAILED" + "\n"
|
||||
+ "for bug " + getBugId() + " (" + getBugName() + ") "
|
||||
+ "file (" + fileName + ") found" + "\n";
|
||||
passedString = "Passed" + "\n" +
|
||||
"file (" + fileName + ") not found" + "\n";
|
||||
System.out.print("Running subtest #" + numTestsRun + "... ");
|
||||
try {
|
||||
File file = new File(fileName);
|
||||
if ((file.exists() && !isNegated) || (!file.exists() && isNegated)) {
|
||||
numTestsPassed += 1;
|
||||
System.out.println(passedString);
|
||||
} else {
|
||||
System.out.println(failedString);
|
||||
}
|
||||
} catch (Error e) {
|
||||
System.err.println(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate through the list of given file pairs and diff each file.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2004, 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
|
||||
@ -23,20 +23,19 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4973609
|
||||
* @bug 4973609 8015249
|
||||
* @summary Make sure that annotation types with 0 members does not have
|
||||
* extra HR tags.
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
* @build JavadocTester
|
||||
* @build TestAnnotationTypes
|
||||
* @build JavadocTester TestAnnotationTypes
|
||||
* @run main TestAnnotationTypes
|
||||
*/
|
||||
|
||||
public class TestAnnotationTypes extends JavadocTester {
|
||||
|
||||
//Test information.
|
||||
private static final String BUG_ID = "4973609";
|
||||
private static final String BUG_ID = "4973609-8015249";
|
||||
|
||||
//Javadoc arguments.
|
||||
private static final String[] ARGS = new String[] {
|
||||
@ -44,7 +43,31 @@ public class TestAnnotationTypes extends JavadocTester {
|
||||
};
|
||||
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST = NO_TEST;
|
||||
private static final String[][] TEST = {
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<li>Summary: </li>" + NL + "<li><a href=\"#annotation_type_" +
|
||||
"field_summary\">Field</a> | </li>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<li>Detail: </li>" + NL + "<li><a href=\"#annotation_type_" +
|
||||
"field_detail\">Field</a> | </li>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<h3>Field Summary</h3>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<td class=\"colLast\"><code><span class=\"strong\"><a href=\"../" +
|
||||
"pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" +
|
||||
"</code> </td>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeField.html",
|
||||
"<h4>DEFAULT_NAME</h4>" + NL + "<pre>public static final java." +
|
||||
"lang.String DEFAULT_NAME</pre>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
"<li>Summary: </li>" + NL + "<li>Field | </li>"},
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
"<li>Detail: </li>" + NL + "<li>Field | </li>"},
|
||||
};
|
||||
private static final String[][] NEGATED_TEST = {
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
"<HR>" + NL + NL + "<P>" + NL + NL + "<P>" +
|
||||
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package pkg;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* This is just a test for annotation type fields.
|
||||
*/
|
||||
@Documented public @interface AnnotationTypeField {
|
||||
String DEFAULT_NAME = "test";
|
||||
|
||||
String name() default DEFAULT_NAME;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -25,7 +25,7 @@ import java.io.File;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4258405 4973606
|
||||
* @bug 4258405 4973606 8024096
|
||||
* @summary This test verifies that the doc-file directory does not
|
||||
* get overwritten when the sourcepath is equal to the destination
|
||||
* directory.
|
||||
@ -47,25 +47,17 @@ public class TestDocFileDir extends JavadocTester {
|
||||
};
|
||||
private static final String[][] NEGATED_TEST1 = NO_TEST;
|
||||
|
||||
private static final String[][] TEST2 = {
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used1" +
|
||||
private static final String[] FILE_TEST2 = {
|
||||
BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used1" +
|
||||
FS + "testfile.txt",
|
||||
"passed"
|
||||
},
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used2" +
|
||||
FS + "testfile.txt",
|
||||
"passed"
|
||||
},
|
||||
BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-used2" +
|
||||
FS + "testfile.txt"
|
||||
};
|
||||
private static final String[][] NEGATED_TEST2 = {
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded1" +
|
||||
private static final String[] FILE_NEGATED_TEST2 = {
|
||||
BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded1" +
|
||||
FS + "testfile.txt",
|
||||
"passed"
|
||||
},
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded2" +
|
||||
FS + "testfile.txt",
|
||||
"passed"
|
||||
},
|
||||
BUG_ID + "-2" + FS + "pkg" + FS + "doc-files" + FS + "subdir-excluded2" +
|
||||
FS + "testfile.txt"
|
||||
};
|
||||
|
||||
private static final String[][] TEST0 = {
|
||||
@ -106,7 +98,7 @@ public class TestDocFileDir extends JavadocTester {
|
||||
run(tester, ARGS0, TEST0, NEGATED_TEST0);
|
||||
copyDir(SRC_DIR + FS + "pkg", BUG_ID + "-1");
|
||||
run(tester, ARGS1, TEST1, NEGATED_TEST1);
|
||||
run(tester, ARGS2, TEST2, NEGATED_TEST2);
|
||||
run(tester, ARGS2, NO_TEST, NO_TEST, FILE_TEST2, FILE_NEGATED_TEST2);
|
||||
tester.printSummary();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -23,7 +23,9 @@
|
||||
|
||||
|
||||
/**
|
||||
* ±ñÉ¿í ¹©¢!
|
||||
* Testing en\u00e7\u00f4ded string.
|
||||
* In the encoded comment string, Unicode U+00E7 is "Latin small letter C with cedilla"
|
||||
* and Unicode U+00F4 is "Latin small letter O with circumflex"
|
||||
*/
|
||||
public class EncodeTest {
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4661481
|
||||
* @bug 4661481 8024096
|
||||
* @summary This test determines if the value of the -encoding option is
|
||||
* properly passed from Javadoc to the source file parser.
|
||||
* @author jamieh
|
||||
@ -40,12 +40,12 @@ public class TestEncoding extends JavadocTester {
|
||||
|
||||
//If ??? is found in the output, the source file was not read with the correct encoding setting.
|
||||
private static final String[][] NEGATED_TEST = {
|
||||
{BUG_ID + FS + "EncodeTest.html", "???"}
|
||||
{BUG_ID + FS + "EncodeTest.html", "??"}
|
||||
};
|
||||
private static final String[] ARGS =
|
||||
new String[] {
|
||||
"-d", BUG_ID, "-sourcepath", SRC_DIR,
|
||||
"-encoding", "SJIS", SRC_DIR + FS + "EncodeTest.java"
|
||||
"-encoding", "iso-8859-1", SRC_DIR + FS + "EncodeTest.java"
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4663254
|
||||
* @bug 4663254 8016328
|
||||
* @summary Verify that spaces do not appear in hrefs and anchors.
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
@ -46,11 +46,11 @@ public class TestHref extends JavadocTester {
|
||||
private static final String[][] TEST = {
|
||||
//External link.
|
||||
{BUG_ID + FS + "pkg" + FS + "C1.html",
|
||||
"href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait(long, int)\""
|
||||
"href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)\""
|
||||
},
|
||||
//Member summary table link.
|
||||
{BUG_ID + FS + "pkg" + FS + "C1.html",
|
||||
"href=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\""
|
||||
"href=\"../pkg/C1.html#method(int,%20int,%20java.util.ArrayList)\""
|
||||
},
|
||||
//Anchor test.
|
||||
{BUG_ID + FS + "pkg" + FS + "C1.html",
|
||||
@ -66,11 +66,11 @@ public class TestHref extends JavadocTester {
|
||||
},
|
||||
//{@link} test.
|
||||
{BUG_ID + FS + "pkg" + FS + "C2.html",
|
||||
"Link: <a href=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
|
||||
"Link: <a href=\"../pkg/C1.html#method(int,%20int,%20java.util.ArrayList)\">"
|
||||
},
|
||||
//@see test.
|
||||
{BUG_ID + FS + "pkg" + FS + "C2.html",
|
||||
"See Also:</span></dt>" + NL + "<dd><a href=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
|
||||
"See Also:</span></dt>" + NL + "<dd><a href=\"../pkg/C1.html#method(int,%20int,%20java.util.ArrayList)\">"
|
||||
},
|
||||
|
||||
//Header does not link to the page itself.
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4665566 4855876 7025314 8012375 8015997
|
||||
* @bug 4665566 4855876 7025314 8012375 8015997 8016328
|
||||
* @summary Verify that the output has the right javascript.
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
@ -56,6 +56,12 @@ public class TestJavascript extends JavadocTester {
|
||||
" if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + NL +
|
||||
" targetPage = \"undefined\";" + NL +
|
||||
" function validURL(url) {" + NL +
|
||||
" try {" + NL +
|
||||
" url = decodeURIComponent(url);" + NL +
|
||||
" }" + NL +
|
||||
" catch (error) {" + NL +
|
||||
" return false;" + NL +
|
||||
" }" + NL +
|
||||
" var pos = url.indexOf(\".html\");" + NL +
|
||||
" if (pos == -1 || pos != url.length - 5)" + NL +
|
||||
" return false;" + NL +
|
||||
@ -67,7 +73,8 @@ public class TestJavascript extends JavadocTester {
|
||||
" if ('a' <= ch && ch <= 'z' ||" + NL +
|
||||
" 'A' <= ch && ch <= 'Z' ||" + NL +
|
||||
" ch == '$' ||" + NL +
|
||||
" ch == '_') {" + NL +
|
||||
" ch == '_' ||" + NL +
|
||||
" ch.charCodeAt(0) > 127) {" + NL +
|
||||
" allowNumber = true;" + NL +
|
||||
" allowSep = true;" + NL +
|
||||
" } else if ('0' <= ch && ch <= '9'" + NL +
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4732864 6280605 7064544 8014636
|
||||
* @bug 4732864 6280605 7064544 8014636 8016328
|
||||
* @summary Make sure that you can link from one member to another using
|
||||
* non-qualified name, furthermore, ensure the right one is linked.
|
||||
* @author jamieh
|
||||
@ -49,9 +49,9 @@ public class TestLinkTaglet extends JavadocTester {
|
||||
"Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL +
|
||||
" Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL +
|
||||
" Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>" + NL +
|
||||
" Qualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>" + NL +
|
||||
" Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>" + NL +
|
||||
" Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(InnerC, InnerC2)</code></a>.<br/>"
|
||||
" Qualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC,%20pkg.C.InnerC2)\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>" + NL +
|
||||
" Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC,%20pkg.C.InnerC2)\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>" + NL +
|
||||
" Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC,%20pkg.C.InnerC2)\"><code>method(InnerC, InnerC2)</code></a>.<br/>"
|
||||
},
|
||||
{BUG_ID + FS + "pkg" + FS + "C.InnerC.html",
|
||||
"Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>" + NL +
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8002304
|
||||
* @bug 8002304 8024096
|
||||
* @summary Test for various method types in the method summary table
|
||||
* @author Bhavesh Patel
|
||||
* @library ../lib/
|
||||
@ -107,7 +107,7 @@ public class TestMethodTypes extends JavadocTester {
|
||||
"</caption>"
|
||||
},
|
||||
|
||||
{BUG_ID + FS + "pkg" + FS + "D.html",
|
||||
{BUG_ID + FS + "pkg1" + FS + "D.html",
|
||||
"<caption><span>Methods</span><span class=\"tabEnd\"> </span>" +
|
||||
"</caption>"
|
||||
},
|
||||
|
@ -155,13 +155,13 @@ public class TestNewLanguageFeatures extends JavadocTester {
|
||||
//=================================
|
||||
//Make sure the summary links are correct.
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
"<li>Summary: </li>" + NL +
|
||||
"<li>Summary: </li>" + NL + "<li>Field | </li>" + NL +
|
||||
"<li><a href=\"#annotation_type_required_element_summary\">" +
|
||||
"Required</a> | </li>" + NL + "<li>" +
|
||||
"<a href=\"#annotation_type_optional_element_summary\">Optional</a></li>"},
|
||||
//Make sure the detail links are correct.
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
"<li>Detail: </li>" + NL +
|
||||
"<li>Detail: </li>" + NL + "<li>Field | </li>" + NL +
|
||||
"<li><a href=\"#annotation_type_element_detail\">Element</a></li>"},
|
||||
//Make sure the heading is correct.
|
||||
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4780441 4874845 4978816 8014017
|
||||
* @bug 4780441 4874845 4978816 8014017 8016328
|
||||
* @summary Make sure that when the -private flag is not used, members
|
||||
* inherited from package private class are documented in the child.
|
||||
*
|
||||
@ -177,7 +177,7 @@ public class TestPrivateClasses extends JavadocTester {
|
||||
// Should document that a method overrides method from private class.
|
||||
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
|
||||
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL +
|
||||
"<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
|
||||
"<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[],%20int,%20T,%20V,%20java.util.List)\">" +
|
||||
"methodOverridenFromParent</a></code> in class <code>" +
|
||||
"<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
|
||||
"PrivateParent</a></code></dd>"},
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8006124 8009684 8016921 8023700
|
||||
* @bug 8006124 8009684 8016921 8023700 8024096
|
||||
* @summary Test javadoc support for profiles.
|
||||
* @author Bhavesh Patel, Evgeniya Stepanova
|
||||
* @library ../lib/
|
||||
@ -187,26 +187,6 @@ public class TestProfiles extends JavadocTester {
|
||||
}
|
||||
};
|
||||
private static final String[][] PACKAGES_NEGATED_TEST = {
|
||||
{PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
|
||||
"<span><a href=\"overview-frame.html\" "
|
||||
+ "target=\"packageListFrame\">All Packages</a></span>"
|
||||
},
|
||||
{PACKAGE_BUG_ID + FS + "compact2-frame.html",
|
||||
"<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
|
||||
+ "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
|
||||
+ "target=\"packageListFrame\">All Profiles</a></span>"
|
||||
},
|
||||
{PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
|
||||
"<a href=\"../compact2-summary.html\" target=\"classFrame\">"
|
||||
+ "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
|
||||
+ "target=\"classFrame\">pkg2</a>"
|
||||
},
|
||||
{PACKAGE_BUG_ID + FS + "compact2-summary.html",
|
||||
"<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>"
|
||||
},
|
||||
{PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
|
||||
"<div class=\"subTitle\">compact3</div>"
|
||||
},
|
||||
{PACKAGE_BUG_ID + FS + "overview-frame.html",
|
||||
"<span><a href=\"profile-overview-frame.html\" "
|
||||
+ "target=\"packageListFrame\">All Profiles</a></span>"
|
||||
@ -222,6 +202,13 @@ public class TestProfiles extends JavadocTester {
|
||||
"</ul>"
|
||||
}
|
||||
};
|
||||
private static final String[] PACKAGES_NEGATED_FILE_TEST = {
|
||||
PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
|
||||
PACKAGE_BUG_ID + FS + "compact2-frame.html",
|
||||
PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
|
||||
PACKAGE_BUG_ID + FS + "compact2-summary.html",
|
||||
PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html"
|
||||
};
|
||||
|
||||
/**
|
||||
* The entry point of the test.
|
||||
@ -231,7 +218,7 @@ public class TestProfiles extends JavadocTester {
|
||||
public static void main(String[] args) {
|
||||
TestProfiles tester = new TestProfiles();
|
||||
run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST);
|
||||
run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST);
|
||||
run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST, NO_FILE_TEST, PACKAGES_NEGATED_FILE_TEST);
|
||||
tester.printSummary();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4496290 4985072 7006178 7068595
|
||||
* @bug 4496290 4985072 7006178 7068595 8016328
|
||||
* @summary A simple test to determine if -use works.
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
@ -60,7 +60,7 @@ public class TestUseOption extends JavadocTester {
|
||||
"UsedInC</a> in <a href=\"../package-summary.html\"><Unnamed></a>"
|
||||
},
|
||||
{BUG_ID + "-3" + FS + "package-use.html", "<td class=\"colOne\">" +
|
||||
"<a href=\"class-use/UsedInC.html#<Unnamed>\">UsedInC</a> </td>"
|
||||
"<a href=\"class-use/UsedInC.html#%3CUnnamed%3E\">UsedInC</a> </td>"
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -23,13 +23,12 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4764045
|
||||
* @bug 4764045 8004825
|
||||
* @summary This test ensures that the value tag works in all
|
||||
* use cases. The explainations for each test case are written below.
|
||||
* @author jamieh
|
||||
* @library ../lib/
|
||||
* @build JavadocTester
|
||||
* @build TestValueTag
|
||||
* @build JavadocTester TestValueTag
|
||||
* @run main TestValueTag
|
||||
*/
|
||||
|
||||
@ -41,11 +40,17 @@ public class TestValueTag extends JavadocTester {
|
||||
//Javadoc arguments.
|
||||
private static final String[] ARGS =
|
||||
new String[] {
|
||||
"-Xdoclint:none",
|
||||
"-d", BUG_ID, "-sourcepath", SRC_DIR, "-tag",
|
||||
"todo", "pkg1", "pkg2"
|
||||
};
|
||||
|
||||
private static final String[] ARGS1 =
|
||||
new String[] {
|
||||
"-Xdoclint:none",
|
||||
"-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-tag",
|
||||
"todo", "pkg1", "pkg2"
|
||||
};
|
||||
|
||||
//Input for string search tests.
|
||||
private static final String[][] TEST = {
|
||||
//Base case: using @value on a constant.
|
||||
@ -91,16 +96,58 @@ public class TestValueTag extends JavadocTester {
|
||||
{BUG_ID + FS + "pkg1" + FS + "CustomTagUsage.html",
|
||||
"<dt><span class=\"strong\">Todo:</span></dt>" + NL +
|
||||
"<dd>the value of this constant is 55.</dd>"},
|
||||
//Test @value errors printed dues to invalid use or when used with
|
||||
//non-constant or with bad references.
|
||||
{ERROR_OUTPUT,"error: value does not refer to a constant" + NL +
|
||||
" * Result: {@value TEST_12_ERROR}"
|
||||
},
|
||||
{ERROR_OUTPUT,"error: {@value} not allowed here" + NL +
|
||||
" * Result: {@value}"
|
||||
},
|
||||
{ERROR_OUTPUT,"error: value does not refer to a constant" + NL +
|
||||
" * Result: {@value NULL}"
|
||||
},
|
||||
{ERROR_OUTPUT,"error: {@value} not allowed here" + NL +
|
||||
" * Invalid (null): {@value}"
|
||||
},
|
||||
{ERROR_OUTPUT,"error: {@value} not allowed here" + NL +
|
||||
" * Invalid (non-constant field): {@value}"
|
||||
},
|
||||
{ERROR_OUTPUT,"error: value does not refer to a constant" + NL +
|
||||
" * Here is a bad value reference: {@value UnknownClass#unknownConstant}"
|
||||
},
|
||||
{ERROR_OUTPUT,"error: reference not found" + NL +
|
||||
" * Here is a bad value reference: {@value UnknownClass#unknownConstant}"
|
||||
},
|
||||
{ERROR_OUTPUT,"error: {@value} not allowed here" + NL +
|
||||
" * @todo the value of this constant is {@value}"
|
||||
}
|
||||
};
|
||||
private static final String[][] TEST1 = {
|
||||
//Test @value warning printed when used with non-constant.
|
||||
{WARNING_OUTPUT,"warning - @value tag (which references nonConstant) " +
|
||||
"can only be used in constants."
|
||||
},
|
||||
{WARNING_OUTPUT,"warning - @value tag (which references NULL) " +
|
||||
"can only be used in constants."
|
||||
},
|
||||
{WARNING_OUTPUT,"warning - @value tag (which references TEST_12_ERROR) " +
|
||||
"can only be used in constants."
|
||||
},
|
||||
//Test warning printed for bad reference.
|
||||
{WARNING_OUTPUT,"warning - UnknownClass#unknownConstant (referenced by " +
|
||||
"@value tag) is an unknown reference."
|
||||
},
|
||||
//Test warning printed for invalid use of @value.
|
||||
{WARNING_OUTPUT,"warning - @value tag cannot be used here."
|
||||
}
|
||||
};
|
||||
private static final String[][] NEGATED_TEST = {
|
||||
//Base case: using @value on a constant.
|
||||
{BUG_ID + FS + "pkg1" + FS + "Class1.html",
|
||||
"Result: <a href=\"../pkg1/Class1.html#TEST_12_ERROR\">\"Test 12 " +
|
||||
"generates an error message\"</a>"},
|
||||
};
|
||||
private static final String[][] NEGATED_TEST = NO_TEST;
|
||||
|
||||
/**
|
||||
* The entry point of the test.
|
||||
@ -109,9 +156,18 @@ public class TestValueTag extends JavadocTester {
|
||||
public static void main(String[] args) {
|
||||
TestValueTag tester = new TestValueTag();
|
||||
run(tester, ARGS, TEST, NEGATED_TEST);
|
||||
checkForException(tester);
|
||||
run(tester, ARGS1, TEST1, NO_TEST);
|
||||
checkForException(tester);
|
||||
tester.printSummary();
|
||||
}
|
||||
|
||||
public static void checkForException(TestValueTag tester) {
|
||||
if (tester.getErrorOutput().contains("DocletAbortException")) {
|
||||
throw new AssertionError("javadoc threw DocletAbortException");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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
|
||||
@ -44,6 +44,16 @@ public class Class1 {
|
||||
public static final String TEST_10_PASSES = "Test 10 passes";
|
||||
public static final String TEST_11_PASSES = "Test 11 passes";
|
||||
|
||||
/**
|
||||
* Invalid (non-constant field): {@value}
|
||||
*/
|
||||
public static String TEST_12_ERROR = "Test 12 generates an error message";
|
||||
|
||||
/**
|
||||
* Invalid (null): {@value}
|
||||
*/
|
||||
public static final String NULL = null;
|
||||
|
||||
/**
|
||||
* Result: {@value TEST_3_PASSES}
|
||||
*/
|
||||
@ -59,6 +69,21 @@ public class Class1 {
|
||||
*/
|
||||
public void method() {}
|
||||
|
||||
/**
|
||||
* Result: {@value TEST_12_ERROR}
|
||||
*/
|
||||
public void invalidValueTag1() {}
|
||||
|
||||
/**
|
||||
* Result: {@value}
|
||||
*/
|
||||
public void invalidValueTag2() {}
|
||||
|
||||
/**
|
||||
* Result: {@value NULL}
|
||||
*/
|
||||
public void testNullConstant() {}
|
||||
|
||||
/**
|
||||
* Result: {@value pkg1.Class1#TEST_6_PASSES}
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8004832 8020556
|
||||
* @bug 8004832 8020556 8002154
|
||||
* @summary Add new doclint package
|
||||
* @build DocLintTester
|
||||
* @run main DocLintTester -Xmsgs:-reference ReferenceTest.java
|
||||
@ -54,5 +54,13 @@ public class ReferenceTest {
|
||||
* @throws T description
|
||||
*/
|
||||
public <T extends Throwable> void valid_throws_generic() throws T { }
|
||||
|
||||
/**
|
||||
* {@link java.util.List<String>}
|
||||
* {@link java.util.List<String>#equals}
|
||||
* @see java.util.List<String>
|
||||
* @see java.util.List<String>#equals
|
||||
*/
|
||||
public void invalid_type_args() { }
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user