1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Wed Nov 14 17:23:10 2012 -0800 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java Thu Nov 15 09:18:36 2012 -0800 1.3 @@ -46,11 +46,13 @@ 1.4 1.5 public class TagletWriterImpl extends TagletWriter { 1.6 1.7 - private HtmlDocletWriter htmlWriter; 1.8 + private final HtmlDocletWriter htmlWriter; 1.9 + private final ConfigurationImpl configuration; 1.10 1.11 public TagletWriterImpl(HtmlDocletWriter htmlWriter, boolean isFirstSentence) { 1.12 + super(isFirstSentence); 1.13 this.htmlWriter = htmlWriter; 1.14 - this.isFirstSentence = isFirstSentence; 1.15 + configuration = htmlWriter.configuration; 1.16 } 1.17 1.18 /** 1.19 @@ -64,8 +66,8 @@ 1.20 * {@inheritDoc} 1.21 */ 1.22 public TagletOutput getDocRootOutput() { 1.23 - if (htmlWriter.configuration.docrootparent.length() > 0) 1.24 - return new TagletOutputImpl(htmlWriter.configuration.docrootparent); 1.25 + if (configuration.docrootparent.length() > 0) 1.26 + return new TagletOutputImpl(configuration.docrootparent); 1.27 else if (htmlWriter.pathToRoot.isEmpty()) 1.28 return new TagletOutputImpl("."); 1.29 else 1.30 @@ -81,7 +83,7 @@ 1.31 if (doc instanceof ClassDoc) { 1.32 if (Util.isDeprecated((ProgramElementDoc) doc)) { 1.33 output.append("<span class=\"strong\">" + 1.34 - ConfigurationImpl.getInstance(). 1.35 + configuration. 1.36 getText("doclet.Deprecated") + "</span> "); 1.37 if (deprs.length > 0) { 1.38 Tag[] commentTags = deprs[0].inlineTags(); 1.39 @@ -97,7 +99,7 @@ 1.40 MemberDoc member = (MemberDoc) doc; 1.41 if (Util.isDeprecated((ProgramElementDoc) doc)) { 1.42 output.append("<span class=\"strong\">" + 1.43 - ConfigurationImpl.getInstance(). 1.44 + configuration. 1.45 getText("doclet.Deprecated") + "</span> "); 1.46 if (deprs.length > 0) { 1.47 output.append("<i>"); 1.48 @@ -108,7 +110,7 @@ 1.49 } else { 1.50 if (Util.isDeprecated(member.containingClass())) { 1.51 output.append("<span class=\"strong\">" + 1.52 - ConfigurationImpl.getInstance(). 1.53 + configuration. 1.54 getText("doclet.Deprecated") + "</span> "); 1.55 } 1.56 } 1.57 @@ -120,7 +122,7 @@ 1.58 * {@inheritDoc} 1.59 */ 1.60 public MessageRetriever getMsgRetriever() { 1.61 - return htmlWriter.configuration.message; 1.62 + return configuration.message; 1.63 } 1.64 1.65 /** 1.66 @@ -147,7 +149,7 @@ 1.67 */ 1.68 public TagletOutput returnTagOutput(Tag returnTag) { 1.69 TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "<dt>" + 1.70 - "<span class=\"strong\">" + htmlWriter.configuration.getText("doclet.Returns") + 1.71 + "<span class=\"strong\">" + configuration.getText("doclet.Returns") + 1.72 "</span>" + "</dt>" + "<dd>" + 1.73 htmlWriter.commentTagsToString(returnTag, null, returnTag.inlineTags(), 1.74 false) + "</dd>"); 1.75 @@ -178,7 +180,7 @@ 1.76 ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName() + "." + ((FieldDoc) holder).name(); 1.77 DocLink link = constantsPath.fragment(whichConstant); 1.78 result += htmlWriter.getHyperLinkString(link, 1.79 - htmlWriter.configuration.getText("doclet.Constants_Summary"), 1.80 + configuration.getText("doclet.Constants_Summary"), 1.81 false); 1.82 } 1.83 if (holder.isClass() && ((ClassDoc)holder).isSerializable()) { 1.84 @@ -189,7 +191,7 @@ 1.85 DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM); 1.86 DocLink link = serialPath.fragment(((ClassDoc)holder).qualifiedName()); 1.87 result += htmlWriter.getHyperLinkString(link, 1.88 - htmlWriter.configuration.getText("doclet.Serialized_Form"), false); 1.89 + configuration.getText("doclet.Serialized_Form"), false); 1.90 } 1.91 } 1.92 return result.equals("") ? null : new TagletOutputImpl(result + "</dd>"); 1.93 @@ -200,7 +202,7 @@ 1.94 return result + ", " + DocletConstants.NL; 1.95 } else { 1.96 return "<dt><span class=\"strong\">" + 1.97 - htmlWriter.configuration().getText("doclet.See_Also") + "</span></dt><dd>"; 1.98 + configuration.getText("doclet.See_Also") + "</span></dt><dd>"; 1.99 } 1.100 } 1.101 1.102 @@ -234,7 +236,7 @@ 1.103 */ 1.104 public TagletOutput getThrowsHeader() { 1.105 return new TagletOutputImpl(DocletConstants.NL + "<dt>" + "<span class=\"strong\">" + 1.106 - htmlWriter.configuration().getText("doclet.Throws") + "</span></dt>"); 1.107 + configuration.getText("doclet.Throws") + "</span></dt>"); 1.108 } 1.109 1.110 /** 1.111 @@ -245,7 +247,7 @@ 1.112 result += throwsTag.exceptionType() == null ? 1.113 htmlWriter.codeText(throwsTag.exceptionName()) : 1.114 htmlWriter.codeText( 1.115 - htmlWriter.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, 1.116 + htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_MEMBER, 1.117 throwsTag.exceptionType()))); 1.118 TagletOutput text = new TagletOutputImpl( 1.119 htmlWriter.commentTagsToString(throwsTag, null, 1.120 @@ -263,7 +265,7 @@ 1.121 public TagletOutput throwsTagOutput(Type throwsType) { 1.122 return new TagletOutputImpl(DocletConstants.NL + "<dd>" + 1.123 htmlWriter.codeText(htmlWriter.getLink( 1.124 - new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "</dd>"); 1.125 + new LinkInfoImpl(configuration, LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "</dd>"); 1.126 } 1.127 1.128 /** 1.129 @@ -303,7 +305,7 @@ 1.130 * {@inheritDoc} 1.131 */ 1.132 public Configuration configuration() { 1.133 - return htmlWriter.configuration(); 1.134 + return configuration; 1.135 } 1.136 1.137 /**