But I do not think it is a bug: It is not prohibited that printStackTrace
can use print instead of println.
I think it is log4j that inappropriately assumes that println is used in
printStackTrace. :)
On 10/19/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:
On 10/19/06, Tony Wu <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> please note that the Throwable is a kernel class. It comes with VME.
Then let's report it as IBM VME bug. (Oliver should be interested?)
I checked DRLVM Throwable#printStackTrace(PrintStream) implementation[1].
It's ok and prints "println" as well. So we needn't fix anything here. :)
[1]
public void printStackTrace(PrintStream ps) {
ps.println(makeThrowableString());
}
On 10/19/06, Andrew Zhang <[EMAIL PROTECTED]> wrote:
> > On 10/19/06, Tony Wu <[EMAIL PROTECTED]> wrote:
> > >
> > > I've tried Log4j on Harmony and found there are many failures caused
> > > by one difference between RI and Harmony. The
> > > Throwable.printStackTrace(PrintWriter) calls the *println* method of
> > > PrinterWriter on RI whereas calls *print* twice(Obviously print
> > > msssage then print a line separator) on Harmony. It will cause
> > > different behavior when a user inherit the PrinterWriter and
override
> > > these two methods. Shall we fix it or leave as an non-bug
difference?
> >
> >
> > For this case, RI doesn't conflict with spec, and is reasonable, so I
> think
> > we'd better follow RI. Additionally, log4j has shown its dependency
of
> this
> > feature!
> >
> > refer to testcase below,
> > >
> > > public class TestThrow {
> > > public static void main(String[] args) {
> > > MyWriter mw = new MyWriter(System.out);
> > > Throwable throwable = new Exception("Just Testing");
> > > throwable.printStackTrace(mw);
> > > }
> > > }
> > > class MyWriter extends PrintWriter {
> > > public MyWriter(OutputStream out) {
> > > super(out);
> > > }
> > >
> > > public void print(String s) {
> > > System.out.println("print");
> > > }
> > >
> > > public void println(String s) {
> > > System.out.println("println");
> > > }
> > > }
> > > OUTPUTS:
> > > RI
> > > println
> > > HARMONY
> > > print
> > > print
> > >
> > > --
> > > Tony Wu
> > > 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]
> > >
> > >
> >
> >
> > --
> > Best regards,
> > Andrew Zhang
> >
> >
>
>
> --
> Tony Wu
> 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]
>
>
--
Best regards,
Andrew Zhang
--
Leo Li
China Software Development Lab, IBM