Bug 156021 - Exception clicking on translatable attribute with no value
Summary: Exception clicking on translatable attribute with no value
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Brock Janiczak CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-09-01 21:40 EDT by Brock Janiczak CLA
Modified: 2007-06-05 18:26 EDT (History)
1 user (show)

See Also:


Attachments
Patch to org.eclipse.pde.ui (862 bytes, patch)
2006-09-01 21:42 EDT, Brock Janiczak CLA
no flags Details | Diff
Patch to org.eclipse.pde.ui (848 bytes, patch)
2006-09-01 21:49 EDT, Brock Janiczak CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brock Janiczak CLA 2006-09-01 21:40:18 EDT
Version: 3.3.0
Build id: I20060830-1650

On the extensions page of the plugin editor, you get the attached error when clicking on the NLS hyperlink for a translatable attribute with no value.

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.lang.String.charAt(Unknown Source)
    at org.eclipse.pde.internal.ui.editor.text.TranslationHyperlink.openHyperLink(TranslationHyperlink.java:51)
    at org.eclipse.pde.internal.ui.editor.text.TranslationHyperlink.open(TranslationHyperlink.java:42)
    at org.eclipse.pde.internal.ui.editor.plugin.rows.TranslatableAttributeRow.openReference(TranslatableAttributeRow.java:41)
    at org.eclipse.pde.internal.ui.editor.plugin.rows.ReferenceAttributeRow$1.linkActivated(ReferenceAttributeRow.java:47)
    at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:208)
    at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:289)
    at org.eclipse.ui.forms.widgets.AbstractHyperlink.access$1(AbstractHyperlink.java:273)
    at org.eclipse.ui.forms.widgets.AbstractHyperlink$4.handleEvent(AbstractHyperlink.java:110)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3387)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3006)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:396)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:172)
    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.invokeFramework(Main.java:341)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:285)
    at org.eclipse.core.launcher.Main.run(Main.java:987)
    at org.eclipse.core.launcher.Main.main(Main.java:962)
Comment 1 Brock Janiczak CLA 2006-09-01 21:42:50 EDT
Created attachment 49287 [details]
Patch to org.eclipse.pde.ui

Patch to add a length >0 check in TranslationHyperlink#openHyperLink
Comment 2 Brock Janiczak CLA 2006-09-01 21:49:11 EDT
Created attachment 49288 [details]
Patch to org.eclipse.pde.ui

Unlike the previous patch, this one actually works.
Comment 3 Wassim Melhem CLA 2006-09-01 22:35:23 EDT
Patch released.  Thanks Brock.