xinbc / jdiameter

Automatically exported from code.google.com/p/jdiameter
0 stars 0 forks source link

Diameter Stack HA: Unboxing to primitive type throws NPE when session data does not exist (ie, is null) #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure your stack for HA
2. Send an CCR with no server running to receive it
3. isRequestTypeSet() throws an NPE (similar problem seen with 
getGatheredCCFH())

What is the expected output? What do you see instead?
isRequestTypeSet() should return false if setRequestTypeSet() has not been 
called.
getGatheredCCFH() should return "ClientRoSessionImpl.NON_INITIALIZED" if 
setGatheredCCFH() has not been called (like the non-HA implementation).
Both throw NPEs.

What version of the product are you using? On what operating system?
1.5.0 SNAPSHOT from git on CentOS 6.3.

Please provide any additional information below.
Attached is a git diff for my patched version.
I suspect Gx, Rx and CCA have similar issues.

Original issue reported on code.google.com by andrew.m...@acision.com on 4 Jan 2013 at 5:41

Attachments:

GoogleCodeExporter commented 9 years ago
The NPE is caused by the unboxing from a null Boolean/Integer to it's primitive 
type. It has been detected in CCA, Gx, Ro and Rx applications.

Original comment by brainslog on 11 Jan 2013 at 2:31

GoogleCodeExporter commented 9 years ago

Original comment by brainslog on 11 Jan 2013 at 2:31

GoogleCodeExporter commented 9 years ago

Original comment by brainslog on 13 Jan 2013 at 2:35

GoogleCodeExporter commented 9 years ago
This issue was updated by revision ded8d9e5ee52.

Created util methods to handle null properly. Fixed the return methods in 
several applications.

Original comment by brainslog on 13 Jan 2013 at 2:39