Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] String index out of bounds when adding interface to new class

Hi,

I'm not sure if this is the right mailing list so please, if I'm wrong, tell me where I should send this.

I'm getting an exception being thrown when trying to create a new Java class and I was wondering if anyone could shed any light on why? It only happens when I try to create a class that implements an interface: I choose to create a class in a package, enter a name for the class, and click "Add" to add an interface. I'm presented with a dialog that reports "Unexpected exception. See log for details. String index out of range: -1". I've included the exception stack trace and the session details from the log after this email so as not to clutter this.

The project was working fine last night and the only thing I've done is add a new JAR file (the JavaMail mail.jar) to it in a lib directory under the project and to the build path. I have tried removing this and that doesn't solve the problem. I've also moved all of the non-Java files (*.properties) from the source directories (I have a project with multiple source directories to separate client and server side code).

I'm using Eclipse 2.1M4 (Build id: 200212181304) on a Windows XP machine. I'm running the Sun JDK 1.4.1. The project has no build errors.

I will continue to investigate the problem to see if I can find out what's causing it but if someone else knows I'd appreciate some help!

Matt

----------------------- Session Details --------------------------------
java.version=1.4.1
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86 -install file:C:/eclipse/

------------------- Exception Stack Trace ------------------------------
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:277)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:716)
at org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog.open(TypeSelectionDialog.java:184) at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.chooseSuperInterfaces(NewTypeWizardPage.java:1285) at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.typePageCustomButtonPressed(NewTypeWizardPage.java:557) at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.access$1(NewTypeWizardPage.java:555) at org.eclipse.jdt.ui.wizards.NewTypeWizardPage$TypeFieldsAdapter.customButtonPressed(NewTypeWizardPage.java:522) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.buttonPressed(ListDialogField.java:196) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.doButtonSelected(ListDialogField.java:430) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.access$0(ListDialogField.java:426) at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField$2.widgetSelected(ListDialogField.java:393)
	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:825)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:561)
	at org.eclipse.jface.window.Window.open(Window.java:541)
at org.eclipse.ui.internal.NewWizardShortcutAction.run(NewWizardShortcutAction.java:87)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:769)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:411) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:365) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:356) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:48)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1692)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1410)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1446)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1429)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	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.basicRun(Main.java:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1480)
at org.eclipse.jdt.internal.corext.util.TypeInfoFactory.createIFileTypeInfo(TypeInfoFactory.java:115) at org.eclipse.jdt.internal.corext.util.TypeInfoFactory.create(TypeInfoFactory.java:51) at org.eclipse.jdt.internal.corext.util.TypeInfoRequestor.acceptClass(TypeInfoRequestor.java:39) at org.eclipse.jdt.core.search.SearchEngine$1.acceptClassDeclaration(SearchEngine.java:524) at org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern.feedIndexRequestor(TypeDeclarationPattern.java:107) at org.eclipse.jdt.internal.core.search.matching.SearchPattern.findIndexMatches(SearchPattern.java:1174) at org.eclipse.jdt.internal.core.search.matching.SearchPattern.findIndexMatches(SearchPattern.java:1149) at org.eclipse.jdt.internal.core.search.PatternSearchJob.search(PatternSearchJob.java:144) at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute(PatternSearchJob.java:93) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:262) at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:538) at org.eclipse.jdt.internal.corext.util.AllTypesCache.doSearchTypes(AllTypesCache.java:117) at org.eclipse.jdt.internal.corext.util.AllTypesCache.getAllTypes(AllTypesCache.java:77) at org.eclipse.jdt.internal.corext.util.AllTypesCache.getTypes(AllTypesCache.java:53) at org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog$1.run(TypeSelectionDialog.java:173) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:95)






Back to the top