1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for PR 51121

This commit is contained in:
Alain Magloire 2004-02-03 18:03:23 +00:00
parent cfb48d06f2
commit 2fbfc15fe4
2 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,13 @@
2004-02-03 Alain Magloire
PR 51121
From Chris Wiebe:
This patch prevents a null pointer exception in
org.eclipse.jface.text.reconciler.AbstractReconciler. Under certain
conditions (like rapidly closing all editors) the call to getDocument()
inside initialProcess() can return null which causes an exception.
* src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java
2004-02-03 Alain Magloire
PR 51115

View file

@ -193,7 +193,15 @@ public class CSourceViewerConfiguration extends SourceViewerConfiguration {
*/
public IReconciler getReconciler(ISourceViewer sourceViewer) {
if (fEditor != null && fEditor.isEditable()) {
Reconciler reconciler= new Reconciler();
Reconciler reconciler= new Reconciler() {
protected void initialProcess() {
// prevent case where getDocument() returns null
// and causes exception in initialProcess()
IDocument doc = getDocument();
if (doc != null)
super.initialProcess();
}
};
reconciler.setDelay(1000);
reconciler.setIsIncrementalReconciler(false);
reconciler.setReconcilingStrategy(new CReconcilingStrategy(fEditor), IDocument.DEFAULT_CONTENT_TYPE);