Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2013-04-27 12:04:07 +0000
committerMatthias Sohn2013-04-28 23:27:03 +0000
commitc3a6041507f6d32ebef265dca18524d1c2b200ac (patch)
tree045a91f13c5c84a7689189f34191f0dd5c068db9 /org.eclipse.egit.ui
parent3f99f2b7980ad42de413e6b082665ddf441c173c (diff)
downloadegit-c3a6041507f6d32ebef265dca18524d1c2b200ac.tar.gz
egit-c3a6041507f6d32ebef265dca18524d1c2b200ac.tar.xz
egit-c3a6041507f6d32ebef265dca18524d1c2b200ac.zip
Fix IAE in DiffViewer.refreshStyleRanges for binary change
The problem was that the underlying document did not yet contain the text that the style ranges were referring to. In DiffEditorPage#formatDiff, the job calls DiffStyleRangeFormatter#write, which flushes the output stream at the end. So implement flush in DocumentOutputStream to make sure the document is complete. Bug: 406542 Change-Id: I2288c8b12a20557f42a51ea11df6dfc6d3b3d91c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java
index dedc020976..a6dae8b27a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffStyleRangeFormatter.java
@@ -139,6 +139,11 @@ public class DiffStyleRangeFormatter extends DiffFormatter {
write(new byte[] { (byte) b });
}
+ @Override
+ public void flush() throws IOException {
+ flushLine();
+ }
+
protected void flushLine() throws IOException {
if (lineBuffer.length() > 0) {
write(lineBuffer.toString());

Back to the top