Bug 35614 RC3 can't handle all file extensions
I work on a large project that includes all kinds of files, including Java source files, .cpp and .cxx C++ files, Perl scripts, and even VMS files that have only "." as their file extension. The "." extension, especially, causes exceptions. Using RC3, I tried to create a new Java project. I specified the Project Contents directory to be directory that holds several Java source trees as well as other trees holding various file types. Eclipse began to scan the project but soon gave an exception (text below) and quit. Eclipse V2.0.2 handled the same project with no problems. ====================================================================== !ENTRY org.eclipse.jdt.ui 4 10001 Mar 24, 2003 13:59:04.556 !MESSAGE Internal Error !STACK 1 org.eclipse.core.internal.resources.ResourceException(/DESTA)[566]: java.lang.IllegalArgumentException: Compilation unit name must end with .java. at org.eclipse.jdt.internal.core.CompilationUnit.<init> (CompilationUnit.java:48) at org.eclipse.jdt.internal.core.PackageFragment.getCompilationUnit (PackageFragment.java:180) at org.eclipse.jdt.internal.core.JavaModelManager.createCompilationUnitFrom (JavaModelManager.java:336) at org.eclipse.jdt.core.JavaCore.createCompilationUnitFrom (JavaCore.java:828) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.visitCompilationUnit (ClassPathDetector.java:210) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.visit (ClassPathDetector.java:266) at org.eclipse.core.internal.resources.Resource$1.visitElement (Resource.java:50) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:76) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:119) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:60) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.<init> (ClassPathDetector.java:62) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.updateProject (NewProjectCreationWizardPage.java:124) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage$1.run (NewProjectCreationWizardPage.java:86) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:302) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:758) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.changeToNewProj ect(NewProjectCreationWizardPage.java:94) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.setVisible (NewProjectCreationWizardPage.java:64) at org.eclipse.jface.wizard.WizardDialog.updateForPage (WizardDialog.java:959) at org.eclipse.jface.wizard.WizardDialog.access$1(WizardDialog.java:940) at org.eclipse.jface.wizard.WizardDialog$3.run(WizardDialog.java:929) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:927) at org.eclipse.jface.wizard.WizardDialog.nextPressed (WizardDialog.java:684) at org.eclipse.jface.wizard.WizardDialog.buttonPressed (WizardDialog.java:316) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:91) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1842) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1549) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at org.eclipse.ui.actions.NewProjectAction.run (NewProjectAction.java:107) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) 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:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1842) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1549) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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.basicRun(Main.java:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583) !ENTRY org.eclipse.core.resources 4 566 Mar 24, 2003 13:59:04.556 !MESSAGE An error occurred while traversing resources. !STACK 0 java.lang.IllegalArgumentException: Compilation unit name must end with .java. at org.eclipse.jdt.internal.core.CompilationUnit.<init> (CompilationUnit.java:48) at org.eclipse.jdt.internal.core.PackageFragment.getCompilationUnit (PackageFragment.java:180) at org.eclipse.jdt.internal.core.JavaModelManager.createCompilationUnitFrom (JavaModelManager.java:336) at org.eclipse.jdt.core.JavaCore.createCompilationUnitFrom (JavaCore.java:828) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.visitCompilationUnit (ClassPathDetector.java:210) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.visit (ClassPathDetector.java:266) at org.eclipse.core.internal.resources.Resource$1.visitElement (Resource.java:50) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:76) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration (ElementTreeIterator.java:80) at org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:119) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:60) at org.eclipse.jdt.internal.ui.wizards.ClassPathDetector.<init> (ClassPathDetector.java:62) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.updateProject (NewProjectCreationWizardPage.java:124) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage$1.run (NewProjectCreationWizardPage.java:86) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:302) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:758) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.changeToNewProj ect(NewProjectCreationWizardPage.java:94) at org.eclipse.jdt.internal.ui.wizards.NewProjectCreationWizardPage.setVisible (NewProjectCreationWizardPage.java:64) at org.eclipse.jface.wizard.WizardDialog.updateForPage (WizardDialog.java:959) at org.eclipse.jface.wizard.WizardDialog.access$1(WizardDialog.java:940) at org.eclipse.jface.wizard.WizardDialog$3.run(WizardDialog.java:929) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:927) at org.eclipse.jface.wizard.WizardDialog.nextPressed (WizardDialog.java:684) at org.eclipse.jface.wizard.WizardDialog.buttonPressed (WizardDialog.java:316) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:91) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1842) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1549) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at org.eclipse.ui.actions.NewProjectAction.run (NewProjectAction.java:107) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) 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:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1842) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1549) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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.basicRun(Main.java:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583)
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 {