Program: 80961
Project: 80961
Buggy source:
/** 
 * @param args the command line arguments
 */
public static void main(String[] args){
  removeOldPreferences();
  System.out.println("String_Node_Str");
  java.net.HttpURLConnection.setFollowRedirects(true);
  boolean isHeadless=GraphicsEnvironment.isHeadless();
  boolean isAutostart=false;
  boolean checkUpdates=true;
  boolean checkNotifications=true;
  boolean startMinimized=false;
  List<String> followList=new ArrayList<>();
  Map<String,String> properties=new HashMap<>();
  String[] twitterTokens=new String[4];
  for (int i=0; i < args.length; i++) {
switch (args[i].toLowerCase()) {
case "String_Node_Str":
      isHeadless=true;
    break;
case "String_Node_Str":
  isAutostart=true;
break;
case "String_Node_Str":
checkUpdates=false;
break;
case "String_Node_Str":
checkNotifications=false;
break;
case "String_Node_Str":
case "String_Node_Str":
followList.add(args[i + 1]);
break;
case "String_Node_Str":
startMinimized=true;
break;
case "String_Node_Str":
if (args.length > i + 2) {
String key=args[i + 1];
String value=args[i + 2];
if (!key.startsWith("String_Node_Str") && !value.startsWith("String_Node_Str")) {
properties.put(key,value);
}
 else {
System.out.println("String_Node_Str");
}
}
 else {
System.out.println("String_Node_Str");
}
break;
case "String_Node_Str":
if (args.length > i + 4) {
twitterTokens[0]=args[i + 1];
twitterTokens[1]=args[i + 2];
twitterTokens[2]=args[i + 3];
twitterTokens[3]=args[i + 4];
for (String s : twitterTokens) {
if (s.startsWith("String_Node_Str")) {
System.out.println("String_Node_Str" + s + "String_Node_Str");
for (int j=0; j < twitterTokens.length; j++) {
twitterTokens[j]=null;
}
break;
}
}
}
 else {
System.out.println("String_Node_Str");
}
break;
case "String_Node_Str":
try {
SavePrintStream printer;
if (args.length > i + 1 && !args[i + 1].startsWith("String_Node_Str")) {
printer=new SavePrintStream(System.out,args[i + 1]);
}
 else {
printer=new SavePrintStream(System.out);
}
System.setOut(printer);
System.setErr(printer);
}
 catch (FileNotFoundException fnfe) {
System.out.println("String_Node_Str");
fnfe.printStackTrace();
}
break;
case "String_Node_Str":
Audio.setAlarmFile(args[i + 1]);
break;
case "String_Node_Str":
break;
default :
if (args[i].startsWith("String_Node_Str")) {
System.out.println("String_Node_Str" + args[i]);
}
break;
}
}
final Startup loadingOutput;
if (isHeadless) {
ErrorBuilder.forceCommandLine();
loadingOutput=new LoadingCLI(System.out);
}
 else {
loadingOutput=new LoadingWindow();
}
String patchNotes=null;
loadingOutput.start();
loadResources(loadingOutput,hasArgument(args,"String_Node_Str"));
if (!isHeadless) {
if (checkUpdates) {
patchNotes=loadUpdates(loadingOutput);
}
if (checkNotifications) {
loadNotifications(loadingOutput);
}
}
 else {
System.out.println("String_Node_Str");
}
loadingOutput.stop();
Setup mySetup;
if (isAutostart) {
mySetup=new SetupAuto(args);
}
 else if (isHeadless) {
mySetup=new SetupCLI(twitterTokens);
}
 else {
SetupGUI myGUI=new SetupGUI(twitterTokens);
if (patchNotes != null) {
myGUI.setPatchNotesText(patchNotes);
}
 else {
myGUI.setPatchNotesText("String_Node_Str");
}
mySetup=myGUI;
}
mySetup.promptForSettings();
twitterTokens[0]=mySetup.getTwitterConsumerKey();
twitterTokens[1]=mySetup.getTwitterConsumerSecret();
twitterTokens[2]=mySetup.getTwitterApplicationKey();
twitterTokens[3]=mySetup.getTwitterApplicationSecret();
Browser myBrowser=new Browser();
myBrowser.setExpo(mySetup.getExpoToCheck());
if (mySetup.shouldFilterShowclix()) {
com.github.sunnybat.paxchecker.browser.ShowclixReader.strictFilter();
}
Status myStatus;
EmailAccount emailAccount;
try {
emailAccount=new EmailAccount(mySetup.getEmailUsername(),mySetup.getEmailPassword());
for (String s : mySetup.getEmailAddresses()) {
emailAccount.addEmailAddress(s);
}
for (String key : properties.keySet()) {
emailAccount.setProperty(key,properties.get(key));
}
}
 catch (IllegalArgumentException e) {
emailAccount=null;
}
if (!isHeadless) {
StatusGUI statGUI;
if (emailAccount != null) {
statGUI=new StatusGUI(myBrowser.getExpo(),emailAccount.getUsername(),emailAccount.getAddressList());
}
 else {
statGUI=new StatusGUI(myBrowser.getExpo());
}
myStatus=statGUI;
if (startMinimized) {
statGUI.minimizeToTray();
}
 else {
statGUI.showWindow();
}
}
 else {
myStatus=new StatusCLI();
}
if (emailAccount != null) {
myStatus.enableEmail();
}
if (mySetup.shouldPlayAlarm()) {
Audio.enableAlarm();
myStatus.enableAlarm();
}
final TicketChecker myChecker=initChecker(mySetup,isHeadless ? null : (StatusGUI)myStatus,myBrowser.getExpo());
if (mySetup.shouldCheckTwitter()) {
TwitterStreamer tcheck=setupTwitter(myStatus,twitterTokens,emailAccount);
for (String s : followList) {
tcheck.addUser(s);
}
tcheck.startStreamingTwitter();
myStreamer=tcheck;
myStatus.enableTwitter();
}
checkForTickets(myStatus,myChecker,emailAccount,mySetup.timeBetweenChecks());
}

Fixed version (ground truth):
/** 
 * @param args the command line arguments
 */
public static void main(String[] args){
  removeOldPreferences();
  System.out.println("String_Node_Str");
  java.net.HttpURLConnection.setFollowRedirects(true);
  boolean isHeadless=GraphicsEnvironment.isHeadless();
  boolean isAutostart=false;
  boolean checkUpdates=true;
  boolean checkNotifications=true;
  boolean startMinimized=false;
  List<String> followList=new ArrayList<>();
  Map<String,String> properties=new HashMap<>();
  String[] twitterTokens=new String[4];
  for (int i=0; i < args.length; i++) {
switch (args[i].toLowerCase()) {
case "String_Node_Str":
      isHeadless=true;
    break;
case "String_Node_Str":
  isAutostart=true;
break;
case "String_Node_Str":
checkUpdates=false;
break;
case "String_Node_Str":
checkNotifications=false;
break;
case "String_Node_Str":
case "String_Node_Str":
followList.add(args[i + 1]);
break;
case "String_Node_Str":
startMinimized=true;
break;
case "String_Node_Str":
if (args.length > i + 2) {
String key=args[i + 1];
String value=args[i + 2];
if (!key.startsWith("String_Node_Str") && !value.startsWith("String_Node_Str")) {
properties.put(key,value);
}
 else {
System.out.println("String_Node_Str");
}
}
 else {
System.out.println("String_Node_Str");
}
break;
case "String_Node_Str":
if (args.length > i + 4) {
twitterTokens[0]=args[i + 1];
twitterTokens[1]=args[i + 2];
twitterTokens[2]=args[i + 3];
twitterTokens[3]=args[i + 4];
for (String s : twitterTokens) {
if (s.startsWith("String_Node_Str")) {
System.out.println("String_Node_Str" + s + "String_Node_Str");
for (int j=0; j < twitterTokens.length; j++) {
twitterTokens[j]=null;
}
break;
}
}
}
 else {
System.out.println("String_Node_Str");
}
break;
case "String_Node_Str":
try {
SavePrintStream printer;
if (args.length > i + 1 && !args[i + 1].startsWith("String_Node_Str")) {
printer=new SavePrintStream(System.out,args[i + 1]);
}
 else {
printer=new SavePrintStream(System.out);
}
System.setOut(printer);
System.setErr(printer);
}
 catch (FileNotFoundException fnfe) {
System.out.println("String_Node_Str");
fnfe.printStackTrace();
}
break;
case "String_Node_Str":
Audio.setAlarmFile(args[i + 1]);
break;
case "String_Node_Str":
break;
default :
if (args[i].startsWith("String_Node_Str")) {
System.out.println("String_Node_Str" + args[i]);
}
break;
}
}
final Startup loadingOutput;
if (isHeadless) {
ErrorBuilder.forceCommandLine();
loadingOutput=new LoadingCLI(System.out);
}
 else {
loadingOutput=new LoadingWindow();
}
String patchNotes=null;
loadingOutput.start();
loadResources(loadingOutput,hasArgument(args,"String_Node_Str"));
if (!isHeadless) {
if (checkUpdates) {
patchNotes=loadUpdates(loadingOutput);
}
if (checkNotifications) {
loadNotifications(loadingOutput);
}
}
 else {
System.out.println("String_Node_Str");
}
loadingOutput.stop();
Setup mySetup;
if (isAutostart) {
mySetup=new SetupAuto(args);
}
 else if (isHeadless) {
mySetup=new SetupCLI(twitterTokens);
}
 else {
SetupGUI myGUI=new SetupGUI(twitterTokens);
if (patchNotes != null) {
myGUI.setPatchNotesText(patchNotes);
}
 else {
myGUI.setPatchNotesText("String_Node_Str");
}
mySetup=myGUI;
}
mySetup.promptForSettings();
twitterTokens[0]=mySetup.getTwitterConsumerKey();
twitterTokens[1]=mySetup.getTwitterConsumerSecret();
twitterTokens[2]=mySetup.getTwitterApplicationKey();
twitterTokens[3]=mySetup.getTwitterApplicationSecret();
Expo myExpo=Expo.parseExpo(mySetup.getExpoToCheck());
if (mySetup.shouldFilterShowclix()) {
com.github.sunnybat.paxchecker.browser.ShowclixReader.strictFilter();
}
Status myStatus;
EmailAccount emailAccount;
try {
emailAccount=new EmailAccount(mySetup.getEmailUsername(),mySetup.getEmailPassword());
for (String s : mySetup.getEmailAddresses()) {
emailAccount.addEmailAddress(s);
}
for (String key : properties.keySet()) {
emailAccount.setProperty(key,properties.get(key));
}
}
 catch (IllegalArgumentException e) {
emailAccount=null;
}
if (!isHeadless) {
StatusGUI statGUI;
if (emailAccount != null) {
statGUI=new StatusGUI(myExpo,emailAccount.getUsername(),emailAccount.getAddressList());
}
 else {
statGUI=new StatusGUI(myExpo);
}
myStatus=statGUI;
if (startMinimized) {
statGUI.minimizeToTray();
}
 else {
statGUI.showWindow();
}
}
 else {
myStatus=new StatusCLI();
}
if (emailAccount != null) {
myStatus.enableEmail();
}
if (mySetup.shouldPlayAlarm()) {
Audio.enableAlarm();
myStatus.enableAlarm();
}
final TicketChecker myChecker=initChecker(mySetup,isHeadless ? null : (StatusGUI)myStatus,myExpo);
if (mySetup.shouldCheckTwitter()) {
TwitterStreamer tcheck=setupTwitter(myStatus,twitterTokens,mySetup.shouldTextTweets() ? emailAccount : null,myChecker);
for (String s : followList) {
tcheck.addUser(s);
}
tcheck.startStreamingTwitter();
myStreamer=tcheck;
myStatus.enableTwitter();
}
checkForTickets(myStatus,myChecker,emailAccount,mySetup.timeBetweenChecks());
}