eclipse-pde / eclipse.pde

Eclipse Public License 2.0
25 stars 64 forks source link

Avoid unhandled NPEs in FoldingReconcilerStrategy #1224

Closed iloveeclipse closed 5 months ago

iloveeclipse commented 5 months ago

The exception below is printed to standard error every time a generic editor diff contribution is used in compare editor for target files. I assume it never worked as designed with TargetPlatformFoldingReconciler, so just add a NPE guard to prevent unhandled exceptions / printouts.

Exception in thread
"org.eclipse.pde.internal.genericeditor.target.extension.reconciler.folding.TargetPlatformFoldingReconciler"
java.lang.NullPointerException: Cannot invoke
"org.eclipse.jface.text.source.projection.ProjectionViewer.getProjectionAnnotationModel()"
because "this.projectionViewer" is null
    at org.eclipse.pde.internal.genericeditor.target.extension.reconciler.folding.FoldingReconcilerStrategy.initialReconcile(FoldingReconcilerStrategy.java:63)
    at org.eclipse.jface.text.reconciler.Reconciler.initialProcess(Reconciler.java:223)
    at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:177)

See https://github.com/eclipse-platform/eclipse.platform.ui/issues/1798

github-actions[bot] commented 5 months ago

Test Results

   291 files  ±0     291 suites  ±0   52m 54s :stopwatch: - 2m 14s  3 526 tests ±0   3 468 :white_check_mark: ±0   58 :zzz: ±0  0 :x: ±0  10 875 runs  ±0  10 698 :white_check_mark: ±0  177 :zzz: ±0  0 :x: ±0 

Results for commit 1ef88afd. ± Comparison against base commit 11de65cd.