I've noticed an odd Eclipse problem from time to time that just occurred again: the occurrence highlight setting (Window > Preferences > Java > Editor > Mark Occurrences) spontaneously is turned off. I think it happened at the same time as the following error was logged by Eclipse:
Message:
Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench.texteditor".
Stack trace:
java.lang.NullPointerException
at org.eclipse.jface.text.AbstractDocument.getDocumentPartitioner(AbstractDocument.java:1467)
at org.eclipse.jface.text.AbstractDocument.computePartitioning(AbstractDocument.java:1426)
at org.eclipse.core.internal.filebuffers.SynchronizableDocument.computePartitioning(SynchronizableDocument.java:292)
at org.eclipse.jface.text.TextUtilities.computePartitioning(TextUtilities.java:431)
at org.eclipse.jdt.internal.ui.text.spelling.JavaSpellingEngine.check(JavaSpellingEngine.java:48)
at org.eclipse.jdt.internal.ui.text.spelling.SpellingEngine.check(SpellingEngine.java:90)
at org.eclipse.jdt.internal.ui.text.spelling.DefaultSpellingEngine.check(DefaultSpellingEngine.java:75)
at org.eclipse.ui.texteditor.spelling.SpellingService$1.run(SpellingService.java:104)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.texteditor.spelling.SpellingService.check(SpellingService.java:109)
at org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy.reconcile(SpellingReconcileStrategy.java:198)
at org.eclipse.jdt.internal.ui.text.spelling.JavaSpellingReconcileStrategy.reconcile(JavaSpellingReconcileStrategy.java:127)
at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:104)
at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
Session data:
eclipse.buildId=M20120208-0800
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
(This happens to be the only error logged by Eclipse today.)
Does anyone know what's causing the spontaneous disabling and whether it's related to the above error? I was editing code for an Android project, if that matters. (The stack trace doesn't show anything that I recognize as being from the Android SDK; however, I have the impression that the frequency of the problem went up with the installation of the latest Android tools.)
While it's certainly easy enough to set highlighting back on, I'd like to know if there's something I can do to fix the problem.
There is a related issue with Eclipse Juno. I am having this issue with Eclipse Juno 4.2.2
Workaround to the issue in the above bugs: Switch to the Outline view and back to your file again, and mark occurrences should start working again (at least for a little while).