2009-10-15T22:04:47.594-0700 Terminator: Exception occurred during event dispatching.
Associated exception:
java.lang.NullPointerException
           at terminator.model.TextLine.getStyledTextSegments(TextLine.java:66)
           at terminator.view.TerminalView.getLineStyledText(TerminalView.java:761)
           at terminator.view.TerminalView.paintComponent(TerminalView.java:737)
           at javax.swing.JComponent.paint(JComponent.java:1027)
           at javax.swing.JComponent.paintToOffscreen(JComponent.java:5122)
           at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:277)
           at javax.swing.RepaintManager.paint(RepaintManager.java:1217)
           at javax.swing.JComponent._paintImmediately(JComponent.java:5070)
           at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
           at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:803)
           at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
           at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
           at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
           at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
           at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
           at e.debug.EventDispatchThreadHangMonitor.dispatchEvent(EventDispatchThreadHangMonitor.java:191)
           at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
           at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
           at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
           at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Â
If we were trying to overwrite some style data for a line which was previously default-styled with styles == null and the region we wanted to overwrite didn't reach the end of the line, wouldn't we need to fill the new array to the end, not just to the start of the region to be overwritten? The code which does the filling in the insertStyleData method looks like the patch I'm suggesting here - somewhat clumsily filling elements that it will immediately overwrite.
Â
Index: src/terminator/model/TextLine.java
===================================================================
--- src/terminator/model/TextLine.java   (revision 1582)
+++ src/terminator/model/TextLine.java   (working copy)
@@ -210,7 +210,7 @@
           if (oldStyleData != null) {
                 System.arraycopy(oldStyleData, 0, styles, 0, oldStyleData.length);
           } else {
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Arrays.fill(styles, 0, offset, Style.getDefaultStyle());
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Arrays.fill(styles, 0, styles.length, Style.getDefaultStyle());
           }
           Arrays.fill(styles, offset, offset + count, value);
Before r1257 overwriteStyleData was called extendWithStyleData, which it was fit for. It was renamed, to what it perhaps should have done, but didn't need to and didn't do. Then r1259 assumed that it did what it now said on the tin.
Sent: Sat Oct 17 18:35:20 2009