harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimmy, Jing Lv" <firep...@gmail.com>
Subject Re: [classlib] Enum ready to go
Date Wed, 07 Jun 2006 09:29:49 GMT
Stepan Mishura wrote:
> I found the reason - tests expect NPE when valueOf(null) is invoked but IAE
> is thrown instead. For example,
> 
> java.lang.IllegalArgumentException
> at org.apache.harmony.tests.java.lang.EnumTest$Sample.valueOf(EnumTest.java
> :22)
> at 
> org.apache.harmony.tests.java.lang.EnumTest.test_valueOfLjava_lang_String
> (EnumTest.java:113)
> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
> 
> Thanks,
> Stepan.
> 

Hi:
     It works well on my workspace, with windows XP sp2, RI (1.5.0_06, 
the latest version). By the way, it also passes all test on RI 1.5.0_01, 
and on Linux(kernel 2.4.2, RI 1.5.0_02).
     Look into code, I doubt perhaps it is compiler who cause the 
problem. I would try an early version of RI 1.5.0, but currently I can 
not find one.

> On 6/7/06, Andrew Zhang wrote:
>>
>> Hello Stepan and Mikhail,
>>
>> All tests passed on my machine.
>>
>> Which test case was failed in your environment, on RI or Harmony?
>>
>> Thanks!
>>
>>
>> On 6/7/06, Stepan Mishura <stepan.mishura@gmail.com> wrote:
>> >
>> > Hi Tim,
>> >
>> > On 6/7/06, Tim Ellison wrote:
>> > >
>> > > Heads up that I completed the implementation of j.l.Enum today; so 
>> you
>> > > can go mad and use enum types in classlib code for real now.
>> >
>> >
>> > Cool!
>> >
>> > I wrote a bunch of tests but if you could hammer on it and try to break
>> > > it that would be good :-)
>> >
>> >
>> > And did you run it? :-) It fails for me :-(
>> >
>> > Thanks,
>> > Stepan.
>> >
>> > If you take a look at the implementation [1] of valueOf(Class, String)
>> > > it uses reflection to get the enum constant values.  I'm not sure how
>> > > 'popular' the valueOf() method is, but since the values don't change
>> > > they are a good candidate for being cached if it proves to be called
>> > > frequently.  I'm happy to do that if people think it is worthwhile.
>> > >
>> > > Regards,
>> > > Tim
>> > >
>> > >
>> > > [1]
>> > >
>> > >
>> >
>> http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Enum.java?revision=412166&view=markup

>>
>> > >
>>
>>
>>
> 
> 
> ------------------------------------------------------
> 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

---------------------------------------------------------------------
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


Mime
View raw message