Bug 33722 Failure creating new project
I get this error with the RC1 release. When I try to create a new project which uses a currently existing source directory, I get this exception, after which, if I cancel the new project wizard, I get a useless project (can't add anything to it at all): java.lang.reflect.InvocationTargetException: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.detectOutputFolder(ClassPathDetector.java:122) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.detectClasspath(ClassPathDetector.java:78) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.<init>(ClassPathDetector.java:57) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.updateProject(NewProjectCreationWizardPage.java:118) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage$1.run(NewProjectCreationWizardPage.java:80) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:296) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:246) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:752) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.changeToNewProject(NewProjectCreationWizardPage.java:88) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.setVisible(NewProjectCreationWizardPage.java:58) at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:953) at org.eclipse.jface.wizard.WizardDialog.access$1(WizardDialog.java:934) at org.eclipse.jface.wizard.WizardDialog$3.run(WizardDialog.java:923) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65) at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:921) at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:678) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:310) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:417) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:87) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483) at org.eclipse.jface.window.Window.runEventLoop(Window.java:577) at org.eclipse.jface.window.Window.open(Window.java:557) at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:107) at org.eclipse.jface.action.Action.runWithEvent(Action.java:841) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1271) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/ClassPathDetector.java
package org.eclipse.jdt.internal.ui.wizards;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.ToolFactory;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.util.IClassFileReader;
import org.eclipse.jdt.core.util.ISourceAttribute;
import org.eclipse.jdt.ui.PreferenceConstants;
/**
  */
public class ClassPathDetector implements IResourceProxyVisitor {