Buggy code:
public class Email { private String name = "" ; private String body_type = "" ; private String from_name = "" ; private String from_email = "" ; private String subject = "" ; private String content = "" ; private String header = "" ; private String subHeader = "" ; private String text_body = "" ; private String testRecepients = "" ; private String abstractContent = "" ; private String scheduled_at_date = "" ; private String scheduled_at_time = "" ; private String custom_type = "" ; private List < Integer > campaign_ids = new ArrayList < Integer > ( ) ; private boolean test_emails = false ; private String footer = "" ; private String status ; private int custom_email_id ; private String custom_html_body = "" ; private String main_content = "" ; private String layout_type = "" ; private String from_type = "" ; private boolean fullEmail = true ; private String template = "" ; private String headContent = "" ; private static final Logger LOG = Logger . getLogger ( SpectateTrigger . class ) ; public Email ( ) { } public Email ( String name , String subject , List < String > recepients , String content , String header , String abstractContent ) { } public String getName ( ) { } public void setName ( String name ) { } public String getSubject ( ) { } public void setSubject ( String subject ) { } public String getTestReceipients ( ) { } public String getContent ( ) { } public void setContent ( String content ) { } public String getHeader ( ) { } public void setHeader ( String header ) { } public String getAbstractContent ( ) { } public String getBodyType ( ) { } public void setBodyType ( String body_type ) { } public String getFromName ( ) { } public void setFromName ( String from_name ) { } public String getFromEmail ( ) { } public void setFromEmail ( String from_email ) { } public String getSubHeader ( ) { } public void setSubHeader ( String subHeader ) { } public String getTextBody ( ) { } public void setTextBody ( String text_body ) { } public boolean getFullEmail ( ) { } public String getScheduledAtDate ( ) { } public void setScheduledAtDate ( String day ) { } public String getScheduledAtTime ( ) { } public String generateJSON ( ) throws UnsupportedEncodingException { Email . LOG . debug ( "Creating<seq2seq4repair_space>JSON<seq2seq4repair_space>Request<seq2seq4repair_space>for<seq2seq4repair_space>Spectate" ) ; StringBuffer jsonString = new StringBuffer ( ) ; String status = getStatus ( ) ; if ( ! ( getScheduledAtDate ( ) . equalsIgnoreCase ( "" ) ) ) { setStatus ( "send_later" ) ; } <START_BUG> String params = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "{\"email\":{\"name\":\"" + ( getName ( ) ) ) + "\"" ) + ",\"subject\":\"" ) + ( getSubject ( ) ) ) + "\"" ) + ",\"heading\":\"" ) + ( getHeader ( ) ) ) + "\"" ) + ",\"footer\":\"" ) + ( getFooter ( ) ) ) + "\"" ) + ",\"from_type\":\"generic\"" ) + ",\"from_name\":\"" ) + ( getFromName ( ) ) ) + "\"" ) + ",\"from_email\":\"" ) + ( getFromEmail ( ) ) ) + "\"" ) + ",\"body_type\":\"" ) + ( getBodyType ( ) ) ) + "\"" ) + ",\"campaign_ids\":" ) + ( outputCampaignIds ( ) ) ) + "" ) + ",\"main_content\":\"" ) + ( getTextBody ( ) ) ) + "{{unsubscribe_link}}" ) + "\"" ) + ",\"text_body\":\"\"" ) + ",\"layout_type\":\"custom\"" ) + ",\"custom_type\":\"supplied\"" ) + ",\"html_body\":null" ) + ",\"custom_html_body\":\"" ) + ( getCustomHTMLBody ( ) ) ) + "\"" ) + ",\"graphic_id\":null" ) + ",\"subheading\":\"\"" ) + ",\"logo_id\":null" ) + ",\"secondary_content\":\"\"" ) + ",\"extended_content\":null" ) + ",\"polished_html_body\":null" ) + ",\"polished_text_body\":null" ) + ",\"test_emails\":\"" ) + ( getTestReceipients ( ) ) ) + "\"" ) + ",\"scheduled_at_date\":\"" ) + ( getScheduledAtDate ( ) ) ) + "\"" ) + ",\"scheduled_at_time\":\"" ) + ( getScheduledAtTime ( ) ) ) + "\"" ) + ",\"status\":\"" ) + ( getStatus ( ) ) ) + "\"" ) + "}}" ; <END_BUG> Email . LOG . debug ( ( "JSON<seq2seq4repair_space>Params:<seq2seq4repair_space>" + params ) ) ; return params ; } public String sendEmail ( String url ) throws Exception { } public String getJSONPair ( String key , String val ) { } public void setScheduledAtTime ( String time ) { } public String getTemplate ( ) { } public void setTemplate ( String template ) { } public String outputCampaignIds ( ) { } public String getCustomType ( ) { } public void setCustomType ( String custom_type ) { } public void setFromType ( String from_type ) { } public String getFromType ( ) { } public List < Integer > getCampaignIds ( ) { } public void setCampaignIds ( List < Integer > campaign_ids ) { } public boolean isTestEmails ( ) { } public void setTestEmails ( boolean test_emails ) { } public String getFooter ( ) { } public void setFooter ( String footer ) { } public String getBody_type ( ) { } public void setBody_type ( String body_type ) { } public String getFrom_name ( ) { } public void setFrom_name ( String from_name ) { } public String getFrom_email ( ) { } public void setFrom_email ( String from_email ) { } public String getText_body ( ) { } public void setText_body ( String text_body ) { } public String getTestRecepients ( ) { } public void setTestRecepients ( String testRecepients ) { } public String getScheduled_at_date ( ) { } public void setScheduled_at_date ( String scheduled_at_date ) { } public String getScheduled_at_time ( ) { }

Fix:
String params = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "{\"email\":{\"name\":\"" + ( getName ( ) ) ) + "\"" ) + ",\"subject\":\"" ) + ( getSubject ( ) ) ) + "\"" ) + ",\"heading\":\"" ) + ( getHeader ( ) ) ) + "\"" ) + ",\"footer\":\"" ) + ( getFooter ( ) ) ) + "\"" ) + ",\"from_type\":\"generic\"" ) + ",\"from_name\":\"" ) + ( getFromName ( ) ) ) + "\"" ) + ",\"from_email\":\"" ) + ( getFromEmail ( ) ) ) + "\"" ) + ",\"body_type\":\"" ) + ( getBodyType ( ) ) ) + "\"" ) + ",\"campaign_ids\":" ) + ( outputCampaignIds ( ) ) ) + "" ) + ",\"main_content\":\"" ) + ( getTextBody ( ) ) ) + "{{unsubscribe_link}}" ) + "\"" ) + ",\"text_body\":\"\"" ) + ",\"layout_type\":\"custom\"" ) + ",\"custom_type\":\"supplied\"" ) + ",\"html_body\":null" ) + ",\"custom_html_body\":\"" ) + ( getCustomHTMLBody ( ) ) ) + "\"" ) + ",\"graphic_id\":null" ) + ",\"subheading\":\"\"" ) + ",\"logo_id\":null" ) + ",\"secondary_content\":\"\"" ) + ",\"extended_content\":null" ) + ",\"polished_html_body\":null" ) + ",\"polished_text_body\":null" ) + ",\"test_emails\":" ) + ( ( getTestReceipients ( ) ) == null ? "null" : ( "\"" + ( getTestReceipients ( ) ) ) + "\"" ) ) + ",\"scheduled_at_date\":\"" ) + ( getScheduledAtDate ( ) ) ) + "\"" ) + ",\"scheduled_at_time\":\"" ) + ( getScheduledAtTime ( ) ) ) + "\"" ) + ",\"status\":\"" ) + ( getStatus ( ) ) ) + "\"" ) + "}}" ;