Bug 140449 - NullPointerException in Intro plugin
Summary: NullPointerException in Intro plugin
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 3.2 RC4   Edit
Assignee: Dejan Glozic CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-05 18:24 EDT by David Pickens CLA
Modified: 2006-05-09 15:34 EDT (History)
2 users (show)

See Also:


Attachments
The fix for the Welcome NPE. (814 bytes, patch)
2006-05-08 18:06 EDT, Dejan Glozic CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Pickens CLA 2006-05-05 18:24:46 EDT
Since upgrading to Eclipse 3.2RC2 from Eclipse 3.1.2, my application now gets a NullPointerException from the org.eclipse.ui.intro plugin. 

In particular, the title text of our intro page is null. This causes the method org.eclipse.ui.internal.intro.impl.model.IntroText::getText() to pass null to the resolveVariables method, which promptly throws the NullPointerException.

Here is the callstack trace:

!SESSION 2006-05-05 09:05:45.132 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.5.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product com.arc.cdt.toolchain.ide -pdelaunch
Command-line arguments:  -product com.arc.cdt.toolchain.ide -data C:\Documents and Settings\davidp\mide\demo-workspace -dev file:C:/workspace/.metadata/.plugins/org.eclipse.pde.core/Run-time Workbench/dev.properties -pdelaunch -debug C:\workspace\.metadata\.plugins\org.eclipse.pde.core\Run-time Workbench/.options -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.ui 4 4 2006-05-05 15:16:58.366
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2006-05-05 15:16:58.381
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
	at org.eclipse.ui.internal.intro.impl.model.IntroModelRoot.resolveVariables(IntroModelRoot.java:850)
	at org.eclipse.ui.internal.intro.impl.model.IntroText.getText(IntroText.java:51)
	at org.eclipse.ui.internal.intro.impl.model.IntroPageTitle.getTitle(IntroPageTitle.java:32)
	at org.eclipse.ui.internal.intro.impl.html.IntroHTMLGenerator.generateIntroTitle(IntroHTMLGenerator.java:551)
	at org.eclipse.ui.internal.intro.impl.html.IntroHTMLGenerator.generateIntroElement(IntroHTMLGenerator.java:270)
	at org.eclipse.ui.internal.intro.impl.html.IntroHTMLGenerator.generateBodyElement(IntroHTMLGenerator.java:228)
	at org.eclipse.ui.internal.intro.impl.html.IntroHTMLGenerator.generateHTMLElement(IntroHTMLGenerator.java:100)
	at org.eclipse.ui.internal.intro.impl.html.IntroHTMLGenerator.generateHTMLforPage(IntroHTMLGenerator.java:67)
	at org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartImplementation.generateDynamicContentForPage(BrowserIntroPartImplementation.java:203)
	at org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartImplementation.dynamicStandbyStateChanged(BrowserIntroPartImplementation.java:434)
	at org.eclipse.ui.internal.intro.impl.presentations.BrowserIntroPartImplementation.doStandbyStateChanged(BrowserIntroPartImplementation.java:641)
	at org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation.standbyStateChanged(AbstractIntroPartImplementation.java:249)
	at org.eclipse.ui.internal.intro.impl.model.IntroPartPresentation.standbyStateChanged(IntroPartPresentation.java:438)
	at org.eclipse.ui.intro.config.CustomizableIntroPart.standbyStateChanged(CustomizableIntroPart.java:263)
	at org.eclipse.ui.internal.ViewIntroAdapterPart$2.run(ViewIntroAdapterPart.java:74)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.ViewIntroAdapterPart.setStandby(ViewIntroAdapterPart.java:70)
	at org.eclipse.ui.internal.ViewIntroAdapterPart$1.propertyChanged(ViewIntroAdapterPart.java:55)
	at org.eclipse.ui.internal.WorkbenchPartReference.fireInternalPropertyChange(WorkbenchPartReference.java:346)
	at org.eclipse.ui.internal.WorkbenchPartReference.fireZoomChange(WorkbenchPartReference.java:511)
	at org.eclipse.ui.internal.PartPane.setZoomed(PartPane.java:333)
	at org.eclipse.ui.internal.PartStack.setZoomed(PartStack.java:1233)
	at org.eclipse.ui.internal.PartSashContainer.zoomIn(PartSashContainer.java:879)
	at org.eclipse.ui.internal.PartSashContainer.childRequestZoomIn(PartSashContainer.java:900)
	at org.eclipse.ui.internal.LayoutPart.requestZoomIn(LayoutPart.java:354)
	at org.eclipse.ui.internal.PartStack.childRequestZoomIn(PartStack.java:1183)
	at org.eclipse.ui.internal.LayoutPart.requestZoomIn(LayoutPart.java:354)
	at org.eclipse.ui.internal.PerspectiveHelper.zoomIn(PerspectiveHelper.java:1315)
	at org.eclipse.ui.internal.WorkbenchPage.setState(WorkbenchPage.java:3549)
	at org.eclipse.ui.internal.WorkbenchPage.toggleZoom(WorkbenchPage.java:3610)
	at org.eclipse.ui.internal.WorkbenchIntroManager.setIntroStandby(WorkbenchIntroManager.java:200)
	at org.eclipse.ui.internal.WorkbenchIntroManager.showIntro(WorkbenchIntroManager.java:135)
	at org.eclipse.ui.application.WorkbenchWindowAdvisor.openIntro(WorkbenchWindowAdvisor.java:172)
	at org.eclipse.ui.internal.ide.IDEWorkbenchWindowAdvisor.openIntro(IDEWorkbenchWindowAdvisor.java:424)
	at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:676)
	at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:803)
	at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1437)
	at org.eclipse.ui.internal.Workbench.access$10(Workbench.java:1435)
	at org.eclipse.ui.internal.Workbench$16.run(Workbench.java:1399)
	at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1421)
	at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1397)
	at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 Dejan Glozic CLA 2006-05-06 21:52:31 EDT
An RC4 candidate.
Comment 2 Dejan Glozic CLA 2006-05-08 18:05:27 EDT
Confirmed - all that is needed is to place an empty element for the title:

       <title style-id="intro-header"></title>

The fix is trivial - we need to short-circuit the null argument. The fix is attached as a patch.
Comment 3 Dejan Glozic CLA 2006-05-08 18:06:08 EDT
Created attachment 40662 [details]
The fix for the Welcome NPE.
Comment 4 Dejan Glozic CLA 2006-05-08 18:07:30 EDT
Wassim, need your +1 for this defect.
Comment 5 Dejan Glozic CLA 2006-05-08 18:08:09 EDT
McQ, need a vote as per RC4 rules of engagement.
Comment 6 Wassim Melhem CLA 2006-05-08 18:10:45 EDT
+1.  Fix is trivial and localized.
Comment 7 Dejan Glozic CLA 2006-05-08 18:11:12 EDT
For voters, the fix above is probably as sweet as it gets for RC4 - we missed a case where the text passeed to the method could be NULL in rare cases. Barfing it out in immediately is the right thing to do and solves this problem. Eclipse does not see this problem because it is unusual to specify the title element but leave it empty, and we have non-null titles.
Comment 8 Mike Wilson CLA 2006-05-09 09:40:33 EDT
+1
Comment 9 Dejan Glozic CLA 2006-05-09 15:34:32 EDT
Released.