Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Spark Shen
Nathan Beyer 写道: > >> -Original Message- >> From: Spark Shen [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, September 20, 2006 9:39 PM >> To: harmony-dev@incubator.apache.org >> Subject: Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw >&g

RE: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Nathan Beyer
> -Original Message- > From: Spark Shen [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 20, 2006 9:39 PM > To: harmony-dev@incubator.apache.org > Subject: Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw > unexpected exception > > Hi Nathan: &g

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Spark Shen
ednesday, September 20, 2006 3:28 AM >> To: harmony-dev@incubator.apache.org >> Subject: Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw >> unexpected exception >> >> Josh Bloch has given an excellent comment on this issue in his famouse >> book "effe

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Spark Shen
ednesday, September 20, 2006 3:28 AM >> To: harmony-dev@incubator.apache.org >> Subject: Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw >> unexpected exception >> >> Josh Bloch has given an excellent comment on this issue in his famouse >> book "effe

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Spark Shen
Rui Hu 写道: Agree. And I think besides Constructors, we could also let clone and de-serialization methods follow this rule, because they're also about initialization of a object. Hi Rui Hu: That's a good point, cited from Effective Java Item 54 "Normally, objects are created using constructors;

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Rui Hu
Agree. And I think besides Constructors, we could also let clone and de-serialization methods follow this rule, because they're also about initialization of a object. On 9/20/06, Andrew Zhang <[EMAIL PROTECTED]> wrote: Josh Bloch has given an excellent comment on this issue in his famouse book

RE: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Nathan Beyer
gt; From: Andrew Zhang [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 20, 2006 3:28 AM > To: harmony-dev@incubator.apache.org > Subject: Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw > unexpected exception > > Josh Bloch has given an excellent comment o

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Andrew Zhang
Josh Bloch has given an excellent comment on this issue in his famouse book "effective java", item 15 "Design and document for inheritance or else prohibit it". [quote from "effective java"] There are a few more restrictions that a class must obey to allow inheritance. Constructors must not invok

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-20 Thread Paulex Yang
Alexey Petrenko wrote: But we can create such test case for every difference in used methods between RI and Harmony. Right? Sure we can:), I guess the issue is just if it is necessary. I've described why I think it is necessary for HashMap's constructor in another post of this thread - HashMap

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Spark Shen
Alexey Petrenko 写道: But we can create such test case for every difference in used methods between RI and Harmony. Right? Hi Alexey: Of course we can. Are you worrying about there will be too many behavior differences like this? Then that depends on every specific case. We may discuss them case

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Alexey Petrenko
But we can create such test case for every difference in used methods between RI and Harmony. Right? 2006/9/20, Paulex Yang <[EMAIL PROTECTED]>: Alexey Petrenko wrote: > Are you trying to say that the methods in Harmony can use only methods > used in corresponding RI implementations? Let Spark s

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Paulex Yang
Alexey Petrenko wrote: Are you trying to say that the methods in Harmony can use only methods used in corresponding RI implementations? Let Spark speak for himself, but IMHO let's discuss the specific case before considering it as a rule, this is not yet another "reverse engineering", the testc

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Paulex Yang
/harmony/subcomponents/classlibrary/compat.html > -Nathan > > >> -Original Message- >> From: Spark Shen [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, September 19, 2006 8:20 PM >> To: harmony-dev@incubator.apache.org >> Subject: Re: [classlib][luni] JIRA

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Spark Shen
Alexey Petrenko 写道: Are you trying to say that the methods in Harmony can use only methods used in corresponding RI implementations? No. I did not imply that. I just find some behavior inconsistency about RI and Harmony. And IMHO, RI seems more tolerable. So, I prefer to follow RI. Best regard

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Alexey Petrenko
Are you trying to say that the methods in Harmony can use only methods used in corresponding RI implementations? 2006/9/20, Spark Shen <[EMAIL PROTECTED]>: Spark Shen 写道: > Hi : > Following is the discussion about JIRA 1492, shall we discuss it here? > > public class SubMapTest extends TestCase

RE: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Nathan Beyer
> To: harmony-dev@incubator.apache.org > Subject: Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw > unexpected exception > > Spark Shen 写道: > > Hi : > > Following is the discussion about JIRA 1492, shall we discuss it here? > > > > public class

Re: [classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Spark Shen
Spark Shen 写道: Hi : Following is the discussion about JIRA 1492, shall we discuss it here? public class SubMapTest extends TestCase { public void testSubclass() { HashMap map = new HashMap(); map.put("a", "a"); SubMap map2 = new SubMap(map); // Harmony will throw an unexpected exception here.

[classlib][luni] JIRA 1492 Constructor of HashMap throw unexpected exception

2006-09-19 Thread Spark Shen
Hi : Following is the discussion about JIRA 1492, shall we discuss it here? public class SubMapTest extends TestCase { public void testSubclass() { HashMap map = new HashMap(); map.put("a", "a"); SubMap map2 = new SubMap(map); // Harmony will throw an unexpected exceptio