Index: modules/text/src/main/java/java/text/RuleBasedCollator.java =================================================================== --- modules/text/src/main/java/java/text/RuleBasedCollator.java.orig 2006-03-23 09:50:06.000000000 +0000 +++ modules/text/src/main/java/java/text/RuleBasedCollator.java 2006-03-24 12:23:23.000000000 +0000 @@ -55,6 +55,8 @@ public RuleBasedCollator(String rules) throws ParseException { if (rules == null) throw new NullPointerException(); + if (rules.length() == 0) + throw new ParseException("Build rules empty.", 0); try { this.icuColl = new com.ibm.icu.text.RuleBasedCollator(rules); Index: modules/text/src/test/java/tests/api/java/text/RuleBasedCollatorTest.java =================================================================== --- modules/text/src/test/java/tests/api/java/text/RuleBasedCollatorTest.java.orig 2006-03-23 09:52:47.000000000 +0000 +++ modules/text/src/test/java/tests/api/java/text/RuleBasedCollatorTest.java 2006-03-24 12:24:14.000000000 +0000 @@ -247,7 +247,7 @@ byte[] bytes = key.toByteArray(); } - public void testNullPointerExpection() { + public void testNullPointerException() { try { RuleBasedCollator o = new RuleBasedCollator(null); fail("Constructor RuleBasedCollator(null) "+ @@ -258,4 +258,16 @@ } } + public void testEmptyStringException() { + try { + RuleBasedCollator o = new RuleBasedCollator(""); + fail("Constructor RuleBasedCollator(\"\") "+ + "should throw ParseException"); + } catch (ParseException e) { + assertEquals("java.text.ParseException", + e.getClass().getName()); + assertEquals(0, e.getErrorOffset()); + } + } + }