Program: 112267
Project: 112267
Buggy source:
/** 
 * THIS IS FOR UNIT TESTS ONLY When we run the unit tests in cobertura, JUnit doesn't seem to clean up static fields which leads to  tons of memory being used by the end and the JVM crashes in Travis. Manually clearing all of the static fields seems to solve this.
 */
public static void clearAllStaticFieldsForUnitTest(){
  Class<?> theType;
  try {
    throw new Exception();
  }
 catch (  Exception e) {
    StackTraceElement[] st=e.getStackTrace();
    StackTraceElement elem=st[1];
    String clazzName=elem.getClassName();
    try {
      theType=Class.forName(clazzName);
    }
 catch (    ClassNotFoundException e1) {
      throw new Error(e);
    }
  }
  for (  Field next : Arrays.asList(theType.getDeclaredFields())) {
    if (Modifier.isStatic(next.getModifiers())) {
      if (!Modifier.isFinal(next.getModifiers()) && !next.getType().isPrimitive()) {
        ourLog.info("String_Node_Str",next.toString());
        try {
          next.setAccessible(true);
          next.set(theType,null);
        }
 catch (        Exception e) {
          throw new Error(e);
        }
      }
      if (Modifier.isFinal(next.getModifiers())) {
        if (next.getType().equals(FhirContext.class)) {
          throw new Error("String_Node_Str" + next);
        }
      }
    }
  }
  Locale[] availableLocales={Locale.CANADA,Locale.GERMANY,Locale.TAIWAN};
  Locale.setDefault(availableLocales[(int)(Math.random() * availableLocales.length)]);
  ourLog.info("String_Node_Str" + Locale.getDefault().getDisplayName());
  if (Math.random() < 0.5) {
    ourLog.info("String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
  }
 else {
    ourLog.info("String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
  }
  String availableTimeZones[]={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String timeZone=availableTimeZones[(int)(Math.random() * availableTimeZones.length)];
  TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
  ourLog.info("String_Node_Str",TimeZone.getDefault().getID());
}

Fixed version (ground truth):
/** 
 * <b>THIS IS FOR UNIT TESTS ONLY - DO NOT CALL THIS METHOD FROM USER CODE</b> When we run the unit tests in cobertura, JUnit doesn't seem to clean up static fields which leads to  tons of memory being used by the end and the JVM crashes in Travis. Manually clearing all of the static fields seems to solve this.
 */
public static void clearAllStaticFieldsForUnitTest(){
  Class<?> theType;
  try {
    throw new Exception();
  }
 catch (  Exception e) {
    StackTraceElement[] st=e.getStackTrace();
    StackTraceElement elem=st[1];
    String clazzName=elem.getClassName();
    try {
      theType=Class.forName(clazzName);
    }
 catch (    ClassNotFoundException e1) {
      throw new Error(e);
    }
  }
  for (  Field next : Arrays.asList(theType.getDeclaredFields())) {
    if (Modifier.isStatic(next.getModifiers())) {
      if (!Modifier.isFinal(next.getModifiers()) && !next.getType().isPrimitive()) {
        ourLog.info("String_Node_Str",next.toString());
        try {
          next.setAccessible(true);
          next.set(theType,null);
        }
 catch (        Exception e) {
          throw new Error(e);
        }
      }
      if (Modifier.isFinal(next.getModifiers())) {
        if (next.getType().equals(FhirContext.class)) {
          throw new Error("String_Node_Str" + next);
        }
      }
    }
  }
  Locale[] availableLocales={Locale.CANADA,Locale.GERMANY,Locale.TAIWAN};
  Locale.setDefault(availableLocales[(int)(Math.random() * availableLocales.length)]);
  ourLog.info("String_Node_Str" + Locale.getDefault().getDisplayName());
  if (Math.random() < 0.5) {
    ourLog.info("String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
  }
 else {
    ourLog.info("String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
    System.setProperty("String_Node_Str","String_Node_Str");
  }
  String availableTimeZones[]={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  String timeZone=availableTimeZones[(int)(Math.random() * availableTimeZones.length)];
  TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
  ourLog.info("String_Node_Str",TimeZone.getDefault().getID());
}