realtalk403/realtalk — pull request #158 by colinkho (2013-06-08 23:20:22+00:00)
Title: Refactored JSONParser and fixed checkstyle issues.

Code Refactoring:
1) Code Smells: Long Method, JSONParser's class name did not reflect entirely on its use.
Issue:
JSONParser - makeHttpRequest was a long method that also led to JSONParser being a god class. It made both a http request and parsed the information.

Fix:
HttpUtility now handles POST or GET requests while JSONParser solely handles parsing the JSON data it receives for a stream returned by a call from a static method in HttpUtility. This helped to split one method into several to improve cohesion and readability.

2) Code Smells: Not generic with respect to server urls
Issue: Over the release of RealTalk, many different server versions were deployed. As such many different server urls work with RealTalk. However, the url server was placed in many files, ChatManager and Common Utilities. This could cause problems as someone would have to change it in two areas for RealTalk to work with the correct server.

Fix: Now all Urls are consolidated in CommonUtilities.

CheckStyle Analysis:
1) Removed Magic Constants
2) Identified a code smell were Activities were "lazy" classes as they did not have getters and settings for their fields for AsyncTasks.
3) Utility Classes are now declared as final.