Bug 99395 [properties] [dialogs] NPE when viewing jar properties
3.1RC2 June 10th 0010 build - use the Plug-in Project creation wizard to create a Hello World project - in the Package Explorer expand the new project's Plug-in Dependencies item and select its first child (org.eclipse.ui_3.1.0.jar - ...) - right-click -> Properties - click OK in the properties dialog and you'll get the following exception: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.preferences.JavadocConfigurationPropertyPage.performOk(JavadocConfigurationPropertyPage.java:175) at org.eclipse.jface.preference.PreferenceDialog$11.run(PreferenceDialog.java:863) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1038) at org.eclipse.core.runtime.Platform.run(Platform.java:775) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.preference.PreferenceDialog.okPressed(PreferenceDialog.java:843) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:296) at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:227) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:556) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2825) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2530) at org.eclipse.jface.window.Window.runEventLoop(Window.java:809) at org.eclipse.jface.window.Window.open(Window.java:787) at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1021) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2825) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2530) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:365) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) 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:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java
private static IRunnableWithProgress getRunnable(final Shell shell, final IJavaElement elem, final URL javadocLocation, final IClasspathEntry entry, final IPath containerPath) {
		return new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor) throws InvocationTargetException {				
				try {
					IJavaProject project= elem.getJavaProject();
					if (elem instanceof IPackageFragmentRoot) {
						CPListElement cpElem= CPListElement.createFromExisting(entry, project);
						String loc= javadocLocation != null ? javadocLocation.toExternalForm() : null;
						cpElem.setAttribute(CPListElement.JAVADOC, loc);
						IClasspathEntry newEntry= cpElem.getClasspathEntry();
						BuildPathSupport.modifyClasspathEntry(shell, newEntry, project, containerPath, monitor);
					} else {
						JavaUI.setProjectJavadocLocation(project, javadocLocation);
					}
				} catch (CoreException e) {
					throw new InvocationTargetException(e);
				}
			}
		};
	}
	/**
	 * @see IStatusChangeListener#statusChanged(IStatus)
	 */
	public void statusChanged(IStatus status) {
		setValid(!status.matches(IStatus.ERROR));
		StatusUtil.applyToStatusLine(this, status);
	}
}