eclipse-platform / eclipse.platform.text

8 stars 45 forks source link

[GenericEditor] An NPE occurs in `IndentFoldingStrategy.reconcile` #228

Closed vrubezhny closed 1 year ago

vrubezhny commented 1 year ago

When running WWD JUnit tests on MacOS Github Actions runner a NullPointerException gets logged:

##[error]Exception in thread "org.eclipse.ui.internal.genericeditor.folding.DefaultFoldingReconciler" java.lang.NullPointerException: Cannot invoke "org.eclipse.jface.text.IDocument.getNumberOfLines()" because "this.document" is null
    at org.eclipse.ui.internal.genericeditor.folding.IndentFoldingStrategy.reconcile(IndentFoldingStrategy.java:234)
    at org.eclipse.ui.internal.genericeditor.folding.DefaultFoldingReconciler.process(DefaultFoldingReconciler.java:48)
    at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:207)

This probably happens because IndentFoldingStrategy.uninstall is invoked during the reconcile run.

The issue happens only on GitHub Actions MacOS runner (at least I never spot it when running tests locally nor while browsing the logs from GitHub Actions Windows runner nor the Jenkins (Linux) one).