Re: Number and valueOf

Susanne Schneider <[email protected]> Tue, 31 Aug 2004 12:13:52 +0200
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hello Ashley,

> Howdy All,
> 
> I keep getting these exceptions:
> 
> 
>> java.lang.NoSuchMethodException: Class java.lang.Number does not 
>>implement method valueOf
>> Reason:  Class java.lang.Number does not implement method valueOf
> 
> 
> Which seems to relate to the fact that the attributes are specified as 
> Number (although they have a value type of i for Integer).
> 
> All eogenerated get methods return Number rather than Integer for these 
> attributes.  And, of course, Number doesn't implement valueOf.
> 
> Similar, if I am using EOUtitlities.object[s]MatchingKeyAndValue(ec, 
> "Entity", "Key", new Integer(5)) EO seems to think the key is a Number. 
>   And, again, Number doesn't implement valueOf.
> 
> Any suggestions?
> 
> Cheers,
> Ashley.
> 

why didn't you simply cast your Number to an Integer when you know (by 
value type of "i") that it is one? I do this all time ;-)

HTH,
Susanne

-- 
Susanne Schneider
secuSuite Development
Coordinator

iAS interActive Systems
Gesellschaft fuer interaktive Medien mbH
Dieffenbachstr. 33 c
10967 Berlin
Germany

fon    +49(0)30 69004-143
fax    +49(0)30 69004-101
mail   [email protected]
URL    http://www.interActive-Systems.de