JDK-7105529 : XAWT: Optimize getFieldsAsString() methods generated by WrapperGenerator
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-10-27
  • Updated: 2013-07-10
  • Resolved: 2011-11-16
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.
7u4Fixed 8 b14Fixed
Related Reports
Relates :  
The issue is related to 7104625.

WrapperGenerator is used to generate XEvent and its descendant classes. All of the generated classes contain a getFieldsAsString() method used to get their string representation. These methods use string concatenation with the "+" operator which leads to huge overhead in terms of memory usage.

EVALUATION More info available at the following mail thread: http://mail.openjdk.java.net/pipermail/awt-dev/2011-October/001952.html

EVALUATION The methods should use the StringBuilder class to avoid wasting memory.