Program: 80965
Project: 80965
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() || hasArgument(args,"String_Node_Str");
  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":
case "String_Node_Str":
      followList.add(args[i + 1]);
    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":
if (i < args.length - 1 && !args[i + 1].startsWith("String_Node_Str")) {
Audio.setAlarmFile(args[i + 1]);
}
 else {
System.out.println("String_Node_Str");
}
break;
}
}
PreferenceHandler prefs=new PreferenceHandler("String_Node_Str");
final Startup loadingOutput;
if (isHeadless) {
ErrorBuilder.forceCommandLine();
loadingOutput=new LoadingCLI(System.out);
}
 else {
loadingOutput=new LoadingWindow();
}
loadingOutput.start();
loadResources(loadingOutput,hasArgument(args,"String_Node_Str"));
Updater programUpdater=new Updater(VERSION);
String patchNotes=null;
if (!hasArgument(args,"String_Node_Str") && prefs.getBooleanPreference("String_Node_Str",true)) {
if (hasArgument(args,"String_Node_Str") || prefs.getBooleanPreference("String_Node_Str",false)) {
programUpdater.enableAnonymousMode();
}
if (isHeadless) {
programUpdater.enableHeadlessMode();
}
if (programUpdater.loadUpdates(loadingOutput)) {
patchNotes=programUpdater.getPatchNotes();
}
 else {
System.out.println("String_Node_Str");
}
}
if (!hasArgument(args,"String_Node_Str") && prefs.getBooleanPreference("String_Node_Str",true)) {
loadNotifications(loadingOutput,hasArgument(args,"String_Node_Str") || prefs.getBooleanPreference("String_Node_Str",false),isHeadless,prefs);
}
loadingOutput.stop();
Setup mySetup;
if (hasArgument(args,"String_Node_Str")) {
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();
if (mySetup.shouldCheckForUpdatesDaily()) {
new Thread(new PeriodicUpdateChecker(programUpdater)).start();
}
Expo myExpo=Expo.parseExpo(mySetup.getExpoToCheck());
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 (hasArgument(args,"String_Node_Str")) {
statGUI.minimizeToTray();
}
 else {
statGUI.showWindow();
}
}
 else {
myStatus=new StatusCLI();
}
if (emailAccount != null) {
myStatus.enableEmail();
}
if (mySetup.shouldPlayAlarm()) {
Audio.enableAlarm();
myStatus.enableAlarm();
}
myLinkManager=new LinkManager(emailAccount);
TicketChecker myChecker=initChecker(mySetup,isHeadless ? null : (StatusGUI)myStatus,myExpo);
if (mySetup.shouldCheckTwitter()) {
TwitterStreamer tcheck=setupTwitter(myStatus,twitterTokens,mySetup.shouldTextTweets());
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() || hasArgument(args,"String_Node_Str");
  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":
case "String_Node_Str":
      followList.add(args[i + 1]);
    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":
if (i < args.length - 1 && !args[i + 1].startsWith("String_Node_Str")) {
Audio.setAlarmFile(args[i + 1]);
}
 else {
System.out.println("String_Node_Str");
}
break;
}
}
PreferenceHandler prefs=new PreferenceHandler("String_Node_Str");
final Startup loadingOutput;
if (isHeadless) {
ErrorBuilder.forceCommandLine();
loadingOutput=new LoadingCLI(System.out);
}
 else {
loadingOutput=new LoadingWindow();
}
loadingOutput.start();
loadResources(loadingOutput,hasArgument(args,"String_Node_Str"));
Updater programUpdater=new Updater(VERSION);
String patchNotes=null;
if (!hasArgument(args,"String_Node_Str") && prefs.getBooleanPreference("String_Node_Str",true)) {
if (hasArgument(args,"String_Node_Str") || prefs.getBooleanPreference("String_Node_Str",false)) {
programUpdater.enableAnonymousMode();
}
if (isHeadless) {
programUpdater.enableHeadlessMode();
}
if (hasArgument(args,"String_Node_Str") || prefs.getBooleanPreference("String_Node_Str")) {
programUpdater.enableBetaUpdates();
}
if (programUpdater.loadUpdates(loadingOutput)) {
patchNotes=programUpdater.getPatchNotes();
}
 else {
System.out.println("String_Node_Str");
}
}
if (!hasArgument(args,"String_Node_Str") && prefs.getBooleanPreference("String_Node_Str",true)) {
loadNotifications(loadingOutput,hasArgument(args,"String_Node_Str") || prefs.getBooleanPreference("String_Node_Str",false),isHeadless,prefs);
}
loadingOutput.stop();
Setup mySetup;
if (hasArgument(args,"String_Node_Str")) {
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();
if (mySetup.shouldCheckForUpdatesDaily()) {
new Thread(new PeriodicUpdateChecker(programUpdater)).start();
}
Expo myExpo=Expo.parseExpo(mySetup.getExpoToCheck());
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 (hasArgument(args,"String_Node_Str")) {
statGUI.minimizeToTray();
}
 else {
statGUI.showWindow();
}
}
 else {
myStatus=new StatusCLI();
}
if (emailAccount != null) {
myStatus.enableEmail();
}
if (mySetup.shouldPlayAlarm()) {
Audio.enableAlarm();
myStatus.enableAlarm();
}
myLinkManager=new LinkManager(emailAccount);
TicketChecker myChecker=initChecker(mySetup,isHeadless ? null : (StatusGUI)myStatus,myExpo);
if (mySetup.shouldCheckTwitter()) {
TwitterStreamer tcheck=setupTwitter(myStatus,twitterTokens,mySetup.shouldTextTweets());
for (String s : followList) {
tcheck.addUser(s);
}
tcheck.startStreamingTwitter();
myStreamer=tcheck;
myStatus.enableTwitter();
}
checkForTickets(myStatus,myChecker,emailAccount,mySetup.timeBetweenChecks());
}