Changes

Jump to: navigation, search

JSON Integration Adapter Code Review 2 Changes

2,902 bytes added, 10:27, 4 February 2012
Created page with 'category: NexJ Express JSON Message Adapter ====JSONMessageFormatter==== {| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collaps…'
[[category: NexJ Express JSON Message Adapter]]

====JSONMessageFormatter====
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
|-
! Tasks
! Status
|-
|Line 35 <br/>
// attributes Should be // associations
|Compelete
|-
|Line 40 <br/>
Move s_logger (final static members) to right before // operations
|Complete
|-
|Line 244 <br/>
<code>if (!innerPart.isCollection() || (bArrayElement && innerPart.isCollection()))</code>
should be
<code>if (!innerPart.isCollection() || bArrayElement)</code>
|Complete
|-
|Line 250, 265, 311 <br/>
You shouldn’t have to catch ClassCastExceptions. You should catch all Exceptions at the top level and wrap them in an Integration exception with the cause exception contained.
Like this:
<code>
catch (IntegrationException e)
{
throw e;
}
catch (Exception e)
{
throw new IntegrationException("err.integration.format",
new Object[]{message.getName()}, e);
}
</code>
|Complete
|-
|Line 369 Remove it
|Complete
|}

====JSONMessageParser====
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
|-
! Tasks
! Status
|-
|Line 297, 338 <br/>
In method parseObjectArray m_nListDepth is decremented, but never incremented. Is this a bug?
|Complete
|-
|Line 366<br/>
parseValue(messagePart) is always called with m_currentMessagePart so you don’t need the argument.
|Complete
|-
|Line 409, 443<br/>
In method parseArray m_nListDepth is decremented, but never incremented. Is this a bug?
|Complete
|-
|Line 502 <br/>
Move to Line 506 – it’s not faster
|Complete
|}

====RootJSONMessagePartMapping====
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
|-
! Tasks
! Status
|-
|Line 50, 75<br/>
|Part instanceof PrimitiveMessagePart should never be true here. You can assert that it isn’t.<br/>
To make sure that it isn’t iterate over child parts, get their mapping and call finish on the mapping.
|Complete
|}


====RootJSONMessagePartMapping====
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
|-
! Tasks
! Status
|-
|Line 31<br/>
*FORMAT_DEFAULT should be FORMAT_OBJECT
*You can mention it’s the default in the documentation (javadoc/xsd).
|Complete
|}


====JSONParser====
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
|-
! Tasks
! Status
|-
|Line 71 <br/>
*Method parse is overridden for no reason.
|Complete
|}


====JSONWriter====
{| border="1" cellpadding="4" cellspacing="2" style="border: 1px solid black;border-collapse:collapse;"
|-
! Tasks
! Status
|-
|Line 53, 76 <br/>
Instead of having getEndObject and getEndArray methods create public static constants for these characters and use them everywhere.
|Complete
|}
1
edit

Navigation menu