Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355343 - NPE in log when accessing project facets page of closed faceted project
Summary: NPE in log when accessing project facets page of closed faceted project
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-22 03:27 EDT by Venkat CLA
Modified: 2014-07-12 12:03 EDT (History)
3 users (show)

See Also:
konstantin: review+


Attachments
Proposed patch (594 bytes, patch)
2014-06-30 12:01 EDT, Roberto Sanchez Herrera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Venkat CLA 2011-08-22 03:27:28 EDT
Build Identifier: Eclipse 3.6 SDK

NullPointer exception is thrown in the log file when accessing Project Facets page of a closed faceted project in the Eclipse workbench.

/* Exception found in log file */

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.wst.common.project.facet.ui.internal.ConvertProjectToFacetedFormRunnable.runInProgressDialog(ConvertProjectToFacetedFormRunnable.java:46)
	at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.handleConvertProjectAction(FacetsPropertyPage.java:539)
	at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.access$1(FacetsPropertyPage.java:537)
	at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$2.widgetSelected(FacetsPropertyPage.java:169)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendSelectionEvent(Widget.java:1093)
	at org.eclipse.swt.widgets.Link.wmNotifyChild(Link.java:1071)
	at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5096)
	at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1887)
	at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:4726)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4215)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886)
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362)
	at org.eclipse.swt.widgets.Link.callWindowProc(Link.java:172)
	at org.eclipse.swt.widgets.Widget.wmLButtonUp(Widget.java:2056)
	at org.eclipse.swt.widgets.Control.WM_LBUTTONUP(Control.java:4516)
	at org.eclipse.swt.widgets.Link.WM_LBUTTONUP(Link.java:909)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4196)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	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:369)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.lang.NullPointerException
	at org.eclipse.wst.common.project.facet.ui.internal.ConvertProjectToFacetedFormRunnable.run(ConvertProjectToFacetedFormRunnable.java:80)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)


Reproducible: Always

Steps to Reproduce:
1. Launch Eclipse IDE (3.6 SDK) in a workspace
2. Create a faceted project (say myProj)
3. Close the project from the project explorer
4. Now switch to Project properties page of the closed project.
            Project properties -> Project Facets
5. Observe that 'Convert to faceted from...' link is still available for a faceted project
6. Click on that link. Observe that null exception is logged silently in the log file.
Comment 1 Roberto Sanchez Herrera CLA 2014-06-19 10:29:55 EDT
This is still happening in WTP 3.6. Triaging to 3.6.1
Comment 2 Roberto Sanchez Herrera CLA 2014-06-30 12:01:48 EDT
Created attachment 244677 [details]
Proposed patch

In this patch, the facets page is hidden is the project is not open.
Comment 3 Konstantin Komissarchik CLA 2014-07-08 18:44:18 EDT
thanks
Comment 4 Roberto Sanchez Herrera CLA 2014-07-12 12:03:25 EDT
Committed to master for WTP 3.6.1 and 3.7. 

http://git.eclipse.org/c/webtools-common/webtools.common.fproj.git/commit/?id=ed3ae7091c3ea10584f758dc6065c560f6804d41

In the next 3.6.1 and 3.7 build, the facets page will be hidden if the project is closed.

Resolving