nus-yam/ex-repair huggingface dataset:
Program: 48190
Project: 48190
Buggy source:
@Test public void testLengthExpected() throws IOException {
  CardCommandAPDU apdu=new ReadBinary();
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF});
  apdu.setLE(1);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x01});
  apdu.setLE(255);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0xFF});
  apdu.setLE(256);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x00});
  apdu.setLE(257);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x00,(byte)0x01,(byte)0x01});
  apdu.setLE(65535);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x00,(byte)0xFF,(byte)0xFF});
  apdu=new CardCommandAPDU((byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,fillBytes(65535));
  apdu.setLE(65535);
  assertEquals(apdu.getLC(),65535);
  assertEquals(apdu.getLE(),65535);
}

Fixed version (ground truth):
@Test public void testLengthExpected() throws IOException {
  CardCommandAPDU apdu=new ReadBinary();
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF});
  apdu.setLE(1);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x01});
  apdu.setLE(255);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0xFF});
  apdu.setLE(256);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x00});
  apdu.setLE(257);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x00,(byte)0x01,(byte)0x01});
  apdu.setLE(65535);
  assertEquals(apdu.toByteArray(),new byte[]{(byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,(byte)0x00,(byte)0xFF,(byte)0xFF});
  apdu=new CardCommandAPDU((byte)0x00,(byte)0xB0,(byte)0x00,(byte)0xFF,fillBytes(65535));
  apdu.setLE(65535);
  assertEquals(apdu.getLC(),65535);
  assertEquals(apdu.getLE(),65535);
  apdu.setLE(256);
  int length=apdu.toByteArray().length;
  assertEquals(apdu.toByteArray()[length - 2],0x01);
  assertEquals(apdu.toByteArray()[length - 1],0x00);
}
Program: 48193
Project: 48193
Buggy source:
private CardApplicationType parseCardApplication(XmlPullParser parser) throws XmlPullParserException, IOException {
  CardApplicationType cardApplication=new CardApplicationType();
  int eventType;
  do {
    parser.next();
    eventType=parser.getEventType();
    if (eventType == XmlPullParser.START_TAG) {
      if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setApplicationIdentifier(StringUtils.toByteArray(parser.nextText()));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setApplicationName(parser.nextText());
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setRequirementLevel(BasicRequirementsType.fromValue(parser.nextText()));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setCardApplicationACL(this.parseACL(parser,"String_Node_Str"));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.getDIDInfo().add(this.parseDIDInfo(parser));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.getDataSetInfo().add(this.parseDataSetInfo(parser));
      }
    }
  }
 while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals("String_Node_Str")));
  return cardApplication;
}

Fixed version (ground truth):
private CardApplicationType parseCardApplication(XmlPullParser parser) throws XmlPullParserException, IOException {
  CardApplicationType cardApplication=new CardApplicationType();
  int eventType;
  do {
    parser.next();
    eventType=parser.getEventType();
    if (eventType == XmlPullParser.START_TAG) {
      if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setApplicationIdentifier(StringUtils.toByteArray(parser.nextText()));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setApplicationName(parser.nextText());
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setRequirementLevel(BasicRequirementsType.fromValue(parser.nextText()));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.setCardApplicationACL(this.parseACL(parser,"String_Node_Str"));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.getDIDInfo().add(this.parseDIDInfo(parser));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.getDataSetInfo().add(this.parseDataSetInfo(parser));
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        cardApplication.getInterfaceProtocol().add(parser.nextText());
      }
    }
  }
 while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals("String_Node_Str")));
  return cardApplication;
}
Program: 48194
Project: 48194
Buggy source:
private Collection<? extends Element> parseAnyTypes(XmlPullParser parser,String name,String ns,Document d,Boolean firstCall) throws XmlPullParserException, IOException {
  int eventType;
  List<Element> elements=new ArrayList<Element>();
  boolean terminalNode=false;
  do {
    parser.next();
    eventType=parser.getEventType();
    if (eventType == XmlPullParser.START_TAG) {
      elements.addAll(parseAnyTypes(parser,parser.getName(),parser.getNamespace(),d,true));
    }
 else     if (eventType == XmlPullParser.TEXT) {
      if (parser.getText().trim().length() > 0) {
        Element em=d.createElementNS(ns,name);
        em.setTextContent(parser.getText());
        elements.add(em);
        terminalNode=true;
      }
    }
  }
 while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals(name)));
  if (!terminalNode && firstCall) {
    Element test=d.createElementNS(ns,name);
    for (    Element e : elements) {
      test.appendChild(e);
    }
    List<Element> elements2=new ArrayList<Element>();
    elements2.add(test);
    return elements2;
  }
  return elements;
}

Fixed version (ground truth):
private Collection<? extends Element> parseAnyTypes(XmlPullParser parser,String name,String ns,Document d,Boolean firstCall,String[] attribNames,String[] attribValues) throws XmlPullParserException, IOException {
  int eventType;
  List<Element> elements=new ArrayList<Element>();
  boolean terminalNode=false;
  do {
    String[] attributeNames=new String[0];
    String[] attributeValues=new String[0];
    parser.next();
    eventType=parser.getEventType();
    if (eventType == XmlPullParser.START_TAG) {
      int attributeCount=parser.getAttributeCount();
      if (attributeCount > 0) {
        attributeNames=new String[attributeCount];
        attributeValues=new String[attributeCount];
        for (int i=0; i < attributeCount; i++) {
          attributeNames[i]=parser.getAttributeName(i);
          attributeValues[i]=parser.getAttributeValue(i);
        }
      }
      elements.addAll(parseAnyTypes(parser,parser.getName(),parser.getNamespace(),d,true,attributeNames,attributeValues));
    }
 else     if (eventType == XmlPullParser.TEXT) {
      if (parser.getText().trim().length() > 0) {
        Element em=d.createElementNS(ns,name);
        em.setTextContent(parser.getText());
        elements.add(em);
        terminalNode=true;
      }
    }
  }
 while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals(name)));
  if (!terminalNode && firstCall) {
    Element test=d.createElementNS(ns,name);
    for (    Element e : elements) {
      test.appendChild(e);
    }
    List<Element> elements2=new ArrayList<Element>();
    for (int i=0; i < attribNames.length; i++) {
      test.setAttribute(attribNames[i],attribValues[i]);
    }
    elements2.add(test);
    return elements2;
  }
  return elements;
}
Program: 48197
Project: 48197
Buggy source:
private Result parseResult(XmlPullParser parser) throws XmlPullParserException, IOException {
  Result r=new Result();
  int eventType;
  do {
    parser.next();
    eventType=parser.getEventType();
    if (eventType == XmlPullParser.START_TAG) {
      if (parser.getName().equals("String_Node_Str")) {
        r.setResultMajor(parser.nextText());
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        r.setResultMinor(parser.nextText());
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        InternationalStringType internationalStringType=new InternationalStringType();
        internationalStringType.setLang(parser.getAttributeValue("String_Node_Str","String_Node_Str"));
        internationalStringType.setValue(parser.nextText());
        r.setResultMessage(internationalStringType);
      }
    }
  }
 while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals("String_Node_Str")));
  return r;
}

Fixed version (ground truth):
private Result parseResult(XmlPullParser parser) throws XmlPullParserException, IOException {
  Result r=new Result();
  int eventType;
  do {
    parser.next();
    eventType=parser.getEventType();
    if (eventType == XmlPullParser.START_TAG) {
      if (parser.getName().equals("String_Node_Str")) {
        r.setResultMajor(parser.nextText());
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        r.setResultMinor(parser.nextText());
      }
 else       if (parser.getName().equals("String_Node_Str")) {
        InternationalStringType internationalStringType=new InternationalStringType();
        String lang=parser.getAttributeValue("String_Node_Str","String_Node_Str");
        internationalStringType.setLang(lang);
        internationalStringType.setValue(parser.nextText());
        r.setResultMessage(internationalStringType);
      }
    }
  }
 while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals("String_Node_Str")));
  return r;
}
Program: 48199
Project: 48199
Buggy source:
/** 
 * @param context application context
 * @param abstractBox abstractBox of type checkbox or radiobox
 * @param useCheckboxes true if checkboxes should be used, false for radioboxes
 */
public BoxItemAdapter(Context context,AbstractBox abstractBox,boolean useCheckboxes){
  this.useCheckboxes=useCheckboxes;
  this.context=context;
  this.id=abstractBox.getID();
  this.boxItems=abstractBox.getBoxItems();
}

Fixed version (ground truth):
/** 
 * @param context application context
 * @param abstractBox abstractBox of type checkbox or radiobox
 * @param useCheckboxes true if checkboxes should be used, false for radioboxes
 */
public BoxItemAdapter(Context context,AbstractBox abstractBox,boolean useCheckboxes){
  this.useCheckboxes=useCheckboxes;
  this.context=context;
  this.id=abstractBox.getID();
  this.boxItems=abstractBox.getBoxItems();
  itemViews=new CompoundButton[boxItems.size()];
}
Program: 48200
Project: 48200
Buggy source:
@Override public View getView(final int position,View convertView,ViewGroup parent){
  CompoundButton b=null;
  if (useCheckboxes) {
    b=new CheckBox(context);
  }
 else {
    b=new RadioButton(context);
  }
  b.setText(boxItems.get(position).getText() != null ? boxItems.get(position).getText() : boxItems.get(position).getName());
  b.setChecked(boxItems.get(position).isChecked());
  b.setEnabled(!boxItems.get(position).isDisabled());
  b.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      boxItems.get(position).setChecked(isChecked);
    }
  }
);
  return b;
}

Fixed version (ground truth):
@Override public View getView(final int position,View convertView,ViewGroup parent){
  CompoundButton b;
  if (useCheckboxes) {
    b=new CheckBox(context);
    b.setOnCheckedChangeListener(new CheckboxChangeListener(boxItems.get(position)));
  }
 else {
    b=new RadioButton(context);
    b.setOnCheckedChangeListener(new RadioboxChangeListener(this,position));
  }
  String text=boxItems.get(position).getText();
  String name=boxItems.get(position).getName();
  b.setText(text != null ? text : name);
  b.setChecked(boxItems.get(position).isChecked());
  b.setEnabled(!boxItems.get(position).isDisabled());
  itemViews[position]=b;
  return b;
}
Program: 48201
Project: 48201
Buggy source:
private void initComponents(){
  headlineLabel.setFont(headlineLabel.getFont().deriveFont(Font.BOLD));
  messageLabel.setMargin(new Insets(0,0,0,0));
  messageLabel.setEditable(false);
  messageLabel.setLineWrap(true);
  messageLabel.setWrapStyleWord(true);
  messageLabel.setFont(new JButton().getFont());
  JScrollPane scrollPane=new JScrollPane(messageLabel);
  scrollPane.setBorder(BorderFactory.createEmptyBorder());
  Logo logo=new Logo();
  GroupLayout layout=new GroupLayout(this);
  setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
  layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(logo,50,50,50).addGap(20).addGroup(layout.createParallelGroup().addComponent(headlineLabel).addComponent(scrollPane)));
  layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER).addComponent(logo).addGroup(layout.createSequentialGroup().addComponent(headlineLabel).addComponent(scrollPane)));
}

Fixed version (ground truth):
private void initComponents(){
  headlineLabel.setFont(headlineLabel.getFont().deriveFont(Font.BOLD));
  messageLabel.setMargin(new Insets(0,0,0,0));
  messageLabel.setEditable(false);
  messageLabel.setLineWrap(true);
  messageLabel.setWrapStyleWord(true);
  messageLabel.setFont(new JButton().getFont());
  JScrollPane scrollPane=new JScrollPane(messageLabel);
  scrollPane.setBorder(BorderFactory.createEmptyBorder());
  Logo logo=new Logo();
  GroupLayout layout=new GroupLayout(this);
  setLayout(layout);
  layout.setAutoCreateGaps(true);
  layout.setAutoCreateContainerGaps(true);
  layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(logo,60,60,60).addGap(20).addGroup(layout.createParallelGroup().addComponent(headlineLabel).addComponent(scrollPane)));
  layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER).addComponent(logo).addGroup(layout.createSequentialGroup().addComponent(headlineLabel).addComponent(scrollPane)));
}
Program: 48203
Project: 48203
Buggy source:
@Override public synchronized Database removeResource(final String name){
  assertNotClosed();
  final Path resourceFile=mDBConfig.getFile().resolve(DatabaseConfiguration.DatabasePaths.DATA.getFile()).resolve(name);
  if (!Databases.hasOpenResourceManagers(resourceFile)) {
    if (Files.exists(resourceFile) && ResourceConfiguration.ResourcePaths.compareStructure(resourceFile) == 0) {
      SirixFiles.recursiveRemove(resourceFile);
      mBufferManagers.remove(resourceFile);
    }
  }
  return this;
}

Fixed version (ground truth):
@Override public synchronized Database removeResource(final String name){
  assertNotClosed();
  final Path resourceFile=mDBConfig.getFile().resolve(DatabaseConfiguration.DatabasePaths.DATA.getFile()).resolve(name);
  if (Databases.hasOpenResourceManagers(resourceFile)) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (Files.exists(resourceFile) && ResourceConfiguration.ResourcePaths.compareStructure(resourceFile) == 0) {
    SirixFiles.recursiveRemove(resourceFile);
    mBufferManagers.remove(resourceFile);
  }
  return this;
}
Program: 48204
Project: 48204
Buggy source:
/** 
 * Determines if there are any open resource managers.
 * @param file the resource file
 * @return {@code true}, if there are any open resource managers,   {@code false} otherwise.
 */
public static synchronized boolean hasOpenResourceManagers(Path file){
  final Set<ResourceManager> resourceManagers=RESOURCE_MANAGERS.get(file);
  if (resourceManagers == null || resourceManagers.isEmpty()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines if there are any open resource managers.
 * @param file the resource file
 * @return {@code true}, if there are any open resource managers,   {@code false} otherwise.
 */
public static synchronized boolean hasOpenResourceManagers(Path file){
  final Set<ResourceManager> resourceManagers=RESOURCE_MANAGERS.get(file);
  if (resourceManagers == null || resourceManagers.isEmpty()) {
    return false;
  }
  return true;
}
Program: 48205
Project: 48205
Buggy source:
/** 
 * Constructor.
 * @param file the file
 * @param isFolder determines if the file denotes a filer or not
 */
private void ResourcePaths(final Path file,final boolean isFolder){
  mFile=file;
  mIsFolder=isFolder;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param path the path
 * @param isFolder determines if the path denotes a filer or not
 */
private void ResourcePaths(final Path path,final boolean isFolder){
  mPath=path;
  mIsFolder=isFolder;
}
Program: 48206
Project: 48206
Buggy source:
/** 
 * Get the configuration file.
 * @return configuration file
 */
public Path getConfigFile(){
  return mPath.resolve(ResourcePaths.CONFIG_BINARY.getFile());
}

Fixed version (ground truth):
/** 
 * Get the configuration file.
 * @return configuration file
 */
public Path getConfigFile(){
  return mPath.resolve(ResourcePaths.CONFIG_BINARY.getPath());
}
Program: 48207
Project: 48207
Buggy source:
/** 
 * Check if file is denoted as folder or not.
 * @return boolean if file is folder
 */
public boolean isFolder(){
  return mIsFolder;
}

Fixed version (ground truth):
/** 
 * Check if file is denoted as folder or not.
 * @return {@code true} if file is a folder, {@code false} otherwise
 */
public boolean isFolder(){
  return mIsFolder;
}
Program: 48208
Project: 48208
Buggy source:
/** 
 * Checking a structure in a folder to be equal with the data in this enum.
 * @param file to be checked
 * @return -1 if less folders are there, 0 if the structure is equal to the one expected, 1 ifthe structure has more folders
 * @throws NullPointerException if {@code file} is {@code null}
 */
public static int compareStructure(final Path file){
  int existing=0;
  for (  final ResourcePaths paths : values()) {
    final Path currentFile=file.resolve(paths.getFile());
    if (Files.exists(currentFile)) {
      existing++;
    }
  }
  return existing - values().length + 1;
}

Fixed version (ground truth):
/** 
 * Checking a structure in a folder to be equal with the data in this enum.
 * @param file to be checked
 * @return -1 if less folders are there, 0 if the structure is equal to the one expected, 1 ifthe structure has more folders
 * @throws NullPointerException if {@code file} is {@code null}
 */
public static int compareStructure(final Path file){
  int existing=0;
  for (  final ResourcePaths paths : values()) {
    final Path currentFile=file.resolve(paths.getPath());
    if (Files.exists(currentFile)) {
      existing++;
    }
  }
  return existing - values().length;
}
Program: 48209
Project: 48209
Buggy source:
/** 
 * Determines if an index of the specified type is available.
 * @param type type of index to lookup
 * @param resourceManager the {@link ResourceManager} this index controller is bound to
 * @return {@code true} if an index of the specified type exists, {@code false} otherwise
 * @throws SirixIOException if an I/O exception occurs while deserializing the index configurationfor the specified  {@code revision}
 */
public static boolean containsIndex(final IndexType type,final ResourceManager resourceManager,final int revision) throws SirixIOException {
  final Indexes indexes=new Indexes();
  final java.nio.file.Path indexesFile=resourceManager.getResourceConfig().mPath.resolve(ResourceConfiguration.ResourcePaths.INDEXES.getFile()).resolve(String.valueOf(revision) + "String_Node_Str");
  try {
    if (Files.exists(indexesFile) && Files.size(indexesFile) > 0) {
      try (final InputStream in=new FileInputStream(indexesFile.toFile())){
        indexes.init(deserialize(in).getFirstChild());
      }
     }
  }
 catch (  IOException|DocumentException|SirixException e) {
    throw new SirixIOException("String_Node_Str",e);
  }
  for (  final IndexDef indexDef : indexes.getIndexDefs()) {
    if (indexDef.getType() == type)     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines if an index of the specified type is available.
 * @param type type of index to lookup
 * @param resourceManager the {@link ResourceManager} this index controller is bound to
 * @return {@code true} if an index of the specified type exists, {@code false} otherwise
 * @throws SirixIOException if an I/O exception occurs while deserializing the index configurationfor the specified  {@code revision}
 */
public static boolean containsIndex(final IndexType type,final ResourceManager resourceManager,final int revision) throws SirixIOException {
  final Indexes indexes=new Indexes();
  final java.nio.file.Path indexesFile=resourceManager.getResourceConfig().mPath.resolve(ResourceConfiguration.ResourcePaths.INDEXES.getPath()).resolve(String.valueOf(revision) + "String_Node_Str");
  try {
    if (Files.exists(indexesFile) && Files.size(indexesFile) > 0) {
      try (final InputStream in=new FileInputStream(indexesFile.toFile())){
        indexes.init(deserialize(in).getFirstChild());
      }
     }
  }
 catch (  IOException|DocumentException|SirixException e) {
    throw new SirixIOException("String_Node_Str",e);
  }
  for (  final IndexDef indexDef : indexes.getIndexDefs()) {
    if (indexDef.getType() == type)     return true;
  }
  return false;
}
Program: 48210
Project: 48210
Buggy source:
/** 
 * A commit file which is used by a   {@link XdmNodeWriteTrx} to denote if it's currently commitingor not.
 */
public Path commitFile(){
  return mResourceConfig.mPath.resolve(ResourceConfiguration.ResourcePaths.TRANSACTION_INTENT_LOG.getFile()).resolve("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * A commit file which is used by a   {@link XdmNodeWriteTrx} to denote if it's currently commitingor not.
 */
public Path commitFile(){
  return mResourceConfig.mPath.resolve(ResourceConfiguration.ResourcePaths.TRANSACTION_INTENT_LOG.getPath()).resolve("String_Node_Str");
}
Program: 48212
Project: 48212
Buggy source:
@Override public TransactionIntentLog createTrxIntentLog(final ResourceConfiguration resourceConfig){
  final Path logFile=resourceConfig.getResource().resolve(ResourceConfiguration.ResourcePaths.TRANSACTION_INTENT_LOG.getFile()).resolve("String_Node_Str");
  try {
    if (Files.exists(logFile)) {
      Files.delete(logFile);
      Files.createFile(logFile);
    }
    final RandomAccessFile file=new RandomAccessFile(logFile.toFile(),"String_Node_Str");
    final FileWriter fileWriter=new FileWriter(file,null,new ByteHandlePipeline(resourceConfig.mByteHandler),SerializationType.TRANSACTION_INTENT_LOG);
    final PersistentFileCache persistentFileCache=new PersistentFileCache(fileWriter);
    return new TransactionIntentLog(persistentFileCache);
  }
 catch (  final IOException e) {
    throw new UncheckedIOException(e);
  }
}

Fixed version (ground truth):
@Override public TransactionIntentLog createTrxIntentLog(final ResourceConfiguration resourceConfig){
  final Path logFile=resourceConfig.getResource().resolve(ResourceConfiguration.ResourcePaths.TRANSACTION_INTENT_LOG.getPath()).resolve("String_Node_Str");
  try {
    if (Files.exists(logFile)) {
      Files.delete(logFile);
      Files.createFile(logFile);
    }
    final RandomAccessFile file=new RandomAccessFile(logFile.toFile(),"String_Node_Str");
    final FileWriter fileWriter=new FileWriter(file,null,new ByteHandlePipeline(resourceConfig.mByteHandler),SerializationType.TRANSACTION_INTENT_LOG);
    final PersistentFileCache persistentFileCache=new PersistentFileCache(fileWriter);
    return new TransactionIntentLog(persistentFileCache);
  }
 catch (  final IOException e) {
    throw new UncheckedIOException(e);
  }
}
Program: 48213
Project: 48213
Buggy source:
/** 
 * Getting concrete storage for this file.
 * @return the concrete storage for this database
 */
private Path getRevisionFilePath(){
  return mFile.resolve(ResourceConfiguration.ResourcePaths.DATA.getFile()).resolve(REVISIONS_FILENAME);
}

Fixed version (ground truth):
/** 
 * Getting concrete storage for this file.
 * @return the concrete storage for this database
 */
private Path getRevisionFilePath(){
  return mFile.resolve(ResourceConfiguration.ResourcePaths.DATA.getPath()).resolve(REVISIONS_FILENAME);
}
Program: 48214
Project: 48214
Buggy source:
/** 
 * Getting path for data file.
 * @return the path for this data file
 */
private Path getDataFilePath(){
  return mFile.resolve(ResourceConfiguration.ResourcePaths.DATA.getFile()).resolve(FILENAME);
}

Fixed version (ground truth):
/** 
 * Getting path for data file.
 * @return the path for this data file
 */
private Path getDataFilePath(){
  return mFile.resolve(ResourceConfiguration.ResourcePaths.DATA.getPath()).resolve(FILENAME);
}
Program: 48215
Project: 48215
Buggy source:
@Override protected void emitRevisionStartTag(final @Nonnull XdmNodeReadTrx rtx){
  try {
    final int length=(mRevisions.length == 1 && mRevisions[0] < 0) ? (int)mResMgr.getMostRecentRevisionNumber() : mRevisions.length;
    if (mSerializeRest || length > 1) {
      indent();
      if (mSerializeRest) {
        write("String_Node_Str");
      }
 else {
        write("String_Node_Str");
      }
      if (length > 1) {
        if (mSerializeRest) {
          write("String_Node_Str");
        }
 else {
          write("String_Node_Str");
        }
        write(Integer.toString(rtx.getRevisionNumber()));
        write("String_Node_Str");
        if (rtx.hasFirstChild())         mStack.push(Constants.NULL_ID_LONG);
      }
 else       if (mSerializeRest) {
        write("String_Node_Str");
        if (rtx.hasFirstChild())         mStack.push(Constants.NULL_ID_LONG);
      }
    }
  }
 catch (  final IOException e) {
    LOGWRAPPER.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override protected void emitRevisionStartTag(final @Nonnull XdmNodeReadTrx rtx){
  try {
    final int length=(mRevisions.length == 1 && mRevisions[0] < 0) ? (int)mResMgr.getMostRecentRevisionNumber() : mRevisions.length;
    if (mSerializeRest || length > 1) {
      indent();
      if (mSerializeRest) {
        write("String_Node_Str");
      }
 else {
        write("String_Node_Str");
      }
      if (length > 1) {
        if (mSerializeRest) {
          write("String_Node_Str");
        }
 else {
          write("String_Node_Str");
        }
        write(Integer.toString(rtx.getRevisionNumber()));
        write("String_Node_Str");
      }
 else       if (mSerializeRest) {
        write("String_Node_Str");
      }
      if (rtx.hasFirstChild())       mStack.push(Constants.NULL_ID_LONG);
      if (mIndent) {
        mOut.write(CharsForSerializing.NEWLINE.getBytes());
      }
    }
  }
 catch (  final IOException e) {
    LOGWRAPPER.error(e.getMessage(),e);
  }
}
Program: 48216
Project: 48216
Buggy source:
@Override protected void emitRevisionEndTag(final @Nonnull XdmNodeReadTrx rtx){
  try {
    final int length=(mRevisions.length == 1 && mRevisions[0] < 0) ? (int)mResMgr.getMostRecentRevisionNumber() : mRevisions.length;
    if (mSerializeRest || length > 1) {
      if (rtx.hasFirstChild())       mStack.pop();
      indent();
      if (mSerializeRest) {
        write("String_Node_Str");
      }
 else {
        write("String_Node_Str");
      }
    }
    if (mIndent) {
      mOut.write(CharsForSerializing.NEWLINE.getBytes());
    }
  }
 catch (  final IOException e) {
    LOGWRAPPER.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override protected void emitRevisionEndTag(final @Nonnull XdmNodeReadTrx rtx){
  try {
    final int length=(mRevisions.length == 1 && mRevisions[0] < 0) ? (int)mResMgr.getMostRecentRevisionNumber() : mRevisions.length;
    if (mSerializeRest || length > 1) {
      if (rtx.moveToDocumentRoot().get().hasFirstChild())       mStack.pop();
      indent();
      if (mSerializeRest) {
        write("String_Node_Str");
      }
 else {
        write("String_Node_Str");
      }
    }
    if (mIndent) {
      mOut.write(CharsForSerializing.NEWLINE.getBytes());
    }
  }
 catch (  final IOException e) {
    LOGWRAPPER.error(e.getMessage(),e);
  }
}
Program: 48218
Project: 48218
Buggy source:
@Override protected void emitStartDocument(){
  try {
    if (mSerializeXMLDeclaration) {
      write("String_Node_Str");
      if (mIndent) {
        mOut.write(CharsForSerializing.NEWLINE.getBytes());
      }
    }
    final int length=(mRevisions.length == 1 && mRevisions[0] < 0) ? (int)mResMgr.getMostRecentRevisionNumber() : mRevisions.length;
    if (mSerializeRest || length > 1) {
      if (mSerializeRest) {
        write("String_Node_Str");
      }
 else {
        write("String_Node_Str");
      }
      if (mIndent) {
        mOut.write(CharsForSerializing.NEWLINE.getBytes());
        mStack.push(Constants.NULL_ID_LONG);
      }
      indent();
    }
  }
 catch (  final IOException e) {
    LOGWRAPPER.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override protected void emitStartDocument(){
  try {
    if (mSerializeXMLDeclaration) {
      write("String_Node_Str");
      if (mIndent) {
        mOut.write(CharsForSerializing.NEWLINE.getBytes());
      }
    }
    final int length=(mRevisions.length == 1 && mRevisions[0] < 0) ? (int)mResMgr.getMostRecentRevisionNumber() : mRevisions.length;
    if (mSerializeRest || length > 1) {
      if (mSerializeRest) {
        write("String_Node_Str");
      }
 else {
        write("String_Node_Str");
      }
      if (mIndent) {
        mOut.write(CharsForSerializing.NEWLINE.getBytes());
        mStack.push(Constants.NULL_ID_LONG);
      }
    }
  }
 catch (  final IOException e) {
    LOGWRAPPER.error(e.getMessage(),e);
  }
}
Program: 48219
Project: 48219
Buggy source:
@BeforeClass public void setUp() throws SirixException, IOException {
  TestHelper.closeEverything();
  TestHelper.deleteEverything();
  Files.createDirectories(TestHelper.PATHS.PATH1.getFile());
  Files.createDirectories(TestHelper.PATHS.PATH1.getFile().resolve(ResourceConfiguration.ResourcePaths.DATA.getFile()));
  Files.createFile(TestHelper.PATHS.PATH1.getFile().resolve(ResourceConfiguration.ResourcePaths.DATA.getFile()).resolve("String_Node_Str"));
  mResourceConfig=new ResourceConfiguration.Builder("String_Node_Str",new DatabaseConfiguration(TestHelper.PATHS.PATH1.getFile())).build();
}

Fixed version (ground truth):
@BeforeClass public void setUp() throws SirixException, IOException {
  TestHelper.closeEverything();
  TestHelper.deleteEverything();
  Files.createDirectories(TestHelper.PATHS.PATH1.getFile());
  Files.createDirectories(TestHelper.PATHS.PATH1.getFile().resolve(ResourceConfiguration.ResourcePaths.DATA.getPath()));
  Files.createFile(TestHelper.PATHS.PATH1.getFile().resolve(ResourceConfiguration.ResourcePaths.DATA.getPath()).resolve("String_Node_Str"));
  mResourceConfig=new ResourceConfiguration.Builder("String_Node_Str",new DatabaseConfiguration(TestHelper.PATHS.PATH1.getFile())).build();
}
Program: 48220
Project: 48220
Buggy source:
private static String readString(final InputStream in) throws IOException {
  int r;
  final ByteArrayOutputStream payload=new ByteArrayOutputStream();
  while ((r=in.read()) != -1) {
    payload.write(r);
  }
  final String string=payload.toString("String_Node_Str");
  return string;
}

Fixed version (ground truth):
private static String readString(final InputStream in) throws IOException {
  int r;
  final ByteArrayOutputStream payload=new ByteArrayOutputStream();
  while ((r=in.read()) != -1) {
    payload.write(r);
  }
  final String string=payload.toString(StandardCharsets.UTF_8.toString());
  return string;
}
Program: 48221
Project: 48221
Buggy source:
public static void main(final String[] args){
  try {
    final Config config=parseParams(args);
    try (final DBStore store=DBStore.newBuilder().build()){
      final QueryContext ctx=new SirixQueryContext(store);
      final String file=config.getValue("String_Node_Str");
      if (file != null) {
        final URI uri=new URI(file);
        final InputStream in=URIHandler.getInputStream(uri);
        try {
          final SubtreeParser parser=new DocumentParser(in);
          final String name=uri.toURL().getFile();
          final TemporalCollection<?> coll=store.create(name,parser);
          final Node<?> doc=coll.getDocument();
          ctx.setContextItem(doc);
        }
  finally {
          in.close();
        }
      }
      String query;
      if (((config.isSet("String_Node_Str")) && (!"String_Node_Str".equals(config.getValue("String_Node_Str"))))) {
        query=readFile(config.getValue("String_Node_Str"));
      }
 else {
        query=readString(System.in);
      }
      final XQuery xq=new XQuery(new SirixCompileChain(store),query);
      if (config.isSet("String_Node_Str")) {
        xq.prettyPrint();
      }
      xq.serialize(ctx,System.out);
    }
   }
 catch (  final QueryException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-2);
  }
catch (  final IOException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-3);
  }
catch (  final Throwable e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-4);
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  try {
    final Config config=parseParams(args);
    try (final DBStore store=DBStore.newBuilder().build()){
      final QueryContext ctx=new SirixQueryContext(store);
      final String file=config.getValue("String_Node_Str");
      if (file != null) {
        final URI uri=new URI(file);
        final InputStream in=URIHandler.getInputStream(uri);
        try {
          final SubtreeParser parser=new DocumentParser(in);
          final String name=uri.toURL().getFile();
          final TemporalCollection<?> coll=store.create(name,parser);
          final Node<?> doc=coll.getDocument();
          ctx.setContextItem(doc);
        }
  finally {
          in.close();
        }
      }
      String query;
      if (((config.isSet("String_Node_Str")) && (!"String_Node_Str".equals(config.getValue("String_Node_Str"))))) {
        query=readFile(config.getValue("String_Node_Str"));
      }
 else {
        query=readStringFromScanner(System.in);
      }
      final XQuery xq=new XQuery(new SirixCompileChain(store),query);
      if (config.isSet("String_Node_Str")) {
        xq.prettyPrint();
      }
      xq.serialize(ctx,System.out);
    }
   }
 catch (  final QueryException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-2);
  }
catch (  final IOException e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-3);
  }
catch (  final Throwable e) {
    System.out.println("String_Node_Str" + e.getMessage());
    System.exit(-4);
  }
}
Program: 48222
Project: 48222
Buggy source:
private VisitResult process(final ImmutableNode node){
  try {
    if (node.getKind() == Kind.TEXT) {
      mRtx.moveTo(node.getParentKey());
    }
    final long PCR=mRtx.isDocumentRoot() ? 0 : mRtx.getNameNode().getPathNodeKey();
    if (mPaths.isEmpty() || mPathSummaryReader.getPCRsForPaths(mPaths).contains(PCR)) {
      final Str strValue=new Str(((ImmutableValueNode)node).getValue());
      boolean isOfType=false;
      try {
        if (mType != Type.STR)         AtomicUtil.toType(strValue,mType);
        isOfType=true;
      }
 catch (      final SirixRuntimeException e) {
      }
      if (isOfType) {
        final CASValue value=new CASValue(strValue,mType,PCR);
        final Optional<NodeReferences> textReferences=mAVLTreeWriter.get(value,SearchMode.EQUAL);
        if (textReferences.isPresent()) {
          setNodeReferences(node,textReferences.get(),value);
        }
 else {
          setNodeReferences(node,new NodeReferences(),value);
        }
      }
    }
    mRtx.moveTo(node.getNodeKey());
  }
 catch (  final PathException|SirixIOException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return VisitResultType.CONTINUE;
}

Fixed version (ground truth):
private VisitResult process(final ImmutableNode node){
  try {
    if (node.getKind() == Kind.TEXT) {
      mRtx.moveTo(node.getParentKey());
    }
    final long PCR=mRtx.isDocumentRoot() ? 0 : mRtx.getNameNode().getPathNodeKey();
    if (mPaths.isEmpty() || mPathSummaryReader.getPCRsForPaths(mPaths,true).contains(PCR)) {
      final Str strValue=new Str(((ImmutableValueNode)node).getValue());
      boolean isOfType=false;
      try {
        if (mType != Type.STR)         AtomicUtil.toType(strValue,mType);
        isOfType=true;
      }
 catch (      final SirixRuntimeException e) {
      }
      if (isOfType) {
        final CASValue value=new CASValue(strValue,mType,PCR);
        final Optional<NodeReferences> textReferences=mAVLTreeWriter.get(value,SearchMode.EQUAL);
        if (textReferences.isPresent()) {
          setNodeReferences(node,textReferences.get(),value);
        }
 else {
          setNodeReferences(node,new NodeReferences(),value);
        }
      }
    }
    mRtx.moveTo(node.getNodeKey());
  }
 catch (  final PathException|SirixIOException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return VisitResultType.CONTINUE;
}
Program: 48223
Project: 48223
Buggy source:
@Override public void listen(final ChangeType type,final ImmutableNode node,final long pathNodeKey) throws SirixIOException {
  if (node instanceof ValueNode) {
    final ValueNode valueNode=((ValueNode)node);
    mPathSummaryReader.moveTo(pathNodeKey);
    try {
switch (type) {
case INSERT:
        if (mPathSummaryReader.getPCRsForPaths(mPaths).contains(pathNodeKey)) {
          insert(valueNode,pathNodeKey);
        }
      break;
case DELETE:
    if (mPathSummaryReader.getPCRsForPaths(mPaths).contains(pathNodeKey)) {
      mAVLTreeWriter.remove(new CASValue(new Str(valueNode.getValue()),mType,pathNodeKey),node.getNodeKey());
    }
  break;
default :
}
}
 catch (final PathException e) {
throw new SirixIOException(e);
}
}
}

Fixed version (ground truth):
@Override public void listen(final ChangeType type,final ImmutableNode node,final long pathNodeKey) throws SirixIOException {
  if (node instanceof ValueNode) {
    final ValueNode valueNode=((ValueNode)node);
    mPathSummaryReader.moveTo(pathNodeKey);
    try {
switch (type) {
case INSERT:
        if (mPathSummaryReader.getPCRsForPaths(mPaths,false).contains(pathNodeKey)) {
          insert(valueNode,pathNodeKey);
        }
      break;
case DELETE:
    if (mPathSummaryReader.getPCRsForPaths(mPaths,false).contains(pathNodeKey)) {
      mAVLTreeWriter.remove(new CASValue(new Str(valueNode.getValue()),mType,pathNodeKey),node.getNodeKey());
    }
  break;
default :
}
}
 catch (final PathException e) {
throw new SirixIOException(e);
}
}
}
Program: 48224
Project: 48224
Buggy source:
@Override public PCRValue getPCRsForPaths(Set<Path<QNm>> paths){
  try (final PathSummaryReader reader=mRtx instanceof XdmNodeWriteTrx ? ((XdmNodeWriteTrx)mRtx).getPathSummary() : mRtx.getResourceManager().openPathSummary(mRtx.getRevisionNumber())){
    final long maxPCR=reader.getMaxNodeKey();
    final Set<Long> pathClassRecords=reader.getPCRsForPaths(paths);
    return PCRValue.getInstance(maxPCR,pathClassRecords);
  }
 catch (  final PathException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return PCRValue.getEmptyInstance();
}

Fixed version (ground truth):
@Override public PCRValue getPCRsForPaths(Set<Path<QNm>> paths){
  try (final PathSummaryReader reader=mRtx instanceof XdmNodeWriteTrx ? ((XdmNodeWriteTrx)mRtx).getPathSummary() : mRtx.getResourceManager().openPathSummary(mRtx.getRevisionNumber())){
    final long maxPCR=reader.getMaxNodeKey();
    final Set<Long> pathClassRecords=reader.getPCRsForPaths(paths,false);
    return PCRValue.getInstance(maxPCR,pathClassRecords);
  }
 catch (  final PathException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return PCRValue.getEmptyInstance();
}
Program: 48225
Project: 48225
Buggy source:
private VisitResult process(final ImmutableNameNode node){
  try {
    final long PCR=node.getPathNodeKey();
    if (mPathSummaryReader.getPCRsForPaths(mPaths).contains(PCR) || mPaths.isEmpty()) {
      final Optional<NodeReferences> textReferences=mAVLTreeWriter.get(PCR,SearchMode.EQUAL);
      if (textReferences.isPresent()) {
        setNodeReferences(node,textReferences.get(),PCR);
      }
 else {
        setNodeReferences(node,new NodeReferences(),PCR);
      }
    }
  }
 catch (  final PathException|SirixIOException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return VisitResultType.CONTINUE;
}

Fixed version (ground truth):
private VisitResult process(final ImmutableNameNode node){
  try {
    final long PCR=node.getPathNodeKey();
    if (mPathSummaryReader.getPCRsForPaths(mPaths,true).contains(PCR) || mPaths.isEmpty()) {
      final Optional<NodeReferences> textReferences=mAVLTreeWriter.get(PCR,SearchMode.EQUAL);
      if (textReferences.isPresent()) {
        setNodeReferences(node,textReferences.get(),PCR);
      }
 else {
        setNodeReferences(node,new NodeReferences(),PCR);
      }
    }
  }
 catch (  final PathException|SirixIOException e) {
    LOGGER.error(e.getMessage(),e);
  }
  return VisitResultType.CONTINUE;
}
Program: 48226
Project: 48226
Buggy source:
@Override public void listen(final ChangeType type,final ImmutableNode node,final long pathNodeKey) throws SirixIOException {
  if (node instanceof NameNode) {
    mPathSummaryReader.moveTo(pathNodeKey);
    try {
switch (type) {
case INSERT:
        if (mPathSummaryReader.getPCRsForPaths(mPaths).contains(pathNodeKey)) {
          final Optional<NodeReferences> textReferences=mAVLTreeWriter.get(pathNodeKey,SearchMode.EQUAL);
          if (textReferences.isPresent()) {
            setNodeReferences(node,textReferences.get(),pathNodeKey);
          }
 else {
            setNodeReferences(node,new NodeReferences(),pathNodeKey);
          }
        }
      break;
case DELETE:
    if (mPathSummaryReader.getPCRsForPaths(mPaths).contains(pathNodeKey)) {
      mAVLTreeWriter.remove(pathNodeKey,node.getNodeKey());
    }
  break;
default :
}
}
 catch (final PathException e) {
throw new SirixIOException(e);
}
}
}

Fixed version (ground truth):
@Override public void listen(final ChangeType type,final ImmutableNode node,final long pathNodeKey) throws SirixIOException {
  if (node instanceof NameNode) {
    mPathSummaryReader.moveTo(pathNodeKey);
    try {
switch (type) {
case INSERT:
        if (mPathSummaryReader.getPCRsForPaths(mPaths,false).contains(pathNodeKey)) {
          final Optional<NodeReferences> textReferences=mAVLTreeWriter.get(pathNodeKey,SearchMode.EQUAL);
          if (textReferences.isPresent()) {
            setNodeReferences(node,textReferences.get(),pathNodeKey);
          }
 else {
            setNodeReferences(node,new NodeReferences(),pathNodeKey);
          }
        }
      break;
case DELETE:
    if (mPathSummaryReader.getPCRsForPaths(mPaths,false).contains(pathNodeKey)) {
      mAVLTreeWriter.remove(pathNodeKey,node.getNodeKey());
    }
  break;
default :
}
}
 catch (final PathException e) {
throw new SirixIOException(e);
}
}
}
Program: 48227
Project: 48227
Buggy source:
/** 
 * Get path class records (PCRs) for the specified path.
 * @param path the path for which to get a set of PCRs
 * @return set of PCRs belonging to the specified path
 * @throws SirixException if anything went wrong
 */
public Set<Long> getPCRsForPath(final Path<QNm> path) throws PathException {
  Set<Long> pcrSet=mPathCache.get(path);
  if (pcrSet != null) {
    return pcrSet;
  }
  pcrSet=new HashSet<Long>();
  final boolean isAttributePattern=path.isAttribute();
  final int pathLength=path.getLength();
  final long nodeKey=mCurrentNode.getNodeKey();
  moveToDocumentRoot();
  for (final Axis axis=new DescendantAxis(this); axis.hasNext(); ) {
    axis.next();
    final PathNode node=this.getPathNode();
    if (node == null) {
      continue;
    }
    if (node.getLevel() < pathLength) {
      continue;
    }
    if (isAttributePattern ^ (node.getPathKind() == Kind.ATTRIBUTE)) {
      continue;
    }
    if (path.matches(node.getPath(this))) {
      pcrSet.add(node.getNodeKey());
    }
  }
  moveTo(nodeKey);
  mPathCache.put(path,pcrSet);
  return pcrSet;
}

Fixed version (ground truth):
/** 
 * Get path class records (PCRs) for the specified path.
 * @param path the path for which to get a set of PCRs
 * @param usePathCache determines if the path cache can be used or not
 * @return set of PCRs belonging to the specified path
 * @throws SirixException if anything went wrong
 */
public Set<Long> getPCRsForPath(final Path<QNm> path,final boolean useCache) throws PathException {
  final Set<Long> pcrSet;
  if (useCache) {
    if (mPathCache.containsKey(path) && mPathCache.get(path) != null) {
      return mPathCache.get(path);
    }
 else {
      pcrSet=new HashSet<>();
    }
  }
 else {
    pcrSet=new HashSet<>();
  }
  final boolean isAttributePattern=path.isAttribute();
  final int pathLength=path.getLength();
  final long nodeKey=mCurrentNode.getNodeKey();
  moveToDocumentRoot();
  for (final Axis axis=new DescendantAxis(this); axis.hasNext(); ) {
    axis.next();
    final PathNode node=this.getPathNode();
    if (node == null) {
      continue;
    }
    if (node.getLevel() < pathLength) {
      continue;
    }
    if (isAttributePattern ^ (node.getPathKind() == Kind.ATTRIBUTE)) {
      continue;
    }
    if (path.matches(node.getPath(this))) {
      pcrSet.add(node.getNodeKey());
    }
  }
  moveTo(nodeKey);
  if (useCache)   mPathCache.put(path,pcrSet);
  return pcrSet;
}
Program: 48228
Project: 48228
Buggy source:
/** 
 * Get a set of PCRs matching the specified collection of paths
 * @param expressions the paths to lookup
 * @return a set of PCRs matching the specified collection of paths
 * @throws SirixException if parsing a path fails
 */
public Set<Long> getPCRsForPaths(final Collection<Path<QNm>> expressions) throws PathException {
  assertNotClosed();
  final Set<Long> pcrs=new HashSet<>();
  for (  final Path<QNm> path : expressions) {
    final Set<Long> pcrsForPath=getPCRsForPath(path);
    pcrs.addAll(pcrsForPath);
  }
  return pcrs;
}

Fixed version (ground truth):
/** 
 * Get a set of PCRs matching the specified collection of paths
 * @param expressions the paths to lookup
 * @param useCache determines if the cache can be used or not
 * @return a set of PCRs matching the specified collection of paths
 * @throws SirixException if parsing a path fails
 */
public Set<Long> getPCRsForPaths(final Collection<Path<QNm>> expressions,final boolean useCache) throws PathException {
  assertNotClosed();
  final Set<Long> pcrs=new HashSet<>();
  for (  final Path<QNm> path : expressions) {
    final Set<Long> pcrsForPath=getPCRsForPath(path,useCache);
    pcrs.addAll(pcrsForPath);
  }
  return pcrs;
}