Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Xenos2015-11-19 20:33:10 +0000
committerStefan Xenos2015-11-19 20:33:10 +0000
commita83e305abab7be90c0001e6be7cd1ead27587d92 (patch)
tree7be1f9127a9c82c2aa958510548f4580a4f13191
parent28a1e3f7f144725c55d0d20a3f21c5fba506fc6d (diff)
downloadeclipse.platform.team-I20151209-2300.tar.gz
eclipse.platform.team-I20151209-2300.tar.xz
eclipse.platform.team-I20151209-2300.zip
Half of the fix for the NPE in JavaReconciler. The other half lives in JDT UI). The JDT fix makes the source viewer disposal happen earlier, which causes some values to be null during teardown which weren't null previously. This adds the null checks but not the code which reorders the events. Change-Id: I3cf940afd2c87533d87e4d0c981256eb0da46f70 Signed-off-by: Stefan Xenos <sxenos@gmail.com>
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java19
2 files changed, 12 insertions, 9 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index 5922600ca..45504d95f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -564,7 +564,7 @@ public abstract class CompareEditorInput extends PlatformObject implements IEdit
* input is disposed at the end making it possible to refer
* during widgets disposal.
*/
- Composite composite = fComposite;
+ Composite composite = (Composite)e.widget;
Control control = composite;
while (composite.getChildren().length > 0) {
control = composite.getChildren()[composite.getChildren().length - 1];
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 49da7cd5a..32c935471 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -904,14 +904,17 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
provider.removeElementStateListener(this);
}
// If we have a listener registered with the widget, remove it
- if (fSourceViewer != null && !fSourceViewer.getSourceViewer().getTextWidget().isDisposed()) {
- if (fNeedsValidation) {
- fSourceViewer.getSourceViewer().getTextWidget().removeVerifyListener(this);
- fNeedsValidation = false;
- }
- IDocument oldDoc= internalGetDocument(fSourceViewer);
- if (oldDoc != null) {
- oldDoc.removeDocumentListener(this);
+ if (fSourceViewer != null) {
+ StyledText textWidget = fSourceViewer.getSourceViewer().getTextWidget();
+ if (textWidget != null && !textWidget.isDisposed()) {
+ if (fNeedsValidation) {
+ fSourceViewer.getSourceViewer().getTextWidget().removeVerifyListener(this);
+ fNeedsValidation = false;
+ }
+ IDocument oldDoc= internalGetDocument(fSourceViewer);
+ if (oldDoc != null) {
+ oldDoc.removeDocumentListener(this);
+ }
}
}
clearCachedDocument();

Back to the top