mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-07 17:15:25 +02:00
PR 51121, patch from Chris Wiebe to fix
and race condition.
This commit is contained in:
parent
a26a745733
commit
be766c6e3a
2 changed files with 20 additions and 1 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
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
|
2004-02-03 Alain Magloire
|
||||||
|
|
||||||
PR 51115
|
PR 51115
|
||||||
|
|
|
@ -192,7 +192,15 @@ public class CSourceViewerConfiguration extends SourceViewerConfiguration {
|
||||||
*/
|
*/
|
||||||
public IReconciler getReconciler(ISourceViewer sourceViewer) {
|
public IReconciler getReconciler(ISourceViewer sourceViewer) {
|
||||||
if (fEditor != null && fEditor.isEditable()) {
|
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.setDelay(1000);
|
||||||
reconciler.setIsIncrementalReconciler(false);
|
reconciler.setIsIncrementalReconciler(false);
|
||||||
reconciler.setReconcilingStrategy(new CReconcilingStrategy(fEditor), IDocument.DEFAULT_CONTENT_TYPE);
|
reconciler.setReconcilingStrategy(new CReconcilingStrategy(fEditor), IDocument.DEFAULT_CONTENT_TYPE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue