JDK-6759682 : APT: compiler message file broken after refactoring of com.sun.tools.javac.util.Message
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: unknown
  • Submitted: 2008-10-15
  • Updated: 2011-05-18
  • Resolved: 2011-05-18
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 7
7 b39Fixed
Related Reports
Relates :  
Relates :  
Description
APT fails to lookup localized strngs in apt's resource file with messages like the following:

warning: compiler message file broken: key=apt.warn.FactoryNotFound arguments=ErrorFactory, {1}, {2}, {3}, {4}, {5}, {6}, {7}

This causes the failure of the test: test/tools/apt/Compile/compile.sh

Comments
SUGGESTED FIX A webrev of this fix is available at the following URL http://sa.sfbay.sun.com/projects/langtools_data/7/6759682
16-10-2008

EVALUATION No regression test is needed - the CR has been marked as noreg-other, as we already have regression tests that compare the output of apt against a golden file (such as test/tools/apt/Compiler/compile.sh) that should cover this issue.
15-10-2008

EVALUATION This problem is due to a bug in JavacMessages.addBundle(String bundleName) that has been introduced after the recent fix of 6406133. This method should reset the list of current bundles - so that any subsequent call to JavacMessages.getBundle will effectively refresh the contents of the messages' cache. Since current bundes are not reset after a call to JavacMessages.addBundle, this means that the contents of the messages' cache never get updated (they only get updated if there's a change in the default locale). This causes a failure in APT, as com/sun/tools/apt/util/Bark (which extends Log) needs to add another resource bundle to the bundle list managed by JavacMessages.
15-10-2008