|
Re: EMF queries using SubStringValue can't handle empty Strings [message #414972 is a reply to message #414969] |
Tue, 27 November 2007 12:30 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Jasper,
Yes, this sounds like a bug. Please raise one:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMF& version=1.1&component=Query
Cheers,
Christian
Jasper wrote:
> All:
>
> SubStringValue#isSatisfied calls StringSearch#new, which throws
> IllegalArgumentException if the second parameter is a String of zero
> length. But isn't it pretty normal for a search to encounter empty
> Strings in a model? Yet with the current implementation, any query using
> SubStringValue will choke on the first empty String it encounters.
>
> Simplest solution would be to have a guard as the first line of in
> SubStringValue#isSatisfied:
>
> if (str == null || str.length() == 0)
> return false;
>
> Regards,
> Jasper.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04227 seconds