Buggy code:
public class VisualizationController extends Controller { public static Result visualization ( ) { } public static Result postVisualization ( ) { } private static ArrayList < ArrayList < ClassifiedStatus > > classify ( Iterable < Status > tweets , boolean ignoreNeutrals ) { } public static Result fetch ( String fromDate , String toDate , String projectName , boolean ignoreNeutrals ) { MongoCursor < Status > tweets = Tweet . findByDate ( fromDate , toDate , projectName ) ; Logger . info ( ( ( "classifying<seq2seq4repair_space>" + ( tweets . count ( ) ) ) + "<seq2seq4repair_space>tweets" ) ) ; ArrayList < ArrayList < ClassifiedStatus > > classifiedAll = VisualizationController . classify ( tweets , ignoreNeutrals ) ; ArrayList < ClassifiedStatus > classifiedTweets = classifiedAll . get ( 0 ) ; ArrayList < ClassifiedStatus > classifiedReplies = classifiedAll . get ( 1 ) ; ObjectNode result = Json . newObject ( ) ; ObjectNode interactions = result . putObject ( "interactions" ) ; for ( ClassifiedStatus classifiedStatus : classifiedTweets ) { Status thisStatus = classifiedStatus . getStatus ( ) ; User thisUser = thisStatus . getUser ( ) ; if ( ( thisStatus . getRetweetedStatus ( ) ) == null ) { if ( ( interactions . get ( ( ( thisStatus . getId ( ) ) + "" ) ) ) == null ) { ObjectNode interaction = interactions . putObject ( ( ( thisStatus . getId ( ) ) + "" ) ) ; interaction . put ( "creator" , thisUser . getName ( ) ) ; interaction . put ( "popularity" , thisUser . getFollowersCount ( ) ) ; interaction . put ( "class" , classifiedStatus . getClassOfstatus ( ) ) ; interaction . put ( "message" , thisStatus . getText ( ) ) ; interaction . put ( "singleton" , true ) ; interaction . putArray ( "retweetedBy" ) ; interaction . putArray ( "replies" ) ; } } if ( ( thisStatus . getRetweetedStatus ( ) ) != null ) { Status retweetedStatus = thisStatus . getRetweetedStatus ( ) ; <START_BUG> if ( ( interactions . get ( ( retweetedStatus + "" ) ) ) == null ) { <END_BUG> User originator = retweetedStatus . getUser ( ) ; ObjectNode interaction = interactions . putObject ( ( ( retweetedStatus . getId ( ) ) + "" ) ) ; interaction . put ( "creator" , originator . getName ( ) ) ; interaction . put ( "popularity" , originator . getFollowersCount ( ) ) ; interaction . put ( "message" , retweetedStatus . getText ( ) ) ; interaction . put ( "class" , classifiedStatus . getClassOfstatus ( ) ) ; interaction . put ( "singleton" , false ) ; interaction . putArray ( "replies" ) ; interaction . putArray ( "retweetedBy" ) . addObject ( ) . put ( "name" , thisUser . getName ( ) ) . put ( "popularity" , thisUser . getFollowersCount ( ) ) ; } else { ObjectNode originalTweet = ( ( ObjectNode ) ( interactions . get ( ( ( retweetedStatus . getId ( ) ) + "" ) ) ) ) ; ArrayNode edges = ( ( ArrayNode ) ( originalTweet . get ( "retweetedBy" ) ) ) ; originalTweet . put ( "singleton" , false ) ; edges . addObject ( ) . put ( "name" , thisUser . getName ( ) ) . put ( "popularity" , thisUser . getFollowersCount ( ) ) ; } } } TwitterCollector collector = null ; for ( ClassifiedStatus classifiedStatus : classifiedReplies ) { Status thisStatus = classifiedStatus . getStatus ( ) ; User thisUser = thisStatus . getUser ( ) ; if ( ( thisStatus . getInReplyToStatusId ( ) ) != ( - 1 ) ) { long originalStatusId = thisStatus . getInReplyToStatusId ( ) ; ObjectNode reply ; System . out . println ( originalStatusId ) ; if ( ( interactions . get ( ( originalStatusId + "" ) ) ) != null ) { ObjectNode originalTweet = ( ( ObjectNode ) ( interactions . get ( ( originalStatusId + "" ) ) ) ) ; ArrayNode replies = ( ( ArrayNode ) ( originalTweet . get ( "replies" ) ) ) ; originalTweet . put ( "singleton" , false ) ; reply = replies . addObject ( ) ; } else { Status originalStatus = ( collector == null ) ? new TwitterCollector ( ) . getStatus ( originalStatusId ) : collector . getStatus ( originalStatusId ) ; if ( originalStatus == null ) { continue ; } else { ObjectNode interaction = interactions . putObject ( ( ( originalStatus . getId ( ) ) + "" ) ) ; interaction . put ( "creator" , originalStatus . getUser ( ) . getName ( ) ) ; interaction . put ( "popularity" , originalStatus . getUser ( ) . getFollowersCount ( ) ) ; interaction . put ( "class" , "neutral" ) ; interaction . put ( "message" , originalStatus . getText ( ) ) ; interaction . putArray ( "retweetedBy" ) ; interaction . put ( "singleton" , false ) ; reply = interaction . putArray ( "replies" ) . addObject ( ) ; } } reply . put ( "id" , ( ( thisStatus . getId ( ) ) + "" ) ) ; reply . put ( "creator" , thisUser . getName ( ) ) ; reply . put ( "popularity" , thisUser . getFollowersCount ( ) ) ; reply . put ( "class" , classifiedStatus . getClassOfstatus ( ) ) ; reply . put ( "message" , thisStatus . getText ( ) ) ; reply . put ( "singleton" , false ) ; reply . putArray ( "retweetedBy" ) ; reply . putArray ( "replies" ) ; } } int total = ( classifiedTweets . size ( ) ) + ( classifiedReplies . size ( ) ) ;

Fix:
if ( ( interactions . get ( ( ( retweetedStatus . getId ( ) ) + "" ) ) ) == null ) {