Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341963 - [metatype] StringIndexOutOfBoundsException when description or name attributes are an empty string
Summary: [metatype] StringIndexOutOfBoundsException when description or name attribute...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: John Ross CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-05 16:38 EDT by Jarek Gawor CLA
Modified: 2011-04-06 12:38 EDT (History)
1 user (show)

See Also:


Attachments
Patch for this issue. (846 bytes, patch)
2011-04-05 16:42 EDT, Jarek Gawor CLA
tjwatson: iplog+
Details | Diff
Test Patch (2.94 KB, patch)
2011-04-05 18:08 EDT, John Ross CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jarek Gawor CLA 2011-04-05 16:38:27 EDT
Build Identifier: 

When description or name attributes in metatype.xml are set to an empty string calling getDescription() or getName() will cause the following exception:

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
 	at java.lang.String.charAt(String.java:686)
 	at org.eclipse.equinox.metatype.LocalizationElement.getLocalized(LocalizationElement.java:38)
 	at org.eclipse.equinox.metatype.AttributeDefinitionImpl.getDescription(AttributeDefinitionImpl.java:117)


Reproducible: Always

Steps to Reproduce:
Create metatype.xml where name or description attributes are empty string. For example:

<AD id="present" description="" type="Boolean" default="true" />
Comment 1 Jarek Gawor CLA 2011-04-05 16:42:33 EDT
Created attachment 192599 [details]
Patch for this issue.
Comment 2 John Ross CLA 2011-04-05 18:08:29 EDT
Created attachment 192601 [details]
Test Patch

Original patch is fine. Here's a companion patch that adds a new test to compendium tests.
Comment 3 Thomas Watson CLA 2011-04-06 12:35:35 EDT
Comment on attachment 192599 [details]
Patch for this issue.

Thanks for the patch!  I released this to HEAD.
Comment 4 Thomas Watson CLA 2011-04-06 12:37:45 EDT
Comment on attachment 192601 [details]
Test Patch

Thanks for the patch.  I released it to HEAD.
Comment 5 Thomas Watson CLA 2011-04-06 12:38:08 EDT
.