Community
Participate
Working Groups
Build 20030114 1. Create a path variable V1 to a folder that exists, say c:\temp\junk 2. Create a project P1 3. Create a folder P1/f1 linked to path variable V1 4. Select P1/f1 and open properties dialog. Click OK. Observe: No problem 5. Delete path variable V1 6. Select P1/f1 and open properties dialog. Click OK. Observe: The dialog does not dismiss. Expectation: Properties dialog should dismiss. Workaround: Clicking Cancel dismisses the dialog. Log entry shows an NPE: !ENTRY org.eclipse.ui 4 0 Jan 14, 2003 15:54:10.527 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at at org.eclipse.ui.internal.dialogs.ResourceInfoPage.performOk (ResourceInfoPage.java:428) at org.eclipse.jface.preference.PreferenceDialog.okPressed (PreferenceDialog.java:616) at org.eclipse.jface.preference.PreferenceDialog.buttonPressed (PreferenceDialog.java:185) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:398) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:541) at org.eclipse.ui.dialogs.PropertyDialogAction.run (PropertyDialogAction.java:158) at org.eclipse.jface.action.Action.runWithEvent(Action.java:804) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:422) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:374) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:368) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:69) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1450) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)
The NPE happens in Resource.setReadOnly (the blank top line in the stack trace above reads org/eclipse/core/internal/resources/Resource.setReadOnly(Z)V on my VM). setReadOnly does not check if the location is not null.
John, please investigate. Thanks.
Fixed the NPE. Knut: As an aside, it's curious that you're calling setReadOnly and setDerived here, regardless of the fact that the user hasn't changed those values. You're doing some extra work "for free" here. In this case it's just a single resource so this probably isn't a big issue.
Opened bug 29635 to consider changing the ResourceInfoPage.