]
Adrian Brock commented on JBAS-4730:
------------------------------------
This code has been there forever:
So I don't know why it was done that way.
I'd guess according the javadoc it should be throwing a MessageFormatException rather
than
a NumberFormatException when there is no value for primitives.
Code smell in SpyMapMessage
---------------------------
Key: JBAS-4730
URL:
http://jira.jboss.com/jira/browse/JBAS-4730
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: JMS service
Affects Versions: JBossAS-4.2.0.GA, JBossAS-4.2.2.GA
Environment: Branch_4_2 from around 7.sept.07
Reporter: Heiko W. Rupp
Assigned To: Adrian Brock
Priority: Minor
SpyMapMessage has in getInt()
if (value == null)
return Integer.parseInt(null);
Integer.parseInt(null) will always throw a NumberFormatException, so the return statement
has no effect. This leads to believe that something else was in mind when writing the
code.
If the NFE was intended to be thrown, then it should in my opinion directly be done
there.
getLong() has similar code and I guess other methods as well.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: