From 9c631fd3f26e7b59a151b24ca3d5bbcc1b890cf1 Mon Sep 17 00:00:00 2001 From: Doug Felt Date: Mon, 9 Jun 2003 04:53:37 +0000 Subject: [PATCH] ICU-2180 fix bug introduced during api coverage X-SVN-Rev: 12375 --- .../test/format/NumberFormatRegistrationTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/icu4j/src/com/ibm/icu/dev/test/format/NumberFormatRegistrationTest.java b/icu4j/src/com/ibm/icu/dev/test/format/NumberFormatRegistrationTest.java index 9b959bc840..abda9c0c6d 100644 --- a/icu4j/src/com/ibm/icu/dev/test/format/NumberFormatRegistrationTest.java +++ b/icu4j/src/com/ibm/icu/dev/test/format/NumberFormatRegistrationTest.java @@ -4,8 +4,8 @@ * others. All Rights Reserved. * ******************************************************************************* * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/format/NumberFormatRegistrationTest.java,v $ - * $Date: 2003/06/05 21:15:20 $ - * $Revision: 1.4 $ + * $Date: 2003/06/09 04:53:37 $ + * $Revision: 1.5 $ ******************************************************************************* */ package com.ibm.icu.dev.test.format; @@ -64,8 +64,13 @@ public class NumberFormatRegistrationTest extends com.ibm.icu.dev.test.TestFmwk } try { - NumberFormat.unregister(""); - errln("unregister of empty string key succeeded"); + // if no NF has been registered yet, shim is null, so this silently + // returns false. if, on the other hand, a NF has been registered, + // this will try to cast the argument to a Factory, and throw + // an exception. + if (NumberFormat.unregister("")) { + errln("unregister of empty string key succeeded"); + } } catch (Exception e) { }