Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-04-18 13:25:17 +0000
committerMichael Valenta2007-04-18 13:25:17 +0000
commitdffe479c42b40648f2ce0686bc7ddeed79d824f1 (patch)
tree3608780af2360f9904ed8596b79ede1108ee970f /bundles/org.eclipse.compare
parent1cda164886da3a4151110bdd107e55ad88dda73c (diff)
downloadeclipse.platform.team-dffe479c42b40648f2ce0686bc7ddeed79d824f1.tar.gz
eclipse.platform.team-dffe479c42b40648f2ce0686bc7ddeed79d824f1.tar.xz
eclipse.platform.team-dffe479c42b40648f2ce0686bc7ddeed79d824f1.zip
Bug 182843 NPE when trying to see conflicting changes
Diffstat (limited to 'bundles/org.eclipse.compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java10
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java10
2 files changed, 18 insertions, 2 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
index 633a1ba44..6e8f526e3 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
@@ -17,7 +17,7 @@ import org.eclipse.ui.texteditor.AbstractTextEditor;
public class ShowWhitespaceAction extends TextEditorPropertyAction {
- private Map painters = new HashMap();
+ private Map fPainters;
private boolean isWhitespaceShowing;
public ShowWhitespaceAction(MergeSourceViewer[] viewers) {
@@ -32,10 +32,17 @@ public class ShowWhitespaceAction extends TextEditorPropertyAction {
}
}
+ private synchronized Map getPainters() {
+ if (fPainters == null)
+ fPainters = new HashMap();
+ return fPainters;
+ }
+
private void showWhitespace() {
if (isWhitespaceShowing)
return;
try {
+ Map painters = getPainters();
MergeSourceViewer[] viewers = getViewers();
for (int i = 0; i < viewers.length; i++) {
MergeSourceViewer viewer = viewers[i];
@@ -49,6 +56,7 @@ public class ShowWhitespaceAction extends TextEditorPropertyAction {
}
private void hideWhitespace() {
+ Map painters = getPainters();
for (Iterator iterator = painters.keySet().iterator(); iterator.hasNext();) {
MergeSourceViewer viewer = (MergeSourceViewer) iterator.next();
WhitespaceCharacterPainter painter = (WhitespaceCharacterPainter)painters.get(viewer);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
index 633a1ba44..6e8f526e3 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ShowWhitespaceAction.java
@@ -17,7 +17,7 @@ import org.eclipse.ui.texteditor.AbstractTextEditor;
public class ShowWhitespaceAction extends TextEditorPropertyAction {
- private Map painters = new HashMap();
+ private Map fPainters;
private boolean isWhitespaceShowing;
public ShowWhitespaceAction(MergeSourceViewer[] viewers) {
@@ -32,10 +32,17 @@ public class ShowWhitespaceAction extends TextEditorPropertyAction {
}
}
+ private synchronized Map getPainters() {
+ if (fPainters == null)
+ fPainters = new HashMap();
+ return fPainters;
+ }
+
private void showWhitespace() {
if (isWhitespaceShowing)
return;
try {
+ Map painters = getPainters();
MergeSourceViewer[] viewers = getViewers();
for (int i = 0; i < viewers.length; i++) {
MergeSourceViewer viewer = viewers[i];
@@ -49,6 +56,7 @@ public class ShowWhitespaceAction extends TextEditorPropertyAction {
}
private void hideWhitespace() {
+ Map painters = getPainters();
for (Iterator iterator = painters.keySet().iterator(); iterator.hasNext();) {
MergeSourceViewer viewer = (MergeSourceViewer) iterator.next();
WhitespaceCharacterPainter painter = (WhitespaceCharacterPainter)painters.get(viewer);

Back to the top