--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,11 +25,11 @@
package com.sun.tools.doclets.formats.html;
-import com.sun.tools.doclets.internal.toolkit.util.*;
+import java.io.*;
+import java.util.*;
import com.sun.javadoc.*;
-import java.io.*;
-import java.util.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
/**
* Generate Index for all the Member Names with Indexing in
@@ -100,18 +100,22 @@
h2();
strong(unicode.toString());
h2End();
- dl();
- for (int i = 0; i < memberlist.size(); i++) {
- Doc element = memberlist.get(i);
- if (element instanceof MemberDoc) {
- printDescription((MemberDoc)element);
- } else if (element instanceof ClassDoc) {
- printDescription((ClassDoc)element);
- } else if (element instanceof PackageDoc) {
- printDescription((PackageDoc)element);
+ int memberListSize = memberlist.size();
+ // Display the list only if there are elements to be displayed.
+ if (memberListSize > 0) {
+ dl();
+ for (int i = 0; i < memberListSize; i++) {
+ Doc element = memberlist.get(i);
+ if (element instanceof MemberDoc) {
+ printDescription((MemberDoc)element);
+ } else if (element instanceof ClassDoc) {
+ printDescription((ClassDoc)element);
+ } else if (element instanceof PackageDoc) {
+ printDescription((PackageDoc)element);
+ }
}
+ dlEnd();
}
- dlEnd();
hr();
}
@@ -126,8 +130,10 @@
printPackageLink(pkg, Util.getPackageName(pkg), true);
print(" - ");
print(configuration.getText("doclet.package") + " " + pkg.name());
+ dtEnd();
dd();
printSummaryComment(pkg);
+ ddEnd();
}
/**
@@ -140,8 +146,10 @@
printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true));
print(" - ");
printClassInfo(cd);
+ dtEnd();
dd();
printComment(cd);
+ ddEnd();
}
/**
@@ -178,8 +186,10 @@
println(" - ");
printMemberDesc(member);
println();
+ dtEnd();
dd();
printComment(member);
+ ddEnd();
println();
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,19 +25,20 @@
package com.sun.tools.doclets.formats.html;
+import java.lang.reflect.Modifier;
+import java.util.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
-import com.sun.javadoc.*;
-import java.util.*;
-import java.lang.reflect.Modifier;
-
/**
* The base class for member writers.
*
* @author Robert Field
* @author Atul M Dambalkar
* @author Jamie Ho (Re-write)
+ * @author Bhavesh Patel (Modified)
*/
public abstract class AbstractMemberWriter {
@@ -232,10 +233,26 @@
}
}
+ /**
+ * Print the deprecated output for the given member.
+ *
+ * @param member the member being documented.
+ */
+ protected void printDeprecated(ProgramElementDoc member) {
+ String output = (new DeprecatedTaglet()).getTagletOutput(member,
+ writer.getTagletWriterInstance(false)).toString().trim();
+ if (!output.isEmpty()) {
+ writer.printMemberDetailsListStartTag();
+ writer.print(output);
+ }
+ }
+
protected void printComment(ProgramElementDoc member) {
if (member.inlineTags().length > 0) {
+ writer.printMemberDetailsListStartTag();
writer.dd();
writer.printInlineComment(member);
+ writer.ddEnd();
}
}
@@ -267,6 +284,14 @@
}
/**
+ * Write the member footer.
+ */
+ protected void printMemberFooter() {
+ writer.printMemberDetailsListEndTag();
+ assert !writer.getMemberDetailsListPrinted();
+ }
+
+ /**
* Forward to containing writer
*/
public void printSummaryHeader(ClassDoc cd) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,10 +25,10 @@
package com.sun.tools.doclets.formats.html;
-import com.sun.tools.doclets.internal.toolkit.*;
+import java.io.*;
+
import com.sun.javadoc.*;
-
-import java.io.*;
+import com.sun.tools.doclets.internal.toolkit.*;
/**
* Writes annotation type optional member documentation in HTML format.
@@ -63,14 +63,20 @@
* {@inheritDoc}
*/
public void writeDefaultValueInfo(MemberDoc member) {
- writer.dl();
- writer.dt();
- writer.strong(ConfigurationImpl.getInstance().
- getText("doclet.Default"));
- writer.dd();
- writer.print(((AnnotationTypeElementDoc) member).defaultValue());
- writer.ddEnd();
- writer.dlEnd();
+ if (((AnnotationTypeElementDoc) member).defaultValue() != null) {
+ writer.printMemberDetailsListStartTag();
+ writer.dd();
+ writer.dl();
+ writer.dt();
+ writer.strong(ConfigurationImpl.getInstance().
+ getText("doclet.Default"));
+ writer.dtEnd();
+ writer.dd();
+ writer.print(((AnnotationTypeElementDoc) member).defaultValue());
+ writer.ddEnd();
+ writer.dlEnd();
+ writer.ddEnd();
+ }
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,11 +25,10 @@
package com.sun.tools.doclets.formats.html;
-import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.tools.doclets.internal.toolkit.taglets.*;
+import java.io.*;
+
import com.sun.javadoc.*;
-
-import java.io.*;
+import com.sun.tools.doclets.internal.toolkit.*;
/**
* Writes annotation type required member documentation in HTML format.
@@ -134,17 +133,14 @@
strong(member.name());
}
writer.preEnd();
- writer.dl();
+ assert !writer.getMemberDetailsListPrinted();
}
/**
* {@inheritDoc}
*/
public void writeComments(MemberDoc member) {
- if (member.inlineTags().length > 0) {
- writer.dd();
- writer.printInlineComment(member);
- }
+ printComment(member);
}
/**
@@ -160,7 +156,7 @@
* Write the annotation type member footer.
*/
public void writeMemberFooter() {
- writer.dlEnd();
+ printMemberFooter();
}
/**
@@ -267,9 +263,7 @@
* {@inheritDoc}
*/
public void writeDeprecated(MemberDoc member) {
- print(((TagletOutputImpl)
- (new DeprecatedTaglet()).getTagletOutput(member,
- writer.getTagletWriterInstance(false))).toString());
+ printDeprecated(member);
}
private Type getType(MemberDoc member) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,10 +25,10 @@
package com.sun.tools.doclets.formats.html;
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
import com.sun.tools.doclets.internal.toolkit.builders.*;
-import com.sun.javadoc.*;
/**
* Generate the Class Information Page.
@@ -165,8 +165,6 @@
* {@inheritDoc}
*/
public void writeAnnotationTypeSignature(String modifiers) {
- dl();
- dt();
preNoNewLine();
writeAnnotationInfo(annotationType);
print(modifiers);
@@ -178,7 +176,6 @@
} else {
strong(name);
}
- dlEnd();
preEnd();
p();
}
@@ -334,6 +331,7 @@
} else {
strongText("doclet.Enclosing_Class");
}
+ dtEnd();
dd();
printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
false));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,12 +25,12 @@
package com.sun.tools.doclets.formats.html;
+import java.util.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
import com.sun.tools.doclets.internal.toolkit.builders.*;
-import com.sun.javadoc.*;
-
-import java.util.*;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
/**
@@ -171,8 +171,6 @@
*/
public void writeClassSignature(String modifiers) {
boolean isInterface = classDoc.isInterface();
- dl();
- dt();
preNoNewLine();
writeAnnotationInfo(classDoc);
print(modifiers);
@@ -191,7 +189,7 @@
Type superclass = Util.getFirstVisibleSuperClass(classDoc,
configuration());
if (superclass != null) {
- dt();
+ println();
print("extends ");
printLink(new LinkInfoImpl(
LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
@@ -208,7 +206,7 @@
continue;
}
if (counter == 0) {
- dt();
+ println();
print(isInterface? "extends " : "implements ");
} else {
print(", ");
@@ -219,7 +217,6 @@
counter++;
}
}
- dlEnd();
preEnd();
p();
}
@@ -342,6 +339,7 @@
TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc,
getTagletWriterInstance(false));
print(output.toString());
+ dtEnd();
dlEnd();
}
}
@@ -360,8 +358,10 @@
dl();
dt();
strongText("doclet.Subclasses");
+ dtEnd();
writeClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES,
subclasses);
+ dlEnd();
}
}
}
@@ -376,8 +376,10 @@
dl();
dt();
strongText("doclet.Subinterfaces");
+ dtEnd();
writeClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES,
subInterfaces);
+ dlEnd();
}
}
}
@@ -398,8 +400,10 @@
dl();
dt();
strongText("doclet.Implementing_Classes");
+ dtEnd();
writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES,
implcl);
+ dlEnd();
}
}
@@ -414,8 +418,10 @@
dl();
dt();
strongText("doclet.All_Implemented_Interfaces");
+ dtEnd();
writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES,
interfaceArray);
+ dlEnd();
}
}
@@ -430,8 +436,10 @@
dl();
dt();
strongText("doclet.All_Superinterfaces");
+ dtEnd();
writeClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES,
interfaceArray);
+ dlEnd();
}
}
@@ -455,7 +463,6 @@
}
}
ddEnd();
- dlEnd();
}
protected void navLinkTree() {
@@ -574,6 +581,7 @@
} else {
strongText("doclet.Enclosing_Class");
}
+ dtEnd();
dd();
printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
false));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,12 +25,12 @@
package com.sun.tools.doclets.formats.html;
+import java.io.*;
+import java.util.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.tools.doclets.internal.toolkit.taglets.*;
-import com.sun.javadoc.*;
-import java.util.*;
-import java.io.*;
/**
* Writes constructor documentation.
@@ -149,7 +149,7 @@
writeParameters(constructor);
writeExceptions(constructor);
writer.preEnd();
- writer.dl();
+ assert !writer.getMemberDetailsListPrinted();
}
/**
@@ -158,12 +158,7 @@
* @param constructor the constructor being documented.
*/
public void writeDeprecated(ConstructorDoc constructor) {
- String output = ((TagletOutputImpl)
- (new DeprecatedTaglet()).getTagletOutput(constructor,
- writer.getTagletWriterInstance(false))).toString();
- if (output != null && output.trim().length() > 0) {
- writer.print(output);
- }
+ printDeprecated(constructor);
}
/**
@@ -172,10 +167,7 @@
* @param constructor the constructor being documented.
*/
public void writeComments(ConstructorDoc constructor) {
- if (constructor.inlineTags().length > 0) {
- writer.dd();
- writer.printInlineComment(constructor);
- }
+ printComment(constructor);
}
/**
@@ -191,7 +183,7 @@
* Write the constructor footer.
*/
public void writeConstructorFooter() {
- writer.dlEnd();
+ printMemberFooter();
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,12 +25,11 @@
package com.sun.tools.doclets.formats.html;
+import java.io.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.tools.doclets.internal.toolkit.taglets.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
-
-import java.io.*;
/**
* Writes enum constant documentation in HTML format.
@@ -146,26 +145,21 @@
strong(enumConstant.name());
}
writer.preEnd();
- writer.dl();
+ assert !writer.getMemberDetailsListPrinted();
}
/**
* {@inheritDoc}
*/
public void writeDeprecated(FieldDoc enumConstant) {
- print(((TagletOutputImpl)
- (new DeprecatedTaglet()).getTagletOutput(enumConstant,
- writer.getTagletWriterInstance(false))).toString());
+ printDeprecated(enumConstant);
}
/**
* {@inheritDoc}
*/
public void writeComments(FieldDoc enumConstant) {
- if (enumConstant.inlineTags().length > 0) {
- writer.dd();
- writer.printInlineComment(enumConstant);
- }
+ printComment(enumConstant);
}
/**
@@ -179,7 +173,7 @@
* {@inheritDoc}
*/
public void writeEnumConstantFooter() {
- writer.dlEnd();
+ printMemberFooter();
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,12 +25,11 @@
package com.sun.tools.doclets.formats.html;
+import java.io.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.tools.doclets.internal.toolkit.taglets.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
-
-import java.io.*;
/**
* Writes field documentation in HTML format.
@@ -156,7 +155,7 @@
strong(field.name());
}
writer.preEnd();
- writer.dl();
+ assert !writer.getMemberDetailsListPrinted();
}
/**
@@ -165,9 +164,7 @@
* @param field the field being documented.
*/
public void writeDeprecated(FieldDoc field) {
- print(((TagletOutputImpl)
- (new DeprecatedTaglet()).getTagletOutput(field,
- writer.getTagletWriterInstance(false))).toString());
+ printDeprecated(field);
}
/**
@@ -178,10 +175,12 @@
public void writeComments(FieldDoc field) {
ClassDoc holder = field.containingClass();
if (field.inlineTags().length > 0) {
+ writer.printMemberDetailsListStartTag();
if (holder.equals(classdoc) ||
(! (holder.isPublic() || Util.isLinkable(holder, configuration())))) {
writer.dd();
writer.printInlineComment(field);
+ writer.ddEnd();
} else {
String classlink = writer.codeText(
writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY,
@@ -196,6 +195,7 @@
writer.ddEnd();
writer.dd();
writer.printInlineComment(field);
+ writer.ddEnd();
}
}
}
@@ -213,7 +213,7 @@
* Write the field footer.
*/
public void writeFieldFooter() {
- writer.dlEnd();
+ printMemberFooter();
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -24,17 +24,16 @@
*/
package com.sun.tools.doclets.formats.html;
-import com.sun.tools.doclets.formats.html.markup.*;
-import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.tools.doclets.internal.toolkit.taglets.*;
-
-import com.sun.javadoc.*;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.internal.toolkit.taglets.*;
/**
* Class for the Html Format Code Generation specific to JavaDoc.
@@ -44,6 +43,7 @@
* @since 1.2
* @author Atul M Dambalkar
* @author Robert Field
+ * @author Bhavesh Patel (Modified)
*/
public class HtmlDocletWriter extends HtmlDocWriter {
@@ -205,7 +205,13 @@
private void printMethodInfo(MethodDoc method) {
ClassDoc[] intfacs = method.containingClass().interfaces();
MethodDoc overriddenMethod = method.overriddenMethod();
- if (intfacs.length > 0 || overriddenMethod != null) {
+ // Check whether there is any implementation or overridden info to be
+ // printed. If no overridden or implementation info needs to be
+ // printed, do not print this section.
+ if ((intfacs.length > 0 &&
+ new ImplementedMethods(method, this.configuration).build().length > 0) ||
+ overriddenMethod != null) {
+ printMemberDetailsListStartTag();
dd();
printTagsInfoHeader();
MethodWriterImpl.printImplementsInfo(this, method);
@@ -216,7 +222,6 @@
printTagsInfoFooter();
ddEnd();
}
- dd();
}
protected void printTags(Doc doc) {
@@ -230,41 +235,35 @@
TagletWriter.genTagOuput(configuration.tagletManager, doc,
configuration.tagletManager.getCustomTags(doc),
getTagletWriterInstance(false), output);
- if (output.toString().trim().length() > 0) {
+ String outputString = output.toString().trim();
+ // For RootDoc and ClassDoc, this section is not the definition description
+ // but the start of definition list.
+ if (!outputString.isEmpty()) {
+ if (!(doc instanceof RootDoc || doc instanceof ClassDoc)) {
+ printMemberDetailsListStartTag();
+ dd();
+ }
printTagsInfoHeader();
- print(output.toString());
+ print(outputString);
printTagsInfoFooter();
- } else if (! (doc instanceof ConstructorDoc ||
- doc instanceof RootDoc || doc instanceof ClassDoc)) {
- //To be consistent with 1.4.2 output.
- //I hate to do this but we have to pass the diff test to prove
- //nothing has broken.
- printTagsInfoHeader();
- printTagsInfoFooter();
+ if (!(doc instanceof RootDoc || doc instanceof ClassDoc))
+ ddEnd();
}
}
/**
- * Check whether there are any tags to be printed.
+ * Check whether there are any tags for Serialization Overview
+ * section to be printed.
*
- * @param doc the Doc object to check for tags.
+ * @param field the FieldDoc object to check for tags.
* @return true if there are tags to be printed else return false.
*/
- protected boolean hasTagsToPrint(Doc doc) {
- if (doc instanceof MethodDoc) {
- ClassDoc[] intfacs = ((MethodDoc)doc).containingClass().interfaces();
- MethodDoc overriddenMethod = ((MethodDoc)doc).overriddenMethod();
- if ((intfacs.length > 0 &&
- new ImplementedMethods((MethodDoc)doc, this.configuration).build().length > 0) ||
- overriddenMethod != null) {
- return true;
- }
- }
+ protected boolean hasSerializationOverviewTags(FieldDoc field) {
TagletOutputImpl output = new TagletOutputImpl("");
- TagletWriter.genTagOuput(configuration.tagletManager, doc,
- configuration.tagletManager.getCustomTags(doc),
+ TagletWriter.genTagOuput(configuration.tagletManager, field,
+ configuration.tagletManager.getCustomTags(field),
getTagletWriterInstance(false), output);
- return (output.toString().trim().isEmpty());
+ return (!output.toString().trim().isEmpty());
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,11 +25,12 @@
package com.sun.tools.doclets.formats.html;
+import java.util.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
-import java.util.*;
/**
* Generate serialized form for serializable fields.
@@ -37,6 +38,7 @@
* <code>serialField</code> is processed.
*
* @author Joe Fialli
+ * @author Bhavesh Patel (Modified)
*/
public class HtmlSerialFieldWriter extends FieldWriterImpl
implements SerializedFormWriter.SerialFieldWriter {
@@ -75,7 +77,7 @@
writer.println();
if (heading.equals(
configuration().getText("doclet.Serialized_Form_class"))) {
- writer.dl();
+ assert !writer.getMemberDetailsListPrinted();
}
} else {
writer.printTableHeadingBackground(heading);
@@ -102,7 +104,7 @@
print(fieldDimensions + ' ');
strong(fieldName);
writer.preEnd();
- writer.dl();
+ assert !writer.getMemberDetailsListPrinted();
}
/**
@@ -111,9 +113,7 @@
* @param field the field to document.
*/
public void writeMemberDeprecatedInfo(FieldDoc field) {
- print(((TagletOutputImpl)
- (new DeprecatedTaglet()).getTagletOutput(field,
- writer.getTagletWriterInstance(false))).toString());
+ printDeprecated(field);
}
/**
@@ -123,14 +123,17 @@
*/
public void writeMemberDescription(FieldDoc field) {
if (field.inlineTags().length > 0) {
+ writer.printMemberDetailsListStartTag();
writer.dd();
writer.printInlineComment(field);
+ writer.ddEnd();
}
Tag[] tags = field.tags("serial");
if (tags.length > 0) {
- writer.dt();
+ writer.printMemberDetailsListStartTag();
writer.dd();
writer.printInlineComment(field, tags[0]);
+ writer.ddEnd();
}
}
@@ -140,9 +143,14 @@
* @param serialFieldTag the field to document (represented by tag).
*/
public void writeMemberDescription(SerialFieldTag serialFieldTag) {
- writer.dd();
- writer.print(serialFieldTag.description());
- writer.dlEnd();
+ String serialFieldTagDesc = serialFieldTag.description().trim();
+ if (!serialFieldTagDesc.isEmpty()) {
+ writer.dl();
+ writer.dd();
+ writer.print(serialFieldTagDesc);
+ writer.ddEnd();
+ writer.dlEnd();
+ }
}
/**
@@ -151,33 +159,57 @@
* @param field the field to document.
*/
public void writeMemberTags(FieldDoc field) {
- writer.dl();
TagletOutputImpl output = new TagletOutputImpl("");
TagletWriter.genTagOuput(configuration().tagletManager, field,
configuration().tagletManager.getCustomTags(field),
writer.getTagletWriterInstance(false), output);
- if (output.toString().length() > 0) {
- print(output.toString());
+ String outputString = output.toString().trim();
+ if (!outputString.isEmpty()) {
+ writer.printMemberDetailsListStartTag();
+ writer.dd();
+ writer.dl();
+ print(outputString);
+ writer.dlEnd();
+ writer.ddEnd();
}
- writer.dlEnd();
- }
- public void writeMemberFooter(FieldDoc member) {
- writer.dlEnd();
}
/**
- * Check to see if member details should be printed. If
+ * Check to see if overview details should be printed. If
* nocomment option set or if there is no text to be printed
- * for deprecation info, inline comment, no serial tag or inline tags,
- * do not print member details.
+ * for deprecation info, comment or tags, do not print overview details.
+ *
+ * @param field the field to check overview details for.
+ * @return true if overview details need to be printed
*/
- public boolean shouldPrintMemberDetails(FieldDoc field) {
- if (!configuration().nocomment)
- if((field.inlineTags().length > 0) ||
- (field.tags("serial").length > 0) || (writer.hasTagsToPrint(field)))
+ public boolean shouldPrintOverview(FieldDoc field) {
+ if (!configuration().nocomment) {
+ if(!field.commentText().isEmpty() ||
+ writer.hasSerializationOverviewTags(field))
return true;
- if (!Util.isDeprecated(field))
+ }
+ if (field.tags("deprecated").length > 0)
return true;
return false;
}
+
+ public void writeMemberFooter() {
+ printMemberFooter();
+ }
+
+ /**
+ * Write the footer information. If the serilization overview section was
+ * printed, check for definition list and close list tag.
+ *
+ * @param heading the heading that was written.
+ */
+ public void writeFooter(String heading) {
+ if (printedOverallAnchor) {
+ if (heading.equals(
+ configuration().getText("doclet.Serialized_Form_class"))) {
+ writer.printMemberDetailsListEndTag();
+ assert !writer.getMemberDetailsListPrinted();
+ }
+ }
+ }
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,9 +25,9 @@
package com.sun.tools.doclets.formats.html;
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
-import com.sun.javadoc.*;
/**
* Generate serialized form for Serializable/Externalizable methods.
@@ -66,14 +66,12 @@
writeSignature(member);
}
- public void writeMemberFooter(MethodDoc member) {
- writer.dlEnd();
+ public void writeMemberFooter() {
+ printMemberFooter();
}
public void writeDeprecatedMemberInfo(MethodDoc member) {
- print(((TagletOutputImpl)
- (new DeprecatedTaglet()).getTagletOutput(member,
- writer.getTagletWriterInstance(false))).toString());
+ printDeprecated(member);
}
public void writeMemberDescription(MethodDoc member) {
@@ -81,23 +79,27 @@
}
public void writeMemberTags(MethodDoc member) {
- writer.dd();
- writer.dl();
TagletOutputImpl output = new TagletOutputImpl("");
TagletManager tagletManager =
ConfigurationImpl.getInstance().tagletManager;
TagletWriter.genTagOuput(tagletManager, member,
tagletManager.getSerializedFormTags(),
writer.getTagletWriterInstance(false), output);
- print(output.toString());
+ String outputString = output.toString().trim();
+ if (!outputString.isEmpty()) {
+ writer.printMemberDetailsListStartTag();
+ writer.dd();
+ writer.dl();
+ print(outputString);
+ writer.dlEnd();
+ writer.ddEnd();
+ }
MethodDoc method = member;
if (method.name().compareTo("writeExternal") == 0
&& method.tags("serialData").length == 0) {
serialWarning(member.position(), "doclet.MissingSerialDataTag",
method.containingClass().qualifiedName(), method.name());
}
- writer.ddEnd();
- writer.dlEnd();
}
protected void printTypeLinkNoDimension(Type type) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,13 +25,13 @@
package com.sun.tools.doclets.formats.html;
+import java.io.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
-import java.io.*;
-import com.sun.javadoc.*;
-
/**
* Writes method documentation in HTML format.
*
@@ -172,7 +172,7 @@
writeParameters(method);
writeExceptions(method);
writer.preEnd();
- writer.dl();
+ assert !writer.getMemberDetailsListPrinted();
}
/**
@@ -181,12 +181,7 @@
* @param method the method being documented.
*/
public void writeDeprecated(MethodDoc method) {
- String output = ((TagletOutputImpl)
- (new DeprecatedTaglet()).getTagletOutput(method,
- writer.getTagletWriterInstance(false))).toString();
- if (output != null && output.trim().length() > 0) {
- writer.print(output);
- }
+ printDeprecated(method);
}
/**
@@ -197,11 +192,13 @@
public void writeComments(Type holder, MethodDoc method) {
ClassDoc holderClassDoc = holder.asClassDoc();
if (method.inlineTags().length > 0) {
+ writer.printMemberDetailsListStartTag();
if (holder.asClassDoc().equals(classdoc) ||
(! (holderClassDoc.isPublic() ||
Util.isLinkable(holderClassDoc, configuration())))) {
writer.dd();
writer.printInlineComment(method);
+ writer.ddEnd();
} else {
String classlink = writer.codeText(
writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY,
@@ -217,6 +214,7 @@
writer.ddEnd();
writer.dd();
writer.printInlineComment(method);
+ writer.ddEnd();
}
}
}
@@ -234,8 +232,7 @@
* Write the method footer.
*/
public void writeMethodFooter() {
- writer.ddEnd();
- writer.dlEnd();
+ printMemberFooter();
}
/**
@@ -318,6 +315,7 @@
String name = method.name();
writer.dt();
writer.strongText(label);
+ writer.dtEnd();
writer.dd();
String methLink = writer.codeText(
writer.getLink(
@@ -326,6 +324,7 @@
writer.getAnchor(method), name, false)
));
writer.printText("doclet.in_class", methLink, overriddenTypeLink);
+ writer.ddEnd();
}
}
@@ -364,11 +363,13 @@
LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY, intfac)));
writer.dt();
writer.strongText("doclet.Specified_By");
+ writer.dtEnd();
writer.dd();
methlink = writer.codeText(writer.getDocLink(
LinkInfoImpl.CONTEXT_MEMBER, implementedMeth,
implementedMeth.name(), false));
writer.printText("doclet.in_interface", methlink, intfaclink);
+ writer.ddEnd();
}
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,11 +25,11 @@
package com.sun.tools.doclets.formats.html;
+import java.io.*;
+
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
-
-import java.io.*;
/**
* Writes nested class documentation in HTML format.
@@ -129,7 +129,6 @@
writer.println("");
}
writer.anchor(nestedClass.name());
- writer.dl();
writer.h3();
writer.print(nestedClass.name());
writer.h3End();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,9 +25,10 @@
package com.sun.tools.doclets.formats.html;
-import com.sun.tools.doclets.internal.toolkit.util.*;
+import java.io.*;
+
import com.sun.javadoc.*;
-import java.io.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
/**
* Class to generate Tree page for a package. The name of the file generated is
@@ -145,8 +146,10 @@
dl();
dt();
strongText("doclet.Package_Hierarchies");
+ dtEnd();
dd();
navLinkMainTree(configuration.getText("doclet.All_Packages"));
+ ddEnd();
dlEnd();
hr();
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,17 +25,18 @@
package com.sun.tools.doclets.formats.html;
+import com.sun.javadoc.*;
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder;
import com.sun.tools.doclets.internal.toolkit.taglets.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
/**
* The taglet writer that writes HTML.
*
* @since 1.5
* @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
*/
public class TagletWriterImpl extends TagletWriter {
@@ -99,11 +100,12 @@
output.append(DocletConstants.NL + "<P>" +
DocletConstants.NL);
}
+ output.append("</DD>");
} else {
if (Util.isDeprecated(member.containingClass())) {
output.append("<DD><STRONG>" +
ConfigurationImpl.getInstance().
- getText("doclet.Deprecated") + "</STRONG> ");
+ getText("doclet.Deprecated") + "</STRONG> </DD>");
}
}
}
@@ -123,7 +125,7 @@
public TagletOutput getParamHeader(String header) {
StringBuffer result = new StringBuffer();
result.append("<DT>");
- result.append("<STRONG>" + header + "</STRONG>");
+ result.append("<STRONG>" + header + "</STRONG></DT>");
return new TagletOutputImpl(result.toString());
}
@@ -132,7 +134,7 @@
*/
public TagletOutput paramTagOutput(ParamTag paramTag, String paramName) {
TagletOutput result = new TagletOutputImpl("<DD><CODE>" + paramName + "</CODE>"
- + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false));
+ + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false) + "</DD>");
return result;
}
@@ -142,9 +144,9 @@
public TagletOutput returnTagOutput(Tag returnTag) {
TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "<DT>" +
"<STRONG>" + htmlWriter.configuration.getText("doclet.Returns") +
- "</STRONG>" + "<DD>" +
+ "</STRONG>" + "</DT>" + "<DD>" +
htmlWriter.commentTagsToString(returnTag, null, returnTag.inlineTags(),
- false));
+ false) + "</DD>");
return result;
}
@@ -174,22 +176,21 @@
}
if (holder.isClass() && ((ClassDoc)holder).isSerializable()) {
//Automatically add link to serialized form page for serializable classes.
- if (!(SerializedFormBuilder.serialInclude(holder) &&
+ if ((SerializedFormBuilder.serialInclude(holder) &&
SerializedFormBuilder.serialInclude(((ClassDoc)holder).containingPackage()))) {
- return result.equals("") ? null : new TagletOutputImpl(result);
+ result = addSeeHeader(result);
+ result += htmlWriter.getHyperLink(htmlWriter.relativePath + "serialized-form.html",
+ ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false);
}
- result = addSeeHeader(result);
- result += htmlWriter.getHyperLink(htmlWriter.relativePath + "serialized-form.html",
- ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false);
}
- return result.equals("") ? null : new TagletOutputImpl(result);
+ return result.equals("") ? null : new TagletOutputImpl(result + "</DD>");
}
private String addSeeHeader(String result) {
if (result != null && result.length() > 0) {
return result + ", " + DocletConstants.NL;
} else {
- return "<DT><STRONG>" + htmlWriter.configuration().getText("doclet.See_Also") + "</STRONG><DD>";
+ return "<DT><STRONG>" + htmlWriter.configuration().getText("doclet.See_Also") + "</STRONG></DT><DD>";
}
}
@@ -205,7 +206,8 @@
}
result += htmlWriter.commentTagsToString(simpleTags[i], null, simpleTags[i].inlineTags(), false);
}
- return new TagletOutputImpl(result + "</DD>" + DocletConstants.NL);
+ result += "</DD>" + DocletConstants.NL;
+ return new TagletOutputImpl(result);
}
/**
@@ -222,7 +224,7 @@
*/
public TagletOutput getThrowsHeader() {
return new TagletOutputImpl(DocletConstants.NL + "<DT>" + "<STRONG>" +
- htmlWriter.configuration().getText("doclet.Throws") + "</STRONG>");
+ htmlWriter.configuration().getText("doclet.Throws") + "</STRONG></DT>");
}
/**
@@ -241,6 +243,7 @@
if (text != null && text.toString().length() > 0) {
result += " - " + text;
}
+ result += "</DD>";
return new TagletOutputImpl(result);
}
@@ -250,7 +253,7 @@
public TagletOutput throwsTagOutput(Type throwsType) {
return new TagletOutputImpl(DocletConstants.NL + "<DD>" +
htmlWriter.codeText(htmlWriter.getLink(
- new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))));
+ new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "</DD>");
}
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,9 +25,11 @@
package com.sun.tools.doclets.formats.html;
-import com.sun.tools.doclets.internal.toolkit.util.*;
+import java.io.*;
+
import com.sun.javadoc.*;
-import java.io.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
/**
* Generate Class Hierarchy page for all the Classes in this run. Use
* ClassTree for building the Tree. The name of
@@ -120,6 +122,7 @@
dl();
dt();
strongText("doclet.Package_Hierarchies");
+ dtEnd();
dd();
for (int i = 0; i < packages.length; i++) {
if (packages[i].name().length() == 0) {
@@ -131,6 +134,7 @@
print(", ");
}
}
+ ddEnd();
dlEnd();
hr();
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -245,6 +245,31 @@
}
/**
+ * Keep track of member details list. Print the definition list start tag
+ * if it is not printed yet.
+ */
+ public void printMemberDetailsListStartTag () {
+ if (!getMemberDetailsListPrinted()) {
+ dl();
+ memberDetailsListPrinted = true;
+ }
+ }
+
+ /**
+ * Print the definition list end tag if the list start tag was printed.
+ */
+ public void printMemberDetailsListEndTag () {
+ if (getMemberDetailsListPrinted()) {
+ dlEnd();
+ memberDetailsListPrinted = false;
+ }
+ }
+
+ public boolean getMemberDetailsListPrinted() {
+ return memberDetailsListPrinted;
+ }
+
+ /**
* Print the frameset version of the Html file header.
* Called only when generating an HTML frameset file.
*
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,9 +25,10 @@
package com.sun.tools.doclets.formats.html.markup;
+import java.io.*;
+
import com.sun.tools.doclets.internal.toolkit.*;
import com.sun.tools.doclets.internal.toolkit.util.*;
-import java.io.*;
/**
* Class for the Html format code generation.
@@ -61,6 +62,11 @@
protected Configuration configuration;
/**
+ * The flag to indicate whether a member details list is printed or not.
+ */
+ protected boolean memberDetailsListPrinted;
+
+ /**
* Constructor.
*
* @param path The directory path to be created for this file
@@ -79,6 +85,7 @@
super(Util.genWriter(configuration, path, filename, docencoding));
this.configuration = configuration;
htmlFilename = filename;
+ this.memberDetailsListPrinted = false;
}
/**
@@ -529,7 +536,14 @@
}
/**
- * Print <DT> tag.
+ * Print </DT> tag.
+ */
+ public void dtEnd() {
+ print("</DT>");
+ }
+
+ /**
+ * Print <DD> tag.
*/
public void dd() {
print("<DD>");
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,8 +25,9 @@
package com.sun.tools.doclets.internal.toolkit;
+import java.io.*;
+
import com.sun.javadoc.*;
-import java.io.*;
/**
* The interface for writing serialized form output.
@@ -147,22 +148,27 @@
String fieldDimensions, String fieldName);
/**
- * Write the footer.
- *
- * @param member the member to write the header for.
+ * Write the member footer.
*/
- public void writeMemberFooter(FieldDoc member);
+ public void writeMemberFooter();
/**
- * Check to see if member details should be printed. If
+ * Check to see if overview details should be printed. If
* nocomment option set or if there is no text to be printed
- * for deprecation info, inline comment, no serial tag or inline tags,
- * do not print member details.
+ * for deprecation info, inline comment or tags,
+ * do not print overview details.
*
- * @param member the member to check details for.
- * @return true if details need to be printed
+ * @param field the field to check overview details for.
+ * @return true if overview details need to be printed
*/
- public boolean shouldPrintMemberDetails(FieldDoc member);
+ public boolean shouldPrintOverview(FieldDoc field);
+
+ /**
+ * Write the footer.
+ *
+ * @param heading the heading that was written.
+ */
+ public void writeFooter (String heading);
}
/**
@@ -193,10 +199,8 @@
/**
* Write the footer.
- *
- * @param member the member to write the header for.
*/
- public void writeMemberFooter(MethodDoc member);
+ public void writeMemberFooter();
/**
* Write the deprecated information for this member.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Mon Mar 09 23:53:41 2009 -0700
@@ -25,13 +25,14 @@
package com.sun.tools.doclets.internal.toolkit.builders;
-import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.javadoc.*;
import java.io.*;
import java.lang.reflect.*;
import java.util.*;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+
/**
* Builds the serialized form.
*
@@ -40,6 +41,7 @@
* Do not use it as an API
*
* @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
* @since 1.5
*/
public class SerializedFormBuilder extends AbstractBuilder {
@@ -379,7 +381,7 @@
* Build the method footer.
*/
public void buildMethodFooter() {
- methodWriter.writeMemberFooter((MethodDoc) currentMember);
+ methodWriter.writeMemberFooter();
}
/**
@@ -405,15 +407,18 @@
Util.asList(classDoc.serializableFields()).get(0);
// Check to see if there are inline comments, tags or deprecation
// information to be printed.
- if (fieldWriter.shouldPrintMemberDetails(serialPersistentField)) {
+ if (fieldWriter.shouldPrintOverview(serialPersistentField)) {
fieldWriter.writeHeader(
- configuration.getText("doclet.Serialized_Form_class"));
+ configuration.getText("doclet.Serialized_Form_class"));
fieldWriter.writeMemberDeprecatedInfo(serialPersistentField);
if (!configuration.nocomment) {
fieldWriter.writeMemberDescription(serialPersistentField);
fieldWriter.writeMemberTags(serialPersistentField);
}
- fieldWriter.writeMemberFooter(serialPersistentField);
+ // Footer required to close the definition list tag
+ // for serialization overview.
+ fieldWriter.writeFooter(
+ configuration.getText("doclet.Serialized_Form_class"));
}
}
}
@@ -476,11 +481,11 @@
}
/**
- * Build the field footer.
+ * Build the field sub footer.
*/
- public void buildFieldFooter() {
+ public void buildFieldSubFooter() {
if (! currentClass.definesSerializableFields()) {
- fieldWriter.writeMemberFooter((FieldDoc) currentMember);
+ fieldWriter.writeMemberFooter();
}
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Mon Mar 09 23:53:41 2009 -0700
@@ -1,205 +1,205 @@
-<?xml version='1.0' encoding='utf-8'?>
-
-<!--
+<?xml version='1.0' encoding='utf-8'?>
+
+<!--
Copyright 2003-2009 Sun Microsystems, Inc. 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. Sun designates this
- particular file as subject to the "Classpath" exception as provided
- by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- CA 95054 USA or visit www.sun.com if you need additional information or
- have any questions.
--->
-
-
-<Doclet>
-
- <PackageDoc>
- <PackageHeader/>
- <Summary>
- <SummaryHeader/>
- <InterfaceSummary/>
- <ClassSummary/>
- <EnumSummary/>
- <ExceptionSummary/>
- <ErrorSummary/>
- <AnnotationTypeSummary/>
- <SummaryFooter/>
- </Summary>
- <PackageDescription/>
- <PackageTags/>
- <PackageFooter/>
- </PackageDoc>
-
- <AnnotationTypeDoc>
- <AnnotationTypeHeader/>
- <DeprecationInfo/>
- <AnnotationTypeSignature/>
- <AnnotationTypeDescription/>
- <AnnotationTypeTagInfo/>
- <MemberSummary>
- <AnnotationTypeRequiredMemberSummary/>
- <AnnotationTypeOptionalMemberSummary/>
- </MemberSummary>
- <AnnotationTypeRequiredMemberDetails>
- <Header/>
- <AnnotationTypeRequiredMember>
- <MemberHeader/>
- <Signature/>
- <DeprecationInfo/>
- <MemberComments/>
- <TagInfo/>
- <MemberFooter/>
- </AnnotationTypeRequiredMember>
- </AnnotationTypeRequiredMemberDetails>
- <AnnotationTypeOptionalMemberDetails>
- <AnnotationTypeOptionalMember>
- <MemberHeader/>
- <Signature/>
- <DeprecationInfo/>
- <MemberComments/>
- <TagInfo/>
- <DefaultValueInfo/>
- <MemberFooter/>
- </AnnotationTypeOptionalMember>
- <Footer/>
- </AnnotationTypeOptionalMemberDetails>
- <AnnotationTypeFooter/>
- </AnnotationTypeDoc>
-
- <ClassDoc>
- <ClassHeader/>
- <ClassTree/>
- <TypeParamInfo/>
- <SuperInterfacesInfo/>
- <ImplementedInterfacesInfo/>
- <SubClassInfo/>
- <SubInterfacesInfo/>
- <InterfaceUsageInfo/>
- <NestedClassInfo/>
- <DeprecationInfo/>
- <ClassSignature/>
- <ClassDescription/>
- <ClassTagInfo/>
- <MemberSummary>
- <NestedClassesSummary/>
- <NestedClassesInheritedSummary/>
- <EnumConstantsSummary/>
- <FieldsSummary/>
- <FieldsInheritedSummary/>
- <ConstructorsSummary/>
- <MethodsSummary/>
- <MethodsInheritedSummary/>
- </MemberSummary>
- <EnumConstantsDetails>
- <Header/>
- <EnumConstant>
- <EnumConstantHeader/>
- <Signature/>
- <DeprecationInfo/>
- <EnumConstantComments/>
- <TagInfo/>
- <EnumConstantFooter/>
- </EnumConstant>
- <Footer/>
- </EnumConstantsDetails>
- <FieldDetails>
- <Header/>
- <FieldDoc>
- <FieldHeader/>
- <Signature/>
- <DeprecationInfo/>
- <FieldComments/>
- <TagInfo/>
- <FieldFooter/>
- </FieldDoc>
- <Footer/>
- </FieldDetails>
- <ConstructorDetails>
- <Header/>
- <ConstructorDoc>
- <ConstructorHeader/>
- <Signature/>
- <DeprecationInfo/>
- <ConstructorComments/>
- <TagInfo/>
- <ConstructorFooter/>
- </ConstructorDoc>
- <Footer/>
- </ConstructorDetails>
- <MethodDetails>
- <Header/>
- <MethodDoc>
- <MethodHeader/>
- <Signature/>
- <DeprecationInfo/>
- <MethodComments/>
- <TagInfo/>
- <MethodFooter/>
- </MethodDoc>
- <Footer/>
- </MethodDetails>
- <ClassFooter/>
- </ClassDoc>
-
- <ConstantSummary>
- <Header/>
- <Contents/>
- <ConstantSummaries>
- <PackageConstantSummary>
- <PackageHeader/>
- <ClassConstantSummary>
- <ClassHeader/>
- <ConstantMembers/>
- <ClassFooter/>
- </ClassConstantSummary>
- </PackageConstantSummary>
- </ConstantSummaries>
- <Footer/>
- </ConstantSummary>
-
- <SerializedForm>
- <Header/>
- <SerializedFormSummaries>
- <PackageSerializedForm>
- <PackageHeader/>
- <ClassSerializedForm>
- <ClassHeader/>
- <SerialUIDInfo/>
- <MethodHeader/>
- <SerializableMethods>
- <MethodSubHeader/>
- <DeprecatedMethodInfo/>
- <MethodInfo>
- <MethodDescription/>
- <MethodTags/>
- </MethodInfo>
- <MethodFooter/>
- </SerializableMethods>
- <FieldHeader/>
- <SerializableFields>
- <FieldSubHeader/>
- <FieldDeprecationInfo/>
- <FieldInfo/>
- <FieldFooter/>
- </SerializableFields>
- </ClassSerializedForm>
- </PackageSerializedForm>
- </SerializedFormSummaries>
- <Footer/>
- </SerializedForm>
-</Doclet>
+ 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. Sun designates this
+ particular file as subject to the "Classpath" exception as provided
+ by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ CA 95054 USA or visit www.sun.com if you need additional information or
+ have any questions.
+-->
+
+
+<Doclet>
+
+ <PackageDoc>
+ <PackageHeader/>
+ <Summary>
+ <SummaryHeader/>
+ <InterfaceSummary/>
+ <ClassSummary/>
+ <EnumSummary/>
+ <ExceptionSummary/>
+ <ErrorSummary/>
+ <AnnotationTypeSummary/>
+ <SummaryFooter/>
+ </Summary>
+ <PackageDescription/>
+ <PackageTags/>
+ <PackageFooter/>
+ </PackageDoc>
+
+ <AnnotationTypeDoc>
+ <AnnotationTypeHeader/>
+ <DeprecationInfo/>
+ <AnnotationTypeSignature/>
+ <AnnotationTypeDescription/>
+ <AnnotationTypeTagInfo/>
+ <MemberSummary>
+ <AnnotationTypeRequiredMemberSummary/>
+ <AnnotationTypeOptionalMemberSummary/>
+ </MemberSummary>
+ <AnnotationTypeRequiredMemberDetails>
+ <Header/>
+ <AnnotationTypeRequiredMember>
+ <MemberHeader/>
+ <Signature/>
+ <DeprecationInfo/>
+ <MemberComments/>
+ <TagInfo/>
+ <MemberFooter/>
+ </AnnotationTypeRequiredMember>
+ </AnnotationTypeRequiredMemberDetails>
+ <AnnotationTypeOptionalMemberDetails>
+ <AnnotationTypeOptionalMember>
+ <MemberHeader/>
+ <Signature/>
+ <DeprecationInfo/>
+ <MemberComments/>
+ <TagInfo/>
+ <DefaultValueInfo/>
+ <MemberFooter/>
+ </AnnotationTypeOptionalMember>
+ <Footer/>
+ </AnnotationTypeOptionalMemberDetails>
+ <AnnotationTypeFooter/>
+ </AnnotationTypeDoc>
+
+ <ClassDoc>
+ <ClassHeader/>
+ <ClassTree/>
+ <TypeParamInfo/>
+ <SuperInterfacesInfo/>
+ <ImplementedInterfacesInfo/>
+ <SubClassInfo/>
+ <SubInterfacesInfo/>
+ <InterfaceUsageInfo/>
+ <NestedClassInfo/>
+ <DeprecationInfo/>
+ <ClassSignature/>
+ <ClassDescription/>
+ <ClassTagInfo/>
+ <MemberSummary>
+ <NestedClassesSummary/>
+ <NestedClassesInheritedSummary/>
+ <EnumConstantsSummary/>
+ <FieldsSummary/>
+ <FieldsInheritedSummary/>
+ <ConstructorsSummary/>
+ <MethodsSummary/>
+ <MethodsInheritedSummary/>
+ </MemberSummary>
+ <EnumConstantsDetails>
+ <Header/>
+ <EnumConstant>
+ <EnumConstantHeader/>
+ <Signature/>
+ <DeprecationInfo/>
+ <EnumConstantComments/>
+ <TagInfo/>
+ <EnumConstantFooter/>
+ </EnumConstant>
+ <Footer/>
+ </EnumConstantsDetails>
+ <FieldDetails>
+ <Header/>
+ <FieldDoc>
+ <FieldHeader/>
+ <Signature/>
+ <DeprecationInfo/>
+ <FieldComments/>
+ <TagInfo/>
+ <FieldFooter/>
+ </FieldDoc>
+ <Footer/>
+ </FieldDetails>
+ <ConstructorDetails>
+ <Header/>
+ <ConstructorDoc>
+ <ConstructorHeader/>
+ <Signature/>
+ <DeprecationInfo/>
+ <ConstructorComments/>
+ <TagInfo/>
+ <ConstructorFooter/>
+ </ConstructorDoc>
+ <Footer/>
+ </ConstructorDetails>
+ <MethodDetails>
+ <Header/>
+ <MethodDoc>
+ <MethodHeader/>
+ <Signature/>
+ <DeprecationInfo/>
+ <MethodComments/>
+ <TagInfo/>
+ <MethodFooter/>
+ </MethodDoc>
+ <Footer/>
+ </MethodDetails>
+ <ClassFooter/>
+ </ClassDoc>
+
+ <ConstantSummary>
+ <Header/>
+ <Contents/>
+ <ConstantSummaries>
+ <PackageConstantSummary>
+ <PackageHeader/>
+ <ClassConstantSummary>
+ <ClassHeader/>
+ <ConstantMembers/>
+ <ClassFooter/>
+ </ClassConstantSummary>
+ </PackageConstantSummary>
+ </ConstantSummaries>
+ <Footer/>
+ </ConstantSummary>
+
+ <SerializedForm>
+ <Header/>
+ <SerializedFormSummaries>
+ <PackageSerializedForm>
+ <PackageHeader/>
+ <ClassSerializedForm>
+ <ClassHeader/>
+ <SerialUIDInfo/>
+ <MethodHeader/>
+ <SerializableMethods>
+ <MethodSubHeader/>
+ <DeprecatedMethodInfo/>
+ <MethodInfo>
+ <MethodDescription/>
+ <MethodTags/>
+ </MethodInfo>
+ <MethodFooter/>
+ </SerializableMethods>
+ <FieldHeader/>
+ <SerializableFields>
+ <FieldSubHeader/>
+ <FieldDeprecationInfo/>
+ <FieldInfo/>
+ <FieldSubFooter/>
+ </SerializableFields>
+ </ClassSerializedForm>
+ </PackageSerializedForm>
+ </SerializedFormSummaries>
+ <Footer/>
+ </SerializedForm>
+</Doclet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,324 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.javac.code;
+
+import java.util.Locale;
+
+import com.sun.tools.javac.api.Messages;
+import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.ListBuffer;
+
+import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.BoundKind.*;
+import static com.sun.tools.javac.code.Flags.*;
+
+/**
+ * A combined type/symbol visitor for generating non-trivial localized string
+ * representation of types and symbols.
+ */
+public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Visitor<String, Locale> {
+
+ /**
+ * This method should be overriden in order to provide proper i18n support.
+ *
+ * @param locale the locale in which the string is to be rendered
+ * @param key the key corresponding to the message to be displayed
+ * @param args a list of optional arguments
+ * @return localized string representation
+ */
+ protected abstract String localize(Locale locale, String key, Object... args);
+
+ /**
+ * Create a printer with default i18n support provided my Messages.
+ * @param messages Messages class to be used for i18n
+ * @return printer visitor instance
+ */
+ public static Printer createStandardPrinter(final Messages messages) {
+ return new Printer() {
+ @Override
+ protected String localize(Locale locale, String key, Object... args) {
+ return messages.getLocalizedString(locale, key, args);
+ }};
+ }
+
+ /**
+ * Get a localized string representation for all the types in the input list.
+ *
+ * @param ts types to be displayed
+ * @param locale the locale in which the string is to be rendered
+ * @return localized string representation
+ */
+ public String visitTypes(List<Type> ts, Locale locale) {
+ ListBuffer<String> sbuf = ListBuffer.lb();
+ for (Type t : ts) {
+ sbuf.append(visit(t, locale));
+ }
+ return sbuf.toList().toString();
+ }
+
+ /**
+ * * Get a localized string represenation for all the symbols in the input list.
+ *
+ * @param ts symbols to be displayed
+ * @param locale the locale in which the string is to be rendered
+ * @return localized string representation
+ */
+ public String visitSymbols(List<Symbol> ts, Locale locale) {
+ ListBuffer<String> sbuf = ListBuffer.lb();
+ for (Symbol t : ts) {
+ sbuf.append(visit(t, locale));
+ }
+ return sbuf.toList().toString();
+ }
+
+ /**
+ * Get a localized string represenation for a given type.
+ *
+ * @param ts type to be displayed
+ * @param locale the locale in which the string is to be rendered
+ * @return localized string representation
+ */
+ public String visit(Type t, Locale locale) {
+ return t.accept(this, locale);
+ }
+
+ /**
+ * Get a localized string represenation for a given symbol.
+ *
+ * @param ts symbol to be displayed
+ * @param locale the locale in which the string is to be rendered
+ * @return localized string representation
+ */
+ public String visit(Symbol s, Locale locale) {
+ return s.accept(this, locale);
+ }
+
+ @Override
+ public String visitCapturedType(CapturedType t, Locale locale) {
+ return localize(locale, "compiler.misc.type.captureof",
+ (t.hashCode() & 0xFFFFFFFFL) % Type.CapturedType.PRIME,
+ visit(t.wildcard, locale));
+ }
+
+ @Override
+ public String visitForAll(ForAll t, Locale locale) {
+ return "<" + visitTypes(t.tvars, locale) + ">" + visit(t.qtype, locale);
+ }
+
+ @Override
+ public String visitUndetVar(UndetVar t, Locale locale) {
+ if (t.inst != null) {
+ return visit(t.inst, locale);
+ } else {
+ return visit(t.qtype, locale) + "?";
+ }
+ }
+
+ @Override
+ public String visitArrayType(ArrayType t, Locale locale) {
+ return visit(t.elemtype, locale) + "[]";
+ }
+
+ @Override
+ public String visitClassType(ClassType t, Locale locale) {
+ StringBuffer buf = new StringBuffer();
+ if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) {
+ buf.append(visit(t.getEnclosingType(), locale));
+ buf.append(".");
+ buf.append(className(t, false, locale));
+ } else {
+ buf.append(className(t, true, locale));
+ }
+ if (t.getTypeArguments().nonEmpty()) {
+ buf.append('<');
+ buf.append(visitTypes(t.getTypeArguments(), locale));
+ buf.append(">");
+ }
+ return buf.toString();
+ }
+
+ @Override
+ public String visitMethodType(MethodType t, Locale locale) {
+ return "(" + printMethodArgs(t.argtypes, false, locale) + ")" + visit(t.restype, locale);
+ }
+
+ @Override
+ public String visitPackageType(PackageType t, Locale locale) {
+ return t.tsym.getQualifiedName().toString();
+ }
+
+ @Override
+ public String visitWildcardType(WildcardType t, Locale locale) {
+ StringBuffer s = new StringBuffer();
+ s.append(t.kind);
+ if (t.kind != UNBOUND) {
+ s.append(visit(t.type, locale));
+ }
+ return s.toString();
+ }
+
+ @Override
+ public String visitErrorType(ErrorType t, Locale locale) {
+ return visitType(t, locale);
+ }
+
+ @Override
+ public String visitTypeVar(TypeVar t, Locale locale) {
+ return visitType(t, locale);
+ }
+
+ public String visitType(Type t, Locale locale) {
+ String s = (t.tsym == null || t.tsym.name == null)
+ ? localize(locale, "compiler.misc.type.none")
+ : t.tsym.name.toString();
+ return s;
+ }
+
+ /**
+ * Converts a class name into a (possibly localized) string. Anonymous
+ * inner classes gets converted into a localized string.
+ *
+ * @param t the type of the class whose name is to be rendered
+ * @param longform if set, the class' fullname is displayed - if unset the
+ * short name is chosen (w/o package)
+ * @param locale the locale in which the string is to be rendered
+ * @return localized string representation
+ */
+ protected String className(ClassType t, boolean longform, Locale locale) {
+ Symbol sym = t.tsym;
+ if (sym.name.length() == 0 && (sym.flags() & COMPOUND) != 0) {
+ StringBuffer s = new StringBuffer(visit(t.supertype_field, locale));
+ for (List<Type> is = t.interfaces_field; is.nonEmpty(); is = is.tail) {
+ s.append("&");
+ s.append(visit(is.head, locale));
+ }
+ return s.toString();
+ } else if (sym.name.length() == 0) {
+ String s;
+ ClassType norm = (ClassType) t.tsym.type;
+ if (norm == null) {
+ s = localize(locale, "compiler.misc.anonymous.class", (Object) null);
+ } else if (norm.interfaces_field.nonEmpty()) {
+ s = localize(locale, "compiler.misc.anonymous.class",
+ visit(norm.interfaces_field.head, locale));
+ } else {
+ s = localize(locale, "compiler.misc.anonymous.class",
+ visit(norm.supertype_field, locale));
+ }
+ return s;
+ } else if (longform) {
+ return sym.getQualifiedName().toString();
+ } else {
+ return sym.name.toString();
+ }
+ }
+
+ /**
+ * Converts a set of method argument types into their corresponding
+ * localized string representation.
+ *
+ * @param args arguments to be rendered
+ * @param varArgs if true, the last method argument is regarded as a vararg
+ * @param locale the locale in which the string is to be rendered
+ * @return localized string representation
+ */
+ protected String printMethodArgs(List<Type> args, boolean varArgs, Locale locale) {
+ if (!varArgs) {
+ return visitTypes(args, locale);
+ } else {
+ StringBuffer buf = new StringBuffer();
+ while (args.tail.nonEmpty()) {
+ buf.append(visit(args.head, locale));
+ args = args.tail;
+ buf.append(',');
+ }
+ if (args.head.tag == ARRAY) {
+ buf.append(visit(((ArrayType) args.head).elemtype, locale));
+ buf.append("...");
+ } else {
+ buf.append(visit(args.head, locale));
+ }
+ return buf.toString();
+ }
+ }
+
+ @Override
+ public String visitClassSymbol(ClassSymbol sym, Locale locale) {
+ return sym.name.isEmpty()
+ ? localize(locale, "compiler.misc.anonymous.class", sym.flatname)
+ : sym.fullname.toString();
+ }
+
+ @Override
+ public String visitMethodSymbol(MethodSymbol s, Locale locale) {
+ if ((s.flags() & BLOCK) != 0) {
+ return s.owner.name.toString();
+ } else {
+ String ms = (s.name == s.name.table.names.init)
+ ? s.owner.name.toString()
+ : s.name.toString();
+ if (s.type != null) {
+ if (s.type.tag == FORALL) {
+ ms = "<" + visitTypes(s.type.getTypeArguments(), locale) + ">" + ms;
+ }
+ ms += "(" + printMethodArgs(
+ s.type.getParameterTypes(),
+ (s.flags() & VARARGS) != 0,
+ locale) + ")";
+ }
+ return ms;
+ }
+ }
+
+ @Override
+ public String visitOperatorSymbol(OperatorSymbol s, Locale locale) {
+ return visitMethodSymbol(s, locale);
+ }
+
+ @Override
+ public String visitPackageSymbol(PackageSymbol s, Locale locale) {
+ return s.isUnnamed()
+ ? localize(locale, "compiler.misc.unnamed.package")
+ : s.fullname.toString();
+ }
+
+ @Override
+ public String visitTypeSymbol(TypeSymbol s, Locale locale) {
+ return visitSymbol(s, locale);
+ }
+
+ @Override
+ public String visitVarSymbol(VarSymbol s, Locale locale) {
+ return visitSymbol(s, locale);
+ }
+
+ @Override
+ public String visitSymbol(Symbol s, Locale locale) {
+ return s.name.toString();
+ }
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Mon Mar 09 23:53:41 2009 -0700
@@ -27,6 +27,8 @@
import java.util.*;
+import com.sun.tools.javac.api.Messages;
+
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.util.List;
@@ -1010,8 +1012,8 @@
&& !disjointTypes(aHigh.allparams(), lowSub.allparams())
&& !disjointTypes(aLow.allparams(), highSub.allparams())
&& !disjointTypes(aLow.allparams(), lowSub.allparams())) {
- if (upcast ? giveWarning(a, highSub) || giveWarning(a, lowSub)
- : giveWarning(highSub, a) || giveWarning(lowSub, a))
+ if (upcast ? giveWarning(a, b) :
+ giveWarning(b, a))
warnStack.head.warnUnchecked();
return true;
}
@@ -2019,7 +2021,7 @@
return t;
else
return visit(t);
- }
+ }
List<Type> subst(List<Type> ts) {
if (from.tail == null)
@@ -2279,225 +2281,21 @@
}
// </editor-fold>
- // <editor-fold defaultstate="collapsed" desc="printType">
/**
- * Visitor for generating a string representation of a given type
+ * Helper method for generating a string representation of a given type
* accordingly to a given locale
*/
public String toString(Type t, Locale locale) {
- return typePrinter.visit(t, locale);
+ return Printer.createStandardPrinter(messages).visit(t, locale);
}
- // where
- private TypePrinter typePrinter = new TypePrinter();
-
- public class TypePrinter extends DefaultTypeVisitor<String, Locale> {
-
- public String visit(List<Type> ts, Locale locale) {
- ListBuffer<String> sbuf = lb();
- for (Type t : ts) {
- sbuf.append(visit(t, locale));
- }
- return sbuf.toList().toString();
- }
-
- @Override
- public String visitCapturedType(CapturedType t, Locale locale) {
- return messages.getLocalizedString("compiler.misc.type.captureof",
- (t.hashCode() & 0xFFFFFFFFL) % Type.CapturedType.PRIME,
- visit(t.wildcard, locale));
- }
-
- @Override
- public String visitForAll(ForAll t, Locale locale) {
- return "<" + visit(t.tvars, locale) + ">" + visit(t.qtype, locale);
- }
-
- @Override
- public String visitUndetVar(UndetVar t, Locale locale) {
- if (t.inst != null) {
- return visit(t.inst, locale);
- } else {
- return visit(t.qtype, locale) + "?";
- }
- }
-
- @Override
- public String visitArrayType(ArrayType t, Locale locale) {
- return visit(t.elemtype, locale) + "[]";
- }
-
- @Override
- public String visitClassType(ClassType t, Locale locale) {
- StringBuffer buf = new StringBuffer();
- if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) {
- buf.append(visit(t.getEnclosingType(), locale));
- buf.append(".");
- buf.append(className(t, false, locale));
- } else {
- buf.append(className(t, true, locale));
- }
- if (t.getTypeArguments().nonEmpty()) {
- buf.append('<');
- buf.append(visit(t.getTypeArguments(), locale));
- buf.append(">");
- }
- return buf.toString();
- }
-
- @Override
- public String visitMethodType(MethodType t, Locale locale) {
- return "(" + printMethodArgs(t.argtypes, false, locale) + ")" + visit(t.restype, locale);
- }
-
- @Override
- public String visitPackageType(PackageType t, Locale locale) {
- return t.tsym.getQualifiedName().toString();
- }
- @Override
- public String visitWildcardType(WildcardType t, Locale locale) {
- StringBuffer s = new StringBuffer();
- s.append(t.kind);
- if (t.kind != UNBOUND) {
- s.append(visit(t.type, locale));
- }
- return s.toString();
- }
-
-
- public String visitType(Type t, Locale locale) {
- String s = (t.tsym == null || t.tsym.name == null)
- ? messages.getLocalizedString("compiler.misc.type.none")
- : t.tsym.name.toString();
- return s;
- }
-
- protected String className(ClassType t, boolean longform, Locale locale) {
- Symbol sym = t.tsym;
- if (sym.name.length() == 0 && (sym.flags() & COMPOUND) != 0) {
- StringBuffer s = new StringBuffer(visit(supertype(t), locale));
- for (List<Type> is = interfaces(t); is.nonEmpty(); is = is.tail) {
- s.append("&");
- s.append(visit(is.head, locale));
- }
- return s.toString();
- } else if (sym.name.length() == 0) {
- String s;
- ClassType norm = (ClassType) t.tsym.type;
- if (norm == null) {
- s = getLocalizedString(locale, "compiler.misc.anonymous.class", (Object) null);
- } else if (interfaces(norm).nonEmpty()) {
- s = getLocalizedString(locale, "compiler.misc.anonymous.class",
- visit(interfaces(norm).head, locale));
- } else {
- s = getLocalizedString(locale, "compiler.misc.anonymous.class",
- visit(supertype(norm), locale));
- }
- return s;
- } else if (longform) {
- return sym.getQualifiedName().toString();
- } else {
- return sym.name.toString();
- }
- }
-
- protected String printMethodArgs(List<Type> args, boolean varArgs, Locale locale) {
- if (!varArgs) {
- return visit(args, locale);
- } else {
- StringBuffer buf = new StringBuffer();
- while (args.tail.nonEmpty()) {
- buf.append(visit(args.head, locale));
- args = args.tail;
- buf.append(',');
- }
- if (args.head.tag == ARRAY) {
- buf.append(visit(((ArrayType) args.head).elemtype, locale));
- buf.append("...");
- } else {
- buf.append(visit(args.head, locale));
- }
- return buf.toString();
- }
- }
-
- protected String getLocalizedString(Locale locale, String key, Object... args) {
- return messages.getLocalizedString(key, args);
- }
- };
- // </editor-fold>
-
- // <editor-fold defaultstate="collapsed" desc="printSymbol">
/**
- * Visitor for generating a string representation of a given symbol
+ * Helper method for generating a string representation of a given type
* accordingly to a given locale
*/
public String toString(Symbol t, Locale locale) {
- return symbolPrinter.visit(t, locale);
+ return Printer.createStandardPrinter(messages).visit(t, locale);
}
- // where
- private SymbolPrinter symbolPrinter = new SymbolPrinter();
-
- public class SymbolPrinter extends DefaultSymbolVisitor<String, Locale> {
-
- @Override
- public String visitClassSymbol(ClassSymbol sym, Locale locale) {
- return sym.name.isEmpty()
- ? getLocalizedString(locale, "compiler.misc.anonymous.class", sym.flatname)
- : sym.fullname.toString();
- }
-
- @Override
- public String visitMethodSymbol(MethodSymbol s, Locale locale) {
- if ((s.flags() & BLOCK) != 0) {
- return s.owner.name.toString();
- } else {
- String ms = (s.name == names.init)
- ? s.owner.name.toString()
- : s.name.toString();
- if (s.type != null) {
- if (s.type.tag == FORALL) {
- ms = "<" + typePrinter.visit(s.type.getTypeArguments(), locale) + ">" + ms;
- }
- ms += "(" + typePrinter.printMethodArgs(
- s.type.getParameterTypes(),
- (s.flags() & VARARGS) != 0,
- locale) + ")";
- }
- return ms;
- }
- }
-
- @Override
- public String visitOperatorSymbol(OperatorSymbol s, Locale locale) {
- return visitMethodSymbol(s, locale);
- }
-
- @Override
- public String visitPackageSymbol(PackageSymbol s, Locale locale) {
- return s.name.isEmpty()
- ? getLocalizedString(locale, "compiler.misc.unnamed.package")
- : s.fullname.toString();
- }
-
- @Override
- public String visitSymbol(Symbol s, Locale locale) {
- return s.name.toString();
- }
-
- public String visit(List<Symbol> ts, Locale locale) {
- ListBuffer<String> sbuf = lb();
- for (Symbol t : ts) {
- sbuf.append(visit(t, locale));
- }
- return sbuf.toList().toString();
- }
-
- protected String getLocalizedString(Locale locale, String key, Object... args) {
- return messages.getLocalizedString(key, args);
- }
- };
- // </editor-fold>
// <editor-fold defaultstate="collapsed" desc="toString">
/**
@@ -3128,7 +2926,7 @@
return t;
}
// where
- private List<Type> freshTypeVariables(List<Type> types) {
+ public List<Type> freshTypeVariables(List<Type> types) {
ListBuffer<Type> result = lb();
for (Type t : types) {
if (t.tag == WILDCARD) {
@@ -3224,9 +3022,11 @@
}
private boolean giveWarning(Type from, Type to) {
- // To and from are (possibly different) parameterizations
- // of the same class or interface
- return to.isParameterized() && !containsType(to.allparams(), from.allparams());
+ Type subFrom = asSub(from, to.tsym);
+ return to.isParameterized() &&
+ (!(isUnbounded(to) ||
+ isSubtype(from, to) ||
+ ((subFrom != null) && isSameType(subFrom, to))));
}
private List<Type> superClosure(Type t, Type s) {
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Mar 09 23:53:41 2009 -0700
@@ -1545,10 +1545,10 @@
void checkNonCyclic(DiagnosticPosition pos, TypeVar t) {
- checkNonCyclic1(pos, t, new HashSet<TypeVar>());
+ checkNonCyclic1(pos, t, List.<TypeVar>nil());
}
- private void checkNonCyclic1(DiagnosticPosition pos, Type t, Set<TypeVar> seen) {
+ private void checkNonCyclic1(DiagnosticPosition pos, Type t, List<TypeVar> seen) {
final TypeVar tv;
if (t.tag == TYPEVAR && (t.tsym.flags() & UNATTRIBUTED) != 0)
return;
@@ -1558,7 +1558,7 @@
log.error(pos, "cyclic.inheritance", t);
} else if (t.tag == TYPEVAR) {
tv = (TypeVar)t;
- seen.add(tv);
+ seen = seen.prepend(tv);
for (Type b : types.getBounds(tv))
checkNonCyclic1(pos, b, seen);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Mon Mar 09 23:53:41 2009 -0700
@@ -3012,6 +3012,7 @@
vardefinit).setType(tree.var.type);
indexDef.sym = tree.var.sym;
JCBlock body = make.Block(0, List.of(indexDef, tree.body));
+ body.endpos = TreeInfo.endPos(tree.body);
result = translate(make.
ForLoop(List.of(init),
cond,
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java Mon Mar 09 23:53:41 2009 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2005-2009 Sun Microsystems, Inc. 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
@@ -111,6 +111,7 @@
*/
public Set<? extends Element> getElementsAnnotatedWith(TypeElement a) {
Set<Element> result = Collections.emptySet();
+ Types typeUtil = processingEnv.getTypeUtils();
if (a.getKind() != ElementKind.ANNOTATION_TYPE)
throw new IllegalArgumentException(NOT_AN_ANNOTATION_TYPE + a);
@@ -122,7 +123,7 @@
throw new AssertionError("Bad implementation type for " + tm);
ElementScanner6<Set<Element>, DeclaredType> scanner =
- new AnnotationSetScanner(result);
+ new AnnotationSetScanner(result, typeUtil);
for (Element element : rootElements)
result = scanner.scan(element, annotationTypeElement);
@@ -135,9 +136,11 @@
ElementScanner6<Set<Element>, DeclaredType> {
// Insertion-order preserving set
Set<Element> annotatedElements = new LinkedHashSet<Element>();
+ Types typeUtil;
- AnnotationSetScanner(Set<Element> defaultSet) {
+ AnnotationSetScanner(Set<Element> defaultSet, Types typeUtil) {
super(defaultSet);
+ this.typeUtil = typeUtil;
}
@Override
@@ -145,7 +148,7 @@
java.util.List<? extends AnnotationMirror> annotationMirrors =
processingEnv.getElementUtils().getAllAnnotationMirrors(e);
for (AnnotationMirror annotationMirror : annotationMirrors) {
- if (annotationMirror.getAnnotationType().equals(p))
+ if (typeUtil.isSameType(annotationMirror.getAnnotationType(), p))
annotatedElements.add(e);
}
e.accept(this, p);
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Mon Mar 09 23:53:41 2009 -0700
@@ -836,6 +836,9 @@
compiler.misc.type.captureof=\
capture#{0} of {1}
+compiler.misc.type.captureof.1=\
+ capture#{0}
+
compiler.misc.type.none=\
<none>
--- a/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java Mon Mar 09 23:53:41 2009 -0700
@@ -38,6 +38,10 @@
import com.sun.tools.javac.api.DiagnosticFormatter.Configuration.MultilineLimit;
import com.sun.tools.javac.api.DiagnosticFormatter.PositionKind;
import com.sun.tools.javac.api.Formattable;
+import com.sun.tools.javac.code.Printer;
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.CapturedType;
import com.sun.tools.javac.file.JavacFileManager;
import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticType.*;
@@ -60,16 +64,31 @@
* JavacMessages object used by this formatter for i18n.
*/
protected JavacMessages messages;
+
+ /**
+ * Configuration object used by this formatter
+ */
private SimpleConfiguration config;
+
+ /**
+ * Current depth level of the disgnostic being formatted
+ * (!= 0 for subdiagnostics)
+ */
protected int depth = 0;
/**
+ * Printer instance to be used for formatting types/symbol
+ */
+ protected Printer printer;
+
+ /**
* Initialize an AbstractDiagnosticFormatter by setting its JavacMessages object.
* @param messages
*/
protected AbstractDiagnosticFormatter(JavacMessages messages, SimpleConfiguration config) {
this.messages = messages;
this.config = config;
+ this.printer = new FormatterPrinter();
}
public String formatKind(JCDiagnostic d, Locale l) {
@@ -83,6 +102,14 @@
}
}
+ @Override
+ public String format(JCDiagnostic d, Locale locale) {
+ printer = new FormatterPrinter();
+ return formatDiagnostic(d, locale);
+ }
+
+ abstract String formatDiagnostic(JCDiagnostic d, Locale locale);
+
public String formatPosition(JCDiagnostic d, PositionKind pk,Locale l) {
assert (d.getPosition() != Position.NOPOS);
return String.valueOf(getPosition(d, pk));
@@ -143,12 +170,21 @@
else if (arg instanceof Iterable<?>) {
return formatIterable(d, (Iterable<?>)arg, l);
}
- else if (arg instanceof JavaFileObject)
+ else if (arg instanceof Type) {
+ return printer.visit((Type)arg, l);
+ }
+ else if (arg instanceof Symbol) {
+ return printer.visit((Symbol)arg, l);
+ }
+ else if (arg instanceof JavaFileObject) {
return JavacFileManager.getJavacBaseFileName((JavaFileObject)arg);
- else if (arg instanceof Formattable)
+ }
+ else if (arg instanceof Formattable) {
return ((Formattable)arg).toString(l, messages);
- else
+ }
+ else {
return String.valueOf(arg);
+ }
}
/**
@@ -404,4 +440,43 @@
return caretEnabled;
}
}
+
+ /**
+ * An enhanced printer for formatting types/symbols used by
+ * AbstractDiagnosticFormatter. Provides alternate numbering of captured
+ * types (they are numbered starting from 1 on each new diagnostic, instead
+ * of relying on the underlying hashcode() method which generates unstable
+ * output). Also detects cycles in wildcard messages (e.g. if the wildcard
+ * type referred by a given captured type C contains C itself) which might
+ * lead to infinite loops.
+ */
+ protected class FormatterPrinter extends Printer {
+
+ List<Type> allCaptured = List.nil();
+ List<Type> seenCaptured = List.nil();
+
+ @Override
+ protected String localize(Locale locale, String key, Object... args) {
+ return AbstractDiagnosticFormatter.this.localize(locale, key, args);
+ }
+
+ @Override
+ public String visitCapturedType(CapturedType t, Locale locale) {
+ if (seenCaptured.contains(t))
+ return localize(locale, "compiler.misc.type.captureof.1",
+ allCaptured.indexOf(t) + 1);
+ else {
+ try {
+ seenCaptured = seenCaptured.prepend(t);
+ allCaptured = allCaptured.append(t);
+ return localize(locale, "compiler.misc.type.captureof",
+ allCaptured.indexOf(t) + 1,
+ visit(t.wildcard, locale));
+ }
+ finally {
+ seenCaptured = seenCaptured.tail;
+ }
+ }
+ }
+ }
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java Mon Mar 09 23:53:41 2009 -0700
@@ -82,7 +82,7 @@
super(msgs, new BasicConfiguration());
}
- public String format(JCDiagnostic d, Locale l) {
+ public String formatDiagnostic(JCDiagnostic d, Locale l) {
if (l == null)
l = messages.getCurrentLocale();
String format = selectFormat(d);
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java Mon Mar 09 23:53:41 2009 -0700
@@ -54,7 +54,7 @@
}
//provide common default formats
- public String format(JCDiagnostic d, Locale l) {
+ public String formatDiagnostic(JCDiagnostic d, Locale l) {
try {
StringBuffer buf = new StringBuffer();
if (d.getPosition() != Position.NOPOS) {
@@ -82,17 +82,11 @@
public String formatMessage(JCDiagnostic d, Locale l) {
StringBuilder buf = new StringBuilder();
Collection<String> args = formatArguments(d, l);
- buf.append(d.getCode());
- String sep = ": ";
- for (Object o : args) {
- buf.append(sep);
- buf.append(o);
- sep = ", ";
- }
+ buf.append(localize(null, d.getCode(), args.toArray()));
if (d.isMultiline() && getConfiguration().getVisible().contains(DiagnosticPart.SUBDIAGNOSTICS)) {
List<String> subDiags = formatSubdiagnostics(d, null);
if (subDiags.nonEmpty()) {
- sep = "";
+ String sep = "";
buf.append(",{");
for (String sub : formatSubdiagnostics(d, null)) {
buf.append(sep);
@@ -117,4 +111,17 @@
else
return s;
}
+
+ @Override
+ protected String localize(Locale l, String key, Object... args) {
+ StringBuilder buf = new StringBuilder();
+ buf.append(key);
+ String sep = ": ";
+ for (Object o : args) {
+ buf.append(sep);
+ buf.append(o);
+ sep = ", ";
+ }
+ return buf.toString();
+ }
}
--- a/langtools/src/share/classes/javax/annotation/processing/Filer.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/src/share/classes/javax/annotation/processing/Filer.java Mon Mar 09 23:53:41 2009 -0700
@@ -35,9 +35,11 @@
* processor. Files created in this way will be known to the
* annotation processing tool implementing this interface, better
* enabling the tool to manage them. Source and class files so
- * created will be considered for processing by the tool after the
- * {@code close} method has been called on the {@code Writer} or
- * {@code OutputStream} used to write the contents of the file.
+ * created will be {@linkplain RoundEnvironment#getRootElements
+ * considered for processing} by the tool in a subsequent {@linkplain
+ * RoundEnvironment round of processing} after the {@code close}
+ * method has been called on the {@code Writer} or {@code
+ * OutputStream} used to write the contents of the file.
*
* Three kinds of files are distinguished: source files, class files,
* and auxiliary resource files.
--- a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java Mon Mar 09 23:53:41 2009 -0700
@@ -91,7 +91,7 @@
// Test multiple @author tags:
- { "<DT><STRONG>Author:</STRONG></DT>"+NL+" <DD>Doug Kramer, Jamie, Neal</DD>"+NL,
+ { "<DT><STRONG>Author:</STRONG></DT>"+NL+" <DD>Doug Kramer, Jamie, Neal</DD>",
BUGID + FS + "p1" + FS + "C1.html" },
};
--- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java Mon Mar 09 23:53:41 2009 -0700
@@ -48,7 +48,7 @@
"<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd(java.math.BigInteger)\" " +
"title=\"class or interface in java.math\"><CODE>Link to external member gcd</CODE></A>"},
{BUG_ID + FS + "C.html",
- "<STRONG>Overrides:</STRONG><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE>"}
+ "<STRONG>Overrides:</STRONG></DT><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE>"}
};
private static final String[][] NEGATED_TEST = NO_TEST;
private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java Mon Mar 09 23:53:41 2009 -0700
@@ -45,9 +45,10 @@
//Input for string search tests.
private static final String[][] TEST = {
- {BUG_ID + FS + "C.html", "<DL>"+NL+"<DD>This is just a simple constructor."+ NL +
- "<P>"+NL+"<DL>"+NL+"<DT><STRONG>Parameters:</STRONG><DD><CODE>i</CODE> - a param.</DL>"+NL +
- "</DL>"
+ {BUG_ID + FS + "C.html", "<DL>" + NL + "<DD>This is just a simple constructor." + NL +
+ "<P>" + NL + "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG>" +
+ "</DT><DD><CODE>i</CODE> - a param.</DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"
}
};
private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Mon Mar 09 23:53:41 2009 -0700
@@ -78,13 +78,12 @@
{TARGET_FILE2, "<STRONG>Deprecated.</STRONG>" + NL +
"<P>" + NL +
- "<DL>" + NL +
- "<DT><PRE><FONT SIZE=\"-1\">@Deprecated" + NL +
+ "<PRE><FONT SIZE=\"-1\">@Deprecated" + NL +
"</FONT>public class <STRONG>DeprecatedClassByAnnotation</STRONG>"},
{TARGET_FILE2, "public int <STRONG>field</STRONG></PRE>" + NL +
"<DL>" + NL +
- "<DD><STRONG>Deprecated.</STRONG> <DL>"},
+ "<DD><STRONG>Deprecated.</STRONG> </DD></DL>"},
{TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL +
"</FONT>public <STRONG>DeprecatedClassByAnnotation</STRONG>()</PRE>" + NL +
--- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java Mon Mar 09 23:53:41 2009 -0700
@@ -39,13 +39,13 @@
private static final String BUG_ID = "4857717";
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "XReader.html",
- "<STRONG>Overrides:</STRONG><DD><CODE><A HREF=\"" +
+ "<STRONG>Overrides:</STRONG></DT><DD><CODE><A HREF=\"" +
"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read()\"" +
" title=\"class or interface in java.io\">read</A></CODE> in class " +
"<CODE><A HREF=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\"" +
" title=\"class or interface in java.io\">FilterReader</A>"},
{BUG_ID + FS + "pkg" + FS + "XReader.html",
- "<STRONG>Specified by:</STRONG><DD><CODE><A HREF=\"" +
+ "<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"" +
"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt()\"" +
" title=\"class or interface in java.io\">readInt</A></CODE> in interface " +
"<CODE><A HREF=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\"" +
--- a/langtools/test/com/sun/javadoc/testHref/TestHref.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java Mon Mar 09 23:53:41 2009 -0700
@@ -67,7 +67,7 @@
},
//@see test.
{BUG_ID + FS + "pkg" + FS + "C2.html",
- "See Also:</STRONG><DD><A HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
+ "See Also:</STRONG></DT><DD><A HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
},
//Header does not link to the page itself.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,370 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6786690
+ * @summary This test verifies the nesting of definition list tags.
+ * @author Bhavesh Patel
+ * @library ../lib/
+ * @build JavadocTester
+ * @build TestHtmlDefinitionListTag
+ * @run main TestHtmlDefinitionListTag
+ */
+
+public class TestHtmlDefinitionListTag extends JavadocTester {
+
+ private static final String BUG_ID = "6786690";
+
+ // Test common to all runs of javadoc. The class signature should print
+ // properly enclosed definition list tags and the Annotation Type
+ // Optional Element should print properly nested definition list tags
+ // for default value.
+ private static final String[][] TEST_ALL = {
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<PRE>public class " +
+ "<STRONG>C1</STRONG>" + NL + "extends " +
+ "java.lang.Object" + NL + "implements " +
+ "java.io.Serializable</PRE>"},
+ {BUG_ID + FS + "pkg1" + FS + "C4.html", "<DL>" + NL + "<DD><DL>" + NL +
+ "<DT><STRONG>Default:</STRONG></DT><DD>true</DD>" + NL +
+ "</DL>" + NL + "</DD>" + NL + "</DL>"}};
+
+ // Test for normal run of javadoc in which various ClassDocs and
+ // serialized form should have properly nested definition list tags
+ // enclosing comments, tags and deprecated information.
+ private static final String[][] TEST_CMNT_DEPR = {
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
+ "<DT><STRONG>Since:</STRONG></DT>" + NL +
+ " <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" +
+ "<A HREF=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
+ "<CODE>C2</CODE></A>, " + NL +
+ "<A HREF=\"../serialized-form.html#pkg1.C1\">" +
+ "Serialized Form</A></DD></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" +
+ " 1.5, replaced by" + NL +
+ " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
+ "<DD>This field indicates whether the C1 is undecorated." + NL +
+ "<P>" + NL + "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>" +
+ "Since:</STRONG></DT>" + NL + " <DD>1.4</DD>" + NL + "<DT>" +
+ "<STRONG>See Also:</STRONG></DT><DD>" +
+ "<A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
+ "setUndecorated(boolean)</CODE></A></DD></DL>" + NL +"</DD>" + NL +
+ "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
+ "<DD>Constructor." + NL + "<P>" + NL + "</DD>" + NL +
+ "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG></DT><DD>" +
+ "<CODE>title</CODE> - the title</DD><DD><CODE>test</CODE>" +
+ " - boolean value</DD>" + NL + "<DT><STRONG>Throws:</STRONG></DT>" + NL +
+ "<DD><CODE>java.lang.IllegalArgumentException</CODE>" +
+ " - if the <code>owner</code>'s" + NL + " <code>GraphicsConfiguration" +
+ "</code> is not from a screen device</DD>" + NL +"<DD><CODE>" +
+ "HeadlessException</CODE></DD></DL>" + NL + "</DD>" + NL +
+ "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
+ "<DD>Method comments." + NL + "<P>" + NL +
+ "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Parameters:" +
+ "</STRONG></DT><DD><CODE>undecorated</CODE> - <code>true</code>" +
+ " if no decorations are" + NL + " to be enabled;" + NL +
+ " <code>false</code> if decorations are to be enabled." +
+ "</DD><DT><STRONG>Since:</STRONG></DT>" + NL +
+ " <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT>" +
+ "<DD><A HREF=\"../pkg1/C1.html#readObject()\"><CODE>" +
+ "readObject()</CODE></A></DD></DL>" + NL + "</DD>" + NL +
+ "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "<DD><DL>" + NL +
+ "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
+ "java.io.IOException</CODE></DD><DT><STRONG>See Also:" +
+ "</STRONG></DT><DD>" +
+ "<A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL>" + NL +
+ "<DD>No modal exclusion." + NL + "<P>" + NL +"</DD>" + NL +
+ "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "<DD>Constructor." + NL +
+ "<P>" + NL +"</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> <I>As of JDK version 1.5, replaced " +
+ "by" + NL + " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
+ "</DD><DD>Set visible." + NL + "<P>" + NL + "</DD>" +NL +
+ "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG></DT><DD>" +
+ "<CODE>set</CODE> - boolean</DD><DT><STRONG>Since:</STRONG></DT>" + NL +
+ " <DD>1.4</DD></DL>" + NL + "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL>" + NL + "<DD>Comment." + NL +
+ "<P>" + NL + "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL +
+ "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
+ "java.io.IOException</CODE></DD><DT><STRONG>See Also:</STRONG>" +
+ "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version " +
+ "1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
+ "<DD>This field indicates whether the C1 is undecorated." + NL +
+ "<P>" + NL + "</DD>" + NL + "<DD> </DD>" + NL +
+ "<DD><DL>" + NL + "<DT><STRONG>Since:</STRONG></DT>" + NL +
+ " <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG>" +
+ "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" +
+ " 1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
+ "</DD><DD>Reads the object stream." + NL + "<P>" + NL +
+ "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Throws:" +
+ "</STRONG></DT>" + NL + "<DD><CODE><code>" +
+ "IOException</code></CODE></DD>" + NL +
+ "<DD><CODE>java.io.IOException</CODE></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> </DD><DD>" +
+ "The name for this class." + NL + "<P>" + NL + "</DD>" + NL +
+ "<DD> </DD>" + NL + "</DL>"}};
+
+ // Test with -nocomment option. The ClassDocs and serialized form should
+ // have properly nested definition list tags enclosing deprecated
+ // information and should not display definition lists for comments
+ // and tags.
+ private static final String[][] TEST_NOCMNT = {
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> <I>As of JDK version 1.5, replaced by" + NL +
+ " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
+ "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" +
+ " 1.5, replaced by" + NL +
+ " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
+ "</DD></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C5.html", "<PRE>" + NL +
+ "protected <STRONG>C5</STRONG>()</PRE>" + NL + "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> </DD></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C5.html", "<PRE>" + NL +
+ "public void <STRONG>printInfo</STRONG>()</PRE>" + NL + "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> </DD></DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "boolean <STRONG>" +
+ "undecorated</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> <I>As of JDK version 1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
+ "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> <I>As of JDK version" +
+ " 1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
+ "</DD></DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "int <STRONG>" +
+ "publicKey</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> </DD></DL>"}};
+
+ // Test with -nodeprecated option. The ClassDocs should have properly nested
+ // definition list tags enclosing comments and tags. The ClassDocs should not
+ // display definition list for deprecated information. The serialized form
+ // should display properly nested definition list tags for comments, tags
+ // and deprecated information.
+ private static final String[][] TEST_NODEPR = {
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
+ "<DT><STRONG>Since:</STRONG></DT>" + NL +
+ " <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" +
+ "<A HREF=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
+ "<CODE>C2</CODE></A>, " + NL +
+ "<A HREF=\"../serialized-form.html#pkg1.C1\">" +
+ "Serialized Form</A></DD></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
+ "<DD>Constructor." + NL + "<P>" + NL + "</DD>" + NL +
+ "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG></DT><DD>" +
+ "<CODE>title</CODE> - the title</DD><DD><CODE>test</CODE>" +
+ " - boolean value</DD>" + NL + "<DT><STRONG>Throws:</STRONG></DT>" + NL +
+ "<DD><CODE>java.lang.IllegalArgumentException</CODE>" +
+ " - if the <code>owner</code>'s" + NL + " <code>GraphicsConfiguration" +
+ "</code> is not from a screen device</DD>" + NL +"<DD><CODE>" +
+ "HeadlessException</CODE></DD></DL>" + NL + "</DD>" + NL +
+ "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
+ "<DD>Method comments." + NL + "<P>" + NL +
+ "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Parameters:" +
+ "</STRONG></DT><DD><CODE>undecorated</CODE> - <code>true</code>" +
+ " if no decorations are" + NL + " to be enabled;" + NL +
+ " <code>false</code> if decorations are to be enabled." +
+ "</DD><DT><STRONG>Since:</STRONG></DT>" + NL +
+ " <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT>" +
+ "<DD><A HREF=\"../pkg1/C1.html#readObject()\"><CODE>" +
+ "readObject()</CODE></A></DD></DL>" + NL + "</DD>" + NL +
+ "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "<DD><DL>" + NL +
+ "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
+ "java.io.IOException</CODE></DD><DT><STRONG>See Also:" +
+ "</STRONG></DT><DD>" +
+ "<A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL>" + NL +
+ "<DD>No modal exclusion." + NL + "<P>" + NL +"</DD>" + NL +
+ "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "<DD>Constructor." + NL +
+ "<P>" + NL +"</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL>" + NL + "<DD>Comment." + NL +
+ "<P>" + NL + "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL +
+ "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
+ "java.io.IOException</CODE></DD><DT><STRONG>See Also:</STRONG>" +
+ "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version " +
+ "1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
+ "<DD>This field indicates whether the C1 is undecorated." + NL +
+ "<P>" + NL + "</DD>" + NL + "<DD> </DD>" + NL +
+ "<DD><DL>" + NL + "<DT><STRONG>Since:</STRONG></DT>" + NL +
+ " <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG>" +
+ "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" +
+ " 1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
+ "</DD><DD>Reads the object stream." + NL + "<P>" + NL +
+ "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Throws:" +
+ "</STRONG></DT>" + NL + "<DD><CODE><code>" +
+ "IOException</code></CODE></DD>" + NL +
+ "<DD><CODE>java.io.IOException</CODE></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> </DD><DD>" +
+ "The name for this class." + NL + "<P>" + NL + "</DD>" + NL +
+ "<DD> </DD>" + NL + "</DL>"}};
+
+ // Test with -nocomment and -nodeprecated options. The ClassDocs whould
+ // not display definition lists for any member details. The serialized
+ // form should display properly nested definition list tags for
+ // deprecated information only.
+ private static final String[][] TEST_NOCMNT_NODEPR = {
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<PRE>" + NL + "public void " +
+ "<STRONG>readObject</STRONG>()" + NL + " throws" +
+ " java.io.IOException</PRE>" + NL + "<HR>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<PRE>" +NL + "public <STRONG>" +
+ "C2</STRONG>()</PRE>" + NL + "<HR>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<PRE>" + NL +
+ "public static final " +
+ "<A HREF=\"../pkg1/C1.ModalExclusionType.html\" " +
+ "title=\"enum in pkg1\">C1.ModalExclusionType</A> <STRONG>" +
+ "APPLICATION_EXCLUDE</STRONG></PRE>" + NL + "<HR>"},
+ {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "boolean <STRONG>" +
+ "undecorated</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> <I>As of JDK version 1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
+ "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> <I>As of JDK version" +
+ " 1.5, replaced by" + NL +
+ " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
+ "</DD></DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "int <STRONG>" +
+ "publicKey</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
+ "Deprecated.</STRONG> </DD></DL>"}};
+
+ // Test for valid HTML generation which should not comprise of empty
+ // definition list tags.
+ private static final String[][] NEGATED_TEST = {
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<DL></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C4.html", "<DL></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C4.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C5.html", "<DL></DL>"},
+ {BUG_ID + FS + "pkg1" + FS + "C5.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "overview-tree.html", "<DL></DL>"},
+ {BUG_ID + FS + "overview-tree.html", "<DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL></DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "</DL>"}};
+
+ private static final String[] ARGS1 =
+ new String[] {
+ "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
+
+ private static final String[] ARGS2 =
+ new String[] {
+ "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"};
+
+ private static final String[] ARGS3 =
+ new String[] {
+ "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
+
+ private static final String[] ARGS4 =
+ new String[] {
+ "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"};
+
+ /**
+ * The entry point of the test.
+ * @param args the array of command line arguments.
+ */
+ public static void main(String[] args) {
+ TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag();
+ run(tester, ARGS1, TEST_ALL, NEGATED_TEST);
+ run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST);
+ run(tester, ARGS2, TEST_ALL, NEGATED_TEST);
+ run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
+ run(tester, ARGS3, TEST_ALL, NEGATED_TEST);
+ run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
+ run(tester, ARGS4, TEST_ALL, NEGATED_TEST);
+ run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR);
+ tester.printSummary();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugId() {
+ return BUG_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugName() {
+ return getClass().getName();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C1.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg1;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+/**
+ * A class comment for testing.
+ *
+ * @author Bhavesh Patel
+ * @see C2
+ * @since JDK1.0
+ */
+
+public class C1 implements Serializable {
+
+ /**
+ * This field indicates whether the C1 is undecorated.
+ *
+ * @see #setUndecorated(boolean)
+ * @since 1.4
+ * @serial
+ * @deprecated As of JDK version 1.5, replaced by
+ * {@link C1#setUndecorated(boolean) setUndecorated(boolean)}.
+ */
+ @Deprecated
+ public boolean undecorated = false;
+
+ private String title;
+
+ /**
+ * This enum specifies the possible modal exclusion types.
+ *
+ * @since 1.6
+ */
+ public static enum ModalExclusionType {
+ /**
+ * No modal exclusion.
+ */
+ NO_EXCLUDE,
+ /**
+ * <code>APPLICATION_EXCLUDE</code> indicates that a top-level window
+ * won't be blocked by any application-modal dialogs. Also, it isn't
+ * blocked by document-modal dialogs from outside of its child hierarchy.
+ */
+ APPLICATION_EXCLUDE
+ };
+
+ /**
+ * Constructor.
+ *
+ * @param title the title
+ * @param test boolean value
+ * @exception IllegalArgumentException if the <code>owner</code>'s
+ * <code>GraphicsConfiguration</code> is not from a screen device
+ * @exception HeadlessException
+ */
+ public C1(String title, boolean test) {
+
+ }
+
+ public C1(String title) {
+
+ }
+
+ /**
+ * Method comments.
+ * @param undecorated <code>true</code> if no decorations are
+ * to be enabled;
+ * <code>false</code> if decorations are to be enabled.
+ * @see #readObject()
+ * @since 1.4
+ */
+ public void setUndecorated(boolean undecorated) {
+ /* Make sure we don't run in the middle of peer creation.*/
+ }
+
+ /**
+ * @see #setUndecorated(boolean)
+ */
+ public void readObject() throws IOException {
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C2.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg1;
+
+import java.io.ObjectInputStream;
+import java.io.IOException;
+import java.io.Serializable;
+
+/**
+ * A class comment for testing.
+ *
+ * @author Bhavesh Patel
+ * @see C1
+ * @since JDK1.0
+ */
+
+public class C2 implements Serializable {
+
+ /**
+ * This field indicates title.
+ */
+ String title;
+
+ public static enum ModalType {
+ NO_EXCLUDE
+ };
+
+ /**
+ * Constructor.
+ *
+ */
+ public C2() {
+
+ }
+
+ public C2(String title) {
+
+ }
+
+ /**
+ * Set visible.
+ *
+ * @param set boolean
+ * @since 1.4
+ * @deprecated As of JDK version 1.5, replaced by
+ * {@link C1#setUndecorated(boolean) setUndecorated(boolean)}.
+ */
+ @Deprecated
+ public void setVisible(boolean set) {
+ }
+
+ /**
+ * Reads the object stream.
+ *
+ * @param s ObjectInputStream
+ * @throws <code>IOException</code>
+ * @deprecated As of JDK version 1.5, replaced by
+ * {@link C1#setUndecorated(boolean) setUndecorated(boolean)}.
+ */
+ @Deprecated
+ public void readObject(ObjectInputStream s) throws IOException {
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C3.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg1;
+
+import java.lang.annotation.*;
+
+/**
+ * Test Annotation class.
+ *
+ * @author Bhavesh Patel
+ * @since 1.5
+ */
+@Retention(RetentionPolicy.SOURCE)
+public @interface C3 {
+ /**
+ * Comment.
+ */
+ String[] value();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C4.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg1;
+
+import java.lang.annotation.*;
+
+/*
+ * The @Inherited annotation has no effect when applied to an interface.
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface C4 {
+ boolean value() default true;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/C5.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg1;
+
+import java.io.Serializable;
+
+/**
+ * Test for Serializable
+ *
+ * @author Bhavesh Patel
+ * @deprecated This class is no longer used.
+ */
+@Deprecated
+public abstract class C5 implements Serializable {
+
+ /**
+ * The name for this class.
+ *
+ * @serial
+ */
+ private String name;
+
+ /**
+ * @serial
+ */
+ private int publicKey;
+
+ /**
+ * Constructor for serialization only.
+ */
+ protected C5() {
+
+ }
+
+ /**
+ * Prints general information.
+ *
+ */
+ public void printInfo() {
+
+ }
+}
--- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java Mon Mar 09 23:53:41 2009 -0700
@@ -73,10 +73,10 @@
{BUG_ID + FS + "index-all.html",
"<DT><A HREF=\"./pkg/C.html#Java\"><STRONG>Java</STRONG></A> - " + NL +
"Static variable in class pkg.<A HREF=\"./pkg/C.html\" title=\"class in pkg\">C</A>" + NL +
- "<DD> " + NL +
+ "</DT><DD> </DD>" + NL + NL +
"<DT><A HREF=\"./pkg/C.html#JDK\"><STRONG>JDK</STRONG></A> - " + NL +
"Static variable in class pkg.<A HREF=\"./pkg/C.html\" title=\"class in pkg\">C</A>" + NL +
- "<DD> "},
+ "</DT><DD> </DD>"},
};
private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java Mon Mar 09 23:53:41 2009 -0700
@@ -55,7 +55,7 @@
// Make sure known implementing class list is correct and omits type parameters.
{BUG_ID + FS + "pkg" + FS + "Interface.html",
- "<DT><STRONG>All Known Implementing Classes:</STRONG> " +
+ "<DT><STRONG>All Known Implementing Classes:</STRONG></DT> " +
"<DD><A HREF=\"../pkg/Child.html\" " +
"title=\"class in pkg\">Child</A>, " +
"<A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">" +
@@ -63,7 +63,9 @@
// Make sure "All Implemented Interfaces": has substituted type parameters
{BUG_ID + FS + "pkg" + FS + "Child.html",
- "<STRONG>All Implemented Interfaces:</STRONG> <DD><A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">Interface</A><T>"
+ "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD>" +
+ "<A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
+ "Interface</A><T>"
},
//Make sure Class Tree has substituted type parameters.
{BUG_ID + FS + "pkg" + FS + "Child.html",
@@ -75,15 +77,15 @@
},
//Make sure "Direct Know Subclasses" omits type parameters
{BUG_ID + FS + "pkg" + FS + "Parent.html",
- "<STRONG>Direct Known Subclasses:</STRONG> <DD><A HREF=\"../pkg/Child.html\" title=\"class in pkg\">Child</A>"
+ "<STRONG>Direct Known Subclasses:</STRONG></DT> <DD><A HREF=\"../pkg/Child.html\" title=\"class in pkg\">Child</A>"
},
//Make sure "Specified By" has substituted type parameters.
{BUG_ID + FS + "pkg" + FS + "Child.html",
- "<STRONG>Specified by:</STRONG><DD><CODE><A HREF=\"../pkg/Interface.html#method()\">method</A></CODE> in interface <CODE><A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">Interface</A><<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>></CODE>"
+ "<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg/Interface.html#method()\">method</A></CODE> in interface <CODE><A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">Interface</A><<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>></CODE>"
},
//Make sure "Overrides" has substituted type parameters.
{BUG_ID + FS + "pkg" + FS + "Child.html",
- "<STRONG>Overrides:</STRONG><DD><CODE><A HREF=\"../pkg/Parent.html#method()\">method</A></CODE> in class <CODE><A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">Parent</A><<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>></CODE>"
+ "<STRONG>Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg/Parent.html#method()\">method</A></CODE> in class <CODE><A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">Parent</A><<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>></CODE>"
},
};
private static final String[][] NEGATED_TEST = {
--- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java Mon Mar 09 23:53:41 2009 -0700
@@ -63,7 +63,8 @@
"title=\"class or interface in java.lang\">Object</A> p3)"
},
{BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
- "public abstract class <STRONG>StringBuilderChild</STRONG><DT>extends <A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">Object</A>"
+ "public abstract class <STRONG>StringBuilderChild</STRONG>" + NL +
+ "extends <A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">Object</A>"
},
};
--- a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java Mon Mar 09 23:53:41 2009 -0700
@@ -59,7 +59,7 @@
" Link to another inner class: <A HREF=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><CODE>C.InnerC2</CODE></A>"
},
{BUG_ID + FS + "pkg" + FS + "C.InnerC2.html",
- "Enclosing class:</STRONG><DD><A HREF=\"../pkg/C.html\" title=\"class in pkg\">C</A>"
+ "Enclosing class:</STRONG></DT><DD><A HREF=\"../pkg/C.html\" title=\"class in pkg\">C</A>"
},
};
private static final String[][] NEGATED_TEST = {
--- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java Mon Mar 09 23:53:41 2009 -0700
@@ -74,7 +74,7 @@
// Test overriding/implementing methods with generic parameters.
{BUG_ID + FS + "pkg" + FS + "BaseClass.html",
- "<DT><STRONG>Specified by:</STRONG><DD><CODE><A HREF=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">getAnnotation</A></CODE> in interface <CODE><A HREF=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</A></CODE></DL>"},
+ "<DT><STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">getAnnotation</A></CODE> in interface <CODE><A HREF=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</A></CODE></DD>"+NL+"</DL>"},
// Test diamond inheritence member summary (6256068)
{BUG_ID + FS + "diamond" + FS + "Z.html",
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java Mon Mar 09 23:53:41 2009 -0700
@@ -54,7 +54,7 @@
{BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</H2>"},
//Make sure enum signature is correct.
{BUG_ID + FS + "pkg" + FS + "Coin.html", "public enum "+
- "<STRONG>Coin</STRONG><DT>extends java.lang.Enum<" +
+ "<STRONG>Coin</STRONG>" + NL + "extends java.lang.Enum<" +
"<A HREF=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</A>>"
},
//Check for enum constant section
@@ -79,20 +79,20 @@
"Class TypeParameters<E></H2>"},
//Check class type parameters section.
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
- "<DT><STRONG>Type Parameters:</STRONG><DD><CODE>E</CODE> - " +
+ "<DT><STRONG>Type Parameters:</STRONG></DT><DD><CODE>E</CODE> - " +
"the type parameter for this class."},
//Type parameters in @see/@link
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
- "<DT><STRONG>See Also:</STRONG><DD><A HREF=\"../pkg/TypeParameters.html\" " +
- "title=\"class in pkg\"><CODE>TypeParameters</CODE></A></DL>"},
+ "<DT><STRONG>See Also:</STRONG></DT><DD><A HREF=\"../pkg/TypeParameters.html\" " +
+ "title=\"class in pkg\"><CODE>TypeParameters</CODE></A></DD></DL>"},
//Method that uses class type parameter.
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
"(<A HREF=\"../pkg/TypeParameters.html\" title=\"type " +
"parameter in TypeParameters\">E</A> param)"},
//Method type parameter section.
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
- "<STRONG>Type Parameters:</STRONG><DD><CODE>T</CODE> - This is the first " +
- "type parameter.<DD><CODE>V</CODE> - This is the second type " +
+ "<STRONG>Type Parameters:</STRONG></DT><DD><CODE>T</CODE> - This is the first " +
+ "type parameter.</DD><DD><CODE>V</CODE> - This is the second type " +
"parameter."},
//Signature of method with type parameters
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
@@ -117,17 +117,17 @@
//Signature of subclass that has type parameters.
{BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
"public class <STRONG>TypeParameterSubClass<T extends java.lang.String>" +
- "</STRONG><DT>extends <A HREF=\"../pkg/TypeParameterSuperClass.html\" " +
+ "</STRONG>" + NL + "extends <A HREF=\"../pkg/TypeParameterSuperClass.html\" " +
"title=\"class in pkg\">TypeParameterSuperClass</A><T>"},
//Interface generic parameter substitution
//Signature of subclass that has type parameters.
{BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
- "<STRONG>All Implemented Interfaces:</STRONG> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A><E>, <A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A><E></DD>"},
+ "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A><E>, <A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A><E></DD>"},
{BUG_ID + FS + "pkg" + FS + "SuperInterface.html",
- "<STRONG>All Known Subinterfaces:</STRONG> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A><V></DD>"},
+ "<STRONG>All Known Subinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A><V></DD>"},
{BUG_ID + FS + "pkg" + FS + "SubInterface.html",
- "<STRONG>All Superinterfaces:</STRONG> <DD><A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A><V></DD>"},
+ "<STRONG>All Superinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A><V></DD>"},
//=================================
// VAR ARG TESTING
@@ -166,7 +166,7 @@
"Element Detail"},
//Make sure default annotation type value is printed when necessary.
{BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
- "<STRONG>Default:</STRONG><DD>\"unknown\"</DD>"},
+ "<STRONG>Default:</STRONG></DT><DD>\"unknown\"</DD>"},
//=================================
// ANNOTATION TYPE USAGE TESTING
@@ -182,7 +182,8 @@
"<FONT SIZE=\"-1\">" +
"<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Class Annotation\","+NL +
" <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
- "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG><DT>extends java.lang.Object</DL>"},
+ "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG>" + NL +
+ "extends java.lang.Object"},
//FIELD
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
@@ -270,8 +271,7 @@
{BUG_ID + FS + "pkg1" + FS + "B.html",
"<PRE><FONT SIZE=\"-1\"><A HREF=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</A>"},
{BUG_ID + FS + "pkg1" + FS + "B.html",
- "</FONT>public interface <STRONG>B</STRONG></DL>" + NL +
- "</PRE>"},
+ "</FONT>public interface <STRONG>B</STRONG></PRE>"},
//==============================================================
@@ -525,7 +525,7 @@
"<FONT SIZE=\"-1\">" + NL +
"<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Class Annotation\"," + NL +
" <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
- "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG><DT>extends java.lang.Object</DL>"},
+ "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG></DT><DT>extends java.lang.Object</DT></DL>"},
//FIELD
{BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java Mon Mar 09 23:53:41 2009 -0700
@@ -40,11 +40,11 @@
private static final String[][] TEST = {
//The public method should be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
//The public method in different package should be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"}
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"}
};
private static final String[][] NEGATED_TEST = {
@@ -52,20 +52,20 @@
//The package private method should be overriden since the base and sub class are in the same
//package. However, the link should not show up because the package private methods are not documented.
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
//The private method in should not be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
//The private method in different package should not be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
//The package private method should not be overriden since the base and sub class are in
//different packages.
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
};
private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java Mon Mar 09 23:53:41 2009 -0700
@@ -40,32 +40,32 @@
private static final String[][] TEST = {
//The public method should be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
//The public method in different package should be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
//The package private method should be overriden since the base and sub class are in the same
//package.
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
};
private static final String[][] NEGATED_TEST = {
//The private method in should not be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
//The private method in different package should not be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
//The package private method should not be overriden since the base and sub class are in
//different packages.
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
};
private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java Mon Mar 09 23:53:41 2009 -0700
@@ -40,32 +40,32 @@
private static final String[][] TEST = {
//The public method should be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
//The package private method should be overriden since the base and sub class are in the same
//package.
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
//The public method in different package should be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
};
private static final String[][] NEGATED_TEST = {
//The private method in should not be overriden
{BUG_ID + FS + "pkg1" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
//The private method in different package should not be overriden
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
//The package private method should not be overriden since the base and sub class are in
//different packages.
{BUG_ID + FS + "pkg2" + FS + "SubClass.html",
- "Overrides:</STRONG><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+ "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
};
--- a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java Mon Mar 09 23:53:41 2009 -0700
@@ -48,12 +48,12 @@
private static final String[][] TEST = {
//Regular param tags.
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<STRONG>Parameters:</STRONG><DD><CODE>param1</CODE> - testing 1 2 3." +
+ "<STRONG>Parameters:</STRONG></DT><DD><CODE>param1</CODE> - testing 1 2 3.</DD>" +
"<DD><CODE>param2</CODE> - testing 1 2 3."
},
//Param tags that don't match with any real parameters.
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<STRONG>Parameters:</STRONG><DD><CODE><I>p1</I></CODE> - testing 1 2 3." +
+ "<STRONG>Parameters:</STRONG></DT><DD><CODE><I>p1</I></CODE> - testing 1 2 3.</DD>" +
"<DD><CODE><I>p2</I></CODE> - testing 1 2 3."
},
//{@inherit} doc misuse does not cause doclet to throw exception.
--- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java Mon Mar 09 23:53:41 2009 -0700
@@ -96,11 +96,11 @@
//Make sure implemented interfaces from private superclass are inherited
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
- "<STRONG>All Known Implementing Classes:</STRONG> <DD><A HREF=\"../pkg/PublicChild.html\" " +
+ "<STRONG>All Known Implementing Classes:</STRONG></DT> <DD><A HREF=\"../pkg/PublicChild.html\" " +
"title=\"class in pkg\">PublicChild</A>"},
{BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
- "<STRONG>All Implemented Interfaces:</STRONG> <DD><A HREF=\"../pkg/PublicInterface.html\" " +
+ "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/PublicInterface.html\" " +
"title=\"interface in pkg\">PublicInterface</A>"},
//Generic interface method test.
@@ -174,18 +174,18 @@
},
// Should document that a method overrides method from private class.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
- "<STRONG>Overrides:</STRONG><DD><CODE>" +
+ "<STRONG>Overrides:</STRONG></DT><DD><CODE>" +
"<A HREF=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
"methodOverridenFromParent</A></CODE> in class <CODE>" +
"<A HREF=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
- "PrivateParent</A></CODE></DL>"},
+ "PrivateParent</A></CODE></DD>" + NL + "</DL>"},
// Should document that a method is specified by private interface.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
- "<STRONG>Specified by:</STRONG><DD><CODE>" +
+ "<STRONG>Specified by:</STRONG></DT><DD><CODE>" +
"<A HREF=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
"methodInterface</A></CODE> in interface <CODE>" +
"<A HREF=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
- "PrivateInterface</A></CODE></DL>" + NL + "</DD>"},
+ "PrivateInterface</A></CODE></DD>" + NL + "</DL>" + NL + "</DD>"},
// Method inheritence from non-public superinterface.
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
"Methods inherited from interface " +
@@ -209,12 +209,12 @@
//Make sure implemented interfaces from private superclass are inherited
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
- "<STRONG>All Known Implementing Classes:</STRONG> <DD><A HREF=\"../pkg/PrivateParent.html\" " +
+ "<STRONG>All Known Implementing Classes:</STRONG></DT> <DD><A HREF=\"../pkg/PrivateParent.html\" " +
"title=\"class in pkg\">PrivateParent</A>, " +
"<A HREF=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</A>"},
{BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
- "<STRONG>All Implemented Interfaces:</STRONG> <DD><A HREF=\"../pkg/PrivateInterface.html\" " +
+ "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/PrivateInterface.html\" " +
"title=\"interface in pkg\">PrivateInterface</A>, " +
"<A HREF=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
"PublicInterface</A>"},
@@ -226,7 +226,7 @@
"<CODE><A HREF=\"../pkg2/I.html#hello(T)\">I</A></CODE></STRONG>"},
{BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
- "<STRONG>Specified by:</STRONG><DD><CODE><A HREF=\"../pkg2/I.html#hello(T)\">" +
+ "<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg2/I.html#hello(T)\">" +
"hello</A></CODE> in interface <CODE><A HREF=\"../pkg2/I.html\" " +
"title=\"interface in pkg2\">I</A>"},
};
--- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Mon Mar 09 23:53:41 2009 -0700
@@ -41,39 +41,39 @@
// Test for normal run of javadoc. The serialized-form.html should
// display the inline comments, tags and deprecation information if any.
private static final String[][] TEST_CMNT_DEPR = {
- {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL + NL +
- "<DT><STRONG>Throws:</STRONG>" + NL + "<DD><CODE>" +
- "java.io.IOException</CODE><DT><STRONG>See Also:</STRONG>" +
- "<DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
- "<CODE>C1.setUndecorated(boolean)</CODE></A></DD>" + NL +
- "</DL>" + NL + "</DL>"},
+ {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL +
+ "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
+ "java.io.IOException</CODE></DD><DT><STRONG>See Also:</STRONG>" +
+ "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
{BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
- "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" +
- " 1.5, replaced by" + NL +
+ "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version " +
+ "1.5, replaced by" + NL +
" <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
- "<CODE>setUndecorated(boolean)</CODE></A>.</I>" +
+ "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
"<DD>This field indicates whether the C1 is undecorated." + NL +
- "<P>" + NL + "<DT><DD> <DL>" + NL +
- "<DT><STRONG>Since:</STRONG></DT>" + NL +
+ "<P>" + NL + "</DD>" + NL + "<DD> </DD>" + NL +
+ "<DD><DL>" + NL + "<DT><STRONG>Since:</STRONG></DT>" + NL +
" <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG>" +
- "<DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
- "<CODE>C1.setUndecorated(boolean)</CODE></A></DL>" + NL +
- "</DL>"},
+ "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+ "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
{BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
"<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" +
" 1.5, replaced by" + NL +
" <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
- "<DD>Reads the object stream." + NL + "<P>" + NL +
- "<DD><DL>" + NL + NL + "<DT><STRONG>Throws:" +
- "</STRONG>" + NL + "<DD><CODE><code>" +
- "IOException</code></CODE>" + NL +
- "<DD><CODE>java.io.IOException</CODE></DD>" + NL +
- "</DL>" + NL + "</DL>"},
+ "</DD><DD>Reads the object stream." + NL + "<P>" + NL +
+ "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Throws:" +
+ "</STRONG></DT>" + NL + "<DD><CODE><code>" +
+ "IOException</code></CODE></DD>" + NL +
+ "<DD><CODE>java.io.IOException</CODE></DD></DL>" + NL +
+ "</DD>" + NL + "</DL>"},
{BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
- "<DD><STRONG>Deprecated.</STRONG> <DD>" +
- "The name for this class." + NL + "<P>" + NL +
- "<DT><DD> <DL>" + NL + "</DL>" + NL + "</DL>"}};
+ "<DD><STRONG>Deprecated.</STRONG> </DD><DD>" +
+ "The name for this class." + NL + "<P>" + NL + "</DD>" + NL +
+ "<DD> </DD>" + NL + "</DL>"}};
// Test with -nocomment option. The serialized-form.html should
// not display the inline comments and tags but should display deprecation
@@ -83,16 +83,16 @@
"undecorated</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
"Deprecated.</STRONG> <I>As of JDK version 1.5, replaced by" + NL +
" <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
- "setUndecorated(boolean)</CODE></A>.</I></DL>"},
+ "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
{BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><STRONG>" +
"Deprecated.</STRONG> <I>As of JDK version" +
" 1.5, replaced by" + NL +
" <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
"<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
- "</DL>"},
+ "</DD></DL>"},
{BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "int <STRONG>" +
"publicKey</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
- "Deprecated.</STRONG> </DL>"}};
+ "Deprecated.</STRONG> </DD></DL>"}};
// Test with -nodeprecated option. The serialized-form.html should
// ignore the -nodeprecated tag and display the deprecation info. This
--- a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java Mon Mar 09 23:53:41 2009 -0700
@@ -46,14 +46,14 @@
//Input for string search tests.
private static final String[][] TEST = {
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<DD><CODE><A HREF=\"../pkg/T1.html\" title=\"class in pkg\">T1</A></CODE> - the first throws tag." + NL +
- "<DD><CODE><A HREF=\"../pkg/T2.html\" title=\"class in pkg\">T2</A></CODE> - the second throws tag." + NL +
- "<DD><CODE><A HREF=\"../pkg/T3.html\" title=\"class in pkg\">T3</A></CODE> - the third throws tag." + NL +
- "<DD><CODE><A HREF=\"../pkg/T4.html\" title=\"class in pkg\">T4</A></CODE> - the fourth throws tag." + NL +
- "<DD><CODE><A HREF=\"../pkg/T5.html\" title=\"class in pkg\">T5</A></CODE> - the first inherited throws tag." + NL +
- "<DD><CODE><A HREF=\"../pkg/T6.html\" title=\"class in pkg\">T6</A></CODE> - the second inherited throws tag." + NL +
- "<DD><CODE><A HREF=\"../pkg/T7.html\" title=\"class in pkg\">T7</A></CODE> - the third inherited throws tag." + NL +
- "<DD><CODE><A HREF=\"../pkg/T8.html\" title=\"class in pkg\">T8</A></CODE> - the fourth inherited throws tag."
+ "<DD><CODE><A HREF=\"../pkg/T1.html\" title=\"class in pkg\">T1</A></CODE> - the first throws tag.</DD>" + NL +
+ "<DD><CODE><A HREF=\"../pkg/T2.html\" title=\"class in pkg\">T2</A></CODE> - the second throws tag.</DD>" + NL +
+ "<DD><CODE><A HREF=\"../pkg/T3.html\" title=\"class in pkg\">T3</A></CODE> - the third throws tag.</DD>" + NL +
+ "<DD><CODE><A HREF=\"../pkg/T4.html\" title=\"class in pkg\">T4</A></CODE> - the fourth throws tag.</DD>" + NL +
+ "<DD><CODE><A HREF=\"../pkg/T5.html\" title=\"class in pkg\">T5</A></CODE> - the first inherited throws tag.</DD>" + NL +
+ "<DD><CODE><A HREF=\"../pkg/T6.html\" title=\"class in pkg\">T6</A></CODE> - the second inherited throws tag.</DD>" + NL +
+ "<DD><CODE><A HREF=\"../pkg/T7.html\" title=\"class in pkg\">T7</A></CODE> - the third inherited throws tag.</DD>" + NL +
+ "<DD><CODE><A HREF=\"../pkg/T8.html\" title=\"class in pkg\">T8</A></CODE> - the fourth inherited throws tag.</DD>"
},
};
private static final String[][] NEGATED_TEST = NO_TEST;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Diagnostics/6799605/T6799605.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 6799605
+ * @summary Basic/Raw formatters should use type/symbol printer instead of toString()
+ * @author mcimadamore
+ * @compile/fail/ref=T6799605.out -XDrawDiagnostics T6799605.java
+ */
+
+class T6799605<X> {
+
+ <T extends T6799605<T>> void m(T6799605<T> x1) {}
+ <T> void m(T6799605<T> x1, T6799605<T> x2) {}
+ <T> void m(T6799605<T> x1, T6799605<T> x2, T6799605<T> x3) {}
+
+ void test(T6799605<?> t) {
+ m(t);
+ m(t, t);
+ m(t, t, t);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Diagnostics/6799605/T6799605.out Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,4 @@
+T6799605.java:39:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>, kindname.class, T6799605<X>
+T6799605.java:40:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>, kindname.class, T6799605<X>
+T6799605.java:41:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>, kindname.class, T6799605<X>
+3 errors
--- a/langtools/test/tools/javac/NestedInnerClassNames.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/NestedInnerClassNames.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,15 +1,15 @@
-NestedInnerClassNames.java:16:5: compiler.err.already.defined: NestedInnerClassNames, unnamed package
+NestedInnerClassNames.java:16:5: compiler.err.already.defined: NestedInnerClassNames, compiler.misc.unnamed.package
NestedInnerClassNames.java:23:9: compiler.err.already.defined: NestedInnerClassNames.foo, NestedInnerClassNames
-NestedInnerClassNames.java:34:9: compiler.err.already.defined: NestedInnerClassNames, unnamed package
+NestedInnerClassNames.java:34:9: compiler.err.already.defined: NestedInnerClassNames, compiler.misc.unnamed.package
NestedInnerClassNames.java:45:9: compiler.err.already.defined: NestedInnerClassNames.baz, NestedInnerClassNames
NestedInnerClassNames.java:46:13: compiler.err.already.defined: NestedInnerClassNames.baz.baz, NestedInnerClassNames.baz
NestedInnerClassNames.java:59:9: compiler.err.already.defined: NestedInnerClassNames.foo$bar, NestedInnerClassNames
NestedInnerClassNames.java:76:13: compiler.err.already.defined: NestedInnerClassNames.$bar, NestedInnerClassNames
NestedInnerClassNames.java:90:13: compiler.err.already.defined: NestedInnerClassNames.bar$bar.bar, NestedInnerClassNames.bar$bar
NestedInnerClassNames.java:109:5: compiler.err.duplicate.class: NestedInnerClassNames.foo.foo
-NestedInnerClassNames.java:19:9: compiler.err.already.defined: NestedInnerClassNames, unnamed package
+NestedInnerClassNames.java:19:9: compiler.err.already.defined: NestedInnerClassNames, compiler.misc.unnamed.package
NestedInnerClassNames.java:28:13: compiler.err.already.defined: foo, m2()
-NestedInnerClassNames.java:40:13: compiler.err.already.defined: NestedInnerClassNames, unnamed package
+NestedInnerClassNames.java:40:13: compiler.err.already.defined: NestedInnerClassNames, compiler.misc.unnamed.package
NestedInnerClassNames.java:52:13: compiler.err.already.defined: baz, m4()
NestedInnerClassNames.java:53:17: compiler.err.already.defined: baz.baz, baz
NestedInnerClassNames.java:67:13: compiler.err.already.defined: foo$bar, m5()
--- a/langtools/test/tools/javac/T6241723.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/T6241723.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,6 +1,6 @@
-T6241723.java:21:5: compiler.warn.has.been.deprecated: A1, unnamed package
+T6241723.java:21:5: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
T6241723.java:23:7: compiler.warn.has.been.deprecated: A2.A21, A2
-T6241723.java:26:5: compiler.warn.has.been.deprecated: Z1, unnamed package
+T6241723.java:26:5: compiler.warn.has.been.deprecated: Z1, compiler.misc.unnamed.package
T6241723.java:28:7: compiler.warn.has.been.deprecated: Z2.Z21, Z2
- compiler.err.warnings.and.werror
1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/6467183/T6467183a.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @author mcimadamore
+ * @bug 6467183
+ * @summary
+ * @compile/fail/ref=T6467183a.out -Xlint:unchecked -Werror -XDrawDiagnostics T6467183a.java
+ */
+
+class T6467183a<T> {
+
+ class A<S> {}
+ class B extends A<Integer> {}
+ class C<X> extends A<X> {}
+
+ void cast1(B b) {
+ Object o = (A<T>)b;
+ }
+
+ void cast2(B b) {
+ Object o = (A<? extends Number>)b;
+ }
+
+ void cast3(A<Integer> a) {
+ Object o = (C<? extends Number>)a;
+ }
+
+ void cast4(A<Integer> a) {
+ Object o = (C<? extends Integer>)a;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/6467183/T6467183a.out Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,6 @@
+T6467183a.java:39:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.B, T6467183a<T>.A<T>
+T6467183a.java:47:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Number>
+T6467183a.java:51:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), T6467183a<T>.A<java.lang.Integer>, T6467183a<T>.C<? extends java.lang.Integer>
+- compiler.err.warnings.and.werror
+1 error
+3 warnings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/6467183/T6467183b.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @author mcimadamore
+ * @bug 6467183
+ * @summary
+ * @compile/fail -Xlint:unchecked -Werror -XDrawDiagnostics T6467183b.java
+ */
+
+class T6665356b<T> {
+
+ class A<S> {}
+ class B<X> extends A<X> {}
+
+ void cast(A<? extends Number> a) {
+ Object o = (B<? extends Integer>)a;
+ }
+}
--- a/langtools/test/tools/javac/depDocComment/SuppressDeprecation.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/depDocComment/SuppressDeprecation.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,4 +1,4 @@
-SuppressDeprecation.java:130:17: compiler.warn.has.been.deprecated: X, unnamed package
+SuppressDeprecation.java:130:17: compiler.warn.has.been.deprecated: X, compiler.misc.unnamed.package
SuppressDeprecation.java:82:10: compiler.warn.has.been.deprecated: g(), T
SuppressDeprecation.java:83:14: compiler.warn.has.been.deprecated: g(), T
SuppressDeprecation.java:84:9: compiler.warn.has.been.deprecated: var, T
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/typevars/6804733/T6804733.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6804733
+ * @summary javac generates spourious diagnostics for ill-formed type-variable bounds
+ * @author mcimadamore
+ * @compile/fail/ref=T6804733.out -XDrawDiagnostics T6804733.java
+ */
+
+import java.util.ArrayList;
+class T6804733<S> extends ArrayList<S> {
+ <T extends S & S> void m() {}
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/typevars/6804733/T6804733.out Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,2 @@
+T6804733.java:34:20: compiler.err.type.var.may.not.be.followed.by.other.bounds
+1 error
--- a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test3.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test3.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,3 +1,3 @@
-A.java:10:9: compiler.warn.has.been.deprecated: A1, unnamed package
-A.java:10:21: compiler.warn.has.been.deprecated: A1, unnamed package
+A.java:10:9: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
+A.java:10:21: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
2 warnings
--- a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test3b.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test3b.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,3 +1,3 @@
-A.java:10:9: compiler.warn.has.been.deprecated: A1, unnamed package
+A.java:10:9: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
- compiler.note.deprecated.filename.additional: A.java
1 warning
--- a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,7 +1,7 @@
-A.java:10:9: compiler.warn.has.been.deprecated: A1, unnamed package
-A.java:10:21: compiler.warn.has.been.deprecated: A1, unnamed package
-B.java:11:9: compiler.warn.has.been.deprecated: B1, unnamed package
-B.java:11:21: compiler.warn.has.been.deprecated: B1, unnamed package
-B.java:12:9: compiler.warn.has.been.deprecated: B1, unnamed package
-B.java:12:22: compiler.warn.has.been.deprecated: B1, unnamed package
+A.java:10:9: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
+A.java:10:21: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
+B.java:11:9: compiler.warn.has.been.deprecated: B1, compiler.misc.unnamed.package
+B.java:11:21: compiler.warn.has.been.deprecated: B1, compiler.misc.unnamed.package
+B.java:12:9: compiler.warn.has.been.deprecated: B1, compiler.misc.unnamed.package
+B.java:12:22: compiler.warn.has.been.deprecated: B1, compiler.misc.unnamed.package
6 warnings
--- a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4b.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4b.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,3 +1,3 @@
-A.java:10:9: compiler.warn.has.been.deprecated: A1, unnamed package
+A.java:10:9: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
- compiler.note.deprecated.plural.additional
1 warning
--- a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4c.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4c.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,4 +1,4 @@
-A.java:10:9: compiler.warn.has.been.deprecated: A1, unnamed package
-A.java:10:21: compiler.warn.has.been.deprecated: A1, unnamed package
+A.java:10:9: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
+A.java:10:21: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
- compiler.note.deprecated.filename: B.java
2 warnings
--- a/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4d.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4d.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,5 +1,5 @@
-A.java:10:9: compiler.warn.has.been.deprecated: A1, unnamed package
-A.java:10:21: compiler.warn.has.been.deprecated: A1, unnamed package
-B.java:11:9: compiler.warn.has.been.deprecated: B1, unnamed package
+A.java:10:9: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
+A.java:10:21: compiler.warn.has.been.deprecated: A1, compiler.misc.unnamed.package
+B.java:11:9: compiler.warn.has.been.deprecated: B1, compiler.misc.unnamed.package
- compiler.note.deprecated.filename.additional: B.java
3 warnings
--- a/langtools/test/tools/javac/positions/T6253161.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/positions/T6253161.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,2 +1,2 @@
-T6253161.java:19:62: compiler.warn.missing.SVUID: <anonymous T6253161$1$1>
+T6253161.java:19:62: compiler.warn.missing.SVUID: compiler.misc.anonymous.class: T6253161$1$1
1 warning
--- a/langtools/test/tools/javac/positions/T6253161a.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/positions/T6253161a.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,2 +1,2 @@
-T6253161a.java:19:62: compiler.warn.missing.SVUID: <anonymous T6253161a$1$1>
+T6253161a.java:19:62: compiler.warn.missing.SVUID: compiler.misc.anonymous.class: T6253161a$1$1
1 warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/environment/round/Foo.java Mon Mar 09 23:53:41 2009 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@AnnotatedElementInfo(annotationName="AnnotatedElementInfo",
+ expectedSize=1,
+ names="Foo")
+public class Foo {}
--- a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Mon Mar 09 23:53:41 2009 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2006-2009 Sun Microsystems, Inc. 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 6397298 6400986 6425592 6449798 6453386 6508401
+ * @bug 6397298 6400986 6425592 6449798 6453386 6508401 6498938
* @summary Tests that getElementsAnnotatedWith works properly.
* @author Joseph D. Darcy
* @compile TestElementsAnnotatedWith.java
@@ -31,16 +31,22 @@
* @compile -processor TestElementsAnnotatedWith -proc:only SurfaceAnnotations.java
* @compile -processor TestElementsAnnotatedWith -proc:only BuriedAnnotations.java
* @compile -processor TestElementsAnnotatedWith -proc:only Part1.java Part2.java
+ * @compile -processor TestElementsAnnotatedWith -proc:only C2.java
+ * @compile -processor TestElementsAnnotatedWith -proc:only Foo.java
+ * @compile -XD-d=. Foo.java
* @compile -processor TestElementsAnnotatedWith -proc:only TestElementsAnnotatedWith.java
- * @compile -processor TestElementsAnnotatedWith -proc:only C2.java
*/
import java.lang.annotation.Annotation;
+import java.io.*;
import java.util.Collections;
import java.util.Set;
import java.util.HashSet;
+import java.util.List;
+import java.util.ArrayList;
import java.util.Arrays;
import javax.annotation.processing.*;
+import javax.tools.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.*;
import javax.lang.model.util.*;
@@ -120,6 +126,9 @@
System.err.println("AnnotatedElementInfo: " + annotatedElementInfo);
throw new RuntimeException();
}
+
+ if("TestElementsAnnotatedWith".equals(firstType.getSimpleName().toString()))
+ writeClassFile(); // Start another round to test class file input
} else {
// If processing is over without an error, the specified
// elements should be empty so an empty set should be returned.
@@ -161,6 +170,37 @@
} catch(IllegalArgumentException iae) {}
}
+ /*
+ * Hack alert! The class file read below is generated by the
+ * "@compile -XD-d=. Foo.java" directive above. This sneakily
+ * overrides the output location to the current directory where a
+ * subsequent @compile can read the file. This could be improved
+ * if either a new directive like @process accepted class file
+ * arguments (the javac command accepts such arguments but
+ * @compile does not) or the test.src and test.classes properties
+ * were set to be read with @compile jobs.
+ */
+ private void writeClassFile() {
+ try {
+ Filer filer = processingEnv.getFiler();
+ JavaFileObject jfo = filer.createClassFile("Foo");
+ OutputStream os = jfo.openOutputStream();
+ // Copy the bytes over
+ System.out.println((new File(".")).getAbsolutePath());
+ InputStream io = new BufferedInputStream(new FileInputStream(new File(".", "Foo.class")));
+ int datum = io.read();
+ while(datum != -1) {
+ os.write(datum);
+ datum = io.read();
+ }
+ os.close();
+ } catch (IOException io) {
+ throw new RuntimeException(io);
+ }
+
+
+ }
+
@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
--- a/langtools/test/tools/javac/warnings/Deprecation.lintAll.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/warnings/Deprecation.lintAll.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,3 +1,3 @@
-Deprecation.java:18:24: compiler.warn.has.been.deprecated: Deprecation, unnamed package
-Deprecation.java:55:24: compiler.warn.has.been.deprecated: Deprecation, unnamed package
+Deprecation.java:18:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
+Deprecation.java:55:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
2 warnings
--- a/langtools/test/tools/javac/warnings/Deprecation.lintDeprecation.out Mon Mar 09 13:34:19 2009 -0700
+++ b/langtools/test/tools/javac/warnings/Deprecation.lintDeprecation.out Mon Mar 09 23:53:41 2009 -0700
@@ -1,3 +1,3 @@
-Deprecation.java:18:24: compiler.warn.has.been.deprecated: Deprecation, unnamed package
-Deprecation.java:55:24: compiler.warn.has.been.deprecated: Deprecation, unnamed package
+Deprecation.java:18:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
+Deprecation.java:55:24: compiler.warn.has.been.deprecated: Deprecation, compiler.misc.unnamed.package
2 warnings