JDK-8024395 : Improve fix for line break calculations
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7u40,8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-09-06
  • Updated: 2014-11-17
  • Resolved: 2013-09-12
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8 b110Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The fix made under JDK-8014863 is not full. JDK 7 and 8 still have some problems with line break calculation.

Steps to reproduce:
1. Run HTMLEditorTest.java (attached).
2. Place the cursor at the beginning of the first line and then type "one two ".

After the last space been entered the first line is incorrectly broken after the "this is" where we'd expect to see at least "this is a test" on the first line.
Comments
Evaluation: the method View.forwardUpdate() does not send update event to the view located right after the changed place. It looks like, this behaviour is caused by complexity of View.forwardUpdate() since the method is responsible for sending updates to all types of views available in the system. Suggested fix: revert the changes added for JDK-8014863 and override forwardUpdate() method for LogicalView class located at FlowView. LogicalView.forwardUpdate() sends update event to all views followed by the changed place. This event will cause view to drop the cache and re-calculate its break points. The fix does not cause the break spots re-calculation every time when a view is laid out. It initiates the break spots re-calculation only when an update of a document takes place.
2013-09-06