nus-yam/ex-repair huggingface dataset:
Program: 117305
Project: 117305
Buggy source:
@Override public void renderHead(IHeaderResponse response){
  super.renderHead(response);
  response.render(CssReferenceHeaderItem.forReference(OARCHITECT_CSS));
  response.render(CssReferenceHeaderItem.forReference(MXGRAPH_CSS));
  response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OArchitectEditorWidget.class,"String_Node_Str")));
  response.render(JavaScriptHeaderItem.forScript(String.format("String_Node_Str","String_Node_Str"),null));
  response.render(JavaScriptHeaderItem.forReference(MXGRAPH_JS));
  addOArchitectDependencies(response);
}

Fixed version (ground truth):
@Override public void renderHead(IHeaderResponse response){
  super.renderHead(response);
  response.render(CssReferenceHeaderItem.forReference(OARCHITECT_CSS));
  response.render(CssReferenceHeaderItem.forReference(MXGRAPH_CSS));
  response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OArchitectEditorWidget.class,"String_Node_Str")));
  response.render(JavaScriptHeaderItem.forScript(String.format("String_Node_Str","String_Node_Str"),null));
  response.render(JavaScriptHeaderItem.forReference(MXGRAPH_JS));
  response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OArchitectEditorWidget.class,"String_Node_Str")));
  response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OArchitectEditorWidget.class,"String_Node_Str")));
  response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OArchitectEditorWidget.class,"String_Node_Str")));
  response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OArchitectEditorWidget.class,"String_Node_Str")));
  response.render(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(OArchitectEditorWidget.class,"String_Node_Str")));
  PackageResourceReference configXml=new PackageResourceReference(OArchitectEditorWidget.class,"String_Node_Str");
  String configUrl=urlFor(configXml,null).toString();
  String baseUrl=configUrl.substring(0,configUrl.indexOf("String_Node_Str"));
  TextTemplate configTemplate=new PackageTextTemplate(OArchitectEditorWidget.class,"String_Node_Str");
  Map<String,Object> params=CommonUtils.toMap("String_Node_Str",baseUrl);
  String config=configTemplate.asString(params);
  response.render(OnLoadHeaderItem.forScript(String.format("String_Node_Str",baseUrl,CommonUtils.escapeAndWrapAsJavaScriptString(config),container.getMarkupId(),editor.getMarkupId(),sidebar.getMarkupId(),toolbar.getMarkupId())));
}
Program: 117306
Project: 117306
Buggy source:
private static OArchitectOClass convertOClassFromJson(JSONObject jsonObject){
  OArchitectOClass oClass=new OArchitectOClass(jsonObject.getString(NAME));
  oClass.setSuperClassesNames(getSuperClasses(jsonObject.getJSONArray(SUPER_CLASSES_NAMES)));
  oClass.setProperties(getOPropertyListFromJson(jsonObject.getJSONArray(PROPERTIES)));
  oClass.setPropertiesForDelete(getOPropertyListFromJson(jsonObject.getJSONArray(PROPERTIES_FOR_DELETE)));
  return oClass;
}

Fixed version (ground truth):
private static OArchitectOClass convertOClassFromJson(JSONObject jsonObject){
  OArchitectOClass oClass=new OArchitectOClass(jsonObject.getString(NAME));
  if (!jsonObject.isNull(SUPER_CLASSES_NAMES)) {
    oClass.setSuperClassesNames(getSuperClasses(jsonObject.getJSONArray(SUPER_CLASSES_NAMES)));
  }
  if (!jsonObject.isNull(PROPERTIES)) {
    oClass.setProperties(getOPropertyListFromJson(jsonObject.getJSONArray(PROPERTIES)));
  }
  if (!jsonObject.isNull(PROPERTIES_FOR_DELETE)) {
    oClass.setPropertiesForDelete(getOPropertyListFromJson(jsonObject.getJSONArray(PROPERTIES_FOR_DELETE)));
  }
  return oClass;
}
Program: 117307
Project: 117307
Buggy source:
@Override protected DatePicker newDatePicker(){
  return new DatePicker(){
    @Override public void beforeRender(    Component component){
      Response response=component.getResponse();
      response.write("String_Node_Str");
    }
    @Override public void afterRender(    Component component){
      Response response=component.getResponse();
      response.write("String_Node_Str" + "String_Node_Str");
      response.write("String_Node_Str");
    }
    @Override public void renderHead(    Component component,    IHeaderResponse response){
      String jqueryInit=String.format("String_Node_Str",getDateTextField().getMarkupId(),getLocale().getLanguage(),OrienteerWebApplication.DATE_CONVERTER.getDatePattern(getLocale()));
      response.render(OnLoadHeaderItem.forScript(jqueryInit));
    }
  }
;
}

Fixed version (ground truth):
@Override protected DatePicker newDatePicker(){
  return new DatePicker(){
    @Override public void beforeRender(    Component component){
      Response response=component.getResponse();
      response.write("String_Node_Str");
    }
    @Override public void afterRender(    Component component){
      Response response=component.getResponse();
      response.write("String_Node_Str" + "String_Node_Str");
      response.write("String_Node_Str");
    }
    @Override public void renderHead(    Component component,    IHeaderResponse response){
      String jqueryInit=String.format("String_Node_Str",getDateTextField().getMarkupId(),getLocale().getLanguage(),getDateFormat());
      response.render(OnDomReadyHeaderItem.forScript(jqueryInit));
    }
  }
;
}
Program: 117308
Project: 117308
Buggy source:
@Override protected DateTextField newDateTextField(String id,PropertyModel<Date> dateFieldModel){
  DateTextField dateTextField=new DateTextField(id,dateFieldModel,OrienteerWebApplication.DATE_CONVERTER);
  dateTextField.setOutputMarkupId(true);
  return dateTextField;
}

Fixed version (ground truth):
@Override protected DateTextField newDateTextField(String id,PropertyModel<Date> model){
  DateTextField dateTextField=DateTextField.forDatePattern(id,model,"String_Node_Str");
  dateTextField.setOutputMarkupId(true);
  return dateTextField;
}
Program: 117309
Project: 117309
Buggy source:
@Override public void renderHead(IHeaderResponse response){
  response.render(new PriorityHeaderItem(CssHeaderItem.forReference(BOOTSTRAP_CSS)));
  response.render(CssHeaderItem.forReference(FONT_AWESOME_CSS));
  response.render(CssHeaderItem.forReference(SB_ADMIN_CSS));
  response.render(CssHeaderItem.forReference(METISMENU_CSS));
  response.render(CssHeaderItem.forReference(ORIENTEER_CSS));
  response.render(CssHeaderItem.forReference(BOOTSTRAP_DATE_PICKER_CSS));
  super.renderHead(response);
  JavaScriptLibrarySettings javaScriptSettings=getApplication().getJavaScriptLibrarySettings();
  response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(javaScriptSettings.getJQueryReference())));
  response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(BOOTSTRAP_JS)));
  response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(METISMENU_JS)));
  response.render(JavaScriptHeaderItem.forReference(BOOTSTRAP_DATE_PICKER_JS));
  response.render(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference(String.format(BOOTSTRAP_DATEPICKER_LOCALE,getLocale().getLanguage()))));
  response.render(OnDomReadyHeaderItem.forScript("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void renderHead(IHeaderResponse response){
  response.render(new PriorityHeaderItem(CssHeaderItem.forReference(BOOTSTRAP_CSS)));
  response.render(CssHeaderItem.forReference(FONT_AWESOME_CSS));
  response.render(CssHeaderItem.forReference(SB_ADMIN_CSS));
  response.render(CssHeaderItem.forReference(METISMENU_CSS));
  response.render(CssHeaderItem.forReference(ORIENTEER_CSS));
  super.renderHead(response);
  addBootstrapDatepicker(response);
  JavaScriptLibrarySettings javaScriptSettings=getApplication().getJavaScriptLibrarySettings();
  response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(javaScriptSettings.getJQueryReference())));
  response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(BOOTSTRAP_JS)));
  response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(METISMENU_JS)));
  response.render(OnDomReadyHeaderItem.forScript("String_Node_Str"));
}
Program: 117310
Project: 117310
Buggy source:
private void addFilterPanels(WebMarkupContainer container,List<AbstractFilterPanel> panels,final List<FilterTab> tabs){
  ListView<AbstractFilterPanel> listView=new ListView<AbstractFilterPanel>("String_Node_Str",panels){
    private boolean first=true;
    @Override protected void populateItem(    ListItem<AbstractFilterPanel> item){
      if (first) {
        first=false;
        item.add(AttributeModifier.append("String_Node_Str",TAB_PANE_ACTIVE));
      }
 else       item.add(AttributeModifier.append("String_Node_Str",TAB_PANE));
      AbstractFilterPanel panel=item.getModelObject();
      for (      FilterTab tab : tabs) {
        if (tab.getType() == panel.getFilterCriteriaType()) {
          tab.setTabId(item.getMarkupId());
          break;
        }
      }
      item.add(panel);
    }
  }
;
  listView.setOutputMarkupPlaceholderTag(true);
  listView.setReuseItems(true);
  container.add(listView);
}

Fixed version (ground truth):
private void addFilterPanels(WebMarkupContainer container,List<AbstractFilterPanel> panels,final List<FilterTab> tabs){
  ListView<AbstractFilterPanel> listView=new ListView<AbstractFilterPanel>("String_Node_Str",panels){
    private boolean first=true;
    @Override protected void populateItem(    ListItem<AbstractFilterPanel> item){
      if (first) {
        first=false;
        item.add(AttributeModifier.append("String_Node_Str",TAB_PANE_ACTIVE));
      }
 else       item.add(AttributeModifier.append("String_Node_Str",TAB_PANE));
      item.add(AttributeModifier.append("String_Node_Str",FILTER_WIDTH));
      AbstractFilterPanel panel=item.getModelObject();
      for (      FilterTab tab : tabs) {
        if (tab.getType() == panel.getFilterCriteriaType()) {
          tab.setTabId(item.getMarkupId());
          break;
        }
      }
      item.add(panel);
    }
  }
;
  listView.setOutputMarkupPlaceholderTag(true);
  listView.setReuseItems(true);
  container.add(listView);
}
Program: 117311
Project: 117311
Buggy source:
@Override public void destroy(Application application){
}

Fixed version (ground truth):
@Override public void destroy(Application application){
  OrienteerWebApplication app=(OrienteerWebApplication)application;
  app.unregisterModule(Module.class);
}
Program: 117312
Project: 117312
Buggy source:
public OClassOMethodConfig(ClassOMethod oMethod,java.lang.reflect.Method javaMethod){
  this.oMethod=oMethod;
  behaviors=Arrays.asList(oMethod.behaviors());
  this.javaMethodName=javaMethod.getName();
  this.javaClassName=javaMethod.getDeclaringClass().getName();
}

Fixed version (ground truth):
public OClassOMethodConfig(ClassOMethod oMethod,Method javaMethod){
  this.oMethod=oMethod;
  behaviors=Arrays.asList(oMethod.behaviors());
  this.javaMethodName=javaMethod.getName();
  this.javaClassName=javaMethod.getDeclaringClass().getName();
}
Program: 117313
Project: 117313
Buggy source:
private OArtifact getOArtifact(String groupArtifactVersion,Path pathToJar){
  OArtifactReference mainArtifact=pathToJar != null ? getArtifactReference(groupArtifactVersion,pathToJar) : resolveAndGetArtifactReference(groupArtifactVersion);
  if (mainArtifact == null)   return null;
  ;
  List<Artifact> artifacts=resolveDependenciesInArtifacts(groupArtifactVersion);
  OArtifact moduleMetadata=new OArtifact();
  moduleMetadata.setLoad(false).setArtifactReference(mainArtifact).setDependencies(toOArtifactDependencies(artifacts));
  return moduleMetadata;
}

Fixed version (ground truth):
private OArtifact getOArtifact(String groupArtifactVersion,Path pathToJar){
  OArtifactReference mainArtifact=pathToJar != null ? getArtifactReference(groupArtifactVersion,pathToJar) : resolveAndGetArtifactReference(groupArtifactVersion);
  if (mainArtifact == null)   return null;
  List<Artifact> artifacts=resolveDependenciesInArtifacts(groupArtifactVersion);
  OArtifact moduleMetadata=new OArtifact();
  moduleMetadata.setLoad(false).setArtifactReference(mainArtifact).setDependencies(toOArtifactDependencies(artifacts));
  return moduleMetadata;
}
Program: 117314
Project: 117314
Buggy source:
/** 
 * Download Orienteer artifacts from server.
 * @return list of {@link OArtifact} from server
 * @throws IOException 
 */
public static List<OArtifact> getOrienteerArtifactsFromServer() throws IOException {
  URL website=new URL(initUtils.getOrienteerModulesUrl());
  File localFile=new File(initUtils.getPathToModulesFolder().toFile(),"String_Node_Str");
  ReadableByteChannel rbc=Channels.newChannel(website.openStream());
  FileOutputStream fos=new FileOutputStream(localFile);
  try {
    fos.getChannel().transferFrom(rbc,0,Long.MAX_VALUE);
  }
  finally {
    fos.close();
  }
  OrienteerArtifactsReader reader=new OrienteerArtifactsReader(localFile.toPath());
  List<OArtifact> ooArtifacts=reader.readArtifacts();
  List<OArtifact> metadataModules=getOArtifactsMetadataAsList();
  for (  OArtifact metadataModule : metadataModules) {
    for (    OArtifact module : ooArtifacts) {
      OArtifactReference metadataArtifact=metadataModule.getArtifactReference();
      OArtifactReference moduleArtifact=module.getArtifactReference();
      if (metadataArtifact.equals(moduleArtifact)) {
        module.setDownloaded(true);
      }
    }
  }
  return ooArtifacts;
}

Fixed version (ground truth):
/** 
 * Download Orienteer artifacts from server.
 * @return list of {@link OArtifact} from server
 * @throws IOException 
 */
public static List<OArtifact> getOrienteerArtifactsFromServer() throws IOException {
  URL website=new URL(initUtils.getOrienteerModulesUrl());
  File localFile=new File(initUtils.getPathToModulesFolder().toFile(),"String_Node_Str");
  FileOutputStream fos=new FileOutputStream(localFile);
  try {
    IOUtils.copy(website.openStream(),fos);
  }
  finally {
    fos.close();
  }
  OrienteerArtifactsReader reader=new OrienteerArtifactsReader(localFile.toPath());
  List<OArtifact> ooArtifacts=reader.readArtifacts();
  List<OArtifact> metadataModules=getOArtifactsMetadataAsList();
  for (  OArtifact metadataModule : metadataModules) {
    for (    OArtifact module : ooArtifacts) {
      OArtifactReference metadataArtifact=metadataModule.getArtifactReference();
      OArtifactReference moduleArtifact=module.getArtifactReference();
      if (metadataArtifact.equals(moduleArtifact)) {
        module.setDownloaded(true);
      }
    }
  }
  return ooArtifacts;
}
Program: 117315
Project: 117315
Buggy source:
@Override public void destroy(Application application){
  OrienteerWebApplication app=(OrienteerWebApplication)application;
}

Fixed version (ground truth):
@Override public void destroy(Application application){
  OrienteerWebApplication app=(OrienteerWebApplication)application;
  app.unregisterModule(Module.class);
}
Program: 117316
Project: 117316
Buggy source:
private ClassLoader initClassLoader(Properties properties){
  OrienteerClassLoader.create(OrienteerFilter.class.getClassLoader());
  OrienteerClassLoader.enable();
  OrienteerClassLoader.reindex();
  return OrienteerClassLoader.getClassLoader();
}

Fixed version (ground truth):
private ClassLoader initClassLoader(Properties properties){
  OrienteerClassLoader.create(OrienteerFilter.class.getClassLoader());
  OrienteerClassLoader.enable();
  return OrienteerClassLoader.getClassLoader();
}
Program: 117317
Project: 117317
Buggy source:
@Override public void destroy(){
  LOG.info("String_Node_Str" + this.getClass().getName());
  OrienteerClassLoader.clear();
  filter.destroy();
  filter=null;
}

Fixed version (ground truth):
@Override public void destroy(){
  LOG.info("String_Node_Str" + this.getClass().getName());
  filter.destroy();
  filter=null;
}
Program: 117318
Project: 117318
Buggy source:
public synchronized <M extends IOrienteerModule>M registerModule(Class<M> moduleClass){
  M module=getServiceInstance(moduleClass);
  registeredModules.put(module.getName(),getServiceInstance(moduleClass));
  registeredModulesSorted=false;
  return module;
}

Fixed version (ground truth):
public synchronized <M extends IOrienteerModule>M registerModule(Class<M> moduleClass){
  M module=getServiceInstance(moduleClass);
  registeredModules.put(module.getName(),getServiceInstance(moduleClass));
  registeredModulesSorted=false;
  MethodManager.get().addModule(moduleClass);
  MethodManager.get().reload();
  return module;
}
Program: 117319
Project: 117319
Buggy source:
public synchronized <M extends IOrienteerModule>M unregisterModule(Class<M> moduleClass){
  M module=getServiceInstance(moduleClass);
  if (registeredModules.containsKey(module.getName())) {
    registeredModules.remove(module.getName());
    return module;
  }
 else   LOG.info("String_Node_Str" + module.getName());
  return null;
}

Fixed version (ground truth):
public synchronized <M extends IOrienteerModule>M unregisterModule(Class<M> moduleClass){
  M module=getServiceInstance(moduleClass);
  if (registeredModules.containsKey(module.getName())) {
    MethodManager.get().removeModule(moduleClass);
    registeredModules.remove(module.getName());
    MethodManager.get().reload();
    return module;
  }
 else   LOG.info("String_Node_Str" + module.getName());
  return null;
}
Program: 117320
Project: 117320
Buggy source:
/** 
 * Add Orienteer modules to classloader resources.
 * @param modules - list which contains modules for add
 * @throws NullPointerException if jar file of module is null
 */
private void addModulesToClassLoaderResources(List<OArtifact> modules){
  for (  OArtifact metadata : modules) {
    try {
      addURL(metadata.getArtifactReference().getFile().toURI().toURL());
      for (      OArtifactReference artifact : metadata.getDependencies()) {
        addURL(artifact.getFile().toURI().toURL());
      }
      addOrienteerModule(metadata.getArtifactReference().getFile().toPath());
    }
 catch (    MalformedURLException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add Orienteer modules to classloader resources.
 * @param modules - list which contains modules for add
 * @throws NullPointerException if jar file of module is null
 */
private void addModulesToClassLoaderResources(List<OArtifact> modules){
  for (  OArtifact metadata : modules) {
    try {
      addURL(metadata.getArtifactReference().getFile().toURI().toURL());
      for (      OArtifactReference artifact : metadata.getDependencies()) {
        addURL(artifact.getFile().toURI().toURL());
      }
    }
 catch (    MalformedURLException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}
Program: 117323
Project: 117323
Buggy source:
private ClassLoader initClassLoader(Properties properties){
  OrienteerClassLoader.create(OrienteerFilter.class.getClassLoader());
  OrienteerClassLoader.enable();
  return OrienteerClassLoader.getClassLoader();
}

Fixed version (ground truth):
private ClassLoader initClassLoader(Properties properties){
  OrienteerClassLoader.create(OrienteerFilter.class.getClassLoader());
  OrienteerClassLoader.enable();
  OrienteerClassLoader.reindex();
  return OrienteerClassLoader.getClassLoader();
}
Program: 117324
Project: 117324
Buggy source:
@Override public void destroy(){
  LOG.info("String_Node_Str" + this.getClass().getName());
  filter.destroy();
  filter=null;
}

Fixed version (ground truth):
@Override public void destroy(){
  LOG.info("String_Node_Str" + this.getClass().getName());
  OrienteerClassLoader.clear();
  filter.destroy();
  filter=null;
}
Program: 117325
Project: 117325
Buggy source:
/** 
 * Add Orienteer modules to classloader resources.
 * @param modules - list which contains modules for add
 * @throws NullPointerException if jar file of module is null
 */
private void addModulesToClassLoaderResources(List<OArtifact> modules){
  for (  OArtifact metadata : modules) {
    try {
      addURL(metadata.getArtifactReference().getFile().toURI().toURL());
      for (      OArtifactReference artifact : metadata.getDependencies()) {
        addURL(artifact.getFile().toURI().toURL());
      }
    }
 catch (    MalformedURLException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add Orienteer modules to classloader resources.
 * @param modules - list which contains modules for add
 * @throws NullPointerException if jar file of module is null
 */
private void addModulesToClassLoaderResources(List<OArtifact> modules){
  for (  OArtifact metadata : modules) {
    try {
      addURL(metadata.getArtifactReference().getFile().toURI().toURL());
      for (      OArtifactReference artifact : metadata.getDependencies()) {
        addURL(artifact.getFile().toURI().toURL());
      }
      addOrienteerModule(metadata.getArtifactReference().getFile().toPath());
    }
 catch (    MalformedURLException e) {
      LOG.error("String_Node_Str",e);
    }
  }
}
Program: 117326
Project: 117326
Buggy source:
/** 
 * Unarchive pom.xml from jar file
 * @param jarFile  jar file which contains pom.xml
 * @param jarEntry {@link JarEntry} of pom.xml
 * @return {@link Optional<Path>} of pom.xml or Optional.absent() if pom.xml is not present
 * @throws IOException
 */
private Optional<Path> unarchivePomFile(JarFile jarFile,JarEntry jarEntry) throws IOException {
  Optional<Path> resultOptional=Optional.absent();
  int pointer=jarEntry.getName().lastIndexOf("String_Node_Str") + 1;
  String fileName=jarEntry.getName().substring(pointer);
  pointer=jarFile.getName().lastIndexOf("String_Node_Str") + 1;
  if (pomFolder == null) {
    String folder=jarFile.getName().substring(0,pointer);
    pomFolder=Paths.get(folder + POM_FOLDER_NAME);
  }
  if (!Files.exists(pomFolder))   Files.createDirectory(pomFolder);
  Path path=pomFolder.resolve(jarFile.getName().substring(pointer).replace("String_Node_Str",fileName));
  try (BufferedInputStream in=new BufferedInputStream(jarFile.getInputStream(jarEntry));BufferedOutputStream out=new BufferedOutputStream(Files.newOutputStream(path))){
    int readBytes;
    byte[] buff=new byte[4096];
    while ((readBytes=in.read(buff)) != -1) {
      out.write(buff,0,readBytes);
    }
    resultOptional=Optional.of(path);
  }
 catch (  IOException e) {
    Files.deleteIfExists(path);
    if (LOG.isDebugEnabled()) {
      LOG.error("String_Node_Str" + jarEntry.getName());
      e.printStackTrace();
    }
  }
  return resultOptional;
}

Fixed version (ground truth):
/** 
 * Unarchive pom.xml from jar file
 * @param jarFile  jar file which contains pom.xml
 * @param jarEntry {@link JarEntry} of pom.xml
 * @return {@link Optional<Path>} of pom.xml or Optional.absent() if pom.xml is not present
 * @throws IOException
 */
private Optional<Path> unarchivePomFile(JarFile jarFile,JarEntry jarEntry) throws IOException {
  Optional<Path> resultOptional=Optional.absent();
  int pointer=jarEntry.getName().lastIndexOf("String_Node_Str") + 1;
  String fileName=jarEntry.getName().substring(pointer);
  Path path=File.createTempFile(fileName,"String_Node_Str").toPath();
  try (BufferedInputStream in=new BufferedInputStream(jarFile.getInputStream(jarEntry));BufferedOutputStream out=new BufferedOutputStream(Files.newOutputStream(path))){
    int readBytes;
    byte[] buff=new byte[4096];
    while ((readBytes=in.read(buff)) != -1) {
      out.write(buff,0,readBytes);
    }
    resultOptional=Optional.of(path);
  }
 catch (  IOException e) {
    Files.deleteIfExists(path);
    if (LOG.isDebugEnabled()) {
      LOG.error("String_Node_Str" + jarEntry.getName());
      e.printStackTrace();
    }
  }
  return resultOptional;
}
Program: 117327
Project: 117327
Buggy source:
/** 
 * Download Orienteer artifacts to target folder.
 * @param oArtifacts - artifacts for download modules
 */
public void downloadOArtifacts(List<OArtifact> oArtifacts){
  for (  OArtifact module : oArtifacts) {
    File jar=module.getArtifactReference().getFile();
    if (jar == null || !jar.exists()) {
      Optional<Artifact> artifactOptional=OrienteerClassLoaderUtil.downloadArtifact(module.getArtifactReference().toAetherArtifact());
      if (artifactOptional.isPresent()) {
        module.setArtifact(OArtifactReference.valueOf(artifactOptional.get()));
      }
 else {
        module.setLoad(false);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Download Orienteer artifacts to target folder.
 * @param oArtifacts - artifacts for download modules
 */
public void downloadOArtifacts(List<OArtifact> oArtifacts){
  for (  OArtifact module : oArtifacts) {
    File jar=module.getArtifactReference().getFile();
    if (jar == null || !jar.exists()) {
      Optional<Artifact> artifactOptional=OrienteerClassLoaderUtil.downloadArtifact(module.getArtifactReference().toAetherArtifact());
      if (artifactOptional.isPresent()) {
        module.setArtifactReference(OArtifactReference.valueOf(artifactOptional.get()));
      }
 else {
        module.setLoad(false);
      }
    }
  }
}
Program: 117328
Project: 117328
Buggy source:
private Optional<OArtifact> getOArtifact(String groupArtifactVersion,Path pathToJar){
  Optional<OArtifactReference> mainArtifact=pathToJar != null ? getArtifactReference(groupArtifactVersion,pathToJar) : resolveAndGetArtifactReference(groupArtifactVersion);
  if (!mainArtifact.isPresent())   return Optional.absent();
  List<Artifact> artifacts=resolveDependenciesInArtifacts(groupArtifactVersion);
  OArtifact moduleMetadata=new OArtifact();
  moduleMetadata.setLoad(false).setArtifact(mainArtifact.get()).setDependencies(toOArtifactDependencies(artifacts));
  return Optional.of(moduleMetadata);
}

Fixed version (ground truth):
private Optional<OArtifact> getOArtifact(String groupArtifactVersion,Path pathToJar){
  Optional<OArtifactReference> mainArtifact=pathToJar != null ? getArtifactReference(groupArtifactVersion,pathToJar) : resolveAndGetArtifactReference(groupArtifactVersion);
  if (!mainArtifact.isPresent())   return Optional.absent();
  List<Artifact> artifacts=resolveDependenciesInArtifacts(groupArtifactVersion);
  OArtifact moduleMetadata=new OArtifact();
  moduleMetadata.setLoad(false).setArtifactReference(mainArtifact.get()).setDependencies(toOArtifactDependencies(artifacts));
  return Optional.of(moduleMetadata);
}
Program: 117329
Project: 117329
Buggy source:
/** 
 * Parse mainElement and get   {@link OArtifact} from it.
 * @param mainElement - {@link Element}t for parse
 * @return {@link OArtifact} from mainElement
 */
@SuppressWarnings("String_Node_Str") private OArtifact getOoArtifact(Element mainElement){
  OArtifact module=new OArtifact();
  NodeList nodeList=mainElement.getElementsByTagName("String_Node_Str");
  for (int i=0; i < nodeList.getLength(); i++) {
    Node node=nodeList.item(i);
    if (node.getNodeType() == Node.ELEMENT_NODE) {
      Element element=(Element)node;
      MetadataTag tag=MetadataTag.getByName(element.getTagName());
switch (tag) {
case LOAD:
        module.setLoad(Boolean.valueOf(element.getTextContent()));
      break;
case TRUSTED:
    module.setTrusted(Boolean.valueOf(element.getTextContent()));
  break;
case DEPENDENCY:
module.setArtifact(getMavenDependency(element));
break;
}
}
}
return module;
}

Fixed version (ground truth):
/** 
 * Parse mainElement and get   {@link OArtifact} from it.
 * @param mainElement - {@link Element}t for parse
 * @return {@link OArtifact} from mainElement
 */
@SuppressWarnings("String_Node_Str") private OArtifact getOoArtifact(Element mainElement){
  OArtifact module=new OArtifact();
  NodeList nodeList=mainElement.getElementsByTagName("String_Node_Str");
  for (int i=0; i < nodeList.getLength(); i++) {
    Node node=nodeList.item(i);
    if (node.getNodeType() == Node.ELEMENT_NODE) {
      Element element=(Element)node;
      MetadataTag tag=MetadataTag.getByName(element.getTagName());
switch (tag) {
case LOAD:
        module.setLoad(Boolean.valueOf(element.getTextContent()));
      break;
case TRUSTED:
    module.setTrusted(Boolean.valueOf(element.getTextContent()));
  break;
case DEPENDENCY:
module.setArtifactReference(getMavenDependency(element));
break;
}
}
}
return module;
}
Program: 117330
Project: 117330
Buggy source:
/** 
 * Parse   {@link Element} element and get {@link OArtifact} from it.
 * @param element {@link Element} for parse
 * @return {@link OArtifact} from element
 */
private OArtifact getArtifact(Element element){
  Element groupElement=(Element)element.getElementsByTagName(MetadataTag.GROUP_ID.get()).item(0);
  Element artifactElement=(Element)element.getElementsByTagName(MetadataTag.ARTIFACT_ID.get()).item(0);
  Element versionElement=(Element)element.getElementsByTagName(MetadataTag.VERSION.get()).item(0);
  Element descriptionElement=(Element)element.getElementsByTagName(MetadataTag.DESCRIPTION.get()).item(0);
  String groupId=groupElement != null ? groupElement.getTextContent() : null;
  String artifactId=artifactElement != null ? artifactElement.getTextContent() : null;
  String version=versionElement != null ? versionElement.getTextContent() : null;
  String description=descriptionElement != null ? descriptionElement.getTextContent() : null;
  OArtifact module=new OArtifact();
  return module.setArtifact(new OArtifactReference(groupId,artifactId,version,description));
}

Fixed version (ground truth):
/** 
 * Parse   {@link Element} element and get {@link OArtifact} from it.
 * @param element {@link Element} for parse
 * @return {@link OArtifact} from element
 */
private OArtifact getArtifact(Element element){
  Element groupElement=(Element)element.getElementsByTagName(MetadataTag.GROUP_ID.get()).item(0);
  Element artifactElement=(Element)element.getElementsByTagName(MetadataTag.ARTIFACT_ID.get()).item(0);
  Element versionElement=(Element)element.getElementsByTagName(MetadataTag.VERSION.get()).item(0);
  Element descriptionElement=(Element)element.getElementsByTagName(MetadataTag.DESCRIPTION.get()).item(0);
  String groupId=groupElement != null ? groupElement.getTextContent() : null;
  String artifactId=artifactElement != null ? artifactElement.getTextContent() : null;
  String version=versionElement != null ? versionElement.getTextContent() : null;
  String description=descriptionElement != null ? descriptionElement.getTextContent() : null;
  OArtifact module=new OArtifact();
  return module.setArtifactReference(new OArtifactReference(groupId,artifactId,version,description));
}
Program: 117331
Project: 117331
Buggy source:
@SuppressWarnings("String_Node_Str") public static Collection<Artifact> getAvailableArtifacts(ClassLoader classLoader){
  Collection<Artifact> ret=new HashSet<>();
  try {
    Enumeration<URL> urls=classLoader.getResources("String_Node_Str");
    while (urls.hasMoreElements()) {
      URL url=(URL)urls.nextElement();
      try (InputStream is=url.openStream()){
        Manifest manifest=new Manifest(is);
        Attributes attrs=manifest.getMainAttributes();
        String groupId=attrs.getValue(Name.IMPLEMENTATION_VENDOR_ID);
        String artifactId=attrs.getValue(Name.IMPLEMENTATION_TITLE);
        String version=attrs.getValue(Name.IMPLEMENTATION_VERSION);
        if (!Strings.isEmpty(groupId) && !Strings.isEmpty(artifactId) && !Strings.isEmpty(version)) {
          try {
            ret.add(new DefaultArtifact(String.format("String_Node_Str",groupId,artifactId,version)));
          }
 catch (          IllegalArgumentException e) {
          }
        }
      }
 catch (      IOException e) {
        LOG.error("String_Node_Str" + url,e);
      }
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
  return ret;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static Collection<Artifact> getAvailableArtifacts(ClassLoader classLoader){
  Collection<Artifact> ret=new HashSet<>();
  try {
    Enumeration<URL> urls=classLoader.getResources("String_Node_Str");
    while (urls.hasMoreElements()) {
      URL url=(URL)urls.nextElement();
      try (InputStream is=url.openStream()){
        Manifest manifest=new Manifest(is);
        Attributes attrs=manifest.getMainAttributes();
        String groupId=attrs.getValue(Name.IMPLEMENTATION_VENDOR_ID);
        String artifactId=attrs.getValue(Name.IMPLEMENTATION_TITLE);
        String version=attrs.getValue(Name.IMPLEMENTATION_VERSION);
        if (!Strings.isNullOrEmpty(groupId) && !Strings.isNullOrEmpty(artifactId) && !Strings.isNullOrEmpty(version)) {
          try {
            ret.add(new DefaultArtifact(String.format("String_Node_Str",groupId,artifactId,version)));
          }
 catch (          IllegalArgumentException e) {
          }
        }
      }
 catch (      IOException e) {
        LOG.error("String_Node_Str" + url,e);
      }
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
  return ret;
}
Program: 117332
Project: 117332
Buggy source:
/** 
 * Delete artifact jar file
 * @param oArtifact {@link OArtifact} artifact which jar file will be delete
 * @throws IllegalArgumentException if oArtifact is null
 * @throws IllegalStateException if jar file of oArtifact is null
 */
public static void deleteOArtifactArtifactFile(OArtifact oArtifact){
  Args.notNull(oArtifact,"String_Node_Str");
  try {
    File file=oArtifact.getArtifactReference().getFile();
    if (file == null)     throw new IllegalStateException("String_Node_Str" + oArtifact);
    Files.deleteIfExists(file.toPath());
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",oArtifact,e);
  }
}

Fixed version (ground truth):
/** 
 * Delete artifact jar file
 * @param oArtifact {@link OArtifact} artifact which jar file will be delete
 * @throws IllegalArgumentException if oArtifact is null
 */
public static void deleteOArtifactArtifactFile(OArtifact oArtifact){
  Args.notNull(oArtifact,"String_Node_Str");
  try {
    File file=oArtifact.getArtifactReference().getFile();
    if (file != null) {
      Files.deleteIfExists(file.toPath());
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",oArtifact,e);
  }
}
Program: 117333
Project: 117333
Buggy source:
public AddOArtifactCommand(OrienteerDataTable<OArtifact,?> table,WebPage page,IOArtifactsUpdater updater){
  super(new ResourceModel(ADD_BUT),table);
  this.modalWindowPage=page;
  this.table=table;
  this.updater=updater;
}

Fixed version (ground truth):
public AddOArtifactCommand(OrienteerDataTable<OArtifact,?> table,OArtifactsModalWindowPage page,IOArtifactsUpdater updater){
  super(new ResourceModel(ADD_BUT),table);
  this.modalWindowPage=page;
  this.table=table;
  this.updater=updater;
}
Program: 117334
Project: 117334
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected void initializeContent(ModalWindow modal){
  modal.setOutputMarkupPlaceholderTag(true);
  modal.setTitle(new ResourceModel(MODAL_WINDOW_TITLE));
  modal.setPageCreator(new ModalWindow.PageCreator(){
    @Override public Page createPage(){
      return modalWindowPage;
    }
  }
);
  modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
    @Override public void onClose(    AjaxRequestTarget target){
      updater.notifyAboutNewArtifacts();
      target.add(table);
    }
  }
);
  modal.setAutoSize(true);
  modal.setMinimalWidth(800);
  modal.setMinimalHeight(600);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected void initializeContent(ModalWindow modal){
  modal.setOutputMarkupPlaceholderTag(true);
  modal.setTitle(new ResourceModel(MODAL_WINDOW_TITLE));
  modal.setPageCreator(new ModalWindow.PageCreator(){
    @Override public Page createPage(){
      return modalWindowPage;
    }
  }
);
  modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
    @Override public void onClose(    AjaxRequestTarget target){
      updater.notifyAboutNewArtifacts();
      target.add(table);
    }
  }
);
  modal.setAutoSize(true);
  modal.setMinimalWidth(800);
  modal.setMinimalHeight(600);
  modalWindowPage.setModalWindow(modal);
}
Program: 117335
Project: 117335
Buggy source:
public void loadMethods(){
  AbstractWidget<?> widget=externalList.findParent(AbstractWidget.class);
  methods=MethodManager.get().getMethods(new MethodBaseData(displayObjectModel,widget,place));
  for (  IMethod method : methods) {
    Component component=method.getDisplayComponent(externalList.newChildId());
    if (component instanceof IBootstrapAware && bootstrapTypeOverriden) {
      ((IBootstrapAware)component).setBootstrapType(bootstrapType);
    }
    externalList.add(component);
  }
}

Fixed version (ground truth):
public void loadMethods(){
  AbstractWidget<?> widget=externalList.findParent(AbstractWidget.class);
  methods=MethodManager.get().getMethods(new MethodBaseData(displayObjectModel,widget,place));
  for (  IMethod method : methods) {
    Component component=method.getDisplayComponent(externalList.newChildId());
    if (component != null) {
      if (component instanceof IBootstrapAware && bootstrapTypeOverriden) {
        ((IBootstrapAware)component).setBootstrapType(bootstrapType);
      }
      externalList.add(component);
    }
  }
}
Program: 117336
Project: 117336
Buggy source:
@Override protected void onConfigure(){
  super.onConfigure();
  IVisitor<Component,Boolean> visitor=new IVisitor<Component,Boolean>(){
    public void component(    Component component,    IVisit<Boolean> visit){
      component.configure();
      if (component.determineVisibility()) {
        visit.stop(true);
      }
 else {
        visit.dontGoDeeper();
      }
    }
  }
;
  Boolean ret=commands.visitChildren(visitor);
  if (ret == null || ret == false) {
    ret=methods.visitChildren(visitor);
  }
  setVisible(ret != null ? ret : false);
}

Fixed version (ground truth):
@Override protected void onConfigure(){
  super.onConfigure();
  IVisitor<Component,Boolean> visitor=new IVisitor<Component,Boolean>(){
    public void component(    Component component,    IVisit<Boolean> visit){
      component.configure();
      if (component.determineVisibility()) {
        visit.stop(true);
      }
 else {
        visit.dontGoDeeper();
      }
    }
  }
;
  Boolean ret=commands.visitChildren(visitor);
  if (ret == null || !ret) {
    ret=methods.visitChildren(visitor);
  }
  setVisible(ret != null ? ret : false);
}
Program: 117337
Project: 117337
Buggy source:
@Override protected void onConfigure(){
  super.onConfigure();
  IVisitor<Component,Boolean> visitor=new IVisitor<Component,Boolean>(){
    public void component(    Component component,    IVisit<Boolean> visit){
      component.configure();
      if (component.determineVisibility()) {
        visit.stop(true);
      }
 else {
        visit.dontGoDeeper();
      }
    }
  }
;
  Boolean ret=commands.visitChildren(visitor);
  if (ret == null || ret == false) {
    ret=methods.visitChildren(visitor);
  }
  setVisible(ret != null ? ret : false);
}

Fixed version (ground truth):
@Override protected void onConfigure(){
  super.onConfigure();
  IVisitor<Component,Boolean> visitor=new IVisitor<Component,Boolean>(){
    public void component(    Component component,    IVisit<Boolean> visit){
      component.configure();
      if (component.determineVisibility()) {
        visit.stop(true);
      }
 else {
        visit.dontGoDeeper();
      }
    }
  }
;
  Boolean ret=commands.visitChildren(visitor);
  if (ret == null || !ret) {
    ret=methods.visitChildren(visitor);
  }
  setVisible(ret != null ? ret : false);
}
Program: 117338
Project: 117338
Buggy source:
@Override public String getDocumentName(ODocument doc,OProperty nameProp){
  if (doc == null)   return Application.get().getResourceSettings().getLocalizer().getString("String_Node_Str",null);
 else {
    if (nameProp == null)     nameProp=getNameProperty(doc.getSchemaClass());
    if (nameProp != null) {
      Object value=doc.field(nameProp.getName());
      if (value == null)       return Application.get().getResourceSettings().getLocalizer().getString("String_Node_Str",null);
      OType type=nameProp.getType();
      Locale locale=OrienteerWebSession.get().getLocale();
switch (type) {
case DATE:
        return OrienteerWebApplication.DATE_CONVERTER.convertToString((Date)value,locale);
case DATETIME:
      return OrienteerWebApplication.DATE_TIME_CONVERTER.convertToString((Date)value,locale);
case LINK:
    return getDocumentName((ODocument)value);
case EMBEDDEDMAP:
  Map<String,Object> localizations=(Map<String,Object>)value;
Object localized=CommonUtils.localizeByMap(localizations,true,locale.getLanguage(),Locale.getDefault().getLanguage());
if (localized != null) return localized.toString();
default :
return value.toString();
}
}
 else {
return doc.toString();
}
}
}

Fixed version (ground truth):
@Override public String getDocumentName(ODocument doc,OProperty nameProp){
  if (doc == null)   return Application.get().getResourceSettings().getLocalizer().getString("String_Node_Str",null);
 else {
    if (nameProp == null)     nameProp=getNameProperty(doc.getSchemaClass());
    if (nameProp != null) {
      Object value=doc.field(nameProp.getName());
      if (value == null)       return Application.get().getResourceSettings().getLocalizer().getString("String_Node_Str",null);
      OType type=nameProp.getType();
      Locale locale=OrienteerWebSession.get().getLocale();
switch (type) {
case DATE:
        return OrienteerWebApplication.DATE_CONVERTER.convertToString((Date)value,locale);
case DATETIME:
      return OrienteerWebApplication.DATE_TIME_CONVERTER.convertToString((Date)value,locale);
case LINK:
    return value instanceof ODocument ? getDocumentName((ODocument)value) : null;
case EMBEDDEDMAP:
  Map<String,Object> localizations=(Map<String,Object>)value;
Object localized=CommonUtils.localizeByMap(localizations,true,locale.getLanguage(),Locale.getDefault().getLanguage());
if (localized != null) return localized.toString();
default :
return value.toString();
}
}
 else {
return doc.toString();
}
}
}
Program: 117339
Project: 117339
Buggy source:
private OModuleMetadata getModule(Element mainElement){
  OModuleMetadata module=new OModuleMetadata();
  List<Element> elements=mainElement.elements();
  for (  Element element : elements) {
switch (element.getName()) {
case ID:
      module.setId(Integer.valueOf(element.getText()));
    break;
case INITIALIZER:
  module.setInitializerName(element.getText());
break;
case LOAD:
module.setLoad(Boolean.valueOf(element.getText()));
break;
case MAVEN:
Artifact mainDependency=getMavenDependency(element.element(MAIN_DEPENDENCY));
List<Artifact> dependencies=getDependencies(element.elements(DEPENDENCIES));
module.setMainArtifact(mainDependency).setDependencies(dependencies);
break;
}
}
return module;
}

Fixed version (ground truth):
private OModuleMetadata getModule(Element mainElement){
  OModuleMetadata module=new OModuleMetadata();
  List<Element> elements=mainElement.elements();
  for (  Element element : elements) {
switch (element.getName()) {
case ID:
      module.setId(Integer.valueOf(element.getText()));
    break;
case INITIALIZER:
  module.setInitializerName(element.getText());
break;
case LOAD:
module.setLoad(Boolean.valueOf(element.getText()));
break;
case MAVEN:
Artifact mainDependency=getMavenDependency(element.element(MAIN_DEPENDENCY));
List<Artifact> dependencies=getDependencies(element.element(DEPENDENCIES));
module.setMainArtifact(mainDependency).setDependencies(dependencies);
break;
}
}
return module;
}
Program: 117340
Project: 117340
Buggy source:
private List<Artifact> getDependencies(List<Element> elements){
  List<Artifact> dependencies=Lists.newArrayList();
  for (  Element element : elements) {
    dependencies.add(getMavenDependency(element.element(DEPENDENCY)));
  }
  return dependencies;
}

Fixed version (ground truth):
private List<Artifact> getDependencies(Element dependenciesElement){
  List<Artifact> dependencies=Lists.newArrayList();
  List<Element> elements=dependenciesElement.elements(DEPENDENCY);
  for (  Element element : elements) {
    if (element.getName().equals(DEPENDENCY)) {
      dependencies.add(getMavenDependency(element));
    }
  }
  return dependencies;
}
Program: 117341
Project: 117341
Buggy source:
void update(List<OModuleMetadata> modulesForWrite){
  Document document=readFromFile();
  if (document == null)   throw new UnsupportedOperationException("String_Node_Str");
  Element rootElement=document.getRootElement();
  List<Node> modules=rootElement.elements(MODULE);
  List<OModuleMetadata> updatedModules=Lists.newArrayList();
  for (  Node node : modules) {
    Element element=(Element)node;
    Element idElement=(Element)element.elements(ID).get(0);
    OModuleMetadata module=containsInModulesList(Integer.valueOf(idElement.getText()),modulesForWrite);
    if (module != null) {
      Iterator iterator=element.elementIterator();
      changeModule(iterator,module);
      updatedModules.add(module);
    }
  }
  if (updatedModules.size() != modulesForWrite.size()) {
    addModules(difference(updatedModules,modulesForWrite),rootElement);
  }
  writeToFile(document);
}

Fixed version (ground truth):
void update(List<OModuleMetadata> modulesForWrite){
  Document document=readFromFile();
  if (document == null)   throw new UnsupportedOperationException("String_Node_Str");
  Element rootElement=document.getRootElement();
  List<Node> modules=rootElement.elements(MODULE);
  List<OModuleMetadata> updatedModules=Lists.newArrayList();
  int id=0;
  for (  Node node : modules) {
    Element element=(Element)node;
    Element idElement=(Element)element.elements(ID).get(0);
    int currentId=Integer.valueOf(idElement.getText());
    if (id < currentId)     id=currentId;
    OModuleMetadata module=containsInModulesList(currentId,modulesForWrite);
    if (module != null) {
      Iterator iterator=element.elementIterator();
      changeModule(iterator,module);
      updatedModules.add(module);
    }
  }
  if (updatedModules.size() != modulesForWrite.size()) {
    setIdForModules(modulesForWrite,++id);
    addModules(difference(updatedModules,modulesForWrite),rootElement);
  }
  writeToFile(document);
}
Program: 117342
Project: 117342
Buggy source:
private static List<OModuleMetadata> getModulesForLoad(){
  Map<Path,OModuleMetadata> modules=MetadataUtil.readModulesForLoadAsMap();
  List<Path> jars=readModulesInFolder(modulesFolder);
  if (modules.isEmpty()) {
    List<OModuleMetadata> newModules=getModulesMetadata(jars);
    MetadataUtil.createMetadata(newModules);
    return newModules;
  }
 else {
    List<Path> modulesForWrite=Lists.newArrayList();
    for (    Path pathToModule : jars) {
      if (!modules.keySet().contains(pathToModule.toAbsolutePath())) {
        modulesForWrite.add(pathToModule);
      }
    }
    List<OModuleMetadata> modulesForAdd=getModulesMetadata(modulesForWrite);
    MetadataUtil.addModulesToMetadata(modulesForAdd);
    modulesForAdd.addAll(modules.values());
    return Collections.unmodifiableList(modulesForAdd);
  }
}

Fixed version (ground truth):
private static List<OModuleMetadata> getModulesForLoad(){
  Map<Path,OModuleMetadata> modules=MetadataUtil.readModulesForLoadAsMap();
  List<Path> jars=readModulesInFolder(modulesFolder);
  if (modules.isEmpty()) {
    LOADED_MODULES.clear();
    OLoaderStorage.clear();
    List<OModuleMetadata> newModules=getModulesMetadata(jars);
    MetadataUtil.createMetadata(newModules);
    return newModules;
  }
 else {
    List<Path> modulesForWrite=Lists.newArrayList();
    for (    Path pathToModule : jars) {
      if (!modules.keySet().contains(pathToModule.toAbsolutePath())) {
        modulesForWrite.add(pathToModule);
      }
    }
    List<OModuleMetadata> modulesForAdd=getModulesMetadata(modulesForWrite);
    MetadataUtil.addModulesToMetadata(modulesForAdd);
    modulesForAdd.addAll(modules.values());
    return Collections.unmodifiableList(modulesForAdd);
  }
}
Program: 117343
Project: 117343
Buggy source:
private static void reload(){
  OrienteerFilter orienteerFilter=injector.getInstance(OrienteerFilter.class);
  ScheduledThreadPoolExecutor executor=new ScheduledThreadPoolExecutor(5);
  executor.schedule(new Reload(orienteerFilter),1,TimeUnit.SECONDS);
}

Fixed version (ground truth):
private static void reload(){
  OrienteerFilter orienteerFilter=injector.getInstance(OrienteerFilter.class);
  ScheduledThreadPoolExecutor executor=new ScheduledThreadPoolExecutor(10);
  executor.schedule(new Reload(orienteerFilter),1,TimeUnit.SECONDS);
}