Skip to content

Commit 3fadd47

Browse files
Code clean up in JSONMessageHandler classes
1 parent 33f6b1d commit 3fadd47

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

modules/json/src/org/apache/axis2/json/gson/JSONMessageHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
7575
} else {
7676
log.debug("JSON MessageReceiver found, proceeding with the JSON request");
7777
Object tempObj = msgContext.getProperty(JsonConstant.IS_JSON_STREAM);
78-
if (tempObj != null) {
79-
boolean isJSON = Boolean.valueOf(tempObj.toString());
78+
if (tempObj != null && Boolean.valueOf(tempObj.toString()) {
8079
Object o = msgContext.getProperty(JsonConstant.GSON_XML_STREAM_READER);
8180
if (o != null) {
8281
GsonXMLStreamReader gsonXMLStreamReader = (GsonXMLStreamReader) o;

modules/json/src/org/apache/axis2/json/moshi/JSONMessageHandler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
7676
log.debug("JSON MessageReceiver found, proceeding with the JSON request");
7777
Object tempObj = msgContext.getProperty(JsonConstant.IS_JSON_STREAM);
7878
if (tempObj != null) {
79-
boolean isJSON = Boolean.valueOf(tempObj.toString());
8079
Object o = msgContext.getProperty(JsonConstant.MOSHI_XML_STREAM_READER);
8180
if (o != null) {
8281
MoshiXMLStreamReader moshiXMLStreamReader = (MoshiXMLStreamReader) o;
@@ -100,8 +99,7 @@ public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
10099
log.debug("On enableJSONOnly=true Axis operation is null on JSON request, message hasn't been dispatched to an operation, proceeding on JSON message name discovery and AxisOperation mapping");
101100
try{
102101
Object tempObj = msgContext.getProperty(JsonConstant.IS_JSON_STREAM);
103-
if (tempObj != null) {
104-
boolean isJSON = Boolean.valueOf(tempObj.toString());
102+
if (tempObj != null && Boolean.valueOf(tempObj.toString()) {
105103
Object o = msgContext.getProperty(JsonConstant.MOSHI_XML_STREAM_READER);
106104
if (o != null) {
107105
MoshiXMLStreamReader moshiXMLStreamReader = (MoshiXMLStreamReader) o;

0 commit comments

Comments
 (0)