JDK-8002168 : Cleanup initialization of javadoc Messager
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-11-02
  • Updated: 2013-06-11
  • Resolved: 2012-11-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b65Fixed
Related Reports
Relates :  
Relates :  
Description
6958836 added support for javadoc -Xmaxerrs and -Xmaxwarns

However, the changeset required an ugly hack to work around initialization issues for Messager/Log.
http://hg.openjdk.java.net/jdk8/jdk8/langtools/rev/d1ea43cb71c1

-        context = new Context();
-        messager = new Messager(context, programName, errWriter, warnWriter, noticeWriter);
+        Context tempContext = new Context(); // interim context until option decoding completed
+        messager = new Messager(tempContext, programName, errWriter, warnWriter, noticeWriter);

However, the ugly hack is no longer necessary because Messager/Log is more tolerant of initialization order.
See 7108668: allow Log to be initialized and used earlier