Re: More helpful error messages

2006-03-26 Thread Mikhail Loenko
2006/3/27, Magnusson, Geir <[EMAIL PROTECTED]>: > Did you catch it? yes i did: public class test3 { static int i; static Exception e = new Exception(""); public static void main(String[] args) { for( int i = 0; i < 500; i++ ) { try { a();

Re: More helpful error messages

2006-03-26 Thread Magnusson, Geir
Did you catch it? -Original Message- From: Mikhail Loenko [mailto:[EMAIL PROTECTED] Sent: Sun Mar 26 21:09:31 2006 To: harmony-dev@incubator.apache.org; [EMAIL PROTECTED] Subject:Re: More helpful error messages I've made another test: I've called various methods 5'000'000

Re: More helpful error messages

2006-03-26 Thread Mikhail Loenko
I've made another test: I've called various methods 5'000'000 times test1: static void a() { i++; } test2: static void a() throws Exception { i++; throw new Exception(""); } test3: static void a() throws Exception { i++; throw e; }

Re: Unit testing revisited

2006-03-26 Thread Geir Magnusson Jr
Mikhail Loenko wrote: Hi Richard, Why? IMHO, it's easier to write test cases through public API. And the internals may possibly change, so if we write test cases directly for the internals, our test cases will not be stable. One of examples might be: to test something trough public API you n

Re: More helpful error messages

2006-03-26 Thread Geir Magnusson Jr
Chris Gray wrote: On Sunday 26 March 2006 21:10, Geir Magnusson Jr wrote: I threw together a toy program when I got back to hotel. ... [SNIP] This simple example probably exaggerates the effect of the exception - test1 is probably so trivial that the JIT compiler probably optimises it

Re: Unit testing revisited

2006-03-26 Thread Geir Magnusson Jr
Richard Liang wrote: Geir Magnusson Jr wrote: George Harley wrote: I don't want an argument any more than the next person but ... I completely agree with the above statement. If you can't test code by going through the public API then how will the users ever get to exercise it in the "

Re: Unit testing revisited

2006-03-26 Thread Mikhail Loenko
Hi Richard, > Why? IMHO, it's easier to write test cases through public API. And the > internals may possibly change, so if we write test cases directly for > the internals, our test cases will not be stable. One of examples might be: to test something trough public API you need a test of 1000 li

Re: More helpful error messages

2006-03-26 Thread Paulex Yang
Chris, The "Micro performance benchmarking" using Java is danger, because of JIT's optimization may "overwhelm any detectable differences in underlying performance"[1], so I agree with you that the example probably exaggerates effect of exception. On the other hand, we all know exception thr

Robert Schröder/PROFI/NB/deg ist außer Haus.

2006-03-26 Thread Robert Schröder
Ich werde ab 27.03.2006 nicht im Büro sein. Ich kehre zurück am 03.04.2006.

Re: [bug-to-bug] UTF-8: interpreting non-shortest forms

2006-03-26 Thread Richard Liang
Nathan Beyer wrote: I've seen similar differences between other VMs around the handling of UTF-8 encoded data, especially between Sun and IBM VMs. For example, if you read a file with a UTF-8 encoding that contains an invalid byte(s), the IBM VM will throw an IOException, but the Sun VM will con

Re: Unit testing revisited

2006-03-26 Thread Richard Liang
Geir Magnusson Jr wrote: George Harley wrote: I don't want an argument any more than the next person but ... I completely agree with the above statement. If you can't test code by going through the public API then how will the users ever get to exercise it in the "real world" ? The ke

Re: More helpful error messages

2006-03-26 Thread Chris Gray
On Sunday 26 March 2006 21:10, Geir Magnusson Jr wrote: > I threw together a toy program when I got back to hotel. I called a > method that did a minor amount of work (increment the int arg and return > it). Then I created one that did the same, but then threw an exception. > Then I did one th

Re: More helpful error messages

2006-03-26 Thread Mark Hindess
Agreed. I think the solution in the JIRA I submitted has a reasonable balance of being helpful while not being significantly slower than the original. -Mark. On 3/26/06, Geir Magnusson Jr <[EMAIL PROTECTED]> wrote: > > > Chris Gray wrote: > > On Sunday 26 March 2006 20:10, Magnusson, Geir wrote:

Re: More helpful error messages

2006-03-26 Thread Geir Magnusson Jr
Chris Gray wrote: On Sunday 26 March 2006 20:10, Magnusson, Geir wrote: The point was to illustrate having useful information in the message. Optime any way you see fit. That said, given that you are throwing an exception... do we really care? I'm praying that we don't have apis that throw

Re: SableVM / Harmony Collaboration

2006-03-26 Thread Archie Cobbs
Stefano Mazzocchi wrote: (DREAM WARNING) Personally, I wouldn't mind seeing a hybrid SableVM/JikesRVM where bootstrap happens in C (no complex platform dependent image generation process), but adaptive compilation happens in Java... Boy, that would be indeed sweet. As long as you have an inte

Re: More helpful error messages

2006-03-26 Thread Chris Gray
On Sunday 26 March 2006 20:10, Magnusson, Geir wrote: > The point was to illustrate having useful information in the message. > Optime any way you see fit. > > That said, given that you are throwing an exception... do we really care? > I'm praying that we don't have apis that throw exceptions as

Re: SableVM / Harmony Collaboration

2006-03-26 Thread Geir Magnusson Jr
Etienne Gagnon wrote: I have no religious beliefs in either direction. I say: do it where it makes the most sense. Note how JikesRVM is much less "portable" than SableVM, even if it's written in Java. Yet, see how faster it is, even if it's written in Java. (DREAM WARNING) Personally, I wo

Re: SableVM? -- ICLA details

2006-03-26 Thread Stefano Mazzocchi
Etienne Gagnon wrote: Leo Simons wrote: Or, potentially, the only one who has ever brought it up :-) As I said, in an earlier message, I take back my request. I do not wish to offend anybody. :-) I know that your intentions were not to offend and, personally, I wasn't, but I was perceiving

Re: SableVM? -- ICLA details

2006-03-26 Thread Stefano Mazzocchi
Leo Simons wrote: On Fri, Mar 24, 2006 at 12:05:11PM -0800, Stefano Mazzocchi wrote: 3) not having ownership does not effect the ability for the ASF to create successful and perpetual open development efforts around such code. The owner cannot stop the ASF from continuing the effort unless it

Re: More helpful error messages

2006-03-26 Thread Magnusson, Geir
The point was to illustrate having useful information in the message. Optime any way you see fit. That said, given that you are throwing an exception... do we really care? I'm praying that we don't have apis that throw exceptions as a normal result of operation. Geir -Original Me

Re: SableVM / Harmony Collaboration

2006-03-26 Thread Stefano Mazzocchi
Etienne Gagnon wrote: (DREAM WARNING) Personally, I wouldn't mind seeing a hybrid SableVM/JikesRVM where bootstrap happens in C (no complex platform dependent image generation process), but adaptive compilation happens in Java... Boy, that would be indeed sweet. -- Stefano.

Re: SableVM / Harmony Collaboration

2006-03-26 Thread Weldon Washburn
Etienne, It would be great to see SableVM fully embrace Harmony Class Libs. Excellent approach! The original design goal for kernel_path, the port of Harmony Class Libs to JCHEVM/SableVM, was to make absolutely minimal changes to the JVM. By design, this port uses little, if any, of the Harmony

Re: More helpful error messages

2006-03-26 Thread Mikhail Loenko
As we discussed earlier we fight for performance not only in case of 'positive' behavior but also when methods throw exceptions. Throwing exceptions with predefeined constant message is much faster then with string concatenation. Thanks, Mikhail 2006/3/25, Geir Magnusson Jr <[EMAIL PROTECTED]>: