One more example of strange RI behaviour

---------------------------------------------------------
import java.text.*;

public class Test {

   static void test(String pattern) {
       System.err.print("[" + pattern + "] ");
       try {
           System.err.println(new ChoiceFormat(pattern).toPattern());
       } catch (Exception e) {
           System.err.println(e);
       }
   }

   public static void main(String[] args) {
       test("|||");
       test("2#a|||");
       test("1<||||");
   }
}

--------------------------------------------- Output
RI
[|||] 0.0#|0.0#|0.0#
[2#a|||] 2.0#a|2.0#|2.0#
[1<||||] 1.0<|1.0<|1.0<|1.0<

Harmony
[|||]
[2#a|||]
[1<||||]


2006/9/5, Richard Liang <[EMAIL PROTECTED]>:
On 9/5/06, Denis Kishenko <[EMAIL PROTECTED]> wrote:
> People what do you think about HARMONY-1110?
>
> Problem is we have to reproduce behavior of ChoiceFormat pattern parser 
without
> specification. There is only one example in Java doc which doesn't
> allow understand when RI assumes that pattern is incorrect.
>


According the sample in sepc, the rule is very straightforward except
there's no explicit description about expcetional cases.

IMHO, "2#ok #ab" and "2#ok <ab" are illegal patterns, we shall follow
RI. I'm a bit confused about "2|", it's illegal too. But maybe we
could also follow RI if it's not too hard to follow RI. ;-)

Best regards,
Richard

> Thanks
>
> --
> Denis M. Kishenko
> Intel Middleware Products Division
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Richard Liang
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Denis M. Kishenko
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to