nus-yam/ex-repair huggingface dataset:
Program: 7497
Project: 7497
Buggy source:
/** 
 * Unloads all plug-ins. All plug-in classes will be destroyed and the plug-in file storages will be hidden from the root overlay. Note that the built-in plug-ins will be unaffected by this.
 */
public void unloadAll(){
  Object[] objs;
  String pluginId;
  objs=storage.loadAll(PATH_PLUGIN);
  for (int i=0; i < objs.length; i++) {
    if (objs[i] instanceof Plugin) {
      pluginId=((Plugin)objs[i]).id();
      try {
        unload(pluginId);
      }
 catch (      PluginException e) {
        LOG.warning("String_Node_Str" + pluginId + "String_Node_Str");
      }
    }
  }
  classLoader=new PluginClassLoader();
}

Fixed version (ground truth):
/** 
 * Unloads all plug-ins. All plug-in classes will be destroyed and the plug-in file storages will be hidden from the root overlay. Note that the built-in plug-ins will be unaffected by this.
 */
public void unloadAll(){
  Object[] objs;
  String pluginId;
  objs=storage.loadAll(PATH_PLUGIN);
  for (int i=0; i < objs.length; i++) {
    if (objs[i] instanceof Plugin) {
      pluginId=((Plugin)objs[i]).id();
      try {
        unload(pluginId);
      }
 catch (      PluginException e) {
        LOG.warning("String_Node_Str" + pluginId + "String_Node_Str");
      }
    }
  }
  storage.flush(null);
  classLoader=new PluginClassLoader();
}
Program: 7498
Project: 7498
Buggy source:
/** 
 * Loads an object from the specified storage. The storage cache will be used primarily, if it exists. If an object is found in the storage that can be cached, it will be initialized and cached by this method.
 * @param storage        the storage to load from
 * @param path           the storage location
 * @return the data read, ornull if not found
 */
private Object loadObject(Storage storage,Path path){
  MemoryStorage cache;
  Object res=null;
  String id;
  String msg;
  cache=(MemoryStorage)cacheStorages.get(storage.path());
  if (cache != null) {
    res=cache.load(path);
    if (res instanceof StorableObject) {
      return res;
    }
  }
  res=storage.load(path);
  if (cache != null && res instanceof Dict) {
    id=StringUtils.removeStart(path.subPath(1).toString(),"String_Node_Str");
    res=initialize(id,(Dict)res);
    if (res instanceof StorableObject) {
      try {
        cache.store(path,res);
      }
 catch (      StorageException e) {
        msg="String_Node_Str" + cache.path();
        LOG.log(Level.WARNING,msg,e);
      }
    }
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Loads an object from the specified storage. The storage cache will be used primarily, if it exists. If an object is found in the storage that can be cached, it will be initialized and cached by this method.
 * @param storage        the storage to load from
 * @param path           the storage location
 * @return the data read, ornull if not found
 */
private Object loadObject(Storage storage,Path path){
  MemoryStorage cache;
  Object res=null;
  String id;
  String msg;
  LOG.fine("String_Node_Str" + path + "String_Node_Str"+ storage.path());
  cache=(MemoryStorage)cacheStorages.get(storage.path());
  if (cache != null) {
    res=cache.load(path);
    if (res instanceof StorableObject && !(res instanceof Index)) {
      LOG.fine("String_Node_Str" + path + "String_Node_Str"+ res);
      return res;
    }
  }
  res=storage.load(path);
  LOG.fine("String_Node_Str" + path + "String_Node_Str"+ res);
  if (cache != null && res instanceof Dict) {
    id=StringUtils.removeStart(path.subPath(1).toString(),"String_Node_Str");
    res=initialize(id,(Dict)res);
    if (res instanceof StorableObject) {
      try {
        cache.store(path,res);
        LOG.fine("String_Node_Str" + path + "String_Node_Str"+ res);
      }
 catch (      StorageException e) {
        msg="String_Node_Str" + cache.path();
        LOG.log(Level.WARNING,msg,e);
      }
    }
  }
  return res;
}
Program: 7499
Project: 7499
Buggy source:
/** 
 * Compares two storages with one another.
 * @param o1             the first object
 * @param o2             the second object
 * @return a negative integer, zero, or a positive integer asthe first argument is less than, equal to, or greater than the second
 * @throws ClassCastException if the values were not comparable
 */
public int compare(Object o1,Object o2){
  Storage s1=(Storage)o1;
  Storage s2=(Storage)o2;
  int cmp1=prio(s1) - prio(s2);
  int cmp2=mountTime(s2).compareTo(mountTime(s2));
  return (cmp1 != 0) ? -cmp1 : cmp2;
}

Fixed version (ground truth):
/** 
 * Compares two storages with one another.
 * @param o1             the first object
 * @param o2             the second object
 * @return a negative integer, zero, or a positive integer asthe first argument is less than, equal to, or greater than the second
 * @throws ClassCastException if the values were not comparable
 */
public int compare(Object o1,Object o2){
  Storage s1=(Storage)o1;
  Storage s2=(Storage)o2;
  int cmp1=prio(s1) - prio(s2);
  int cmp2=s1.mountTime().compareTo(s2.mountTime());
  return (cmp1 != 0) ? -cmp1 : cmp2;
}
Program: 7500
Project: 7500
Buggy source:
/** 
 * Sets an indexed property in this object.
 * @param index          the index of the property
 * @param start          the object in which the lookup began
 * @param value          the value to set
 */
public void put(int index,Scriptable start,Object value){
  if (data instanceof Array) {
    ((Array)data).set(index,JsSerializer.unwrap(value));
  }
}

Fixed version (ground truth):
/** 
 * Sets an indexed property in this object.
 * @param index          the index of the property
 * @param start          the object in which the lookup began
 * @param value          the value to set
 */
public void put(int index,Scriptable start,Object value){
  if (data instanceof Array) {
    ((Array)data).set(index,value);
  }
}
Program: 7503
Project: 7503
Buggy source:
/** 
 * Loads an object from the specified location. The path may locate either an index or a specific object. In case of an index, the data returned is an index dictionary listing of all objects in it.
 * @param path           the storage location
 * @return the data read, ornull if not found
 */
public Object load(Path path){
  File file=locateFile(path);
  String msg;
  if (file == null) {
    return path.isIndex() ? new Index() : null;
  }
 else   if (path.isIndex()) {
    Index idx=new Index();
    File[] files=file.listFiles();
    for (int i=0; i < files.length; i++) {
      String name=files[i].getName();
      if (files[i].isDirectory()) {
        idx.addIndex(name);
      }
 else {
        idx.addObject(StringUtils.removeEnd(name,SUFFIX_PROPS));
      }
    }
    idx.updateLastModified(new Date(file.lastModified()));
    return idx;
  }
 else   if (file.getName().endsWith(SUFFIX_PROPS)) {
    try {
      return PropertiesSerializer.read(file);
    }
 catch (    FileNotFoundException e) {
      msg="String_Node_Str" + file.toString();
      LOG.log(Level.SEVERE,msg,e);
      return null;
    }
catch (    IOException e) {
      msg="String_Node_Str" + file.toString();
      LOG.log(Level.SEVERE,msg,e);
      return null;
    }
  }
 else {
    return file;
  }
}

Fixed version (ground truth):
/** 
 * Loads an object from the specified location. The path may locate either an index or a specific object. In case of an index, the data returned is an index dictionary listing of all objects in it.
 * @param path           the storage location
 * @return the data read, ornull if not found
 */
public Object load(Path path){
  File file=locateFile(path);
  String msg;
  if (file == null) {
    return null;
  }
 else   if (path.isIndex()) {
    Index idx=new Index();
    File[] files=file.listFiles();
    for (int i=0; i < files.length; i++) {
      String name=files[i].getName();
      if (files[i].isDirectory()) {
        idx.addIndex(name);
      }
 else {
        idx.addObject(StringUtils.removeEnd(name,SUFFIX_PROPS));
      }
    }
    idx.updateLastModified(new Date(file.lastModified()));
    return idx;
  }
 else   if (file.getName().endsWith(SUFFIX_PROPS)) {
    try {
      return PropertiesSerializer.read(file);
    }
 catch (    FileNotFoundException e) {
      msg="String_Node_Str" + file.toString();
      LOG.log(Level.SEVERE,msg,e);
      return null;
    }
catch (    IOException e) {
      msg="String_Node_Str" + file.toString();
      LOG.log(Level.SEVERE,msg,e);
      return null;
    }
  }
 else {
    return file;
  }
}
Program: 7505
Project: 7505
Buggy source:
/** 
 * Converts the query result set into an array of row data objects.
 * @param meta           the result set meta-data
 * @param rs             the result set to convert
 * @param flags          the processing and mapping flags
 * @return the data array object with all the result data
 * @throws AdapterException if the result data couldn't be read
 */
protected Data createRowData(ResultSetMetaData meta,ResultSet rs,String flags) throws AdapterException {
  boolean flagColumnNames=hasFlag(flags,"String_Node_Str",true);
  boolean flagNativeTypes=hasFlag(flags,"String_Node_Str",true);
  boolean flagSingleRow=hasFlag(flags,"String_Node_Str",false);
  int colCount;
  Data rows=new Data(10);
  Data obj;
  Object value;
  try {
    colCount=meta.getColumnCount();
    while (rs.next()) {
      obj=flagColumnNames ? new Data() : new Data(colCount);
      for (int i=0; i < colCount; i++) {
        value=createValue(meta,rs,i + 1,flagNativeTypes);
        if (flagColumnNames) {
          obj.add(meta.getColumnName(i + 1).toLowerCase(),value);
        }
 else {
          obj.add(value);
        }
      }
      rows.add(obj);
    }
  }
 catch (  SQLException e) {
    throw new AdapterException("String_Node_Str" + e.getMessage());
  }
  if (flagSingleRow) {
    if (rows.arraySize() < 1) {
      return null;
    }
 else     if (rows.arraySize() == 1) {
      return rows.getData(0);
    }
 else {
      throw new AdapterException("String_Node_Str" + "String_Node_Str" + rows.arraySize());
    }
  }
  return rows;
}

Fixed version (ground truth):
/** 
 * Converts the query result set into an array of row data objects.
 * @param meta           the result set meta-data
 * @param rs             the result set to convert
 * @param flags          the processing and mapping flags
 * @return the data array object with all the result data
 * @throws AdapterException if the result data couldn't be read
 */
protected Data createRowData(ResultSetMetaData meta,ResultSet rs,String flags) throws AdapterException {
  boolean flagColumnNames=hasFlag(flags,"String_Node_Str",true);
  boolean flagNativeTypes=hasFlag(flags,"String_Node_Str",true);
  boolean flagSingleRow=hasFlag(flags,"String_Node_Str",false);
  int colCount;
  Data rows=new Data(10);
  Data obj;
  Object value;
  try {
    colCount=meta.getColumnCount();
    while (rs.next()) {
      obj=flagColumnNames ? new Data() : new Data(colCount);
      for (int i=0; i < colCount; i++) {
        value=createValue(meta,rs,i + 1,flagNativeTypes);
        if (flagColumnNames) {
          obj.add(meta.getColumnLabel(i + 1).toLowerCase(),value);
        }
 else {
          obj.add(value);
        }
      }
      rows.add(obj);
    }
  }
 catch (  SQLException e) {
    throw new AdapterException("String_Node_Str" + e.getMessage());
  }
  if (flagSingleRow) {
    if (rows.arraySize() < 1) {
      return null;
    }
 else     if (rows.arraySize() == 1) {
      return rows.getData(0);
    }
 else {
      throw new AdapterException("String_Node_Str" + "String_Node_Str" + rows.arraySize());
    }
  }
  return rows;
}
Program: 7506
Project: 7506
Buggy source:
/** 
 * Converts the query meta-data into an array of column data objects.
 * @param meta           the result set meta-data to convert
 * @param flags          the processing and mapping flags
 * @return the data array object with all the column information
 * @throws AdapterException if the result data couldn't be read
 */
protected Data createColumnData(ResultSetMetaData meta,String flags) throws AdapterException {
  Data cols;
  Data obj;
  int colCount;
  try {
    colCount=meta.getColumnCount();
    cols=new Data(colCount);
    for (int i=0; i < colCount; i++) {
      obj=new Data();
      obj.set("String_Node_Str",meta.getColumnName(i + 1).toLowerCase());
      obj.set("String_Node_Str",meta.getCatalogName(i + 1));
      obj.set("String_Node_Str",meta.getColumnTypeName(i + 1));
      obj.setInt("String_Node_Str",meta.getColumnType(i + 1));
      obj.set("String_Node_Str",meta.getSchemaName(i + 1));
      obj.set("String_Node_Str",meta.getTableName(i + 1));
      obj.set("String_Node_Str",meta.getColumnName(i + 1));
      cols.add(obj);
    }
  }
 catch (  SQLException e) {
    throw new AdapterException("String_Node_Str" + e.getMessage());
  }
  return cols;
}

Fixed version (ground truth):
/** 
 * Converts the query meta-data into an array of column data objects.
 * @param meta           the result set meta-data to convert
 * @param flags          the processing and mapping flags
 * @return the data array object with all the column information
 * @throws AdapterException if the result data couldn't be read
 */
protected Data createColumnData(ResultSetMetaData meta,String flags) throws AdapterException {
  Data cols;
  Data obj;
  int colCount;
  try {
    colCount=meta.getColumnCount();
    cols=new Data(colCount);
    for (int i=0; i < colCount; i++) {
      obj=new Data();
      obj.set("String_Node_Str",meta.getColumnLabel(i + 1).toLowerCase());
      obj.set("String_Node_Str",meta.getCatalogName(i + 1));
      obj.set("String_Node_Str",meta.getColumnTypeName(i + 1));
      obj.setInt("String_Node_Str",meta.getColumnType(i + 1));
      obj.set("String_Node_Str",meta.getSchemaName(i + 1));
      obj.set("String_Node_Str",meta.getTableName(i + 1));
      obj.set("String_Node_Str",meta.getColumnName(i + 1));
      cols.add(obj);
    }
  }
 catch (  SQLException e) {
    throw new AdapterException("String_Node_Str" + e.getMessage());
  }
  return cols;
}
Program: 7507
Project: 7507
Buggy source:
/** 
 * Converts a specific row column value to a scriptable object. Normally this means returning a simple string containing the value. If the native types flag is set, SQL types will be converted into their native Java object types by the JDBC driver.
 * @param meta           the result set meta-data
 * @param rs             the result set to convert
 * @param column         the column index
 * @param nativeTypes    the native value types flag
 * @return the scriptable object with the column value
 * @throws AdapterException if the result data couldn't be read
 */
protected Object createValue(ResultSetMetaData meta,ResultSet rs,int column,boolean nativeTypes) throws AdapterException {
  try {
switch (meta.getColumnType(column)) {
case Types.DATE:
case Types.TIMESTAMP:
      try {
        return DateUtil.formatIsoDateTime(rs.getTimestamp(column));
      }
 catch (      SQLException e) {
        return null;
      }
default :
    if (nativeTypes) {
      return rs.getObject(column);
    }
 else {
      return rs.getString(column);
    }
}
}
 catch (SQLException e) {
throw new AdapterException("String_Node_Str" + "String_Node_Str" + column + "String_Node_Str"+ e.getMessage());
}
}

Fixed version (ground truth):
/** 
 * Converts a specific row column value to a scriptable object. Normally this means returning a simple string containing the value. If the native types flag is set, SQL types will be converted into their native Java object types by the JDBC driver.
 * @param meta           the result set meta-data
 * @param rs             the result set to convert
 * @param column         the column index
 * @param nativeTypes    the native value types flag
 * @return the scriptable object with the column value
 * @throws AdapterException if the result data couldn't be read
 */
protected Object createValue(ResultSetMetaData meta,ResultSet rs,int column,boolean nativeTypes) throws AdapterException {
  try {
switch (meta.getColumnType(column)) {
case Types.DATE:
case Types.TIMESTAMP:
      try {
        return DateUtil.formatIsoDateTime(rs.getTimestamp(column));
      }
 catch (      SQLException e) {
        return null;
      }
default :
    if (nativeTypes) {
      Object value=rs.getObject(column);
      return isNativeValue(value) ? value : rs.getString(column);
    }
 else {
      return rs.getString(column);
    }
}
}
 catch (SQLException e) {
throw new AdapterException("String_Node_Str" + "String_Node_Str" + column + "String_Node_Str"+ e.getMessage());
}
}
Program: 7509
Project: 7509
Buggy source:
public void transform(XmlConfiguration configuration){
  InputStream in=null;
  Document doc=null;
  String xmlFile=configuration.getFileName();
  try {
    displayMessageln(xmlFile);
    in=new BufferedInputStream(new FileInputStream(xmlFile));
    DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
    doc=docBuilder.parse(in);
    applyTransformation(configuration,doc);
  }
 catch (  SAXException ex) {
    Logger.getLogger(XPathTransformer.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  ParserConfigurationException ex) {
    Logger.getLogger(XPathTransformer.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  IOException ioex) {
    Logger.getLogger(XPathTransformer.class.getName()).log(Level.SEVERE,null,ioex);
  }
 finally {
    IOUtils.closeQuietly(in);
  }
  if (doc != null) {
    saveDoc(xmlFile,doc);
  }
}

Fixed version (ground truth):
public void transform(XmlConfiguration configuration){
  InputStream in=null;
  Document doc=null;
  String xmlFile=configuration.getFileName();
  try {
    displayMessageln(xmlFile);
    in=new BufferedInputStream(new FileInputStream(xmlFile));
    DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
    docFactory.setValidating(false);
    DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
    docBuilder.setEntityResolver(new ClasspathEntityResolver(null));
    doc=docBuilder.parse(in);
    applyTransformation(configuration,doc);
  }
 catch (  SAXException ex) {
    Logger.getLogger(XPathTransformer.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  ParserConfigurationException ex) {
    Logger.getLogger(XPathTransformer.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  IOException ioex) {
    Logger.getLogger(XPathTransformer.class.getName()).log(Level.SEVERE,null,ioex);
  }
 finally {
    IOUtils.closeQuietly(in);
  }
  if (doc != null) {
    saveDoc(xmlFile,doc);
  }
}
Program: 7510
Project: 7510
Buggy source:
/** 
 * Create a new node (element or attribute) to be inserted into the target node as a child or attribute.
 * @param doc DOM document
 * @param target the target ode
 * @param value the value for creating the new node.
 */
public void createNewNode(Document doc,Node target,Value value){
  if (value.getLocation().startsWith("String_Node_Str")) {
    Attr result=doc.createAttribute(value.getLocation().substring(1));
    result.setValue(value.getValue());
    target.getAttributes().setNamedItem(result);
  }
 else {
    Element result=doc.createElement(value.getLocation());
    result.setNodeValue(value.getValue());
    target.appendChild(result);
  }
}

Fixed version (ground truth):
/** 
 * Create a new node (element or attribute) to be inserted into the target node as a child or attribute.
 * @param doc DOM document
 * @param target the target ode
 * @param value the value for creating the new node.
 */
public void createNewNode(Document doc,Node target,Value value){
  if (value.getLocation().startsWith("String_Node_Str")) {
    Attr newAttribute=doc.createAttribute(value.getLocation().substring(1));
    newAttribute.setValue(value.getValue());
    target.getAttributes().setNamedItem(newAttribute);
  }
 else {
    Element newElement=doc.createElement(value.getLocation());
    newElement.setTextContent(value.getValue());
    target.appendChild(newElement);
  }
}
Program: 7512
Project: 7512
Buggy source:
/** 
 * Transform the DOM tree using the configuration.
 * @param configuration the transformation configuration.
 * @param doc the DOM tree to be updated.
 */
protected void applyTransformation(XmlConfiguration configuration,Document doc){
  List<Parameter> parameters=configuration.getParameters();
  for (  Parameter parameter : parameters) {
    displayMessageln("String_Node_Str" + parameter.getKey() + "String_Node_Str"+ parameter.getMode()+ "String_Node_Str");
    Node rootXpathNode=getMatchingNode(parameter.getKey(),doc);
    if (rootXpathNode != null) {
      for (      Value value : parameter.getValues()) {
switch (value.getMode()) {
case XmlTreeHandler.MODE_INSERT:
{
            createNewNode(doc,rootXpathNode,value);
          }
        break;
case XmlTreeHandler.MODE_DELETE:
{
        Node deletedNode=getMatchingNode(value.getLocation(),rootXpathNode);
        rootXpathNode.removeChild(deletedNode);
      }
    break;
case XmlTreeHandler.MODE_UPDATE:
{
    Node oldNode=getMatchingNode(value.getLocation(),rootXpathNode);
    if (oldNode == null) {
      createNewNode(doc,rootXpathNode,value);
    }
 else {
      Node newNode=oldNode.cloneNode(true);
      if (newNode instanceof Element) {
        ((Element)newNode).setNodeValue(value.getValue());
        rootXpathNode.replaceChild(oldNode,newNode);
      }
 else {
        ((Attr)newNode).setValue(value.getValue());
        rootXpathNode.getAttributes().setNamedItem(newNode);
      }
    }
    break;
  }
}
}
}
}
}

Fixed version (ground truth):
/** 
 * Transform the DOM tree using the configuration.
 * @param configuration the transformation configuration.
 * @param doc the DOM tree to be updated.
 */
protected void applyTransformation(XmlConfiguration configuration,Document doc){
  List<Parameter> parameters=configuration.getParameters();
  for (  Parameter parameter : parameters) {
    displayMessageln("String_Node_Str" + parameter.getKey() + "String_Node_Str"+ parameter.getMode()+ "String_Node_Str");
    Node rootXpathNode=getMatchingNode(parameter.getKey(),doc);
    if (rootXpathNode != null) {
      for (      Value value : parameter.getValues()) {
switch (value.getMode()) {
case XmlTreeHandler.MODE_INSERT:
{
            createNewNode(doc,rootXpathNode,value);
          }
        break;
case XmlTreeHandler.MODE_DELETE:
{
        Node deletedNode=getMatchingNode(value.getLocation(),rootXpathNode);
        rootXpathNode.removeChild(deletedNode);
      }
    break;
case XmlTreeHandler.MODE_UPDATE:
{
    Node oldNode=getMatchingNode(value.getLocation(),rootXpathNode);
    if (oldNode == null) {
      createNewNode(doc,rootXpathNode,value);
    }
 else {
      Node newNode=oldNode.cloneNode(true);
      if (oldNode instanceof Element) {
        ((Element)newNode).setTextContent(value.getValue());
        rootXpathNode.replaceChild(newNode,oldNode);
      }
 else {
        ((Attr)newNode).setValue(value.getValue());
        rootXpathNode.getAttributes().setNamedItem(newNode);
      }
    }
    break;
  }
}
}
}
}
}
Program: 7513
Project: 7513
Buggy source:
public void loadArray(SlaveArray array){
  int startPort=(int)array.getStartPort();
  int portCount=(int)array.getCount();
  int statusCount=(int)array.getPointWidth().getStatus();
  int analogCount=(int)array.getPointWidth().getAnalog();
  int counterCount=(int)array.getPointWidth().getCounter();
  StackConfig config=new StackConfig(statusCount,analogCount,counterCount);
  for (int i=0; i < portCount; i++) {
    int port=startPort + i;
    String portName="String_Node_Str" + port;
    stacks.addPort(portName,port);
    stacks.addStack("String_Node_Str" + port,portName,config);
  }
}

Fixed version (ground truth):
public void loadArray(SlaveArray array){
  int startPort=(int)array.getStartPort();
  int portCount=(int)array.getCount();
  int statusCount=(int)array.getPointWidth().getStatus();
  int analogCount=(int)array.getPointWidth().getAnalog();
  int counterCount=(int)array.getPointWidth().getCounter();
  StackConfig config=new StackConfig(statusCount,analogCount,counterCount);
  for (int i=0; i < portCount; i++) {
    int port=startPort + i;
    System.out.println("String_Node_Str" + port);
    String portName="String_Node_Str" + port;
    stacks.addPort(portName,port);
    stacks.addStack("String_Node_Str" + port,portName,config);
  }
}
Program: 7514
Project: 7514
Buggy source:
public static void main(String[] args){
  StackSet set=new StackSet();
  StackConfig config=new StackConfig(5,5,5);
  set.addPort("String_Node_Str",50000);
  set.addStack("String_Node_Str","String_Node_Str",config);
  System.out.println("String_Node_Str");
  try {
    System.in.read();
  }
 catch (  IOException ex) {
    System.out.println("String_Node_Str" + ex);
  }
  set.removeAllStacks();
  set.removeAllPorts();
  set.stop();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  if (args.length < 1) {
    throw new Exception("String_Node_Str");
  }
  SimNode config=loadXml(args[0]);
  if (config == null)   throw new RuntimeException("String_Node_Str");
  SimulationManager mgr=new SimulationManager(config);
  mgr.start();
  System.out.println("String_Node_Str");
  try {
    System.in.read();
  }
 catch (  IOException ex) {
    System.out.println("String_Node_Str" + ex);
  }
  mgr.stop();
}
Program: 7515
Project: 7515
Buggy source:
public StackSet(){
  dnp.AddLogHook(new ConsoleLogAdapter());
}

Fixed version (ground truth):
public StackSet(){
  dnp.AddLogHook(logAdapter);
}
Program: 7516
Project: 7516
Buggy source:
public void addStack(String name,String portName,StackConfig config){
  CommandAcceptor cmdAcceptor=new CommandAcceptor();
  IDataObserver obs=dnp.AddSlave(portName,name,FilterLevel.LEV_INFO,cmdAcceptor,config.buildConfig());
  stackMap.put(name,obs);
}

Fixed version (ground truth):
public void addStack(String name,String portName,StackConfig config){
  CommandAcceptor cmdAcceptor=new CommandAcceptor();
  SlaveStackConfig cfg=config.buildConfig();
  IDataObserver obs=dnp.AddSlave(portName,name,FilterLevel.LEV_DEBUG,cmdAcceptor,cfg);
  stackMap.put(name,new StackItems(obs,cmdAcceptor));
}
Program: 7517
Project: 7517
Buggy source:
public void addPort(String name,int port){
  PhysLayerSettings phys=new PhysLayerSettings(FilterLevel.LEV_INFO,5000);
  dnp.AddTCPServer(name,phys,"String_Node_Str",port);
}

Fixed version (ground truth):
public void addPort(String name,int port){
  PhysLayerSettings phys=new PhysLayerSettings(FilterLevel.LEV_DEBUG,5000);
  dnp.AddTCPServer(name,phys,"String_Node_Str",port);
}
Program: 7518
Project: 7518
Buggy source:
@Override public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  Player player=(Player)sender;
  if (!HelperFunctions.isAdmin(player)) {
    player.sendMessage("String_Node_Str");
    return true;
  }
  World world=sender.getServer().getWorld("String_Node_Str");
  List<LivingEntity> mobs=world.getLivingEntities();
  for (Iterator<LivingEntity> iterator=mobs.iterator(); iterator.hasNext(); ) {
    LivingEntity m=iterator.next();
    if (isAnimal(m)) {
      m.setHealth(0);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  Player player=(Player)sender;
  if (!HelperFunctions.isAdmin(player)) {
    player.sendMessage("String_Node_Str");
    return true;
  }
  World world=sender.getServer().getWorld("String_Node_Str");
  List<LivingEntity> mobs=world.getLivingEntities();
  for (Iterator<LivingEntity> iterator=mobs.iterator(); iterator.hasNext(); ) {
    LivingEntity m=iterator.next();
    if (isAnimal(m)) {
      if (m instanceof Wolf) {
        m.setHealth(100);
      }
      m.setHealth(0);
    }
  }
  return true;
}
Program: 7519
Project: 7519
Buggy source:
@Override public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  Player player=(Player)sender;
  Block chestToLock=player.getTargetBlock(null,5);
  if (chestToLock.getTypeId() == 54) {
    String owner=chestFunctions.getOwner(chestToLock.getLocation());
    if (owner.equalsIgnoreCase(player.getName())) {
      ChestData myChest=chestFunctions.getChest(chestToLock.getLocation());
      myChest.setName("String_Node_Str");
      chestFunctions.plugin.getDatabase().save(myChest);
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  Player player=(Player)sender;
  Block chestToLock=player.getTargetBlock(null,5);
  if (chestToLock.getTypeId() == 54) {
    String owner=chestFunctions.getOwner(chestToLock.getLocation());
    if (owner.equalsIgnoreCase(player.getName()) || HelperFunctions.isAdmin(player)) {
      ChestData myChest=chestFunctions.getChest(chestToLock.getLocation());
      myChest.setName("String_Node_Str");
      chestFunctions.plugin.getDatabase().save(myChest);
      player.sendMessage("String_Node_Str");
    }
  }
  return true;
}
Program: 7520
Project: 7520
Buggy source:
@Override public void onBlockBreak(BlockBreakEvent event){
switch (event.getBlock().getType()) {
case CHEST:
    if (plugin.chestFunctions.doesUserOwnChest("String_Node_Str",event.getBlock().getLocation())) {
      System.out.println("String_Node_Str" + event.getBlock().getLocation().toString());
      return;
    }
 else     if (plugin.chestFunctions.doesUserOwnChest(event.getPlayer().getName(),event.getBlock().getLocation())) {
      System.out.println("String_Node_Str" + event.getBlock().getLocation().toString());
      return;
    }
 else {
      event.setCancelled(true);
      event.getPlayer().sendMessage("String_Node_Str");
      return;
    }
default :
  return;
}
}

Fixed version (ground truth):
@Override public void onBlockBreak(BlockBreakEvent event){
  if (event.isCancelled()) {
    return;
  }
switch (event.getBlock().getType()) {
case CHEST:
    Player player=event.getPlayer();
  if (HelperFunctions.isAdmin(player)) {
    player.sendMessage("String_Node_Str" + plugin.chestFunctions.getOwner(event.getBlock().getLocation()) + "String_Node_Str");
    return;
  }
if (plugin.chestFunctions.isPublicChest(event.getBlock().getLocation())) {
  System.out.println("String_Node_Str" + event.getBlock().getLocation().toString());
  return;
}
if (plugin.chestFunctions.doesUserOwnChest(event.getPlayer().getName(),event.getBlock().getLocation())) {
System.out.println("String_Node_Str" + event.getBlock().getLocation().toString());
return;
}
event.setCancelled(true);
event.getPlayer().sendMessage("String_Node_Str");
return;
default :
return;
}
}
Program: 7521
Project: 7521
Buggy source:
@Override public void onPlayerInteract(PlayerInteractEvent event){
switch (event.getAction()) {
case RIGHT_CLICK_BLOCK:
    Block myBlock=event.getClickedBlock();
  if (myBlock.getTypeId() == 54) {
    Player player=event.getPlayer();
    if (plugin.rankFunctions.getRank(player.getName()) >= 5) {
      player.sendMessage("String_Node_Str" + plugin.chestFunctions.getOwner(myBlock.getLocation()) + "String_Node_Str");
      return;
    }
    if (plugin.chestFunctions.isPublicChest(myBlock.getLocation())) {
      player.sendMessage("String_Node_Str");
      return;
    }
 else     if (plugin.chestFunctions.doesUserOwnChest(player.getName(),event.getClickedBlock().getLocation())) {
      player.sendMessage("String_Node_Str");
      return;
    }
 else {
      player.sendMessage("String_Node_Str" + plugin.chestFunctions.getOwner(myBlock.getLocation()));
      player.sendMessage("String_Node_Str");
      event.setCancelled(true);
      return;
    }
  }
default :
return;
}
}

Fixed version (ground truth):
@Override public void onPlayerInteract(PlayerInteractEvent event){
switch (event.getAction()) {
case RIGHT_CLICK_BLOCK:
    Block myBlock=event.getClickedBlock();
  if (myBlock.getTypeId() == 54) {
    Player player=event.getPlayer();
    if (HelperFunctions.isAdmin(player)) {
      player.sendMessage("String_Node_Str" + plugin.chestFunctions.getOwner(myBlock.getLocation()) + "String_Node_Str");
      return;
    }
    if (plugin.chestFunctions.isPublicChest(myBlock.getLocation())) {
      player.sendMessage("String_Node_Str");
      return;
    }
 else     if (plugin.chestFunctions.doesUserOwnChest(player.getName(),event.getClickedBlock().getLocation())) {
      player.sendMessage("String_Node_Str");
      return;
    }
 else {
      player.sendMessage("String_Node_Str" + plugin.chestFunctions.getOwner(myBlock.getLocation()));
      player.sendMessage("String_Node_Str");
      event.setCancelled(true);
      return;
    }
  }
default :
return;
}
}
Program: 7522
Project: 7522
Buggy source:
public boolean isNewPlayer(Player player){
  String name=player.getName();
  RankData playerRank=plugin.getDatabase().find(RankData.class).where().ieq("String_Node_Str",name).ieq("String_Node_Str",player.getName()).findUnique();
  if (playerRank == null) {
    playerRank=new RankData();
    playerRank.setPlayer(player);
    playerRank.setName(name);
    playerRank.setRank(0);
    BankData newAccount=new BankData();
    newAccount.setPlayer(player);
    newAccount.setPlayerName(name);
    newAccount.setBalance(500);
    plugin.getDatabase().save(playerRank);
    plugin.getDatabase().save(newAccount);
    plugin.getServer().broadcastMessage("String_Node_Str" + player.getName() + "String_Node_Str");
    player.sendMessage("String_Node_Str" + player.getName());
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isNewPlayer(Player player){
  String name=player.getName();
  RankData playerRank=plugin.getDatabase().find(RankData.class).where().ieq("String_Node_Str",name).ieq("String_Node_Str",player.getName()).findUnique();
  if (playerRank == null) {
    playerRank=new RankData();
    playerRank.setPlayer(player);
    playerRank.setName(name);
    playerRank.setRank(0);
    BankData newAccount=new BankData();
    newAccount.setPlayer(player);
    newAccount.setPlayerName(name);
    newAccount.setBalance(500);
    plugin.getDatabase().save(playerRank);
    plugin.getDatabase().save(newAccount);
    plugin.getServer().broadcastMessage("String_Node_Str" + player.getName() + "String_Node_Str");
    player.sendMessage("String_Node_Str" + player.getName());
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    player.sendMessage("String_Node_Str");
    return true;
  }
  BankData bankAccount=plugin.getDatabase().find(BankData.class).where().ieq("String_Node_Str",name).ieq("String_Node_Str",player.getName()).findUnique();
  if (bankAccount == null) {
    BankData newAccount=new BankData();
    newAccount.setPlayer(player);
    newAccount.setPlayerName(name);
    newAccount.setBalance(500);
    plugin.getDatabase().save(newAccount);
    player.sendMessage("String_Node_Str");
  }
  return false;
}
Program: 7523
Project: 7523
Buggy source:
@Override public void onBlockBurn(BlockBurnEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (event.getBlock().getTypeId() == 18) {
    event.setCancelled(true);
    return;
  }
}

Fixed version (ground truth):
@Override public void onBlockBurn(BlockBurnEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (event.getBlock().getType() == Material.LEAVES) {
    event.setCancelled(true);
    return;
  }
}
Program: 7524
Project: 7524
Buggy source:
protected void backup(){
  String startBackupMessage="String_Node_Str";
  System.out.println(startBackupMessage);
  server.broadcastMessage(startBackupMessage);
  ConsoleCommandSender ccs=new ConsoleCommandSender(server);
  server.dispatchCommand(ccs,"String_Node_Str");
  server.dispatchCommand(ccs,"String_Node_Str");
  server.savePlayers();
  try {
    boolean hasToZIP=true;
    for (    World world : server.getWorlds()) {
      String backupDir="String_Node_Str".concat("String_Node_Str").concat(world.getName());
      backupDir=backupDir.concat(this.getDate());
      world.save();
      FileUtils.copyDirectory(new File(world.getName()),new File(backupDir));
      String targetName=world.getName();
      String targetDir="String_Node_Str".concat("String_Node_Str");
      if (backupName != null) {
        targetName=backupName;
        targetDir=targetDir.concat("String_Node_Str").concat("String_Node_Str");
      }
      if (hasToZIP) {
        FileUtils.zipDirectory(backupDir,targetDir.concat(targetName).concat(getDate()));
        FileUtils.deleteDirectory(new File(backupDir));
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace(System.out);
  }
  server.dispatchCommand(ccs,"String_Node_Str");
  String completedBackupMessage="String_Node_Str";
  server.broadcastMessage(completedBackupMessage);
  System.out.println(completedBackupMessage);
  deleteOldBackups();
  backupName=null;
}

Fixed version (ground truth):
protected void backup(){
  String startBackupMessage="String_Node_Str";
  System.out.println(startBackupMessage);
  server.broadcastMessage(startBackupMessage);
  ConsoleCommandSender ccs=new ConsoleCommandSender(server);
  server.dispatchCommand(ccs,"String_Node_Str");
  server.dispatchCommand(ccs,"String_Node_Str");
  server.savePlayers();
  try {
    World world=server.getWorld("String_Node_Str");
    String backupDir="String_Node_Str".concat(FILE_SEPARATOR).concat(world.getName());
    world.save();
    FileUtils.copyDirectory(new File(world.getName()),new File(backupDir));
    String targetName=world.getName();
    String targetDir="String_Node_Str".concat(FILE_SEPARATOR);
    if (backupName != null) {
      targetName=backupName;
      targetDir=targetDir.concat(FILE_SEPARATOR);
    }
    FileUtils.zipDirectory(backupDir,targetDir.concat(targetName).concat(getDate()));
    FileUtils.deleteDirectory(new File(backupDir));
  }
 catch (  Exception e) {
    e.printStackTrace(System.out);
  }
  server.dispatchCommand(ccs,"String_Node_Str");
  String completedBackupMessage="String_Node_Str";
  server.broadcastMessage(completedBackupMessage);
  System.out.println(completedBackupMessage);
  deleteOldBackups();
  backupName=null;
}
Program: 7526
Project: 7526
Buggy source:
@Override public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  Player player=(Player)sender;
  Block chestToLock=player.getTargetBlock(null,5);
  if (chestToLock.getTypeId() == 54) {
    String owner=chestFunctions.getOwner(chestToLock.getLocation());
    if (owner.equalsIgnoreCase(player.getName()) || HelperFunctions.isAdmin(player)) {
      ChestData myChest=chestFunctions.getChest(chestToLock.getLocation());
      myChest.setName("String_Node_Str");
      chestFunctions.plugin.getDatabase().save(myChest);
      player.sendMessage("String_Node_Str");
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onCommand(CommandSender sender,Command command,String label,String[] args){
  Player player=(Player)sender;
  Block chestToLock=player.getTargetBlock(null,5);
  if (chestToLock.getTypeId() == 54) {
    String owner=chestFunctions.getOwner(chestToLock.getLocation());
    if (owner.equalsIgnoreCase(player.getName())) {
      ChestData myChest=chestFunctions.getChest(chestToLock.getLocation());
      myChest.setName("String_Node_Str");
      chestFunctions.plugin.getDatabase().save(myChest);
      BlockFace[] faces=new BlockFace[]{BlockFace.NORTH,BlockFace.SOUTH,BlockFace.EAST,BlockFace.WEST};
      for (      BlockFace blockFace : faces) {
        Block face=chestToLock.getFace(blockFace);
        if (face.getTypeId() == 54) {
          ChestData thatChest=chestFunctions.getChest(face.getLocation());
          thatChest.setName("String_Node_Str");
          chestFunctions.plugin.getDatabase().save(thatChest);
        }
      }
      player.sendMessage(ChatColor.DARK_PURPLE + "String_Node_Str");
    }
  }
  return true;
}
Program: 7527
Project: 7527
Buggy source:
@Override public void onPlayerRespawn(PlayerRespawnEvent event){
  ItemStack item=new ItemStack(Material.GOLD_AXE,1);
  event.getPlayer().setItemInHand(item);
}

Fixed version (ground truth):
@Override public void onPlayerRespawn(PlayerRespawnEvent event){
  Player p=event.getPlayer();
  p.sendMessage("String_Node_Str");
}
Program: 7529
Project: 7529
Buggy source:
@Override public void onEnable(){
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.PLAYER_CHAT,this.playerListener,Priority.Low,this);
  pm.registerEvent(Event.Type.PLAYER_LOGIN,this.playerListener,Priority.Low,this);
  pm.registerEvent(Event.Type.BLOCK_PLACED,this.blockListener,Priority.Lowest,this);
  pm.registerEvent(Event.Type.BLOCK_INTERACT,this.blockListener,Priority.Lowest,this);
  pm.registerEvent(Event.Type.BLOCK_DAMAGED,this.blockListener,Priority.Lowest,this);
  pm.registerEvent(Event.Type.BLOCK_BREAK,this.blockListener,Priority.Lowest,this);
  PluginDescriptionFile pdfFile=this.getDescription();
  System.out.println(pdfFile.getName() + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEnable(){
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Event.Type.PLAYER_CHAT,this.playerListener,Priority.Low,this);
  pm.registerEvent(Event.Type.PLAYER_LOGIN,this.playerListener,Priority.Low,this);
  pm.registerEvent(Event.Type.BLOCK_PLACED,this.blockListener,Priority.Lowest,this);
  pm.registerEvent(Event.Type.BLOCK_INTERACT,this.blockListener,Priority.Lowest,this);
  pm.registerEvent(Event.Type.BLOCK_DAMAGED,this.blockListener,Priority.Lowest,this);
  pm.registerEvent(Event.Type.BLOCK_BREAK,this.blockListener,Priority.Lowest,this);
  PluginDescriptionFile pdfFile=this.getDescription();
  System.out.println(pdfFile.getName() + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
  chestMachine.Load();
  rankMachine.Load();
}
Program: 7530
Project: 7530
Buggy source:
@Override public void onDisable(){
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onDisable(){
  chestMachine.Save();
  rankMachine.Save();
  System.out.println("String_Node_Str");
}
Program: 7531
Project: 7531
Buggy source:
@Override public void onBlockPlace(BlockPlaceEvent event){
  Player p=event.getPlayer();
  if (ARGAntiPirate.rankMachine.getRank(p) <= 0) {
    p.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
 else {
    Block placedBlock=event.getBlock();
    Location chestLocation=placedBlock.getLocation();
    if ((event.getItemInHand().getTypeId() == 54 && event.getBlockReplacedState().getTypeId() == 78)) {
      double Ypos=placedBlock.getLocation().getY();
      chestLocation.setY(Ypos - 1);
    }
 else     if (placedBlock.getTypeId() == 54) {
      placedBlock=placedBlock.getWorld().getBlockAt(chestLocation);
      ARGAntiPirate.chestMachine.lockIt(p,placedBlock);
    }
  }
}

Fixed version (ground truth):
@Override public void onBlockPlace(BlockPlaceEvent event){
  Player p=event.getPlayer();
  if (ARGAntiPirate.rankMachine.getRank(p) <= 0) {
    p.sendMessage(ChatColor.RED + "String_Node_Str");
    event.setCancelled(true);
    return;
  }
  Block placedBlock=event.getBlock();
  Location chestLocation=placedBlock.getLocation();
  if (placedBlock.getTypeId() == 54) {
    if (ARGAntiPirate.chestMachine.lockIt(p,placedBlock)) {
      return;
    }
 else {
      event.setCancelled(true);
    }
  }
 else   if ((event.getItemInHand().getTypeId() == 54 && event.getBlockReplacedState().getTypeId() == 78)) {
    double Ypos=placedBlock.getLocation().getY();
    chestLocation.setY(Ypos - 1);
    placedBlock=placedBlock.getWorld().getBlockAt(chestLocation);
    if (ARGAntiPirate.chestMachine.lockIt(p,placedBlock)) {
      return;
    }
 else {
      event.setCancelled(true);
    }
  }
}
Program: 7532
Project: 7532
Buggy source:
@Override public void onPlayerChat(PlayerChatEvent event){
  Player player=event.getPlayer();
  int myRank=ARGAntiPirate.rankMachine.getRank(player);
switch (myRank) {
case 0:
    player.setDisplayName(ChatColor.RED + player.getName() + ChatColor.WHITE);
  return;
case 1:
player.setDisplayName(ChatColor.GRAY + player.getName() + ChatColor.WHITE);
return;
case 2:
player.setDisplayName(ChatColor.DARK_GRAY + player.getName() + ChatColor.WHITE);
return;
case 3:
player.setDisplayName(ChatColor.DARK_PURPLE + player.getName() + ChatColor.WHITE);
return;
case 4:
player.setDisplayName(ChatColor.GREEN + player.getName() + ChatColor.WHITE);
return;
case 5:
player.setDisplayName(ChatColor.GOLD + player.getName() + ChatColor.WHITE);
return;
}
player.setDisplayName(ChatColor.RED + player.getName() + ChatColor.WHITE);
}

Fixed version (ground truth):
@Override public void onPlayerChat(PlayerChatEvent event){
  Player player=event.getPlayer();
  int myRank=ARGAntiPirate.rankMachine.getRank(player);
  if (player.getName().equalsIgnoreCase("String_Node_Str")) {
    player.setDisplayName(ChatColor.DARK_PURPLE + player.getName() + ChatColor.WHITE);
  }
 else {
switch (myRank) {
case 0:
      player.setDisplayName(ChatColor.RED + player.getName() + ChatColor.WHITE);
    return;
case 1:
  player.setDisplayName(ChatColor.GRAY + player.getName() + ChatColor.WHITE);
return;
case 2:
player.setDisplayName(ChatColor.DARK_GRAY + player.getName() + ChatColor.WHITE);
return;
case 3:
player.setDisplayName(ChatColor.DARK_PURPLE + player.getName() + ChatColor.WHITE);
return;
case 4:
player.setDisplayName(ChatColor.GREEN + player.getName() + ChatColor.WHITE);
return;
case 5:
player.setDisplayName(ChatColor.GOLD + player.getName() + ChatColor.WHITE);
return;
}
player.setDisplayName(ChatColor.RED + player.getName() + ChatColor.WHITE);
}
}
Program: 7533
Project: 7533
Buggy source:
public boolean openChest(Player player,Block targetChest){
  String myOwner=ARGAntiPirate.chestMachine.getOwner(targetChest.getLocation());
  if (myOwner.equals(player.getName()) || ARGAntiPirate.rankMachine.getRank(player) > 4) {
    player.sendMessage("String_Node_Str" + myOwner);
    return true;
  }
 else   if (myOwner.equals("String_Node_Str") || myOwner.equalsIgnoreCase("String_Node_Str")) {
    player.sendMessage("String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean openChest(Player player,Block targetChest){
  String myOwner=ARGAntiPirate.chestMachine.getOwner(targetChest.getLocation());
  player.sendMessage("String_Node_Str" + myOwner);
  if (myOwner.equals(player.getName()) || ARGAntiPirate.rankMachine.getRank(player) > 4) {
    return true;
  }
 else   if (myOwner.equals("String_Node_Str") || myOwner.equalsIgnoreCase("String_Node_Str")) {
    player.sendMessage("String_Node_Str");
    return true;
  }
  return false;
}
Program: 7534
Project: 7534
Buggy source:
public boolean next(){
  frame this_frame=null;
  if (on_time < frames.size()) {
    ++on_time;
    this_frame=frames.get(on_time);
    output(on_time,this_frame);
    p.getServer().broadcastMessage("String_Node_Str" + (on_time + 1) + "String_Node_Str"+ this_frame.frame_blocks_data.size()+ "String_Node_Str");
    this_frame.draw();
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean next(){
  frame this_frame=null;
  if (on_time + 1 < frames.size()) {
    ++on_time;
    this_frame=frames.get(on_time);
    output(on_time,this_frame);
    p.getServer().broadcastMessage("String_Node_Str" + (on_time + 1) + "String_Node_Str"+ this_frame.frame_blocks_data.size()+ "String_Node_Str");
    this_frame.draw();
    return true;
  }
 else {
    return false;
  }
}