nus-yam/ex-repair huggingface dataset:
Program: 38813
Project: 38813
Buggy source:
private ModifiedNetwork loadNetworkFromVirtualCase(VirtualCase virtualCase){
  ProjectCase baseCase=virtualCase.getCase().orElseThrow(() -> new AfsException("String_Node_Str"));
  ModifiedNetwork modifiedNetwork=loadNetworkFromProjectCase(baseCase);
  if (modifiedNetwork.getScriptError() != null) {
    return modifiedNetwork;
  }
  ModificationScript script=virtualCase.getScript().orElseThrow(VirtualCase::createScriptLinkIsDeadException);
  LOGGER.info("String_Node_Str" + virtualCase.getId());
  return applyScript(modifiedNetwork.getNetwork(),modifiedNetwork.getScriptOutput(),script);
}

Fixed version (ground truth):
private ModifiedNetwork loadNetworkFromVirtualCase(VirtualCase virtualCase){
  ProjectCase baseCase=virtualCase.getCase().orElseThrow(() -> new AfsException("String_Node_Str"));
  ModifiedNetwork modifiedNetwork=loadNetworkFromProjectCase(baseCase);
  if (modifiedNetwork.getScriptError() != null) {
    return modifiedNetwork;
  }
  ModificationScript script=virtualCase.getScript().orElseThrow(VirtualCase::createScriptLinkIsDeadException);
  LOGGER.info("String_Node_Str",virtualCase.getId());
  return applyScript(modifiedNetwork.getNetwork(),modifiedNetwork.getScriptOutput(),script);
}
Program: 38814
Project: 38814
Buggy source:
@Deprecated Integer getOptionalIntProperty(String name);

Fixed version (ground truth):
/** 
 * @deprecated Use getOptionalIntegerProperty(String) instead.
 */
@Deprecated Integer getOptionalIntProperty(String name);
Program: 38815
Project: 38815
Buggy source:
@Deprecated Boolean getOptinalBooleanProperty(String name);

Fixed version (ground truth):
/** 
 * @deprecated Use getOptionalBooleanProperty(String) instead.
 */
@Deprecated Boolean getOptinalBooleanProperty(String name);
Program: 38816
Project: 38816
Buggy source:
GzMemDataSource(String fileName,InputStream content){
  super(DataSourceUtil.getBaseName(fileName));
  String zipped=fileName.substring(0,fileName.lastIndexOf("String_Node_Str"));
  putData(zipped,content);
}

Fixed version (ground truth):
GzMemDataSource(String fileName,InputStream content){
  super(DataSourceUtil.getBaseName(fileName));
  String zipped=fileName.substring(0,fileName.lastIndexOf('.'));
  putData(zipped,content);
}
Program: 38817
Project: 38817
Buggy source:
public String anonymize(String str){
  if (str == null) {
    return null;
  }
  String str2=mapping.get(str);
  if (str2 == null) {
    str2=getAlpha(mapping.size() + 1);
    mapping.put(str,str2);
  }
  return str2;
}

Fixed version (ground truth):
public String anonymize(String str){
  if (str == null) {
    return null;
  }
  return mapping.computeIfAbsent(str,k -> getAlpha(mapping.size() + 1));
}
Program: 38818
Project: 38818
Buggy source:
@Override public void onTaskEnd(StatisticsReader.TaskExecution task,StatisticsReader.JobExecution job){
  if (task.workingDataSize != null) {
    String slaveId=task.slaveRank + "String_Node_Str" + task.slaveThread;
    AtomicLong workingDataSize=workingDataSizePerSlave.get(slaveId);
    if (workingDataSize == null) {
      workingDataSize=new AtomicLong();
      workingDataSizePerSlave.put(slaveId,workingDataSize);
    }
    workingDataSize.addAndGet(task.workingDataSize);
    totalWorkingDataSize[0]+=task.workingDataSize;
  }
}

Fixed version (ground truth):
@Override public void onTaskEnd(StatisticsReader.TaskExecution task,StatisticsReader.JobExecution job){
  if (task.workingDataSize != null) {
    String slaveId=task.slaveRank + "String_Node_Str" + task.slaveThread;
    AtomicLong workingDataSize=workingDataSizePerSlave.computeIfAbsent(slaveId,k -> new AtomicLong());
    workingDataSize.addAndGet(task.workingDataSize);
    totalWorkingDataSize[0]+=task.workingDataSize;
  }
}
Program: 38820
Project: 38820
Buggy source:
@Override @Deprecated public void onProgress(CommandExecution execution,int executionIndex){
}

Fixed version (ground truth):
/** 
 * @deprecated Use onExecutionCompletion(CommandExecution, int) instead.
 */
@Override @Deprecated public void onProgress(CommandExecution execution,int executionIndex){
}
Program: 38821
Project: 38821
Buggy source:
@Deprecated CommandExecutor newCommandExecutor(Map<String,String> env,String workingDirPrefix,boolean debug) throws Exception ;

Fixed version (ground truth):
/** 
 * @deprecated Use execute(ExecutionEnvironment, ExecutionHandler<R>) instead.
 */
@Deprecated CommandExecutor newCommandExecutor(Map<String,String> env,String workingDirPrefix,boolean debug) throws Exception ;
Program: 38822
Project: 38822
Buggy source:
@Deprecated void onProgress(CommandExecution execution,int executionIndex);

Fixed version (ground truth):
/** 
 * @deprecated Use onExecutionCompletion(CommandExecution, int) instead.
 */
@Deprecated void onProgress(CommandExecution execution,int executionIndex);
Program: 38823
Project: 38823
Buggy source:
public InputFile(Function<Integer,String> nameFunc,FilePreProcessor preProcessor){
  this.name=new FunctionFileName(nameFunc,name -> checkName(name,preProcessor));
  this.preProcessor=preProcessor;
}

Fixed version (ground truth):
public InputFile(Function<Integer,String> nameFunc,FilePreProcessor preProcessor){
  this.name=new FunctionFileName(nameFunc,fileName -> checkName(fileName,preProcessor));
  this.preProcessor=preProcessor;
}
Program: 38824
Project: 38824
Buggy source:
@Deprecated public static DataSource createReadOnly(Path file){
  return createDataSource(file);
}

Fixed version (ground truth):
/** 
 * @deprecated Use createDataSource(Path) instead.
 */
@Deprecated public static DataSource createReadOnly(Path file){
  return createDataSource(file);
}
Program: 38825
Project: 38825
Buggy source:
@Override protected String getTypeDescription(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override protected String getTypeDescription(){
  return TYPE_DESCRIPTION;
}
Program: 38826
Project: 38826
Buggy source:
void update(){
  if (components != null) {
    return;
  }
  long startTime=System.currentTimeMillis();
  for (  Bus b : network.getBusBreakerView().getBuses()) {
    setComponentNumber((BusExt)b,-1);
  }
  int num=0;
  Map<String,Integer> id2num=new HashMap<>();
  List<BusExt> num2bus=new ArrayList<>();
  for (  Bus bus : network.getBusView().getBuses()) {
    num2bus.add((BusExt)bus);
    id2num.put(bus.getId(),num);
    num++;
  }
  TIntArrayList[] adjacencyList=new TIntArrayList[num];
  for (int i=0; i < adjacencyList.length; i++) {
    adjacencyList[i]=new TIntArrayList(3);
  }
  fillAdjacencyList(id2num,adjacencyList);
  ConnectedComponentsComputationResult result=GraphUtil.computeConnectedComponents(adjacencyList);
  components=new ArrayList<>(result.getComponentSize().length);
  for (int i=0; i < result.getComponentSize().length; i++) {
    components.add(createComponent(i,result.getComponentSize()[i]));
  }
  for (int i=0; i < result.getComponentNumber().length; i++) {
    BusExt bus=num2bus.get(i);
    setComponentNumber(bus,result.getComponentNumber()[i]);
  }
  LOGGER.debug(getComponentLabel() + "String_Node_Str",System.currentTimeMillis() - startTime);
}

Fixed version (ground truth):
void update(){
  if (components != null) {
    return;
  }
  long startTime=System.currentTimeMillis();
  for (  Bus b : network.getBusBreakerView().getBuses()) {
    setComponentNumber((BusExt)b,-1);
  }
  int num=0;
  Map<String,Integer> id2num=new HashMap<>();
  List<BusExt> num2bus=new ArrayList<>();
  for (  Bus bus : network.getBusView().getBuses()) {
    num2bus.add((BusExt)bus);
    id2num.put(bus.getId(),num);
    num++;
  }
  TIntArrayList[] adjacencyList=new TIntArrayList[num];
  for (int i=0; i < adjacencyList.length; i++) {
    adjacencyList[i]=new TIntArrayList(3);
  }
  fillAdjacencyList(id2num,adjacencyList);
  ConnectedComponentsComputationResult result=GraphUtil.computeConnectedComponents(adjacencyList);
  components=new ArrayList<>(result.getComponentSize().length);
  for (int i=0; i < result.getComponentSize().length; i++) {
    components.add(createComponent(i,result.getComponentSize()[i]));
  }
  for (int i=0; i < result.getComponentNumber().length; i++) {
    BusExt bus=num2bus.get(i);
    setComponentNumber(bus,result.getComponentNumber()[i]);
  }
  LOGGER.debug("String_Node_Str",getComponentLabel(),System.currentTimeMillis() - startTime);
}
Program: 38827
Project: 38827
Buggy source:
@Override public String getName(VoltageLevel voltageLevel,TIntArrayList nodes){
  AtomicInteger i;
  lock.lock();
  try {
    i=counter.get(voltageLevel);
    if (i == null) {
      i=new AtomicInteger();
      counter.put(voltageLevel,i);
    }
  }
  finally {
    lock.unlock();
  }
  return voltageLevel.getId() + "String_Node_Str" + i.getAndIncrement();
}

Fixed version (ground truth):
@Override public String getName(VoltageLevel voltageLevel,TIntArrayList nodes){
  AtomicInteger i;
  lock.lock();
  try {
    i=counter.computeIfAbsent(voltageLevel,k -> new AtomicInteger());
  }
  finally {
    lock.unlock();
  }
  return voltageLevel.getId() + "String_Node_Str" + i.getAndIncrement();
}
Program: 38828
Project: 38828
Buggy source:
protected BusChecker getBusChecker(){
  return CALCULATED_BUS_BREAKER_CHECKER;
}

Fixed version (ground truth):
@Override protected BusChecker getBusChecker(){
  return CALCULATED_BUS_BREAKER_CHECKER;
}
Program: 38829
Project: 38829
Buggy source:
@Deprecated static void checkTargetP(Validable validable,float targetP){
  checkActivePowerSetpoint(validable,targetP);
}

Fixed version (ground truth):
/** 
 * @deprecated Use checkActivePowerSetpoint(Validable, float) instead.
 */
@Deprecated static void checkTargetP(Validable validable,float targetP){
  checkActivePowerSetpoint(validable,targetP);
}
Program: 38830
Project: 38830
Buggy source:
@Deprecated public boolean isComputationOk(){
  return limitViolationsResult.isComputationOk();
}

Fixed version (ground truth):
/** 
 * @deprecated Use getLimitViolationsResult().isComputationOk() instead.
 */
@Deprecated public boolean isComputationOk(){
  return limitViolationsResult.isComputationOk();
}
Program: 38831
Project: 38831
Buggy source:
@Deprecated public List<String> getActionsTaken(){
  return limitViolationsResult.getActionsTaken();
}

Fixed version (ground truth):
/** 
 * @deprecated Use getLimitViolationsResult().getActionsTaken() instead.
 */
@Deprecated public List<String> getActionsTaken(){
  return limitViolationsResult.getActionsTaken();
}
Program: 38832
Project: 38832
Buggy source:
@Deprecated public List<LimitViolation> getLimitViolations(){
  return limitViolationsResult.getLimitViolations();
}

Fixed version (ground truth):
/** 
 * @deprecated Use getLimitViolationsResult().getLimitViolations() instead.
 */
@Deprecated public List<LimitViolation> getLimitViolations(){
  return limitViolationsResult.getLimitViolations();
}
Program: 38833
Project: 38833
Buggy source:
private int printUsage(PrintStream err){
  HelpFormatter formatter=new HelpFormatter();
  PrintWriter usage=new PrintWriter(err);
  formatter.printUsage(usage,80,"String_Node_Str");
  usage.append(System.lineSeparator()).append("String_Node_Str").append(System.lineSeparator());
  formatter.printOptions(usage,80,getScriptOptions(),formatter.getLeftPadding(),formatter.getDescPadding());
  usage.append(System.lineSeparator()).append("String_Node_Str").append(System.lineSeparator()).append(System.lineSeparator());
  List<Tool> allTools=Lists.newArrayList(tools).stream().filter(t -> !t.getCommand().isHidden()).collect(Collectors.toList());
  Map<String,Collection<Tool>> toolsByTheme=new TreeMap<>(Multimaps.index(allTools,tool -> tool.getCommand().getTheme()).asMap());
  for (  Map.Entry<String,Collection<Tool>> entry : toolsByTheme.entrySet()) {
    String theme=entry.getKey();
    List<Tool> tools=new ArrayList<>(entry.getValue());
    Collections.sort(tools,Comparator.comparing(t -> t.getCommand().getName()));
    usage.append(theme != null ? theme : "String_Node_Str").append("String_Node_Str").append(System.lineSeparator());
    for (    Tool tool : tools) {
      usage.append(String.format("String_Node_Str",tool.getCommand().getName(),tool.getCommand().getDescription())).append(System.lineSeparator());
    }
    usage.append(System.lineSeparator());
  }
  usage.flush();
  return COMMAND_NOT_FOUND_STATUS;
}

Fixed version (ground truth):
private int printUsage(PrintStream err){
  HelpFormatter formatter=new HelpFormatter();
  PrintWriter usage=new PrintWriter(err);
  formatter.printUsage(usage,80,"String_Node_Str");
  usage.append(System.lineSeparator()).append("String_Node_Str").append(System.lineSeparator());
  formatter.printOptions(usage,80,getScriptOptions(),formatter.getLeftPadding(),formatter.getDescPadding());
  usage.append(System.lineSeparator()).append("String_Node_Str").append(System.lineSeparator()).append(System.lineSeparator());
  List<Tool> allTools=Lists.newArrayList(tools).stream().filter(t -> !t.getCommand().isHidden()).collect(Collectors.toList());
  Map<String,Collection<Tool>> toolsByTheme=new TreeMap<>(Multimaps.index(allTools,tool -> tool.getCommand().getTheme()).asMap());
  for (  Map.Entry<String,Collection<Tool>> entry : toolsByTheme.entrySet()) {
    String theme=entry.getKey();
    usage.append(theme != null ? theme : "String_Node_Str").append("String_Node_Str").append(System.lineSeparator());
    entry.getValue().stream().sorted(Comparator.comparing(t -> t.getCommand().getName())).forEach(tool -> usage.append(String.format("String_Node_Str",tool.getCommand().getName(),tool.getCommand().getDescription())).append(System.lineSeparator()));
    usage.append(System.lineSeparator());
  }
  usage.flush();
  return COMMAND_NOT_FOUND_STATUS;
}
Program: 38834
Project: 38834
Buggy source:
@Deprecated default void run(CommandLine line) throws Exception {
}

Fixed version (ground truth):
/** 
 * @deprecated Use run(CommandLine, ToolRunningContext) instead.
 */
@Deprecated default void run(CommandLine line) throws Exception {
}
Program: 38835
Project: 38835
Buggy source:
private static void createXnodeCoupler(UcteNetworkExt ucteNetwork,UcteLine ucteLine,UcteNodeCode ucteXnodeCode,UcteVoltageLevel ucteXvoltageLevel,UcteNodeCode ucteOtherNodeCode,Network network){
  String xNodeName=ucteXnodeCode.toString();
  String yNodeName="String_Node_Str" + xNodeName.substring(1);
  VoltageLevel xNodeVoltageLevel=network.getVoltageLevel(ucteXvoltageLevel.getName());
  xNodeVoltageLevel.getBusBreakerView().newBus().setId(yNodeName).add();
  UcteNode ucteXnode=ucteNetwork.getNode(ucteXnodeCode);
  LOGGER.warn("String_Node_Str",xNodeName + yNodeName,ucteXnode.getCode());
  float p0=0;
  if (isValueValid(ucteXnode.getActiveLoad())) {
    p0+=ucteXnode.getActiveLoad();
  }
  if (isValueValid(ucteXnode.getActivePowerGeneration())) {
    p0+=ucteXnode.getActivePowerGeneration();
  }
  float q0=0;
  if (isValueValid(ucteXnode.getReactiveLoad())) {
    q0+=ucteXnode.getReactiveLoad();
  }
  if (isValueValid(ucteXnode.getReactivePowerGeneration())) {
    q0+=ucteXnode.getReactivePowerGeneration();
  }
  xNodeVoltageLevel.newDanglingLine().setId(xNodeName + yNodeName).setBus(yNodeName).setConnectableBus(yNodeName).setR(0.0f).setX(LINE_MIN_Z).setG(0f).setB(0f).setP0(p0).setQ0(q0).setUcteXnodeCode(ucteXnode.getCode().toString()).add();
  xNodeVoltageLevel.getBusBreakerView().newSwitch().setId(ucteLine.getId().toString()).setBus1(yNodeName).setBus2(ucteOtherNodeCode.toString()).setOpen(ucteLine.getStatus() == UcteElementStatus.BUSBAR_COUPLER_OUT_OF_OPERATION).add();
}

Fixed version (ground truth):
private static void createXnodeCoupler(UcteNetworkExt ucteNetwork,UcteLine ucteLine,UcteNodeCode ucteXnodeCode,UcteVoltageLevel ucteXvoltageLevel,UcteNodeCode ucteOtherNodeCode,Network network){
  String xNodeName=ucteXnodeCode.toString();
  String yNodeName="String_Node_Str" + xNodeName.substring(1);
  VoltageLevel xNodeVoltageLevel=network.getVoltageLevel(ucteXvoltageLevel.getName());
  xNodeVoltageLevel.getBusBreakerView().newBus().setId(yNodeName).add();
  UcteNode ucteXnode=ucteNetwork.getNode(ucteXnodeCode);
  LOGGER.warn("String_Node_Str",xNodeName,yNodeName,ucteXnode.getCode());
  float p0=0;
  if (isValueValid(ucteXnode.getActiveLoad())) {
    p0+=ucteXnode.getActiveLoad();
  }
  if (isValueValid(ucteXnode.getActivePowerGeneration())) {
    p0+=ucteXnode.getActivePowerGeneration();
  }
  float q0=0;
  if (isValueValid(ucteXnode.getReactiveLoad())) {
    q0+=ucteXnode.getReactiveLoad();
  }
  if (isValueValid(ucteXnode.getReactivePowerGeneration())) {
    q0+=ucteXnode.getReactivePowerGeneration();
  }
  xNodeVoltageLevel.newDanglingLine().setId(xNodeName + yNodeName).setBus(yNodeName).setConnectableBus(yNodeName).setR(0.0f).setX(LINE_MIN_Z).setG(0f).setB(0f).setP0(p0).setQ0(q0).setUcteXnodeCode(ucteXnode.getCode().toString()).add();
  xNodeVoltageLevel.getBusBreakerView().newSwitch().setId(ucteLine.getId().toString()).setBus1(yNodeName).setBus2(ucteOtherNodeCode.toString()).setOpen(ucteLine.getStatus() == UcteElementStatus.BUSBAR_COUPLER_OUT_OF_OPERATION).add();
}
Program: 38837
Project: 38837
Buggy source:
private String alignAndTruncate(String str,int strLen,Alignment alignment){
  String formattedStr=String.format(java.util.Locale.US,"String_Node_Str" + (alignment.equals(Alignment.LEFT) ? "String_Node_Str" : "String_Node_Str") + strLen+ "String_Node_Str",str);
  return formattedStr.substring(0,strLen);
}

Fixed version (ground truth):
private String alignAndTruncate(String str,int strLen,Alignment alignment){
  String format=String.format(Locale.US,alignment.equals(Alignment.LEFT) ? "String_Node_Str" : "String_Node_Str",strLen);
  String formattedStr=String.format(Locale.US,format,str);
  return formattedStr.substring(0,strLen);
}
Program: 38838
Project: 38838
Buggy source:
public void load(int version,List<TimeSeries> timeSeriesList){
  checkVersion(version);
  Objects.requireNonNull(timeSeriesList);
  if (timeSeriesList.isEmpty()) {
    throw new TimeSeriesException("String_Node_Str");
  }
  Stopwatch stopWatch=Stopwatch.createStarted();
  List<DoubleTimeSeries> doubleTimeSeries=new ArrayList<>();
  List<StringTimeSeries> stringTimeSeries=new ArrayList<>();
  for (  TimeSeries timeSeries : timeSeriesList) {
    Objects.requireNonNull(timeSeries);
    if (timeSeries instanceof DoubleTimeSeries) {
      doubleTimeSeries.add((DoubleTimeSeries)timeSeries);
    }
 else     if (timeSeries instanceof StringTimeSeries) {
      stringTimeSeries.add((StringTimeSeries)timeSeries);
    }
 else {
      throw new AssertionError("String_Node_Str" + timeSeries.getClass());
    }
  }
  initTable(doubleTimeSeries,stringTimeSeries);
  for (  DoubleTimeSeries timeSeries : doubleTimeSeries) {
    loadDouble(version,timeSeries);
  }
  for (  StringTimeSeries timeSeries : stringTimeSeries) {
    loadString(version,timeSeries);
  }
  LOGGER.info("String_Node_Str",timeSeriesList.size(),version,stopWatch.elapsed(TimeUnit.MILLISECONDS));
}

Fixed version (ground truth):
public void load(int version,List<TimeSeries> timeSeriesList){
  checkVersion(version);
  Objects.requireNonNull(timeSeriesList);
  if (timeSeriesList.isEmpty()) {
    throw new TimeSeriesException("String_Node_Str");
  }
  Stopwatch stopWatch=Stopwatch.createStarted();
  List<DoubleTimeSeries> doubleTimeSeries=new ArrayList<>();
  List<StringTimeSeries> stringTimeSeries=new ArrayList<>();
  for (  TimeSeries timeSeries : timeSeriesList) {
    Objects.requireNonNull(timeSeries);
    if (timeSeries instanceof DoubleTimeSeries) {
      doubleTimeSeries.add((DoubleTimeSeries)timeSeries);
    }
 else     if (timeSeries instanceof StringTimeSeries) {
      stringTimeSeries.add((StringTimeSeries)timeSeries);
    }
 else {
      throw new AssertionError("String_Node_Str" + timeSeries.getClass());
    }
  }
  initTable(doubleTimeSeries,stringTimeSeries);
  for (  DoubleTimeSeries timeSeries : doubleTimeSeries) {
    timeSeries.synchronize(tableIndex);
    loadDouble(version,timeSeries);
  }
  for (  StringTimeSeries timeSeries : stringTimeSeries) {
    timeSeries.synchronize(tableIndex);
    loadString(version,timeSeries);
  }
  LOGGER.info("String_Node_Str",timeSeriesList.size(),version,stopWatch.elapsed(TimeUnit.MILLISECONDS));
}
Program: 38840
Project: 38840
Buggy source:
public int add(E e){
  Objects.requireNonNull(e);
  int i=list.size();
  list.add(e);
  reverse.put(e,i);
  return i;
}

Fixed version (ground truth):
public int add(E e){
  Objects.requireNonNull(e);
  lock.lock();
  try {
    int i=list.size();
    list.add(e);
    reverse.put(e,i);
    return i;
  }
  finally {
    lock.unlock();
  }
}
Program: 38841
Project: 38841
Buggy source:
int size(){
  return list.size();
}

Fixed version (ground truth):
int size(){
  lock.lock();
  try {
    return list.size();
  }
  finally {
    lock.unlock();
  }
}
Program: 38842
Project: 38842
Buggy source:
public E get(int index){
  return list.get(index);
}

Fixed version (ground truth):
public E get(int index){
  lock.lock();
  try {
    return list.get(index);
  }
  finally {
    lock.unlock();
  }
}
Program: 38843
Project: 38843
Buggy source:
void clear(){
  list.clear();
  reverse.clear();
}

Fixed version (ground truth):
void clear(){
  lock.lock();
  try {
    list.clear();
    reverse.clear();
  }
  finally {
    lock.unlock();
  }
}
Program: 38844
Project: 38844
Buggy source:
public int indexOf(E e){
  Objects.requireNonNull(e);
  if (!reverse.containsKey(e)) {
    return -1;
  }
  return reverse.get(e);
}

Fixed version (ground truth):
public int indexOf(E e){
  Objects.requireNonNull(e);
  lock.lock();
  try {
    if (!reverse.containsKey(e)) {
      return -1;
    }
    return reverse.get(e);
  }
  finally {
    lock.unlock();
  }
}
Program: 38845
Project: 38845
Buggy source:
public void putString(int index,String value){
  int num;
  if (value == null) {
    num=-1;
  }
 else {
    num=dict.indexOf(value);
    if (num == -1) {
      num=dict.add(value);
    }
  }
  buffer.put(index,num);
}

Fixed version (ground truth):
public void putString(int index,String value){
  int num;
  if (value == null) {
    num=-1;
  }
 else {
    num=dict.addIfNotAlreadyExist(value);
  }
  buffer.put(index,num);
}
Program: 38846
Project: 38846
Buggy source:
@Test public void test() throws IOException {
  NodeInfo info=new NodeInfo("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",1000000,1000001,0,new NodeGenericMetadata());
  NodeDependency dependency=new NodeDependency("String_Node_Str",info);
  assertEquals("String_Node_Str",dependency.getName());
  assertEquals(info,dependency.getNodeInfo());
  assertEquals("String_Node_Str",dependency.toString());
  ObjectMapper objectMapper=new ObjectMapper().registerModule(new AppStorageJsonModule());
  NodeDependency dependency2=objectMapper.readValue(objectMapper.writeValueAsString(dependency),NodeDependency.class);
  assertEquals(dependency,dependency2);
}

Fixed version (ground truth):
@Test public void test() throws IOException {
  NodeInfo info=new NodeInfo("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",1000000,1000001,0,new NodeGenericMetadata());
  NodeDependency dependency=new NodeDependency("String_Node_Str",info);
  assertEquals("String_Node_Str",dependency.getName());
  assertEquals(info,dependency.getNodeInfo());
  assertEquals("String_Node_Str",dependency.toString());
  ObjectMapper objectMapper=JsonUtil.createObjectMapper().registerModule(new AppStorageJsonModule());
  NodeDependency dependency2=objectMapper.readValue(objectMapper.writeValueAsString(dependency),NodeDependency.class);
  assertEquals(dependency,dependency2);
}
Program: 38847
Project: 38847
Buggy source:
@Before public void setUp() throws Exception {
  objectMapper=new ObjectMapper().registerModule(new AppStorageJsonModule());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  objectMapper=JsonUtil.createObjectMapper().registerModule(new AppStorageJsonModule());
}
Program: 38848
Project: 38848
Buggy source:
@Before public void setUp() throws Exception {
  objectMapper=new ObjectMapper().registerModule(new AppStorageJsonModule());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  objectMapper=JsonUtil.createObjectMapper().registerModule(new AppStorageJsonModule());
}
Program: 38849
Project: 38849
Buggy source:
@Before public void setUp() throws Exception {
  objectMapper=new ObjectMapper();
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  objectMapper=JsonUtil.createObjectMapper();
}
Program: 38850
Project: 38850
Buggy source:
public static <T>T parseJson(Reader reader,Function<JsonParser,T> function){
  Objects.requireNonNull(reader);
  Objects.requireNonNull(function);
  JsonFactory factory=new JsonFactory();
  try (JsonParser parser=factory.createParser(reader)){
    return function.apply(parser);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}

Fixed version (ground truth):
public static <T>T parseJson(Reader reader,Function<JsonParser,T> function){
  Objects.requireNonNull(reader);
  Objects.requireNonNull(function);
  JsonFactory factory=createJsonFactory();
  try (JsonParser parser=factory.createParser(reader)){
    return function.apply(parser);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}
Program: 38851
Project: 38851
Buggy source:
static Foo read(InputStream stream) throws IOException {
  ObjectMapper mapper=new ObjectMapper();
  SimpleModule module=new SimpleModule();
  module.addDeserializer(Foo.class,new FooDeserializer());
  mapper.registerModule(module);
  return mapper.readValue(stream,Foo.class);
}

Fixed version (ground truth):
static Foo read(InputStream stream) throws IOException {
  ObjectMapper mapper=JsonUtil.createObjectMapper();
  SimpleModule module=new SimpleModule();
  module.addDeserializer(Foo.class,new FooDeserializer());
  mapper.registerModule(module);
  return mapper.readValue(stream,Foo.class);
}
Program: 38852
Project: 38852
Buggy source:
private static Contingency read(Path jsonFile){
  Objects.requireNonNull(jsonFile);
  try (InputStream is=Files.newInputStream(jsonFile)){
    ObjectMapper objectMapper=new ObjectMapper();
    SimpleModule module=new SimpleModule();
    module.addDeserializer(Contingency.class,new ContingencyDeserializer());
    module.addDeserializer(ContingencyElement.class,new ContingencyElementDeserializer());
    objectMapper.registerModule(module);
    return objectMapper.readValue(is,Contingency.class);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}

Fixed version (ground truth):
private static Contingency read(Path jsonFile){
  Objects.requireNonNull(jsonFile);
  try (InputStream is=Files.newInputStream(jsonFile)){
    ObjectMapper objectMapper=JsonUtil.createObjectMapper();
    SimpleModule module=new SimpleModule();
    module.addDeserializer(Contingency.class,new ContingencyDeserializer());
    module.addDeserializer(ContingencyElement.class,new ContingencyElementDeserializer());
    objectMapper.registerModule(module);
    return objectMapper.readValue(is,Contingency.class);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}
Program: 38853
Project: 38853
Buggy source:
private static void write(Contingency object,Path jsonFile){
  Objects.requireNonNull(object);
  Objects.requireNonNull(jsonFile);
  try (OutputStream os=Files.newOutputStream(jsonFile)){
    ObjectMapper mapper=new ObjectMapper();
    SimpleModule module=new SimpleModule();
    module.addSerializer(ContingencyElement.class,new ContingencyElementSerializer());
    mapper.registerModule(module);
    ObjectWriter writer=mapper.writerWithDefaultPrettyPrinter();
    writer.writeValue(os,object);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}

Fixed version (ground truth):
private static void write(Contingency object,Path jsonFile){
  Objects.requireNonNull(object);
  Objects.requireNonNull(jsonFile);
  try (OutputStream os=Files.newOutputStream(jsonFile)){
    ObjectMapper mapper=JsonUtil.createObjectMapper();
    SimpleModule module=new SimpleModule();
    module.addSerializer(ContingencyElement.class,new ContingencyElementSerializer());
    mapper.registerModule(module);
    ObjectWriter writer=mapper.writerWithDefaultPrettyPrinter();
    writer.writeValue(os,object);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}
Program: 38854
Project: 38854
Buggy source:
public static void write(LoadFlowResult result,Path jsonFile){
  Objects.requireNonNull(result);
  Objects.requireNonNull(jsonFile);
  try (OutputStream os=Files.newOutputStream(jsonFile)){
    ObjectMapper objectMapper=new ObjectMapper();
    SimpleModule module=new SimpleModule();
    module.addSerializer(LoadFlowResult.class,new LoadFlowResultSerializer());
    objectMapper.registerModule(module);
    ObjectWriter writer=objectMapper.writerWithDefaultPrettyPrinter();
    writer.writeValue(os,result);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}

Fixed version (ground truth):
public static void write(LoadFlowResult result,Path jsonFile){
  Objects.requireNonNull(result);
  Objects.requireNonNull(jsonFile);
  try (OutputStream os=Files.newOutputStream(jsonFile)){
    ObjectMapper objectMapper=JsonUtil.createObjectMapper();
    SimpleModule module=new SimpleModule();
    module.addSerializer(LoadFlowResult.class,new LoadFlowResultSerializer());
    objectMapper.registerModule(module);
    ObjectWriter writer=objectMapper.writerWithDefaultPrettyPrinter();
    writer.writeValue(os,result);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}
Program: 38855
Project: 38855
Buggy source:
static void parseJson(JsonParser parser,List<DoubleArrayChunk> doubleChunks,List<StringArrayChunk> stringChunks,boolean single){
  Objects.requireNonNull(parser);
  try {
    JsonParsingContext context=new JsonParsingContext(doubleChunks,stringChunks);
    JsonToken token;
    while ((token=parser.nextToken()) != null) {
switch (token) {
case FIELD_NAME:
        parseFieldName(parser,context);
      break;
case END_OBJECT:
    parseEndObject(context);
  if (single) {
    return;
  }
 else {
    break;
  }
case END_ARRAY:
if (context.valuesOrLengthArray) {
  context.valuesOrLengthArray=false;
}
 else {
  return;
}
break;
case VALUE_NUMBER_FLOAT:
context.addDoubleValue(parser.getDoubleValue());
break;
case VALUE_NUMBER_INT:
parseValueNumberInt(parser,context);
break;
case VALUE_STRING:
context.addStringValue(parser.getValueAsString());
break;
default :
break;
}
}
}
 catch (IOException e) {
throw new UncheckedIOException(e);
}
}

Fixed version (ground truth):
static void parseJson(JsonParser parser,List<DoubleArrayChunk> doubleChunks,List<StringArrayChunk> stringChunks,boolean single){
  Objects.requireNonNull(parser);
  try {
    JsonParsingContext context=new JsonParsingContext(doubleChunks,stringChunks);
    JsonToken token;
    while ((token=parser.nextToken()) != null) {
switch (token) {
case FIELD_NAME:
        parseFieldName(parser,context);
      break;
case END_OBJECT:
    parseEndObject(context);
  if (single) {
    return;
  }
 else {
    break;
  }
case END_ARRAY:
if (context.valuesOrLengthArray) {
  context.valuesOrLengthArray=false;
}
 else {
  return;
}
break;
case VALUE_NUMBER_FLOAT:
context.addDoubleValue(parser.getDoubleValue());
break;
case VALUE_NUMBER_INT:
parseValueNumberInt(parser,context);
break;
case VALUE_STRING:
context.addStringValue(parser.getValueAsString());
break;
case VALUE_NULL:
context.addStringValue(null);
break;
default :
break;
}
}
}
 catch (IOException e) {
throw new UncheckedIOException(e);
}
}
Program: 38856
Project: 38856
Buggy source:
static void addCompressedChunk(JsonParsingContext context){
  if (context.doubleValues != null) {
    context.doubleChunks.add(new CompressedDoubleArrayChunk(context.offset,context.uncompressedLength,context.doubleValues.toArray(),context.stepLengths.toArray()));
    context.doubleValues=null;
    context.stepLengths=null;
    context.uncompressedLength=-1;
  }
 else   if (context.stringValues != null) {
    context.stringChunks.add(new CompressedStringArrayChunk(context.offset,context.uncompressedLength,context.stringValues.toArray(new String[context.stringValues.size()]),context.stepLengths.toArray()));
    context.stringValues=null;
    context.stepLengths=null;
    context.uncompressedLength=-1;
  }
 else {
    throw new AssertionError("String_Node_Str");
  }
}

Fixed version (ground truth):
static void addCompressedChunk(JsonParsingContext context){
  if (context.doubleValues != null && context.stringValues == null) {
    context.doubleChunks.add(new CompressedDoubleArrayChunk(context.offset,context.uncompressedLength,context.doubleValues.toArray(),context.stepLengths.toArray()));
    context.doubleValues=null;
    context.stepLengths=null;
    context.uncompressedLength=-1;
  }
 else   if (context.stringValues != null && context.doubleValues == null) {
    context.stringChunks.add(new CompressedStringArrayChunk(context.offset,context.uncompressedLength,context.stringValues.toArray(new String[context.stringValues.size()]),context.stepLengths.toArray()));
    context.stringValues=null;
    context.stepLengths=null;
    context.uncompressedLength=-1;
  }
 else   if (context.stringValues != null && context.doubleValues != null) {
    throw new AssertionError("String_Node_Str");
  }
 else {
    throw new AssertionError("String_Node_Str");
  }
}
Program: 38857
Project: 38857
Buggy source:
static void addUncompressedChunk(JsonParsingContext context){
  if (context.doubleValues != null) {
    context.doubleChunks.add(new UncompressedDoubleArrayChunk(context.offset,context.doubleValues.toArray()));
  }
 else   if (context.stringValues != null) {
    context.stringChunks.add(new UncompressedStringArrayChunk(context.offset,context.stringValues.toArray(new String[context.stringValues.size()])));
  }
 else {
    throw new AssertionError("String_Node_Str");
  }
}

Fixed version (ground truth):
static void addUncompressedChunk(JsonParsingContext context){
  if (context.doubleValues != null && context.stringValues == null) {
    context.doubleChunks.add(new UncompressedDoubleArrayChunk(context.offset,context.doubleValues.toArray()));
  }
 else   if (context.stringValues != null && context.doubleValues == null) {
    context.stringChunks.add(new UncompressedStringArrayChunk(context.offset,context.stringValues.toArray(new String[context.stringValues.size()])));
  }
 else   if (context.stringValues != null && context.doubleValues != null) {
    throw new AssertionError("String_Node_Str");
  }
 else {
    throw new AssertionError("String_Node_Str");
  }
}
Program: 38863
Project: 38863
Buggy source:
public static SecurityAnalysisResult read(Path jsonFile){
  Objects.requireNonNull(jsonFile);
  try (InputStream is=Files.newInputStream(jsonFile)){
    ObjectMapper objectMapper=new ObjectMapper().enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING).registerModule(new SecurityAnalysisJsonModule());
    return objectMapper.readValue(is,SecurityAnalysisResult.class);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}

Fixed version (ground truth):
public static SecurityAnalysisResult read(Path jsonFile){
  Objects.requireNonNull(jsonFile);
  try (InputStream is=Files.newInputStream(jsonFile)){
    ObjectMapper objectMapper=JsonUtil.createObjectMapper().registerModule(new SecurityAnalysisJsonModule());
    return objectMapper.readValue(is,SecurityAnalysisResult.class);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}
Program: 38864
Project: 38864
Buggy source:
public static void write(SecurityAnalysisResult result,Writer writer) throws IOException {
  Objects.requireNonNull(result);
  Objects.requireNonNull(writer);
  ObjectMapper objectMapper=new ObjectMapper().registerModule(new SecurityAnalysisJsonModule());
  ObjectWriter objectWriter=objectMapper.writerWithDefaultPrettyPrinter();
  objectWriter.writeValue(writer,result);
}

Fixed version (ground truth):
public static void write(SecurityAnalysisResult result,Writer writer) throws IOException {
  Objects.requireNonNull(result);
  Objects.requireNonNull(writer);
  ObjectMapper objectMapper=JsonUtil.createObjectMapper().registerModule(new SecurityAnalysisJsonModule());
  ObjectWriter objectWriter=objectMapper.writerWithDefaultPrettyPrinter();
  objectWriter.writeValue(writer,result);
}
Program: 38865
Project: 38865
Buggy source:
@Override public MpiStatistics create(Path dbDir,String dbName){
  try {
    return new CsvMpiStatistics(dbDir,dbName);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}

Fixed version (ground truth):
@Override public MpiStatistics create(Path dbDir,String dbName){
  if (dbDir == null || dbName == null) {
    return new NoMpiStatistics();
  }
  try {
    return new CsvMpiStatistics(dbDir,dbName);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
}
Program: 38866
Project: 38866
Buggy source:
public MpiComputationManager(Path localDir,MpiJobScheduler scheduler,MpiStatistics statistics,MpiExecutorContext executorContext){
  this.localDir=Objects.requireNonNull(localDir);
  this.statistics=Objects.requireNonNull(statistics);
  this.executorContext=Objects.requireNonNull(executorContext);
  this.scheduler=scheduler;
  if (executorContext.getMonitorExecutor() != null) {
    busyCoresPrintTask=executorContext.getMonitorExecutor().scheduleAtFixedRate(() -> LOGGER.info("String_Node_Str",scheduler.getResources().getBusyCores(),scheduler.getResources().getAvailableCores(),((float)scheduler.getStartedTasksAndReset()) / LOG_DELAY),0,LOG_DELAY,TimeUnit.SECONDS);
  }
}

Fixed version (ground truth):
public MpiComputationManager(Path localDir,MpiJobScheduler scheduler,MpiExecutorContext executorContext){
  this.localDir=Objects.requireNonNull(localDir);
  this.executorContext=Objects.requireNonNull(executorContext);
  this.scheduler=scheduler;
  if (executorContext.getMonitorExecutor() != null) {
    busyCoresPrintTask=executorContext.getMonitorExecutor().scheduleAtFixedRate(() -> LOGGER.info("String_Node_Str",scheduler.getResources().getBusyCores(),scheduler.getResources().getAvailableCores(),((float)scheduler.getStartedTasksAndReset()) / LOG_DELAY),0,LOG_DELAY,TimeUnit.SECONDS);
  }
}
Program: 38867
Project: 38867
Buggy source:
@Override public void close(){
  try {
    scheduler.shutdown();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
  try {
    statistics.close();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
  if (busyCoresPrintTask != null) {
    busyCoresPrintTask.cancel(true);
  }
  try {
    executorContext.shutdown();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
}

Fixed version (ground truth):
@Override public void close(){
  try {
    scheduler.shutdown();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
  if (busyCoresPrintTask != null) {
    busyCoresPrintTask.cancel(true);
  }
  try {
    executorContext.shutdown();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
}
Program: 38869
Project: 38869
Buggy source:
@Override public void shutdown() throws Exception {
  stopRequested=true;
  future.get();
}

Fixed version (ground truth):
@Override public void shutdown() throws Exception {
  try {
    statistics.close();
  }
 catch (  Exception e) {
    LOGGER.error(e.toString(),e);
  }
  stopRequested=true;
  future.get();
}
Program: 38870
Project: 38870
Buggy source:
public static ComputationManager createMpiComputationManager(CommandLine line,FileSystem fileSystem){
  Path tmpDir=fileSystem.getPath(line.hasOption(TMP_DIR) ? line.getOptionValue(TMP_DIR) : System.getProperty("String_Node_Str"));
  Path statisticsDbDir=line.hasOption(STATISTICS_DB_DIR) ? fileSystem.getPath(line.getOptionValue(STATISTICS_DB_DIR)) : null;
  String statisticsDbName=line.hasOption(STATISTICS_DB_NAME) ? line.getOptionValue(STATISTICS_DB_NAME) : null;
  int coresPerRank=Integer.parseInt(line.getOptionValue(CORES));
  boolean verbose=line.hasOption(VERBOSE);
  Path stdOutArchive=line.hasOption(STDOUT_ARCHIVE) ? fileSystem.getPath(line.getOptionValue(STDOUT_ARCHIVE)) : null;
  ComponentDefaultConfig config=ComponentDefaultConfig.load();
  MpiStatisticsFactory statisticsFactory=createMpiStatisticsFactory(config,statisticsDbDir,statisticsDbName);
  try {
    return new MpiComputationManager(tmpDir,statisticsFactory.create(statisticsDbDir,statisticsDbName),new MpiExecutorContext(),coresPerRank,verbose,stdOutArchive);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    throw new UncheckedInterruptedException(e);
  }
}

Fixed version (ground truth):
public static ComputationManager createMpiComputationManager(CommandLine line,FileSystem fileSystem){
  Path tmpDir=fileSystem.getPath(line.hasOption(TMP_DIR) ? line.getOptionValue(TMP_DIR) : System.getProperty("String_Node_Str"));
  Path statisticsDbDir=line.hasOption(STATISTICS_DB_DIR) ? fileSystem.getPath(line.getOptionValue(STATISTICS_DB_DIR)) : null;
  String statisticsDbName=line.hasOption(STATISTICS_DB_NAME) ? line.getOptionValue(STATISTICS_DB_NAME) : null;
  int coresPerRank=Integer.parseInt(line.getOptionValue(CORES));
  boolean verbose=line.hasOption(VERBOSE);
  Path stdOutArchive=line.hasOption(STDOUT_ARCHIVE) ? fileSystem.getPath(line.getOptionValue(STDOUT_ARCHIVE)) : null;
  ComponentDefaultConfig config=ComponentDefaultConfig.load();
  MpiStatisticsFactory statisticsFactory=config.newFactoryImpl(MpiStatisticsFactory.class,NoMpiStatisticsFactory.class);
  try {
    return new MpiComputationManager(tmpDir,statisticsFactory,statisticsDbDir,statisticsDbName,new MpiExecutorContext(),coresPerRank,verbose,stdOutArchive);
  }
 catch (  IOException e) {
    throw new UncheckedIOException(e);
  }
catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    throw new UncheckedInterruptedException(e);
  }
}
Program: 38871
Project: 38871
Buggy source:
static void parseFieldName(JsonParser parser,JsonParsingContext context) throws IOException {
  String fieldName=parser.getCurrentName();
switch (fieldName) {
case "String_Node_Str":
    break;
case "String_Node_Str":
  context.name=parser.nextTextValue();
break;
case "String_Node_Str":
context.dataType=TimeSeriesDataType.valueOf(parser.nextTextValue());
break;
case "String_Node_Str":
context.insideTags=true;
break;
case RegularTimeSeriesIndex.TYPE:
context.index=RegularTimeSeriesIndex.parseJson(parser);
break;
default :
if (context.insideTags) {
context.tags.put(fieldName,parser.nextTextValue());
}
 else {
throw new IllegalStateException("String_Node_Str" + fieldName);
}
}
}

Fixed version (ground truth):
static void parseFieldName(JsonParser parser,JsonParsingContext context) throws IOException {
  String fieldName=parser.getCurrentName();
  if (context.insideTags) {
    context.tags.put(fieldName,parser.nextTextValue());
  }
 else {
switch (fieldName) {
case "String_Node_Str":
      break;
case "String_Node_Str":
    context.name=parser.nextTextValue();
  break;
case "String_Node_Str":
context.dataType=TimeSeriesDataType.valueOf(parser.nextTextValue());
break;
case "String_Node_Str":
context.insideTags=true;
break;
case RegularTimeSeriesIndex.TYPE:
context.index=RegularTimeSeriesIndex.parseJson(parser);
break;
default :
throw new IllegalStateException("String_Node_Str" + fieldName);
}
}
}
Program: 38872
Project: 38872
Buggy source:
TerminalExt build(){
  String connectionBus=getConnectionBus();
  if (node != null && connectionBus != null) {
    throw new ValidationException(validable,"String_Node_Str");
  }
  return node != null ? new NodeTerminal(network,node) : new BusTerminal(network,connectionBus,bus != null);
}

Fixed version (ground truth):
TerminalExt build(){
  String connectionBus=getConnectionBus();
  if (node != null && connectionBus != null) {
    throw new ValidationException(validable,"String_Node_Str");
  }
  if (node == null) {
    if (connectionBus == null) {
      throw new ValidationException(validable,"String_Node_Str");
    }
    return new BusTerminal(network,connectionBus,bus != null);
  }
 else {
    return new NodeTerminal(network,node);
  }
}
Program: 38873
Project: 38873
Buggy source:
@Override public InputStream newInputStream(String fileName) throws IOException {
  Objects.requireNonNull(fileName);
  Path zipFilePath=getZipFilePath();
  if (Files.exists(zipFilePath)) {
    ZipFile zipFile=new ZipFile(zipFilePath);
    InputStream is=zipFile.getInputStream(fileName);
    if (is != null) {
      InputStream fis=new ForwardingInputStream<InputStream>(is){
        @Override public void close() throws IOException {
          zipFile.close();
        }
      }
;
      return observer != null ? new ObservableInputStream(fis,zipFilePath + "String_Node_Str" + fileName,observer) : fis;
    }
 else {
      zipFile.close();
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public InputStream newInputStream(String fileName) throws IOException {
  Objects.requireNonNull(fileName);
  Path zipFilePath=getZipFilePath();
  if (entryExists(zipFilePath,fileName)) {
    InputStream is=new ZipEntryInputStream(new ZipFile(zipFilePath),fileName);
    return observer != null ? new ObservableInputStream(is,zipFilePath + "String_Node_Str" + fileName,observer) : is;
  }
  return null;
}
Program: 38874
Project: 38874
Buggy source:
@Override public boolean exists(String fileName) throws IOException {
  Objects.requireNonNull(fileName);
  Path zipFilePath=getZipFilePath();
  if (Files.exists(zipFilePath)) {
    try (ZipFile zipFile=new ZipFile(zipFilePath)){
      return zipFile.entry(fileName) != null;
    }
   }
  return false;
}

Fixed version (ground truth):
@Override public boolean exists(String fileName) throws IOException {
  Objects.requireNonNull(fileName);
  Path zipFilePath=getZipFilePath();
  return entryExists(zipFilePath,fileName);
}
Program: 38875
Project: 38875
Buggy source:
public CacheEntry build(){
  Path baseDir=cacheDir.resolve(name);
  if (keys.size() > 0) {
    HashFunction hf=Hashing.md5();
    Hasher h=hf.newHasher();
    for (    String key : keys) {
      h.putString(key,Charsets.UTF_8);
    }
    HashCode hc=h.hash();
    baseDir=baseDir.resolve(hc.toString());
  }
  cacheEntriesLock.lock();
  try {
    CacheEntry cacheEntry=cacheEntries.get(baseDir.toString());
    if (cacheEntry != null) {
      if (!cacheEntry.getKeys().equals(keys)) {
        throw new PowsyblException("String_Node_Str");
      }
    }
 else {
      cacheEntry=new CacheEntry(baseDir,keys);
      cacheEntries.put(baseDir.toString(),cacheEntry);
    }
    return cacheEntry;
  }
  finally {
    cacheEntriesLock.unlock();
  }
}

Fixed version (ground truth):
public CacheEntry build(){
  Path baseDir=cacheDir.resolve(name);
  if (!keys.isEmpty()) {
    HashFunction hf=Hashing.md5();
    Hasher h=hf.newHasher();
    for (    String key : keys) {
      h.putString(key,Charsets.UTF_8);
    }
    HashCode hc=h.hash();
    baseDir=baseDir.resolve(hc.toString());
  }
  cacheEntriesLock.lock();
  try {
    CacheEntry cacheEntry=cacheEntries.get(baseDir.toString());
    if (cacheEntry != null) {
      if (!cacheEntry.getKeys().equals(keys)) {
        throw new PowsyblException("String_Node_Str");
      }
    }
 else {
      cacheEntry=new CacheEntry(baseDir,keys);
      cacheEntries.put(baseDir.toString(),cacheEntry);
    }
    return cacheEntry;
  }
  finally {
    cacheEntriesLock.unlock();
  }
}
Program: 38876
Project: 38876
Buggy source:
public void lock(){
  try {
    semaphore.acquire();
  }
 catch (  InterruptedException e) {
    throw new UncheckedInterruptedException(e);
  }
}

Fixed version (ground truth):
public void lock(){
  try {
    semaphore.acquire();
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    throw new UncheckedInterruptedException(e);
  }
}