nus-yam/ex-repair huggingface dataset:
Program: 8689
Project: 8689
Buggy source:
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 * @throws InterruptedException when sleep is interrupted
 */
public static void main(String[] args) throws InterruptedException {
  for (int i=0; i < THREADS; i++) {
    new MultithreadedSleeping().start();
  }
  latch.await();
  System.out.println("String_Node_Str" + SimonManager.getStopwatch(NAME));
}

Fixed version (ground truth):
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 * @throws InterruptedException when sleep is interrupted
 */
public static void main(String[] args) throws InterruptedException {
  System.out.println("String_Node_Str" + THREADS + "String_Node_Str");
  Split realTimeSplit=new Split();
  for (int i=0; i < THREADS; i++) {
    new MultithreadedSleeping().start();
  }
  latch.await();
  System.out.println("String_Node_Str" + SimonManager.getStopwatch(NAME));
  System.out.println("String_Node_Str" + realTimeSplit.stop());
}
Program: 8690
Project: 8690
Buggy source:
/** 
 * Run method implementing the code performed by the thread.
 */
@Override public void run(){
  Split split=SimonManager.getStopwatch(NAME).start();
  try {
    sleep(SLEEP);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  split.stop();
  latch.countDown();
}

Fixed version (ground truth):
/** 
 * Run method implementing the code performed by the thread.
 */
@Override public void run(){
  Stopwatch stopwatch=SimonManager.getStopwatch(NAME);
  Split split=stopwatch.start();
  try {
    sleep(SLEEP);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  split.stop();
  latch.countDown();
}
Program: 8691
Project: 8691
Buggy source:
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 */
public static void main(String[] args){
  Sampler sampler=new Sampler();
  sampler.setDaemon(true);
  sampler.start();
  while (true) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomly(50);
    split.stop();
  }
}

Fixed version (ground truth):
/** 
 * Entry point of the demo application.
 * @param args command line arguments
 */
public static void main(String[] args){
  Sampler sampler=new Sampler();
  sampler.setDaemon(true);
  sampler.start();
  while (true) {
    Split split=SimonManager.getStopwatch("String_Node_Str").start();
    ExampleUtils.waitRandomlySquared(50);
    split.stop();
  }
}
Program: 8692
Project: 8692
Buggy source:
/** 
 * Entry point to the JMX Callback Example.
 * @param args unused
 * @throws Exception whatever may happen in this crazy world
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws Exception {
  SimonManager.callback().addCallback(new JmxRegisterCallback("String_Node_Str"));
  Counter counter=SimonManager.getCounter("String_Node_Str");
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getCounter("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  System.out.println("String_Node_Str");
  while (true) {
    counter.increase();
    Split split=stopwatch.start();
    ExampleUtils.waitRandomly(40);
    split.stop();
  }
}

Fixed version (ground truth):
/** 
 * Entry point to the JMX Callback Example.
 * @param args unused
 * @throws Exception whatever may happen in this crazy world
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws Exception {
  SimonManager.callback().addCallback(new JmxRegisterCallback("String_Node_Str"));
  Counter counter=SimonManager.getCounter("String_Node_Str");
  Stopwatch stopwatch=SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getCounter("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  SimonManager.getStopwatch("String_Node_Str");
  System.out.println("String_Node_Str");
  while (true) {
    counter.increase();
    Split split=stopwatch.start();
    ExampleUtils.waitRandomlySquared(40);
    split.stop();
  }
}
Program: 8693
Project: 8693
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected boolean shouldBeAddedStopwatchInfo(StopwatchInfo info){
  if (isJdbcResultSetNextSimon(info)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean shouldBeAddedStopwatchInfo(StopwatchInfo info){
  return !(isJdbcResultSetNextSimon(info));
}
Program: 8694
Project: 8694
Buggy source:
/** 
 * Get the main interface of the type
 * @param type Implementation class
 * @return Main interface class
 */
public static Class normalizeType(Class type){
  SimonType simonType=SimonTypeFactory.getValueFromType(type);
  Class normalizedType;
  if (simonType == null) {
    simonType=SimonTypeFactory.getValueFromSampleType(type);
    if (simonType == null) {
      normalizedType=null;
    }
 else {
      normalizedType=simonType.getSampleType();
    }
  }
 else {
    normalizedType=simonType.getType();
  }
  return normalizedType;
}

Fixed version (ground truth):
/** 
 * Get the main interface of the type
 * @param type Implementation class
 * @return Main interface class
 */
public static Class normalizeType(Class type){
  SimonType simonType=SimonTypeFactory.getValueFromType(type);
  Class normalizedType;
  if (simonType == null) {
    simonType=SimonTypeFactory.getValueFromSampleType(type);
    if (simonType == null) {
      normalizedType=type;
    }
 else {
      normalizedType=simonType.getSampleType();
    }
  }
 else {
    normalizedType=simonType.getType();
  }
  return normalizedType;
}
Program: 8695
Project: 8695
Buggy source:
/** 
 * Get the main interface of the type
 * @param type Implementation class
 * @return Main interface class
 */
public static Class normalizeType(Class type){
  SimonType simonType=SimonTypeFactory.getValueFromType(type);
  Class normalizedType;
  if (simonType == null) {
    simonType=SimonTypeFactory.getValueFromSampleType(type);
    if (simonType == null) {
      normalizedType=null;
    }
 else {
      normalizedType=simonType.getSampleType();
    }
  }
 else {
    normalizedType=simonType.getType();
  }
  return normalizedType;
}

Fixed version (ground truth):
/** 
 * Get the main interface of the type
 * @param type Implementation class
 * @return Main interface class
 */
public static Class normalizeType(Class type){
  SimonType simonType=SimonTypeFactory.getValueFromType(type);
  Class normalizedType;
  if (simonType == null) {
    simonType=SimonTypeFactory.getValueFromSampleType(type);
    if (simonType == null) {
      normalizedType=type;
    }
 else {
      normalizedType=simonType.getSampleType();
    }
  }
 else {
    normalizedType=simonType.getType();
  }
  return normalizedType;
}
Program: 8696
Project: 8696
Buggy source:
@Override protected boolean isValid(Double object){
  return super.isValid(object) && object >= 0D;
}

Fixed version (ground truth):
@Override protected boolean isValid(Double object){
  return super.isValid(object) && object >= 0D && object < Double.MAX_VALUE && object != Double.NaN;
}
Program: 8697
Project: 8697
Buggy source:
/** 
 * Warning and stack trace are print out to the error output. Either cause or warning (or both) should be provided otherwise the method does nothing. <p/>  {@inheritDoc}
 */
@Override public void onManagerWarning(String warning,Exception cause){
  if (warning != null) {
    System.err.println("String_Node_Str" + warning);
  }
  if (cause != null) {
    cause.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Warning and stack trace are print out to the error output. Either cause or warning (or both) should be provided otherwise the method does nothing. <p/>  {@inheritDoc}
 */
@Override public void onManagerWarning(String warning,Exception cause){
  if (warning != null) {
    System.err.println(DEBUG_PREFIX + "String_Node_Str" + warning);
  }
  if (cause != null) {
    System.err.print(DEBUG_PREFIX);
    cause.printStackTrace();
  }
}
Program: 8698
Project: 8698
Buggy source:
@Override public void onStopwatchStop(Split split,StopwatchSample sample){
  System.out.println("String_Node_Str" + split + "String_Node_Str"+ sample.stopwatchToString());
}

Fixed version (ground truth):
@Override public void onStopwatchStop(Split split,StopwatchSample sample){
  out("String_Node_Str" + split + "String_Node_Str"+ sample.stopwatchToString());
}
Program: 8699
Project: 8699
Buggy source:
@Override public void onSimonReset(Simon simon){
  System.out.println("String_Node_Str" + simon);
}

Fixed version (ground truth):
@Override public void onSimonReset(Simon simon){
  out("String_Node_Str" + simon);
}
Program: 8700
Project: 8700
Buggy source:
private Stopwatch getStopwatch(){
  return SimonManager.getStopwatch(getClass().getName() + "String_Node_Str");
}

Fixed version (ground truth):
private Stopwatch getStopwatch(){
  return manager.getStopwatch(getClass().getName() + "String_Node_Str");
}
Program: 8701
Project: 8701
Buggy source:
@BeforeClass public static void addCallcack(){
  SimonManager.manager().callback().addCallback(lastSplitsCallback);
}

Fixed version (ground truth):
@BeforeClass public void addCallcack(){
  manager.callback().addCallback(lastSplitsCallback);
}
Program: 8702
Project: 8702
Buggy source:
/** 
 * Get request parameter as a String
 * @param name Parameter name
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public String getParameterAsString(String name,String defaultValue){
  String value=getParameter(name);
  if (value != null) {
    value=value.trim();
    if (value.equals("String_Node_Str")) {
      value=null;
    }
  }
  if (value == null) {
    value=defaultValue;
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Get request parameter as a String
 * @param name Parameter name
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public String getParameterAsString(String name,String defaultValue){
  return defaultValue(blankToNull(getParameter(name)),defaultValue);
}
Program: 8703
Project: 8703
Buggy source:
/** 
 * Get request parameter as a Enum
 * @param name Parameter name
 * @param type Enum type
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public <T extends Enum<T>>T getParameterAsEnum(String name,Class<T> type,T defaultValue){
  String value=getParameterAsString(name,null);
  return (value == null) ? defaultValue : Enum.valueOf(type,value.toUpperCase());
}

Fixed version (ground truth):
/** 
 * Get request parameter as a Enum
 * @param name Parameter name
 * @param type Enum type
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public <T extends Enum<T>>T getParameterAsEnum(String name,Class<T> type,T defaultValue){
  return defaultValue(stringToEnum(blankToNull(getParameter(name)),type),defaultValue);
}
Program: 8704
Project: 8704
Buggy source:
/** 
 * Visit simons as a list. Calls   {@link Manager#getSimons(org.javasimon.SimonPattern)} methodthen Simons are sorted by name and filtered by type finally the visitor is called on each of them.
 * @param manager Simon manager
 * @param pattern Pattern
 * @param type Type
 * @param visitor Visitor
 * @throws IOException
 */
public static void visitList(Manager manager,String pattern,SimonType type,SimonVisitor visitor) throws IOException {
  List<Simon> simons=new ArrayList<Simon>(manager.getSimons(SimonPattern.create(pattern)));
  Collections.sort(simons,new Comparator<Simon>(){
    public int compare(    Simon s1,    Simon s2){
      return s1.getName().compareTo(s2.getName());
    }
  }
);
  for (  Simon simon : simons) {
    SimonType lType=SimonType.getValueFromInstance(simon);
    if (type == null || type == lType) {
      visitor.visit(simon);
    }
  }
}

Fixed version (ground truth):
/** 
 * Visit simons as a list. Calls   {@link Manager#getSimons(org.javasimon.SimonPattern)} methodthen Simons are sorted by name and filtered by type finally the visitor is called on each of them.
 * @param manager Simon manager
 * @param pattern Pattern
 * @param type Type
 * @param visitor Visitor
 * @throws IOException
 */
public static void visitList(Manager manager,String pattern,Set<SimonType> types,SimonVisitor visitor) throws IOException {
  List<Simon> simons=new ArrayList<Simon>(manager.getSimons(SimonPattern.create(pattern)));
  Collections.sort(simons,new Comparator<Simon>(){
    public int compare(    Simon s1,    Simon s2){
      return s1.getName().compareTo(s2.getName());
    }
  }
);
  for (  Simon simon : simons) {
    SimonType lType=SimonType.getValueFromInstance(simon);
    if (types == null || types.contains(lType)) {
      visitor.visit(simon);
    }
  }
}
Program: 8705
Project: 8705
Buggy source:
@Override public void readParameters(){
  TimeFormatType timeFormat=getContext().getParameterAsEnum("String_Node_Str",TimeFormatType.class,TimeFormatType.MILLISECOND);
  stringifierFactory.init(timeFormat,StringifierFactory.READABLE_DATE_PATTERN,numberPattern);
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  type=getContext().getParameterAsEnum("String_Node_Str",SimonType.class,null);
}

Fixed version (ground truth):
@Override public void readParameters(){
  TimeFormatType timeFormat=getContext().getParameterAsEnum("String_Node_Str",TimeFormatType.class,TimeFormatType.MILLISECOND);
  stringifierFactory.init(timeFormat,StringifierFactory.READABLE_DATE_PATTERN,numberPattern);
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  types=getContext().getParametersAsEnums("String_Node_Str",SimonType.class,null);
}
Program: 8706
Project: 8706
Buggy source:
protected void printBody(PrintWriter writer) throws IOException {
  SimonVisitors.visitList(getContext().getManager(),pattern,type,new SimonVisitorImpl(writer));
}

Fixed version (ground truth):
protected void printBody(PrintWriter writer) throws IOException {
  SimonVisitors.visitList(getContext().getManager(),pattern,types,new SimonVisitorImpl(writer));
}
Program: 8707
Project: 8707
Buggy source:
@Override public void readParameters(){
  super.readParameters();
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  type=getContext().getParameterAsEnum("String_Node_Str",SimonType.class,null);
}

Fixed version (ground truth):
@Override public void readParameters(){
  super.readParameters();
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  types=getContext().getParametersAsEnums("String_Node_Str",SimonType.class,null);
}
Program: 8708
Project: 8708
Buggy source:
@Override public void execute() throws ServletException, IOException, ActionException {
  getContext().setContentType("String_Node_Str");
  ArrayJS arrayJS=new ArrayJS();
  SimonVisitors.visitList(getContext().getManager(),pattern,type,new SimonVisitorImpl(arrayJS));
  arrayJS.write(getContext().getWriter());
}

Fixed version (ground truth):
@Override public void execute() throws ServletException, IOException, ActionException {
  getContext().setContentType("String_Node_Str");
  ArrayJS arrayJS=new ArrayJS();
  SimonVisitors.visitList(getContext().getManager(),pattern,types,new SimonVisitorImpl(arrayJS));
  arrayJS.write(getContext().getWriter());
}
Program: 8709
Project: 8709
Buggy source:
@Override public void readParameters(){
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  name=getContext().getParameterAsString("String_Node_Str",null);
  type=getContext().getParameterAsEnum("String_Node_Str",SimonType.class,null);
}

Fixed version (ground truth):
@Override public void readParameters(){
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  name=getContext().getParameterAsString("String_Node_Str",null);
  types=getContext().getParametersAsEnums("String_Node_Str",SimonType.class,null);
}
Program: 8710
Project: 8710
Buggy source:
@Override public void execute() throws ServletException, IOException, ActionException {
  SimonVisitorImpl visitor=new SimonVisitorImpl();
  if (name != null) {
    Simon simon=SimonManager.getSimon(name);
    if (simon == null) {
      throw new ActionException("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      visitor.visit(simon);
    }
  }
 else {
    SimonVisitors.visitList(getContext().getManager(),pattern,type,visitor);
  }
  getContext().getWriter().print("String_Node_Str" + visitor.getCount() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void execute() throws ServletException, IOException, ActionException {
  SimonVisitorImpl visitor=new SimonVisitorImpl();
  if (name != null) {
    Simon simon=SimonManager.getSimon(name);
    if (simon == null) {
      throw new ActionException("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      visitor.visit(simon);
    }
  }
 else {
    SimonVisitors.visitList(getContext().getManager(),pattern,types,visitor);
  }
  getContext().getWriter().print("String_Node_Str" + visitor.getCount() + "String_Node_Str");
}
Program: 8711
Project: 8711
Buggy source:
/** 
 * Get request parameter as a String
 * @param name Parameter name
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public String getParameterAsString(String name,String defaultValue){
  String value=getParameter(name);
  if (value != null) {
    value=value.trim();
    if (value.equals("String_Node_Str")) {
      value=null;
    }
  }
  if (value == null) {
    value=defaultValue;
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Get request parameter as a String
 * @param name Parameter name
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public String getParameterAsString(String name,String defaultValue){
  return defaultValue(blankToNull(getParameter(name)),defaultValue);
}
Program: 8712
Project: 8712
Buggy source:
/** 
 * Get request parameter as a Enum
 * @param name Parameter name
 * @param type Enum type
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public <T extends Enum<T>>T getParameterAsEnum(String name,Class<T> type,T defaultValue){
  String value=getParameterAsString(name,null);
  return (value == null) ? defaultValue : Enum.valueOf(type,value.toUpperCase());
}

Fixed version (ground truth):
/** 
 * Get request parameter as a Enum
 * @param name Parameter name
 * @param type Enum type
 * @param defaultValue Parameter default value (can be null)
 * @return Parameter value
 */
public <T extends Enum<T>>T getParameterAsEnum(String name,Class<T> type,T defaultValue){
  return defaultValue(stringToEnum(blankToNull(getParameter(name)),type),defaultValue);
}
Program: 8713
Project: 8713
Buggy source:
/** 
 * Visit simons as a list. Calls   {@link Manager#getSimons(org.javasimon.SimonPattern)} methodthen Simons are sorted by name and filtered by type finally the visitor is called on each of them.
 * @param manager Simon manager
 * @param pattern Pattern
 * @param type Type
 * @param visitor Visitor
 * @throws IOException
 */
public static void visitList(Manager manager,String pattern,SimonType type,SimonVisitor visitor) throws IOException {
  List<Simon> simons=new ArrayList<Simon>(manager.getSimons(SimonPattern.create(pattern)));
  Collections.sort(simons,new Comparator<Simon>(){
    public int compare(    Simon s1,    Simon s2){
      return s1.getName().compareTo(s2.getName());
    }
  }
);
  for (  Simon simon : simons) {
    SimonType lType=SimonType.getValueFromInstance(simon);
    if (type == null || type == lType) {
      visitor.visit(simon);
    }
  }
}

Fixed version (ground truth):
/** 
 * Visit simons as a list. Calls   {@link Manager#getSimons(org.javasimon.SimonPattern)} methodthen Simons are sorted by name and filtered by type finally the visitor is called on each of them.
 * @param manager Simon manager
 * @param pattern Pattern
 * @param type Type
 * @param visitor Visitor
 * @throws IOException
 */
public static void visitList(Manager manager,String pattern,Set<SimonType> types,SimonVisitor visitor) throws IOException {
  List<Simon> simons=new ArrayList<Simon>(manager.getSimons(SimonPattern.create(pattern)));
  Collections.sort(simons,new Comparator<Simon>(){
    public int compare(    Simon s1,    Simon s2){
      return s1.getName().compareTo(s2.getName());
    }
  }
);
  for (  Simon simon : simons) {
    SimonType lType=SimonType.getValueFromInstance(simon);
    if (types == null || types.contains(lType)) {
      visitor.visit(simon);
    }
  }
}
Program: 8714
Project: 8714
Buggy source:
@Override public void readParameters(){
  TimeFormatType timeFormat=getContext().getParameterAsEnum("String_Node_Str",TimeFormatType.class,TimeFormatType.MILLISECOND);
  stringifierFactory.init(timeFormat,StringifierFactory.READABLE_DATE_PATTERN,numberPattern);
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  type=getContext().getParameterAsEnum("String_Node_Str",SimonType.class,null);
}

Fixed version (ground truth):
@Override public void readParameters(){
  TimeFormatType timeFormat=getContext().getParameterAsEnum("String_Node_Str",TimeFormatType.class,TimeFormatType.MILLISECOND);
  stringifierFactory.init(timeFormat,StringifierFactory.READABLE_DATE_PATTERN,numberPattern);
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  types=getContext().getParametersAsEnums("String_Node_Str",SimonType.class,null);
}
Program: 8715
Project: 8715
Buggy source:
protected void printBody(PrintWriter writer) throws IOException {
  SimonVisitors.visitList(getContext().getManager(),pattern,type,new SimonVisitorImpl(writer));
}

Fixed version (ground truth):
protected void printBody(PrintWriter writer) throws IOException {
  SimonVisitors.visitList(getContext().getManager(),pattern,types,new SimonVisitorImpl(writer));
}
Program: 8716
Project: 8716
Buggy source:
@Override public void readParameters(){
  super.readParameters();
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  type=getContext().getParameterAsEnum("String_Node_Str",SimonType.class,null);
}

Fixed version (ground truth):
@Override public void readParameters(){
  super.readParameters();
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  types=getContext().getParametersAsEnums("String_Node_Str",SimonType.class,null);
}
Program: 8717
Project: 8717
Buggy source:
@Override public void execute() throws ServletException, IOException, ActionException {
  getContext().setContentType("String_Node_Str");
  ArrayJS arrayJS=new ArrayJS();
  SimonVisitors.visitList(getContext().getManager(),pattern,type,new SimonVisitorImpl(arrayJS));
  arrayJS.write(getContext().getWriter());
}

Fixed version (ground truth):
@Override public void execute() throws ServletException, IOException, ActionException {
  getContext().setContentType("String_Node_Str");
  ArrayJS arrayJS=new ArrayJS();
  SimonVisitors.visitList(getContext().getManager(),pattern,types,new SimonVisitorImpl(arrayJS));
  arrayJS.write(getContext().getWriter());
}
Program: 8718
Project: 8718
Buggy source:
@Override public void readParameters(){
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  name=getContext().getParameterAsString("String_Node_Str",null);
  type=getContext().getParameterAsEnum("String_Node_Str",SimonType.class,null);
}

Fixed version (ground truth):
@Override public void readParameters(){
  pattern=getContext().getParameterAsString("String_Node_Str",null);
  name=getContext().getParameterAsString("String_Node_Str",null);
  types=getContext().getParametersAsEnums("String_Node_Str",SimonType.class,null);
}
Program: 8719
Project: 8719
Buggy source:
@Override public void execute() throws ServletException, IOException, ActionException {
  SimonVisitorImpl visitor=new SimonVisitorImpl();
  if (name != null) {
    Simon simon=SimonManager.getSimon(name);
    if (simon == null) {
      throw new ActionException("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      visitor.visit(simon);
    }
  }
 else {
    SimonVisitors.visitList(getContext().getManager(),pattern,type,visitor);
  }
  getContext().getWriter().print("String_Node_Str" + visitor.getCount() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void execute() throws ServletException, IOException, ActionException {
  SimonVisitorImpl visitor=new SimonVisitorImpl();
  if (name != null) {
    Simon simon=SimonManager.getSimon(name);
    if (simon == null) {
      throw new ActionException("String_Node_Str" + name + "String_Node_Str");
    }
 else {
      visitor.visit(simon);
    }
  }
 else {
    SimonVisitors.visitList(getContext().getManager(),pattern,types,visitor);
  }
  getContext().getWriter().print("String_Node_Str" + visitor.getCount() + "String_Node_Str");
}
Program: 8720
Project: 8720
Buggy source:
@Override protected boolean isValid(Double object){
  return super.isValid(object) && object >= 0D;
}

Fixed version (ground truth):
@Override protected boolean isValid(Double object){
  return super.isValid(object) && object >= 0D && object < Double.MAX_VALUE && object != Double.NaN;
}
Program: 8721
Project: 8721
Buggy source:
/** 
 * Warning and stack trace are print out to the error output. Either cause or warning (or both) should be provided otherwise the method does nothing. <p/>  {@inheritDoc}
 */
@Override public void onManagerWarning(String warning,Exception cause){
  if (warning != null) {
    System.err.println("String_Node_Str" + warning);
  }
  if (cause != null) {
    cause.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Warning and stack trace are print out to the error output. Either cause or warning (or both) should be provided otherwise the method does nothing. <p/>  {@inheritDoc}
 */
@Override public void onManagerWarning(String warning,Exception cause){
  if (warning != null) {
    System.err.println(DEBUG_PREFIX + "String_Node_Str" + warning);
  }
  if (cause != null) {
    System.err.print(DEBUG_PREFIX);
    cause.printStackTrace();
  }
}
Program: 8722
Project: 8722
Buggy source:
@Override public void onStopwatchStop(Split split,StopwatchSample sample){
  System.out.println("String_Node_Str" + split + "String_Node_Str"+ sample.stopwatchToString());
}

Fixed version (ground truth):
@Override public void onStopwatchStop(Split split,StopwatchSample sample){
  out("String_Node_Str" + split + "String_Node_Str"+ sample.stopwatchToString());
}
Program: 8723
Project: 8723
Buggy source:
@Override public void onSimonReset(Simon simon){
  System.out.println("String_Node_Str" + simon);
}

Fixed version (ground truth):
@Override public void onSimonReset(Simon simon){
  out("String_Node_Str" + simon);
}
Program: 8724
Project: 8724
Buggy source:
private Stopwatch getStopwatch(){
  return SimonManager.getStopwatch(getClass().getName() + "String_Node_Str");
}

Fixed version (ground truth):
private Stopwatch getStopwatch(){
  return manager.getStopwatch(getClass().getName() + "String_Node_Str");
}
Program: 8725
Project: 8725
Buggy source:
@BeforeClass public static void addCallcack(){
  SimonManager.manager().callback().addCallback(lastSplitsCallback);
}

Fixed version (ground truth):
@BeforeClass public void addCallcack(){
  manager.callback().addCallback(lastSplitsCallback);
}
Program: 8726
Project: 8726
Buggy source:
/** 
 * Wraps the HTTP request with Simon measuring. Separate Simons are created for different URIs (parameters ignored).
 * @param servletRequest HTTP servlet request
 * @param response HTTP servlet response
 * @param filterChain filter chain
 * @throws IOException possibly thrown by other filter/serlvet in the chain
 * @throws ServletException possibly thrown by other filter/serlvet in the chain
 */
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  if (consolePath != null && request.getRequestURI().startsWith(consolePath)) {
    consolePage(request,(HttpServletResponse)response);
    return;
  }
  if (reportThreshold != null) {
    SPLITS.set(new ArrayList<Split>());
  }
  String simonName=getSimonName(request);
  Stopwatch stopwatch=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName);
  if (stopwatch.getNote() == null) {
    stopwatch.setNote(request.getRequestURI());
  }
  Split split=stopwatch.start();
  try {
    filterChain.doFilter(request,response);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    long splitNanoTime=split.stop().runningFor();
    if (reportThreshold != null) {
      if (splitNanoTime > reportThreshold) {
        SimonManager.message("String_Node_Str" + SimonUtils.presentNanoTime(splitNanoTime) + "String_Node_Str"+ SPLITS.get());
      }
      SPLITS.remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Wraps the HTTP request with Simon measuring. Separate Simons are created for different URIs (parameters ignored).
 * @param servletRequest HTTP servlet request
 * @param response HTTP servlet response
 * @param filterChain filter chain
 * @throws IOException possibly thrown by other filter/serlvet in the chain
 * @throws ServletException possibly thrown by other filter/serlvet in the chain
 */
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String localPath=request.getRequestURI().substring(request.getContextPath().length());
  if (consolePath != null && localPath.startsWith(consolePath)) {
    consolePage(request,(HttpServletResponse)response,localPath);
    return;
  }
  if (reportThreshold != null) {
    SPLITS.set(new ArrayList<Split>());
  }
  String simonName=getSimonName(request);
  Stopwatch stopwatch=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName);
  if (stopwatch.getNote() == null) {
    stopwatch.setNote(request.getRequestURI());
  }
  Split split=stopwatch.start();
  try {
    filterChain.doFilter(request,response);
  }
  finally {
    long splitNanoTime=split.stop().runningFor();
    if (reportThreshold != null) {
      if (splitNanoTime > reportThreshold) {
        SimonManager.message("String_Node_Str" + SimonUtils.presentNanoTime(splitNanoTime) + "String_Node_Str"+ SPLITS.get());
      }
      SPLITS.remove();
    }
  }
}
Program: 8727
Project: 8727
Buggy source:
private void consolePage(HttpServletRequest request,HttpServletResponse response) throws IOException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  String subcommand=request.getRequestURI().substring(consolePath.length());
  if (subcommand.isEmpty()) {
    printSimonTree(response);
  }
 else   if (subcommand.equalsIgnoreCase("String_Node_Str")) {
    SimonManager.clear();
    response.getOutputStream().println("String_Node_Str");
  }
 else {
    response.getOutputStream().println("String_Node_Str");
    simonHelp(response);
  }
}

Fixed version (ground truth):
private void consolePage(HttpServletRequest request,HttpServletResponse response,String localPath) throws IOException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  String subcommand=localPath.substring(consolePath.length());
  if (subcommand.isEmpty()) {
    printSimonTree(response);
  }
 else   if (subcommand.equalsIgnoreCase("String_Node_Str")) {
    SimonManager.clear();
    response.getOutputStream().println("String_Node_Str");
  }
 else {
    response.getOutputStream().println("String_Node_Str");
    simonHelp(response);
  }
}
Program: 8728
Project: 8728
Buggy source:
/** 
 * Wraps the HTTP request with Simon measuring. Separate Simons are created for different URIs (parameters ignored).
 * @param servletRequest HTTP servlet request
 * @param response HTTP servlet response
 * @param filterChain filter chain
 * @throws IOException possibly thrown by other filter/serlvet in the chain
 * @throws ServletException possibly thrown by other filter/serlvet in the chain
 */
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  if (consolePath != null && request.getRequestURI().startsWith(consolePath)) {
    consolePage(request,(HttpServletResponse)response);
    return;
  }
  if (reportThreshold != null) {
    SPLITS.set(new ArrayList<Split>());
  }
  String simonName=getSimonName(request);
  Stopwatch stopwatch=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName);
  if (stopwatch.getNote() == null) {
    stopwatch.setNote(request.getRequestURI());
  }
  Split split=stopwatch.start();
  try {
    filterChain.doFilter(request,response);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    long splitNanoTime=split.stop().runningFor();
    if (reportThreshold != null) {
      if (splitNanoTime > reportThreshold) {
        SimonManager.message("String_Node_Str" + SimonUtils.presentNanoTime(splitNanoTime) + "String_Node_Str"+ SPLITS.get());
      }
      SPLITS.remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Wraps the HTTP request with Simon measuring. Separate Simons are created for different URIs (parameters ignored).
 * @param servletRequest HTTP servlet request
 * @param response HTTP servlet response
 * @param filterChain filter chain
 * @throws IOException possibly thrown by other filter/serlvet in the chain
 * @throws ServletException possibly thrown by other filter/serlvet in the chain
 */
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String localPath=request.getRequestURI().substring(request.getContextPath().length());
  if (consolePath != null && localPath.startsWith(consolePath)) {
    consolePage(request,(HttpServletResponse)response,localPath);
    return;
  }
  if (reportThreshold != null) {
    SPLITS.set(new ArrayList<Split>());
  }
  String simonName=getSimonName(request);
  Stopwatch stopwatch=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName);
  if (stopwatch.getNote() == null) {
    stopwatch.setNote(request.getRequestURI());
  }
  Split split=stopwatch.start();
  try {
    filterChain.doFilter(request,response);
  }
  finally {
    long splitNanoTime=split.stop().runningFor();
    if (reportThreshold != null) {
      if (splitNanoTime > reportThreshold) {
        SimonManager.message("String_Node_Str" + SimonUtils.presentNanoTime(splitNanoTime) + "String_Node_Str"+ SPLITS.get());
      }
      SPLITS.remove();
    }
  }
}
Program: 8729
Project: 8729
Buggy source:
private void consolePage(HttpServletRequest request,HttpServletResponse response) throws IOException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  String subcommand=request.getRequestURI().substring(consolePath.length());
  if (subcommand.isEmpty()) {
    printSimonTree(response);
  }
 else   if (subcommand.equalsIgnoreCase("String_Node_Str")) {
    SimonManager.clear();
    response.getOutputStream().println("String_Node_Str");
  }
 else {
    response.getOutputStream().println("String_Node_Str");
    simonHelp(response);
  }
}

Fixed version (ground truth):
private void consolePage(HttpServletRequest request,HttpServletResponse response,String localPath) throws IOException {
  response.setContentType("String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  String subcommand=localPath.substring(consolePath.length());
  if (subcommand.isEmpty()) {
    printSimonTree(response);
  }
 else   if (subcommand.equalsIgnoreCase("String_Node_Str")) {
    SimonManager.clear();
    response.getOutputStream().println("String_Node_Str");
  }
 else {
    response.getOutputStream().println("String_Node_Str");
    simonHelp(response);
  }
}
Program: 8730
Project: 8730
Buggy source:
/** 
 * Returns unmodifiable collection containing names of all existing Simons.
 * @return collection of all Simon names
 * @since 3.1
 */
Collection<String> getSimonNames();

Fixed version (ground truth):
/** 
 * Returns unmodifiable collection containing names of all existing Simons. Collection is not ordered.
 * @return collection of all Simon names
 * @since 3.1
 */
Collection<String> getSimonNames();
Program: 8731
Project: 8731
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sampleAndReset(){
  return new CounterSample((org.javasimon.CounterSample)counter.sampleAndReset());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sampleAndReset(){
  return new CounterSample(counter.sampleAndReset());
}
Program: 8732
Project: 8732
Buggy source:
/** 
 * Creates the MX bean for the provided Counter.
 * @param counter wrapped Counter
 */
protected CounterMXBeanImpl(Counter counter){
  this.counter=counter;
}

Fixed version (ground truth):
/** 
 * Creates the MX bean for the provided Counter.
 * @param counter wrapped Counter
 */
public CounterMXBeanImpl(Counter counter){
  this.counter=counter;
}
Program: 8733
Project: 8733
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sample(){
  return new CounterSample((org.javasimon.CounterSample)counter.sample());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sample(){
  return new CounterSample(counter.sample());
}
Program: 8734
Project: 8734
Buggy source:
/** 
 * Returns array containing names and types of all existing Simons.
 * @return array of {@link SimonInfo} object
 */
SimonInfo[] getSimonInfos();

Fixed version (ground truth):
/** 
 * Returns array containing names and types of all existing Simons ordered naturally by name.
 * @return array of {@link SimonInfo} objects
 */
SimonInfo[] getSimonInfos();
Program: 8735
Project: 8735
Buggy source:
/** 
 * Returns array containing full hierarchical names of all existing Simons.
 * @return array of all Simon names
 * @see org.javasimon.Manager#simonNames()
 */
String[] getSimonNames();

Fixed version (ground truth):
/** 
 * Returns array containing full hierarchical names of all existing Simons.
 * @return array of all Simon names
 * @see org.javasimon.Manager#getSimonNames()
 */
String[] getSimonNames();
Program: 8736
Project: 8736
Buggy source:
/** 
 * {@inheritDoc}
 */
public final SimonInfo[] getSimonInfos(){
  Collection<String> simonNames=manager.getSimonNames();
  SimonInfo[] simonInfo=new SimonInfo[simonNames.size()];
  int i=0;
  for (  String name : simonNames) {
    Simon s=manager.getSimon(name);
    simonInfo[i++]=new SimonInfo(name,s instanceof Stopwatch ? SimonInfo.STOPWATCH : s instanceof Counter ? SimonInfo.COUNTER : SimonInfo.UNKNOWN);
  }
  return simonInfo;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final SimonInfo[] getSimonInfos(){
  String[] simonNames=getSimonNamesOrdered();
  SimonInfo[] simonInfo=new SimonInfo[simonNames.length];
  int i=0;
  for (  String name : simonNames) {
    Simon s=manager.getSimon(name);
    simonInfo[i++]=new SimonInfo(name,s instanceof Stopwatch ? SimonInfo.STOPWATCH : s instanceof Counter ? SimonInfo.COUNTER : SimonInfo.UNKNOWN);
  }
  return simonInfo;
}
Program: 8737
Project: 8737
Buggy source:
/** 
 * {@inheritDoc}
 */
public final String[] getSimonNames(){
  return (String[])manager.getSimonNames().toArray();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final String[] getSimonNames(){
  Collection<String> simonNames=manager.getSimonNames();
  return simonNames.toArray(new String[simonNames.size()]);
}
Program: 8738
Project: 8738
Buggy source:
/** 
 * {@inheritDoc}
 */
public void reset(String name){
  manager.getSimon(name).reset();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final void reset(String name){
  manager.getSimon(name).reset();
}
Program: 8739
Project: 8739
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String getLastAsString(){
  return SimonUtils.presentNanoTime(getLast());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final String getLastAsString(){
  return SimonUtils.presentNanoTime(getLast());
}
Program: 8740
Project: 8740
Buggy source:
/** 
 * Creates the MX bean for the provided Stopwatch.
 * @param stopwatch wrapped Stopwatch
 */
protected StopwatchMXBeanImpl(Stopwatch stopwatch){
  this.stopwatch=stopwatch;
}

Fixed version (ground truth):
/** 
 * Creates the MX bean for the provided Stopwatch.
 * @param stopwatch wrapped Stopwatch
 */
public StopwatchMXBeanImpl(Stopwatch stopwatch){
  this.stopwatch=stopwatch;
}
Program: 8741
Project: 8741
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sampleAndReset(){
  return new StopwatchSample((org.javasimon.StopwatchSample)stopwatch.sampleAndReset());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sampleAndReset(){
  return new StopwatchSample(stopwatch.sampleAndReset());
}
Program: 8742
Project: 8742
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sample(){
  return new StopwatchSample((org.javasimon.StopwatchSample)stopwatch.sample());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sample(){
  return new StopwatchSample(stopwatch.sample());
}
Program: 8744
Project: 8744
Buggy source:
/** 
 * Returns unmodifiable collection containing names of all existing Simons.
 * @return collection of all Simon names
 * @since 3.1
 */
Collection<String> getSimonNames();

Fixed version (ground truth):
/** 
 * Returns unmodifiable collection containing names of all existing Simons. Collection is not ordered.
 * @return collection of all Simon names
 * @since 3.1
 */
Collection<String> getSimonNames();
Program: 8745
Project: 8745
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sampleAndReset(){
  return new CounterSample((org.javasimon.CounterSample)counter.sampleAndReset());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sampleAndReset(){
  return new CounterSample(counter.sampleAndReset());
}
Program: 8746
Project: 8746
Buggy source:
/** 
 * Creates the MX bean for the provided Counter.
 * @param counter wrapped Counter
 */
protected CounterMXBeanImpl(Counter counter){
  this.counter=counter;
}

Fixed version (ground truth):
/** 
 * Creates the MX bean for the provided Counter.
 * @param counter wrapped Counter
 */
public CounterMXBeanImpl(Counter counter){
  this.counter=counter;
}
Program: 8747
Project: 8747
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sample(){
  return new CounterSample((org.javasimon.CounterSample)counter.sample());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final CounterSample sample(){
  return new CounterSample(counter.sample());
}
Program: 8748
Project: 8748
Buggy source:
/** 
 * Returns array containing names and types of all existing Simons.
 * @return array of {@link SimonInfo} object
 */
SimonInfo[] getSimonInfos();

Fixed version (ground truth):
/** 
 * Returns array containing names and types of all existing Simons ordered naturally by name.
 * @return array of {@link SimonInfo} objects
 */
SimonInfo[] getSimonInfos();
Program: 8749
Project: 8749
Buggy source:
/** 
 * Returns array containing full hierarchical names of all existing Simons.
 * @return array of all Simon names
 * @see org.javasimon.Manager#simonNames()
 */
String[] getSimonNames();

Fixed version (ground truth):
/** 
 * Returns array containing full hierarchical names of all existing Simons.
 * @return array of all Simon names
 * @see org.javasimon.Manager#getSimonNames()
 */
String[] getSimonNames();
Program: 8750
Project: 8750
Buggy source:
/** 
 * {@inheritDoc}
 */
public final SimonInfo[] getSimonInfos(){
  Collection<String> simonNames=manager.getSimonNames();
  SimonInfo[] simonInfo=new SimonInfo[simonNames.size()];
  int i=0;
  for (  String name : simonNames) {
    Simon s=manager.getSimon(name);
    simonInfo[i++]=new SimonInfo(name,s instanceof Stopwatch ? SimonInfo.STOPWATCH : s instanceof Counter ? SimonInfo.COUNTER : SimonInfo.UNKNOWN);
  }
  return simonInfo;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final SimonInfo[] getSimonInfos(){
  String[] simonNames=getSimonNamesOrdered();
  SimonInfo[] simonInfo=new SimonInfo[simonNames.length];
  int i=0;
  for (  String name : simonNames) {
    Simon s=manager.getSimon(name);
    simonInfo[i++]=new SimonInfo(name,s instanceof Stopwatch ? SimonInfo.STOPWATCH : s instanceof Counter ? SimonInfo.COUNTER : SimonInfo.UNKNOWN);
  }
  return simonInfo;
}
Program: 8751
Project: 8751
Buggy source:
/** 
 * {@inheritDoc}
 */
public final String[] getSimonNames(){
  return (String[])manager.getSimonNames().toArray();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final String[] getSimonNames(){
  Collection<String> simonNames=manager.getSimonNames();
  return simonNames.toArray(new String[simonNames.size()]);
}
Program: 8752
Project: 8752
Buggy source:
/** 
 * {@inheritDoc}
 */
public void reset(String name){
  manager.getSimon(name).reset();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public final void reset(String name){
  manager.getSimon(name).reset();
}
Program: 8753
Project: 8753
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String getLastAsString(){
  return SimonUtils.presentNanoTime(getLast());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final String getLastAsString(){
  return SimonUtils.presentNanoTime(getLast());
}
Program: 8754
Project: 8754
Buggy source:
/** 
 * Creates the MX bean for the provided Stopwatch.
 * @param stopwatch wrapped Stopwatch
 */
protected StopwatchMXBeanImpl(Stopwatch stopwatch){
  this.stopwatch=stopwatch;
}

Fixed version (ground truth):
/** 
 * Creates the MX bean for the provided Stopwatch.
 * @param stopwatch wrapped Stopwatch
 */
public StopwatchMXBeanImpl(Stopwatch stopwatch){
  this.stopwatch=stopwatch;
}
Program: 8755
Project: 8755
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sampleAndReset(){
  return new StopwatchSample((org.javasimon.StopwatchSample)stopwatch.sampleAndReset());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sampleAndReset(){
  return new StopwatchSample(stopwatch.sampleAndReset());
}
Program: 8756
Project: 8756
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sample(){
  return new StopwatchSample((org.javasimon.StopwatchSample)stopwatch.sample());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final StopwatchSample sample(){
  return new StopwatchSample(stopwatch.sample());
}
Program: 8758
Project: 8758
Buggy source:
public void init(FilterConfig filterConfig) throws ServletException {
  simonPrefix=filterConfig.getInitParameter(INIT_PARAM_PREFIX);
  String publishManager=filterConfig.getInitParameter(INIT_PARAM_PUBLISH_MANAGER);
  if (publishManager != null) {
    filterConfig.getServletContext().setAttribute(publishManager,SimonManager.manager());
  }
}

Fixed version (ground truth):
public void init(FilterConfig filterConfig) throws ServletException {
  if (filterConfig.getInitParameter(INIT_PARAM_PREFIX) != null) {
    simonPrefix=filterConfig.getInitParameter(INIT_PARAM_PREFIX);
  }
  String publishManager=filterConfig.getInitParameter(INIT_PARAM_PUBLISH_MANAGER);
  if (publishManager != null) {
    filterConfig.getServletContext().setAttribute(publishManager,SimonManager.manager());
  }
}