Bug 357918 - NullPointerException when switching to opened Tab(Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench")
Summary: NullPointerException when switching to opened Tab(Problems occurred when invo...
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 358045 358306 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-16 06:01 EDT by markus.hager CLA
Modified: 2011-09-21 02:13 EDT (History)
6 users (show)

See Also:


Attachments
the empty tab after the error occurs (74.29 KB, image/png)
2011-09-16 06:06 EDT, markus.hager CLA
no flags Details
the dialog which occurs when switching to the empty tab (13.34 KB, image/png)
2011-09-16 06:06 EDT, markus.hager CLA
no flags Details
Event details dialog of the error log (59.77 KB, image/png)
2011-09-16 06:07 EDT, markus.hager CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description markus.hager CLA 2011-09-16 06:01:39 EDT
Build Identifier: 

I don't know how to reproduce it. But since my update yesterday I am getting crazy, because every about 15-30 minutes I get this error and I have to close the tab, reopen the file and take care that my last changes have been saved.

In the error log I could find the following error:

Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".

java.lang.NullPointerException
	at org.eclipse.ui.texteditor.SelectMarkerRulerAction.includesRulerLine(SelectMarkerRulerAction.java:293)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.findJavaAnnotation(JavaSelectAnnotationRulerAction.java:157)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.update(JavaSelectAnnotationRulerAction.java:108)
	at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.update(AbstractRulerActionDelegate.java:132)
	at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.setActiveEditor(AbstractRulerActionDelegate.java:89)
	at org.eclipse.ui.internal.EditorPluginAction.editorChanged(EditorPluginAction.java:75)
	at org.eclipse.ui.internal.EditorActionBuilder$EditorContribution.editorChanged(EditorActionBuilder.java:83)
	at org.eclipse.ui.internal.EditorActionBuilder$ExternalContributor.setActiveEditor(EditorActionBuilder.java:129)
	at org.eclipse.ui.internal.EditorActionBars.partChanged(EditorActionBars.java:346)
	at org.eclipse.ui.internal.WorkbenchPage$3.run(WorkbenchPage.java:709)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.runtime.Platform.run(Platform.java:888)
	at org.eclipse.ui.internal.WorkbenchPage.activatePart(WorkbenchPage.java:698)
	at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3632)
	at org.eclipse.ui.internal.WorkbenchPage.toggleFastView(WorkbenchPage.java:3980)
	at org.eclipse.ui.internal.WorkbenchPage.hideFastView(WorkbenchPage.java:3960)
	at org.eclipse.ui.internal.FastViewPane$2.setState(FastViewPane.java:95)
	at org.eclipse.ui.internal.FastViewPane$3.handleEvent(FastViewPane.java:306)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Reproducible: Couldn't Reproduce

Steps to Reproduce:
I have opened some file I am working on. After some time after I switched to another application(e.g. the browser) and I switch back, suddenly the tab shows me a blank text area with the only text error(hopefully I am able to add a screenshot). Then I have to close the tab and reopen the file and control if my last changes have been saved
Comment 1 markus.hager CLA 2011-09-16 06:06:00 EDT
Created attachment 203479 [details]
the empty tab after the error occurs
Comment 2 markus.hager CLA 2011-09-16 06:06:42 EDT
Created attachment 203480 [details]
the dialog which occurs when switching to the empty tab
Comment 3 markus.hager CLA 2011-09-16 06:07:16 EDT
Created attachment 203481 [details]
Event details dialog of the error log
Comment 4 Dani Megert CLA 2011-09-16 07:42:44 EDT
Which release and build id are you using?
Can you try to provide steps?

Maybe something went wrong with the update. I suggest you try to download a complete new build.
Comment 5 tb1sl3y CLA 2011-09-16 09:20:33 EDT
I've just tried a clean install of indigo on linux and I'm getting exactly the same issue.

Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product

Unfortunately, it's not possible to give steps to reproduce as it appears the issue is random. In my case, I have a few java classes opened up and after switching between the classes a number of times I'll select one of the java tabs and it will npe with exactly the same stack trace as reported above.
Comment 6 Dani Megert CLA 2011-09-16 12:15:12 EDT
(In reply to comment #5)
> I've just tried a clean install of indigo on linux and I'm getting exactly the
> same issue.
> 
> Session Data:
> eclipse.buildId=I20110613-1736
> java.version=1.6.0_26
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_GB
> Framework arguments:  -product org.eclipse.epp.package.jee.product
> Command-line arguments:  -os linux -ws gtk -arch x86 -product
> org.eclipse.epp.package.jee.product
> 
> Unfortunately, it's not possible to give steps to reproduce as it appears the
> issue is random. In my case, I have a few java classes opened up and after
> switching between the classes a number of times I'll select one of the java
> tabs and it will npe with exactly the same stack trace as reported above.

Very strange. Can you try with a build from here:
http://download.eclipse.org/eclipse/downloads/drops/M20110909-1335/index.php
Comment 7 Oleg Lyashko CLA 2011-09-17 15:58:57 EDT
(In reply to comment #6)
> 
> Very strange. Can you try with a build from here:
> http://download.eclipse.org/eclipse/downloads/drops/M20110909-1335/index.php

I'm having the same problems with build M20110909-1335.

!SESSION
eclipse.buildId=M20110909-1335
java.version=1.6.0_27
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64 -data eclipse/workspaces/indigo

I can't explicitly describe how to reproduce it. But in my case this issue begin with exceptions as follows

!ENTRY org.eclipse.ui 4 0 2011-09-17 14:04:19.754
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: assertion failed:
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
	at org.eclipse.jface.text.source.AnnotationModel.getRegionAnnotationIterator(AnnotationModel.java:742)
	at org.eclipse.jface.text.source.AnnotationModel.getAnnotationIterator(AnnotationModel.java:700)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.doPaint1(AnnotationRulerColumn.java:727)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.doubleBufferPaint(AnnotationRulerColumn.java:541)
	at org.eclipse.jface.text.source.AnnotationRulerColumn.access$3(AnnotationRulerColumn.java:517)
	at org.eclipse.jface.text.source.AnnotationRulerColumn$1.paintControl(AnnotationRulerColumn.java:289)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:229)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
	at org.eclipse.swt.widgets.Control.gtk_expose_event(Control.java:2961)
	at org.eclipse.swt.widgets.Composite.gtk_expose_event(Composite.java:701)
	at org.eclipse.swt.widgets.Canvas.gtk_expose_event(Canvas.java:167)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1739)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:5016)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4408)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8422)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1245)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2276)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3207)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

Eventually switching tabs lead to NullPointerException, and Eclipse even cannot exit correctly.

I don't have this problem on clean install/empty workspace without any plugins installed. But it seems start to happen after Eclipse Checkstyle plugin installation.
Comment 8 Oleg Lyashko CLA 2011-09-17 18:19:12 EDT
It seems that this bug related to error in Eclipse Checkstyle plugin version 5.4.0.201109110000, http://sourceforge.net/projects/eclipse-cs/forums/forum/274377/topic/4708915

For me, after installing snapshot version eclipse-cs
http://eclipse-cs.sf.net/net.sf.eclipsecs-updatesite-5.4.1-SNAPSHOT-bin.zip
the problem is gone.
Comment 9 markus.hager CLA 2011-09-19 01:53:30 EDT
I'll try the checkstyle snapshot and give you a feedback latest today at 16:00 CEST. I can remember now that checkstyle was updated.
Comment 10 tb1sl3y CLA 2011-09-19 03:28:00 EDT
Installing the snapshot version of the Checkstyle plugin resolves the issue for me - thanks Oleg.
Comment 11 markus.hager CLA 2011-09-19 05:26:50 EDT
Since I installed the snapshot of Checkstyle the error didn't occur anymore. I close this issue because it's caused by the Checkstyle Plugin
Comment 12 Dani Megert CLA 2011-09-19 05:39:20 EDT
*** Bug 358045 has been marked as a duplicate of this bug. ***
Comment 13 Dani Megert CLA 2011-09-21 02:13:53 EDT
*** Bug 358306 has been marked as a duplicate of this bug. ***