[jboss-jira] [JBoss JIRA] Closed: (JBAS-4730) Code smell in SpyMapMessage
Adrian Brock (JIRA)
jira-events at lists.jboss.org
Wed Sep 19 09:16:11 EDT 2007
[ http://jira.jboss.com/jira/browse/JBAS-4730?page=all ]
Adrian Brock closed JBAS-4730.
------------------------------
Resolution: Won't Fix
Actually when you look at the header javadoc for MapMessage you will see the following:
"
Attempting to read a null value as a primitive type must be treated as calling the primitive's corresponding valueOf(String) conversion method with a null value. Since char does not support a String conversion, attempting to read a null value as a char must throw a NullPointerException.
"
So what JBossMQ is doing is spec defined behaviour.
> 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: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list