Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Dalibor Topic
Geir Magnusson Jr pobox.com> writes: > Good question though - what does GNU Classpath do? Throw better exception messages, of course ;) I don't see a specific rule regarding this in the GNU Classpath hackers guide [1], but as long as a specific exception message (format) is not mandated by th

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Geir Magnusson Jr
cubator.apache.org Subject: Re: should strings in exceptions match the reference implementation? Yes - great example. The point is for mechanical means, but familiarity for users - we don't want them to be "uncomfortable" when using the Harmony class library - we want it to feel

RE: should strings in exceptions match the reference implementation?

2006-04-18 Thread Semukhina, Elena V
s" to help our users find the cause of an exception? Regards, Elena Semukhina Intel Middleware Products Division >-Original Message- >From: Geir Magnusson Jr [mailto:[EMAIL PROTECTED] >Sent: Tuesday, April 18, 2006 6:56 PM >To: harmony-dev@incubator.apache.org >Subjec

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Geir Magnusson Jr
This aspect is easy. I'll just ask Sun. geir Anton Avtamonov wrote: On 4/18/06, Mark Hindess <[EMAIL PROTECTED]> wrote: I thought my first message in this thread made this clear but obviously not. I'm not suggesting that code would care if the exception messages are identical. I was sugges

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Geir Magnusson Jr
Yes - great example. The point is for mechanical means, but familiarity for users - we don't want them to be "uncomfortable" when using the Harmony class library - we want it to feel the same as when they use it from Sun... geir Mark Hindess wrote: I thought my first message in this thread

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Geir Magnusson Jr
Chris Gray wrote: On Tuesday 18 April 2006 04:20, Geir Magnusson Jr wrote: Good question though - what does GNU Classpath do? What GNU Classpath "does" is the same as what the Sun class libraries do, so the former no more needs the latter than Apache needs IIS ... (Sorry to be playing th

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Geir Magnusson Jr
Chris Gray wrote: On Tuesday 18 April 2006 01:34, Geir Magnusson Jr wrote: Really? Every other JRE uses the classlibrary from sun. Of the many open-source runtimes, none uses Sun's class library; I'm aware of that - that's why we're here. But as I understand it, there are no complete

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Paulex Yang
Mark Hindess wrote: I thought my first message in this thread made this clear but obviously not. I'm not suggesting that code would care if the exception messages are identical. I was suggesting that it is probably now quite common for users to type error messages straight in to google. Theref

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Jimmy, Jing Lv
>Anton Avtamonov wrote: On 4/18/06, Mark Hindess <[EMAIL PROTECTED]> wrote: I thought my first message in this thread made this clear but obviously not. I'm not suggesting that code would care if the exception messages are identical. I was suggesting that it is probably now quite common for us

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Anton Avtamonov
On 4/18/06, Mark Hindess <[EMAIL PROTECTED]> wrote: > I thought my first message in this thread made this clear but obviously not. > > I'm not suggesting that code would care if the exception messages are > identical. I was suggesting that it is probably now quite common for > users to type error

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Mark Hindess
I thought my first message in this thread made this clear but obviously not. I'm not suggesting that code would care if the exception messages are identical. I was suggesting that it is probably now quite common for users to type error messages straight in to google. Therefore having messages ma

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Chris Gray
On Tuesday 18 April 2006 09:37, Mark Hindess wrote: > Are you saying that Classpath does match strings in exceptions? No. Ah, I see: the "do" in Geir's question stood for "what is Classpath's policy wrt to exception messages matching those of the RI?". Then I don't speak authoritatively, but I'v

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Mark Hindess
Are you saying that Classpath does match strings in exceptions? -Mark. On 4/18/06, Chris Gray <[EMAIL PROTECTED]> wrote: > On Tuesday 18 April 2006 04:20, Geir Magnusson Jr wrote: > > > Good question though - what does GNU Classpath do? > > What GNU Classpath "does" is the same as what the Sun c

Re: should strings in exceptions match the reference implementation?

2006-04-18 Thread Chris Gray
On Tuesday 18 April 2006 04:20, Geir Magnusson Jr wrote: > Good question though - what does GNU Classpath do? What GNU Classpath "does" is the same as what the Sun class libraries do, so the former no more needs the latter than Apache needs IIS ... (Sorry to be playing the pedant but I do somet

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Chris Gray
On Tuesday 18 April 2006 01:34, Geir Magnusson Jr wrote: > Really? Every other JRE uses the classlibrary from sun. Of the many open-source runtimes, none uses Sun's class library; almost all use Classpath. Among non-open source products, J9 has its own libraries, and I believe this is also tru

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Paulex Yang
Geir Magnusson Jr wrote: Paulex Yang wrote: Geir Magnusson Jr wrote: Nathan Beyer wrote: This seems overly excessive and I'm fairly sure that other JREs don't match every message of every exception in the RI. Really? Every other JRE uses the classlibrary from sun. They would have the

RE: should strings in exceptions match the reference implementation?

2006-04-17 Thread Nathan Beyer
> -Original Message- > From: Geir Magnusson Jr [mailto:[EMAIL PROTECTED] > Paulex Yang wrote: > > Geir Magnusson Jr wrote: > >> > >> > >> Nathan Beyer wrote: > >>> This seems overly excessive and I'm fairly sure that other JREs don't > >>> match > >>> every message of every exception in th

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Geir Magnusson Jr
Paulex Yang wrote: Geir Magnusson Jr wrote: Nathan Beyer wrote: This seems overly excessive and I'm fairly sure that other JREs don't match every message of every exception in the RI. Really? Every other JRE uses the classlibrary from sun. They would have the same messages, wouldn't t

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Paulex Yang
Geir Magnusson Jr wrote: Nathan Beyer wrote: This seems overly excessive and I'm fairly sure that other JREs don't match every message of every exception in the RI. Really? Every other JRE uses the classlibrary from sun. They would have the same messages, wouldn't they? I'm sure not *eve

RE: should strings in exceptions match the reference implementation?

2006-04-17 Thread bootjvm
> [Original Message] > From: Mark Hindess <[EMAIL PROTECTED]> > To: Harmony Dev > Date: 4/15/06 3:44:40 PM > 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 t

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Geir Magnusson Jr
Nathan Beyer wrote: This seems overly excessive and I'm fairly sure that other JREs don't match every message of every exception in the RI. Really? Every other JRE uses the classlibrary from sun. They would have the same messages, wouldn't they? geir I'm not opposed to matching messag

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Mikhail Loenko
Andrew, 2006/4/17, Andrew Zhang <[EMAIL PROTECTED]>: > Hi, MIkhail, > > Thanks for the information. > > I took a quick look > at tests/api/java/util/regex/PatternSyntaxExceptionTest. > Yes, the exception description is important to developers, however, I can't > find the message defination in jav

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Sergey Soldatov
Such functionality should be supported by the test harness and as far as I know JUnit framework doesn't support it. Please correct me if I'm wrong. It's much easier to isolate such tests to a separate class. On 4/17/06, Paulex Yang <[EMAIL PROTECTED]> wrote: > > Anton Avtamonov wrote: > > I also a

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Paulex Yang
Anton Avtamonov wrote: I also agree. The only 'requirement' I would add is that it should be possible to do such mark-up on per-check basis rather than per-test_method or even per-test_class basic. Because each testMehtod() may have several checks only few of them will be harmony-dependent. Wo

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Anton Avtamonov
I also agree. The only 'requirement' I would add is that it should be possible to do such mark-up on per-check basis rather than per-test_method or even per-test_class basic. Because each testMehtod() may have several checks only few of them will be harmony-dependent. -- Anton Avtamonov, Intel Mid

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Andrew Zhang
+1. Annotation is a good way to deliver such information. On 4/17/06, Paulex Yang <[EMAIL PROTECTED]> wrote: > > I consider the isHarmony() should be metadata, I have concerns to hard > code in test cases. How about mark these test cases as "non-compatible" > by annotation, by naming convention

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Paulex Yang
Mark Hindess wrote: > Ok. I think it's a little unfortunate for our users that we can't > match error messages but you are probably correct about them being > copyright. > > So, the second issue, should we be checking for messages/descriptions > in exception > tests, even to match what Harmony

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Paulex Yang
Anton Avtamonov wrote: On 4/17/06, Andrew Zhang <[EMAIL PROTECTED]> wrote: On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: Well, not completely agree. I RI has BUG, I agree to have corresponding Harmony test failing. However do you think that different exception messges say is a

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Andrew Zhang
Hi, MIkhail, Thanks for the information. I took a quick look at tests/api/java/util/regex/PatternSyntaxExceptionTest. Yes, the exception description is important to developers, however, I can't find the message defination in java spec. Am I missing something? If no, don't you think test case su

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Mikhail Loenko
2006/4/17, Andrew Zhang <[EMAIL PROTECTED]>: > On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: > > > > Well, not completely agree. I RI has BUG, I agree to have > > corresponding Harmony test failing. However do you think that > > different exception messges say is a good reason to have fail

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Anton Avtamonov
> Yes, and another problem is that it is hard to tell if the tests are > currently running on Harmony or RI, even harder than to tell the platforms. Well, actually it is quite simple :-). It is enough just to check presence of some class which is specific for Harmony (something from org.apache.ha

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Anton Avtamonov
On 4/17/06, Andrew Zhang <[EMAIL PROTECTED]> wrote: > On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: > > > > Well, not completely agree. I RI has BUG, I agree to have > > corresponding Harmony test failing. However do you think that > > different exception messges say is a good reason to ha

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Jimmy, Jing Lv
Andrew Zhang wrote: On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: Well, not completely agree. I RI has BUG, I agree to have corresponding Harmony test failing. However do you think that different exception messges say is a good reason to have failures? I don't think so. Just a minor

Re: should strings in exceptions match the reference implementation?

2006-04-17 Thread Andrew Zhang
On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: > > Well, not completely agree. I RI has BUG, I agree to have > corresponding Harmony test failing. However do you think that > different exception messges say is a good reason to have failures? I > don't think so. Just a minor differemce which

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
On 4/17/06, Mikhail Loenko <[EMAIL PROTECTED]> wrote: > Why it is that complicated? > > Why one have jump over utility methods in different classes or even folders to > understand what a 5-line test does? > > testSomething() throw OtherException { >try { >ec.do_something_excep

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
On 4/17/06, Andrew Zhang <[EMAIL PROTECTED]> wrote: > Very sorry, there're some typing mistakes in last letter. Please ignore it. Exctually, I haven't noticed any :-). May be because I also do lots of them. I hope native-speakers will excuse us :-). Wishes, -- Anton Avtamonov, Intel Middleware Pr

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
On 4/17/06, Andrew Zhang <[EMAIL PROTECTED]> wrote: > Hello, Anton, > > On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: > > > > No, we don't need all those branches. Only the branch for Harmony. > > Only for those cases when we DO know that we have a deviation. > > IMHO, I prefer to have all

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Andrew Zhang
Very sorry, there're some typing mistakes in last letter. Please ignore it. Hello, Anton, On 4/17/06, Andrew Zhang <[EMAIL PROTECTED]> wrote: > > > > On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: > > > > No, we don't need all those branches. Only the branch for Harmony. > > Only for tho

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
On 4/17/06, Mikhail Loenko <[EMAIL PROTECTED]> wrote: > Sorry, Anton, I did not catch. > > Only one branch means "no branches, just one way" or does it mean > "two different ways (one normal way and one branch)"? > > If we have just one way, why isHarmony() method necessary? Mikhail, Formally two

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Andrew Zhang
Hello, Anton, On 4/17/06, Anton Avtamonov <[EMAIL PROTECTED]> wrote: > > No, we don't need all those branches. Only the branch for Harmony. > Only for those cases when we DO know that we have a deviation. > IMHO, I prefer to have all tests passing on RI (which verify tests > itself) and on Harmony

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Mikhail Loenko
Sorry, Anton, I did not catch. Only one branch means "no branches, just one way" or does it mean "two different ways (one normal way and one branch)"? If we have just one way, why isHarmony() method necessary? Thanks, Mikhail 2006/4/17, Anton Avtamonov <[EMAIL PROTECTED]>: > On 4/17/06, Mikhail

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Mikhail Loenko
2006/4/17, Anton Avtamonov <[EMAIL PROTECTED]>: > In addition, I want to share what I do when testing exceptions. > > I created the following basic abstract class: > >protected abstract class ExceptionalCase { >private Class clazz; >private String msg; > >public abstract

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
On 4/17/06, Mikhail Loenko <[EMAIL PROTECTED]> wrote: > Why we should test something other than Harmony? > > We might run our tests on different implemetations to > see whether/how they differ from Harmony, but we do not need > special branches in our tests like > > if( isHarmony() ) { > assert(ha

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
In addition, I want to share what I do when testing exceptions. I created the following basic abstract class: protected abstract class ExceptionalCase { private Class clazz; private String msg; public abstract void exceptionalAction() throws Exception; public

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Mikhail Loenko
Why we should test something other than Harmony? We might run our tests on different implemetations to see whether/how they differ from Harmony, but we do not need special branches in our tests like if( isHarmony() ) { assert(harmony behavior) } else if( is BEA ) { assert(BEA behav) { } else

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Mikhail Loenko
I think we may have this kind of tests. It is not a problem if we do not pass on other implementations - we will have a number of test types and some of them will stick to our implementation. it is OK. So if the message in exception is important (e.g. IMHO text for an NPE message in a one-argument

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
On 4/17/06, Mark Hindess <[EMAIL PROTECTED]> wrote: > So, the second issue, should we be checking for messages/descriptions > in exception > tests, even to match what Harmony throws? If we do then our api tests > wont pass on other implementations. Hi Mark, As I said already I don't see any huge

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Mark Hindess
Ok. I think it's a little unfortunate for our users that we can't match error messages but you are probably correct about them being copyright. So, the second issue, should we be checking for messages/descriptions in exception tests, even to match what Harmony throws? If we do then our api tests

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread Anton Avtamonov
On 4/17/06, LvJimmy,Jing <[EMAIL PROTECTED]> wrote: > 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; >} > } > Bu

Re: should strings in exceptions match the reference implementation?

2006-04-16 Thread LvJimmy,Jing
2006/4/16, Mikhail Loenko <[EMAIL PROTECTED]>: > > 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-compatibl

Re: should strings in exceptions match the reference implementation?

2006-04-15 Thread Mikhail Loenko
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. Thanks, Mikhail 2006/4/16, Nathan Beyer <[EMAIL PROTECTED]>: > This seems overly excessive and I'm fairly sure that other JREs do

RE: should strings in exceptions match the reference implementation?

2006-04-15 Thread Nathan Beyer
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,