| Summary: | XMLTypeUtil normalize is unable to handle strings containing only whitespaces | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Paul Idstein <idstein> |
| Component: | XML/XMI | Assignee: | Ed Merks <Ed.Merks> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Paul Idstein
Can you show me a string value I can pass that will display this problem. I can't reproduce it with any value I've tried, including null, an empty string, a string with one space, a string with two spaces, a string with three spaces, or anything else I tried.
String[] EXAMPLES = { null, "", " ", " ", " ", " a ", "\n\ta\t\n"};
for (int i = 0; i < EXAMPLES.length; ++i)
{
for (int j = 0; j < 2; ++j)
{
System.out.println("'" + EXAMPLES[i] + "' -> '" + XMLTypeUtil.normalize(EXAMPLES[i], j !=0) + "'");
}
}
I don't know how to "call normalize on element empty".
Please provide an actual test case I can run locally and then reopen.
Hi there,
indeed your sample works pretty well for me, too! In fact the bug occurred when we were assign a value to an element of a DataObject (IBM WebSphere ESB Implementation specifc).
The value is propagated down to XMLTypeUtil.normalize and is binary a string of spaces as printed via String.format("%x", new BigInteger( value )) -> 20 20 20 20
So the error might be somewhere in between as we have a valid String before and within calling XMLTypeUtil.norrmalize we'll end up with this StringIndexOutOfBoundsException.
I'll have to catch what's propagated in the final call.
Thanks so far!
|