harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Kishenko" <dkishe...@gmail.com>
Subject Re: [classlib][text] ChoiceFormat pattern parser compatibility
Date Tue, 05 Sep 2006 11:00:40 GMT
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 <richard.liangyx@gmail.com>:
> On 9/5/06, Denis Kishenko <dkishenko@gmail.com> 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: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>
> --
> Richard Liang
> China Software Development Lab, IBM
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Denis M. Kishenko
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message