harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LvJimmy´╝îJing" <firep...@gmail.com>
Subject Re: should strings in exceptions match the reference implementation?
Date Mon, 17 Apr 2006 01:23:40 GMT
2006/4/16, Mikhail Loenko <mloenko@gmail.com>:
>
> Are those strings copyrighted? I mean we obviously cannot copy-paste
> spec to the javadoc comments of our code, and we probably cannot
> copy-paste RI's messages as well.


Agreed. Try some other words may be better. The only possible un-compatible
with RI is that some rookie may write codes like:
try{
    ...
}catch(Except e){
    if (e.getMessage().equals(RI_String)){
        dosomething;
    }
}
But this kind of code is properly unstable and unacceptable,right?

Thanks,
> Mikhail
>
> 2006/4/16, Nathan Beyer <nbeyer@kc.rr.com>:
> > This seems overly excessive and I'm fairly sure that other JREs don't
> match
> > every message of every exception in the RI.
> >
> > I'm not opposed to matching messages to help consistency and debugging,
> but
> > I just don't want it to be a dictate for development and testing. The
> only
> > exception, no pun intended, to this would be if the specification
> defines a
> > format for the message and thus making it an explicit part of the API.
> >
> > > -----Original Message-----
> > > From: Mark Hindess [mailto:mark.hindess@googlemail.com]
> > > Sent: Saturday, April 15, 2006 2:44 PM
> > > To: Harmony Dev
> > > Subject: should strings in exceptions match the reference
> implementation?
> > >
> > > Another thing that came up when looking at PatternSyntaxExceptionTest
> > > (HARMONY-352) was that the test was testing for the strings in
> > > exceptions.  Since these were testing for strings not in the
> exceptions
> > > thrown by the new implementation (nor by the reference
> > > implementation), I thought about removing the tests and just ignoring
> > > the strings.  But then...
> > >
> > > I remembered that two days ago I had solved a problem with tests
> > > failing on our windows build machine [0], by doing a google search for
> > > the exact string in the exception that was being thrown.  It would
> > > have been much harder to solve if the string didn't match the string
> > > thrown by the reference implementation.  So, I think we should try to
> > > match strings in exceptions because it will help our users when trying
> > > to debug problems.  Currently we don't in very many cases.
> > >
> > > What do other people think?
> > >
> > > Obviously we will have to match them if we are going to test for them
> > > in our API tests or they wont pass when run against a reference
> > > implementation.
> > >
> > > My patch for the PatternSyntaxExceptionTest has the string tests with
> > > the expected values set to the values from the exceptions trhown by
> > > the RI.  But I've commented them out since harmony strings don't
> > > currently match and since the strings probably should have different
> > > line endings on different platforms.
> > >
> > > Regards,
> > >  Mark.
> > >
> > > [0] SystemRoot not being set in the environment when called from my
> > >     ant task.
> > >
> > > --
> > > Mark Hindess <mark.hindess@googlemail.com>
> > > IBM Java Technology Centre, UK.
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>


--

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message