MessageFormat.java (parse): When parsing strings, check for an empty pattern trailer.

2005-06-08  Ziga Mahkovec  <ziga.mahkovec@klika.si>

	* java/text/MessageFormat.java (parse): When parsing strings, check
	for an empty pattern trailer.

From-SVN: r100761
This commit is contained in:
Ziga Mahkovec 2005-06-08 17:46:08 +02:00 committed by Ziga Mahkovec
parent cf22360307
commit a6cddf6e80
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-06-08 Ziga Mahkovec <ziga.mahkovec@klika.si>
* java/text/MessageFormat.java (parse): When parsing strings, check
for an empty pattern trailer.
2005-06-06 Keith Seitz <keiths@redhat.com>
* gnu/classpath/jdwp/util/Signature.java: New file.

View File

@ -658,7 +658,11 @@ public class MessageFormat extends Format
{
// We have a String format. This can lose in a number
// of ways, but we give it a shot.
int next_index = sourceStr.indexOf(elements[i].trailer, index);
int next_index;
if (elements[i].trailer.length() > 0)
next_index = sourceStr.indexOf(elements[i].trailer, index);
else
next_index = sourceStr.length();
if (next_index == -1)
{
pos.setErrorIndex(index);