nus-yam/ex-repair huggingface dataset:
Program: 91243
Project: 91243
Buggy source:
/** 
 * @return return code returned by the command
 */
public int getReturnCode(){
  return returnCode;
}

Fixed version (ground truth):
/** 
 * Get return code returned by the command
 * @return return code returned by the command
 */
public int getReturnCode(){
  return returnCode;
}
Program: 91244
Project: 91244
Buggy source:
/** 
 * Specific error condition identified by   {@link ObjectChecker}.
 * @return error condition or null.
 * @since 4.2
 */
@Nullable public ObjectChecker.ErrorType getErrorType(){
  return errorType;
}

Fixed version (ground truth):
/** 
 * Specific error condition identified by  {@link org.eclipse.jgit.lib.ObjectChecker}.
 * @return error condition or null.
 * @since 4.2
 */
@Nullable public ObjectChecker.ErrorType getErrorType(){
  return errorType;
}
Program: 91245
Project: 91245
Buggy source:
/** 
 * Indicates that the thread computing a diff was interrupted. 
 */
public DiffInterruptedException(){
  super();
}

Fixed version (ground truth):
/** 
 * Indicates that the thread computing a diff was interrupted.
 */
public DiffInterruptedException(){
  super();
}
Program: 91246
Project: 91246
Buggy source:
/** 
 * @return another path that has a conflict. 
 */
public String getPath2(){
  return path2;
}

Fixed version (ground truth):
/** 
 * Get another path that has a conflict
 * @return another path that has a conflict
 */
public String getPath2(){
  return path2;
}
Program: 91247
Project: 91247
Buggy source:
/** 
 * @return one of the paths that has a conflict. 
 */
public String getPath1(){
  return path1;
}

Fixed version (ground truth):
/** 
 * Get one of the paths that has a conflict
 * @return one of the paths that has a conflict
 */
public String getPath1(){
  return path1;
}
Program: 91248
Project: 91248
Buggy source:
/** 
 * @param msg
 */
public IllegalTodoFileModification(final String msg){
  super(msg);
}

Fixed version (ground truth):
/** 
 * Constructor for IllegalTodoFileModification
 * @param msg error message
 */
public IllegalTodoFileModification(final String msg){
  super(msg);
}
Program: 91249
Project: 91249
Buggy source:
/** 
 * @param id the invalid id.
 * @since 4.1
 */
public InvalidObjectIdException(String id){
  super(MessageFormat.format(JGitText.get().invalidId,id));
}

Fixed version (ground truth):
/** 
 * Constructor for InvalidObjectIdException
 * @param id the invalid id.
 * @since 4.1
 */
public InvalidObjectIdException(String id){
  super(MessageFormat.format(JGitText.get().invalidId,id));
}
Program: 91250
Project: 91250
Buggy source:
/** 
 * @param message explains what was wrong with the pattern.
 * @param pattern the invalid pattern.
 */
public InvalidPatternException(String message,String pattern){
  super(message);
  this.pattern=pattern;
}

Fixed version (ground truth):
/** 
 * Constructor for InvalidPatternException
 * @param message explains what was wrong with the pattern.
 * @param pattern the invalid pattern.
 */
public InvalidPatternException(String message,String pattern){
  super(message);
  this.pattern=pattern;
}
Program: 91251
Project: 91251
Buggy source:
/** 
 * @return the invalid pattern.
 */
public String getPattern(){
  return pattern;
}

Fixed version (ground truth):
/** 
 * Get the invalid pattern
 * @return the invalid pattern.
 */
public String getPattern(){
  return pattern;
}
Program: 91252
Project: 91252
Buggy source:
/** 
 * @return either the hex encoded name of the object, or 'unknown object'. 
 */
protected String getObjectName(){
  if (getObjectId() != null)   return getObjectId().name();
  return JGitText.get().unknownObject;
}

Fixed version (ground truth):
/** 
 * Get the hex encoded name of the object, or 'unknown object'
 * @return either the hex encoded name of the object, or 'unknown object'
 */
protected String getObjectName(){
  if (getObjectId() != null)   return getObjectId().name();
  return JGitText.get().unknownObject;
}
Program: 91253
Project: 91253
Buggy source:
/** 
 * @return identity of the object that is too large; may be null. 
 */
public ObjectId getObjectId(){
  return objectId;
}

Fixed version (ground truth):
/** 
 * Get identity of the object that is too large; may be null
 * @return identity of the object that is too large; may be null
 */
public ObjectId getObjectId(){
  return objectId;
}
Program: 91254
Project: 91254
Buggy source:
/** 
 * @return the ObjectId that was not found. 
 */
public ObjectId getObjectId(){
  return missing;
}

Fixed version (ground truth):
/** 
 * Get the ObjectId that was not found
 * @return the ObjectId that was not found
 */
public ObjectId getObjectId(){
  return missing;
}
Program: 91255
Project: 91255
Buggy source:
/** 
 * @param indexOfOpeningBracket the position of the [ character which has no ] character.
 * @param openingBracket the unclosed bracket.
 * @param closingBracket the missing closing bracket.
 * @param pattern the invalid pattern.
 */
public NoClosingBracketException(final int indexOfOpeningBracket,final String openingBracket,final String closingBracket,final String pattern){
  super(createMessage(indexOfOpeningBracket,openingBracket,closingBracket),pattern);
}

Fixed version (ground truth):
/** 
 * Constructor for NoClosingBracketException
 * @param indexOfOpeningBracket the position of the [ character which has no ] character.
 * @param openingBracket the unclosed bracket.
 * @param closingBracket the missing closing bracket.
 * @param pattern the invalid pattern.
 */
public NoClosingBracketException(final int indexOfOpeningBracket,final String openingBracket,final String closingBracket,final String pattern){
  super(createMessage(indexOfOpeningBracket,openingBracket,closingBracket),pattern);
}
Program: 91256
Project: 91256
Buggy source:
/** 
 * @return the reason why no merge base could be found
 */
public MergeBaseFailureReason getReason(){
  return reason;
}

Fixed version (ground truth):
/** 
 * Get the reason why no merge base could be found
 * @return the reason why no merge base could be found
 */
public MergeBaseFailureReason getReason(){
  return reason;
}
Program: 91257
Project: 91257
Buggy source:
/** 
 * Creates an exception indicating there is no work tree for a repository. 
 */
public NoWorkTreeException(){
  super(JGitText.get().bareRepositoryNoWorkdirAndIndex);
}

Fixed version (ground truth):
/** 
 * Creates an exception indicating there is no work tree for a repository.
 */
public NoWorkTreeException(){
  super(JGitText.get().bareRepositoryNoWorkdirAndIndex);
}
Program: 91258
Project: 91258
Buggy source:
@Test public void testCloneBareRepositoryDefaultDirectory() throws IOException, URISyntaxException, JGitInternalException, GitAPIException {
  CloneCommand command=Git.cloneRepository().setURI(fileUri()).setBare(true);
  command.verifyDirectories(new URIish(fileUri()));
  File directory=command.getDirectory();
  assertEquals(git.getRepository().getWorkTree().getName() + Constants.DOT_GIT_EXT,directory.getName());
}

Fixed version (ground truth):
@Test public void testCloneBareRepositoryDefaultDirectory() throws URISyntaxException, JGitInternalException {
  CloneCommand command=Git.cloneRepository().setURI(fileUri()).setBare(true);
  command.verifyDirectories(new URIish(fileUri()));
  File directory=command.getDirectory();
  assertEquals(git.getRepository().getWorkTree().getName() + Constants.DOT_GIT_EXT,directory.getName());
}
Program: 91259
Project: 91259
Buggy source:
@Test public void testCloneRepositoryDefaultDirectory() throws IOException, URISyntaxException, JGitInternalException, GitAPIException {
  CloneCommand command=Git.cloneRepository().setURI(fileUri());
  command.verifyDirectories(new URIish(fileUri()));
  File directory=command.getDirectory();
  assertEquals(git.getRepository().getWorkTree().getName(),directory.getName());
}

Fixed version (ground truth):
@Test public void testCloneRepositoryDefaultDirectory() throws URISyntaxException, JGitInternalException {
  CloneCommand command=Git.cloneRepository().setURI(fileUri());
  command.verifyDirectories(new URIish(fileUri()));
  File directory=command.getDirectory();
  assertEquals(git.getRepository().getWorkTree().getName(),directory.getName());
}
Program: 91260
Project: 91260
Buggy source:
static int count(String s,char c,boolean ignoreFirstLast){
  int start=0;
  int count=0;
  while (true) {
    start=s.indexOf(c,start);
    if (start == -1)     break;
    if (!ignoreFirstLast || (start != 0 && start != s.length()))     count++;
    start++;
  }
  return count;
}

Fixed version (ground truth):
static int count(String s,char c,boolean ignoreFirstLast){
  int start=0;
  int count=0;
  int length=s.length();
  while (start < length) {
    start=s.indexOf(c,start);
    if (start == -1) {
      break;
    }
    if (!ignoreFirstLast || (start != 0 && start != length - 1)) {
      count++;
    }
    start++;
  }
  return count;
}
Program: 91261
Project: 91261
Buggy source:
static int count(String s,char c,boolean ignoreFirstLast){
  int start=0;
  int count=0;
  while (true) {
    start=s.indexOf(c,start);
    if (start == -1)     break;
    if (!ignoreFirstLast || (start != 0 && start != s.length()))     count++;
    start++;
  }
  return count;
}

Fixed version (ground truth):
static int count(String s,char c,boolean ignoreFirstLast){
  int start=0;
  int count=0;
  int length=s.length();
  while (start < length) {
    start=s.indexOf(c,start);
    if (start == -1) {
      break;
    }
    if (!ignoreFirstLast || (start != 0 && start != length - 1)) {
      count++;
    }
    start++;
  }
  return count;
}
Program: 91263
Project: 91263
Buggy source:
void stopBuffering() throws IOException {
  if (buffer != null) {
    buffer.writeTo(rawOut);
    buffer=null;
    out=rawOut;
  }
}

Fixed version (ground truth):
void stopBuffering() throws IOException {
  if (out != rawOut) {
    ((ByteArrayOutputStream)out).writeTo(rawOut);
    out=rawOut;
  }
}
Program: 91264
Project: 91264
Buggy source:
ResponseBufferedOutputStream(OutputStream rawOut){
  this.rawOut=rawOut;
  this.out=this.buffer=new ByteArrayOutputStream();
}

Fixed version (ground truth):
ResponseBufferedOutputStream(OutputStream rawOut){
  this.rawOut=rawOut;
  this.out=new ByteArrayOutputStream();
}
Program: 91265
Project: 91265
Buggy source:
void stopBuffering() throws IOException {
  if (buffer != null) {
    buffer.writeTo(rawOut);
    buffer=null;
    out=rawOut;
  }
}

Fixed version (ground truth):
void stopBuffering() throws IOException {
  if (out != rawOut) {
    ((ByteArrayOutputStream)out).writeTo(rawOut);
    out=rawOut;
  }
}
Program: 91266
Project: 91266
Buggy source:
ResponseBufferedOutputStream(OutputStream rawOut){
  this.rawOut=rawOut;
  this.out=this.buffer=new ByteArrayOutputStream();
}

Fixed version (ground truth):
ResponseBufferedOutputStream(OutputStream rawOut){
  this.rawOut=rawOut;
  this.out=new ByteArrayOutputStream();
}
Program: 91267
Project: 91267
Buggy source:
@Test public void testContains(){
  final RevFlag flag1=rw.newFlag("String_Node_Str");
  final RevFlag flag2=rw.newFlag("String_Node_Str");
  final RevFlagSet set=new RevFlagSet();
  set.add(flag1);
  assertTrue(set.contains(flag1));
  assertFalse(set.contains(flag2));
  assertFalse(set.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testContains(){
  final RevFlag flag1=rw.newFlag("String_Node_Str");
  final RevFlag flag2=rw.newFlag("String_Node_Str");
  final RevFlagSet set=new RevFlagSet();
  set.add(flag1);
  assertTrue(set.contains(flag1));
  assertFalse(set.contains(flag2));
}
Program: 91268
Project: 91268
Buggy source:
public RefLeaseSpec(final String ref,final String expected){
  this.ref=ref;
  this.expected=expected;
}

Fixed version (ground truth):
/** 
 * @param ref ref being pushed
 * @param expected the expected value of the ref
 */
public RefLeaseSpec(String ref,String expected){
  this.ref=ref;
  this.expected=expected;
}
Program: 91269
Project: 91269
Buggy source:
/** 
 * Loosen objects in a pack file which are not also in the newly-created pack files.
 */
private void loosen(ObjectDirectoryInserter inserter,ObjectReader reader,PackFile pack,HashSet<ObjectId> existing) throws IOException {
  for (  PackIndex.MutableEntry entry : pack) {
    ObjectId oid=entry.toObjectId();
    if (existing.contains(oid)) {
      continue;
    }
    existing.add(oid);
    ObjectLoader loader=reader.open(oid);
    inserter.insert(loader.getType(),loader.getSize(),loader.openStream(),true);
  }
}

Fixed version (ground truth):
/** 
 * Loosen objects in a pack file which are not also in the newly-created pack files.
 * @param inserter
 * @param reader
 * @param pack
 * @param existing
 * @throws IOException
 */
private void loosen(ObjectDirectoryInserter inserter,ObjectReader reader,PackFile pack,HashSet<ObjectId> existing) throws IOException {
  for (  PackIndex.MutableEntry entry : pack) {
    ObjectId oid=entry.toObjectId();
    if (existing.contains(oid)) {
      continue;
    }
    existing.add(oid);
    ObjectLoader loader=reader.open(oid);
    inserter.insert(loader.getType(),loader.getSize(),loader.openStream(),true);
  }
}
Program: 91270
Project: 91270
Buggy source:
/** 
 * Insert a loose object into the database.  If createDuplicate is true, write the loose object even if we already have it in the loose or packed ODB.
 */
ObjectId insert(int type,long len,InputStream is,boolean createDuplicate) throws IOException {
  if (len <= buffer().length) {
    byte[] buf=buffer();
    int actLen=IO.readFully(is,buf,0);
    return insert(type,buf,0,actLen,createDuplicate);
  }
 else {
    MessageDigest md=digest();
    File tmp=toTemp(md,type,len,is);
    ObjectId id=ObjectId.fromRaw(md.digest());
    return insertOneObject(tmp,id,createDuplicate);
  }
}

Fixed version (ground truth):
/** 
 * Insert a loose object into the database. If createDuplicate is true, write the loose object even if we already have it in the loose or packed ODB.
 * @param type
 * @param len
 * @param is
 * @param createDuplicate
 * @return ObjectId
 * @throws IOException
 */
ObjectId insert(int type,long len,InputStream is,boolean createDuplicate) throws IOException {
  if (len <= buffer().length) {
    byte[] buf=buffer();
    int actLen=IO.readFully(is,buf,0);
    return insert(type,buf,0,actLen,createDuplicate);
  }
 else {
    MessageDigest md=digest();
    File tmp=toTemp(md,type,len,is);
    ObjectId id=ObjectId.fromRaw(md.digest());
    return insertOneObject(tmp,id,createDuplicate);
  }
}
Program: 91271
Project: 91271
Buggy source:
public int run() throws IOException {
  try {
    byte[] buf=new byte[8192];
    int length=in.read(buf);
    if (length != -1) {
      aOut.write(buf,0,length);
      size+=length;
      return length;
    }
 else {
      aOut.close();
      AnyLongObjectId loid=aOut.getId();
      aOut=null;
      Path mediaFile=lfsUtil.getMediaFile(loid);
      if (Files.isRegularFile(mediaFile)) {
        long fsSize=Files.size(mediaFile);
        if (fsSize != size) {
          throw new CorruptMediaFile(mediaFile,size,fsSize);
        }
 else {
          FileUtils.delete(tmpFile.toFile());
        }
      }
 else {
        FileUtils.mkdirs(mediaFile.getParent().toFile(),true);
        FileUtils.rename(tmpFile.toFile(),mediaFile.toFile(),StandardCopyOption.ATOMIC_MOVE);
      }
      LfsPointer lfsPointer=new LfsPointer(loid,size);
      lfsPointer.encode(out);
      out.close();
      return -1;
    }
  }
 catch (  IOException e) {
    if (aOut != null) {
      aOut.abort();
    }
    out.close();
    throw e;
  }
}

Fixed version (ground truth):
public int run() throws IOException {
  try {
    byte[] buf=new byte[8192];
    int length=in.read(buf);
    if (length != -1) {
      aOut.write(buf,0,length);
      size+=length;
      return length;
    }
 else {
      aOut.close();
      AnyLongObjectId loid=aOut.getId();
      aOut=null;
      Path mediaFile=lfsUtil.getMediaFile(loid);
      if (Files.isRegularFile(mediaFile)) {
        long fsSize=Files.size(mediaFile);
        if (fsSize != size) {
          throw new CorruptMediaFile(mediaFile,size,fsSize);
        }
 else {
          FileUtils.delete(tmpFile.toFile());
        }
      }
 else {
        Path parent=mediaFile.getParent();
        if (parent != null) {
          FileUtils.mkdirs(parent.toFile(),true);
        }
        FileUtils.rename(tmpFile.toFile(),mediaFile.toFile(),StandardCopyOption.ATOMIC_MOVE);
      }
      LfsPointer lfsPointer=new LfsPointer(loid,size);
      lfsPointer.encode(out);
      out.close();
      return -1;
    }
  }
 catch (  IOException e) {
    if (aOut != null) {
      aOut.abort();
    }
    out.close();
    throw e;
  }
}
Program: 91272
Project: 91272
Buggy source:
public boolean accept(Path file) throws IOException {
  return Files.isRegularFile(file) && PATTERN_LOOSE_OBJECT.matcher(file.getFileName().toString()).matches();
}

Fixed version (ground truth):
public boolean accept(Path file) throws IOException {
  Path fileName=file.getFileName();
  return Files.isRegularFile(file) && fileName != null && PATTERN_LOOSE_OBJECT.matcher(fileName.toString()).matches();
}
Program: 91273
Project: 91273
Buggy source:
/** 
 * Quickly estimate number of loose objects, SHA1 is distributed evenly so counting objects in one directory (bucket 17) is sufficient
 * @return {@code true} if number of loose objects > gc.auto (default 6700)
 */
boolean tooManyLooseObjects(){
  int auto=repo.getConfig().getInt(ConfigConstants.CONFIG_GC_SECTION,ConfigConstants.CONFIG_KEY_AUTO,DEFAULT_AUTOLIMIT);
  if (auto <= 0) {
    return false;
  }
  int n=0;
  int threshold=(auto + 255) / 256;
  Path dir=repo.getObjectsDirectory().toPath().resolve("String_Node_Str");
  if (!Files.exists(dir)) {
    return false;
  }
  try (DirectoryStream<Path> stream=Files.newDirectoryStream(dir,new DirectoryStream.Filter<Path>(){
    public boolean accept(    Path file) throws IOException {
      return Files.isRegularFile(file) && PATTERN_LOOSE_OBJECT.matcher(file.getFileName().toString()).matches();
    }
  }
)){
    for (Iterator<Path> iter=stream.iterator(); iter.hasNext(); iter.next()) {
      if (++n > threshold) {
        return true;
      }
    }
  }
 catch (  IOException e) {
    LOG.error(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Quickly estimate number of loose objects, SHA1 is distributed evenly so counting objects in one directory (bucket 17) is sufficient
 * @return {@code true} if number of loose objects > gc.auto (default 6700)
 */
boolean tooManyLooseObjects(){
  int auto=repo.getConfig().getInt(ConfigConstants.CONFIG_GC_SECTION,ConfigConstants.CONFIG_KEY_AUTO,DEFAULT_AUTOLIMIT);
  if (auto <= 0) {
    return false;
  }
  int n=0;
  int threshold=(auto + 255) / 256;
  Path dir=repo.getObjectsDirectory().toPath().resolve("String_Node_Str");
  if (!Files.exists(dir)) {
    return false;
  }
  try (DirectoryStream<Path> stream=Files.newDirectoryStream(dir,new DirectoryStream.Filter<Path>(){
    public boolean accept(    Path file) throws IOException {
      Path fileName=file.getFileName();
      return Files.isRegularFile(file) && fileName != null && PATTERN_LOOSE_OBJECT.matcher(fileName.toString()).matches();
    }
  }
)){
    for (Iterator<Path> iter=stream.iterator(); iter.hasNext(); iter.next()) {
      if (++n > threshold) {
        return true;
      }
    }
  }
 catch (  IOException e) {
    LOG.error(e.getMessage(),e);
  }
  return false;
}
Program: 91274
Project: 91274
Buggy source:
public void assertWorkDir(Map<String,String> i) throws CorruptObjectException, IOException {
  try (TreeWalk walk=new TreeWalk(db)){
    walk.setRecursive(false);
    walk.addTree(new FileTreeIterator(db));
    String expectedValue;
    String path;
    int nrFiles=0;
    FileTreeIterator ft;
    while (walk.next()) {
      ft=walk.getTree(0,FileTreeIterator.class);
      path=ft.getEntryPathString();
      expectedValue=i.get(path);
      File file=new File(db.getWorkTree(),path);
      assertTrue(file.exists());
      if (file.isFile()) {
        assertNotNull("String_Node_Str" + path + "String_Node_Str",expectedValue);
        FileInputStream is=new FileInputStream(file);
        byte[] buffer=new byte[(int)file.length()];
        int offset=0;
        int numRead=0;
        while (offset < buffer.length && (numRead=is.read(buffer,offset,buffer.length - offset)) >= 0) {
          offset+=numRead;
        }
        is.close();
        assertArrayEquals("String_Node_Str" + path + "String_Node_Str",buffer,i.get(path).getBytes());
        nrFiles++;
      }
 else       if (file.isDirectory()) {
        if (file.list().length == 0) {
          assertEquals("String_Node_Str" + path + "String_Node_Str","String_Node_Str",i.get(path));
          nrFiles++;
        }
      }
      if (walk.isSubtree()) {
        walk.enterSubtree();
      }
    }
    assertEquals("String_Node_Str",i.size(),nrFiles);
  }
 }

Fixed version (ground truth):
public void assertWorkDir(Map<String,String> i) throws CorruptObjectException, IOException {
  try (TreeWalk walk=new TreeWalk(db)){
    walk.setRecursive(false);
    walk.addTree(new FileTreeIterator(db));
    String expectedValue;
    String path;
    int nrFiles=0;
    FileTreeIterator ft;
    while (walk.next()) {
      ft=walk.getTree(0,FileTreeIterator.class);
      path=ft.getEntryPathString();
      expectedValue=i.get(path);
      File file=new File(db.getWorkTree(),path);
      assertTrue(file.exists());
      if (file.isFile()) {
        assertNotNull("String_Node_Str" + path + "String_Node_Str",expectedValue);
        FileInputStream is=new FileInputStream(file);
        byte[] buffer=new byte[(int)file.length()];
        int offset=0;
        int numRead=0;
        while (offset < buffer.length && (numRead=is.read(buffer,offset,buffer.length - offset)) >= 0) {
          offset+=numRead;
        }
        is.close();
        assertArrayEquals("String_Node_Str" + path + "String_Node_Str",buffer,i.get(path).getBytes());
        nrFiles++;
      }
 else       if (file.isDirectory()) {
        String[] files=file.list();
        if (files != null && files.length == 0) {
          assertEquals("String_Node_Str" + path + "String_Node_Str","String_Node_Str",i.get(path));
          nrFiles++;
        }
      }
      if (walk.isSubtree()) {
        walk.enterSubtree();
      }
    }
    assertEquals("String_Node_Str",i.size(),nrFiles);
  }
 }
Program: 91275
Project: 91275
Buggy source:
@Test public void emptyRefDirectoryDeleted() throws Exception {
  String ref="String_Node_Str";
  tr.branch(ref).commit().create();
  String name=repo.findRef(ref).getName();
  Path dir=repo.getDirectory().toPath().resolve(name).getParent();
  gc.packRefs();
  assertFalse(Files.exists(dir));
}

Fixed version (ground truth):
@Test public void emptyRefDirectoryDeleted() throws Exception {
  String ref="String_Node_Str";
  tr.branch(ref).commit().create();
  String name=repo.findRef(ref).getName();
  Path dir=repo.getDirectory().toPath().resolve(name).getParent();
  assertNotNull(dir);
  gc.packRefs();
  assertFalse(Files.exists(dir));
}
Program: 91277
Project: 91277
Buggy source:
protected KnownUser loadUserInfo(String usrname){
  return null;
}

Fixed version (ground truth):
protected KnownUser loadUserInfo(@SuppressWarnings("String_Node_Str") String usrname){
  return null;
}
Program: 91278
Project: 91278
Buggy source:
private void auth(ServletContextHandler ctx,Authenticator authType){
  final String role="String_Node_Str";
  MappedLoginService users=new MappedLoginService(){
    @Override protected UserIdentity loadUser(    String who){
      return null;
    }
    @Override protected void loadUsers() throws IOException {
      putUser(username,new Password(password),new String[]{role});
    }
    protected String[] loadRoleInfo(    KnownUser user){
      return null;
    }
    protected KnownUser loadUserInfo(    String usrname){
      return null;
    }
  }
;
  ConstraintMapping cm=new ConstraintMapping();
  cm.setConstraint(new Constraint());
  cm.getConstraint().setAuthenticate(true);
  cm.getConstraint().setDataConstraint(Constraint.DC_NONE);
  cm.getConstraint().setRoles(new String[]{role});
  cm.setPathSpec("String_Node_Str");
  ConstraintSecurityHandler sec=new ConstraintSecurityHandler();
  sec.setRealmName(realm);
  sec.setAuthenticator(authType);
  sec.setLoginService(users);
  sec.setConstraintMappings(new ConstraintMapping[]{cm});
  sec.setHandler(ctx);
  contexts.removeHandler(ctx);
  contexts.addHandler(sec);
}

Fixed version (ground truth):
private void auth(ServletContextHandler ctx,Authenticator authType){
  final String role="String_Node_Str";
  MappedLoginService users=new TestMappedLoginService(role);
  ConstraintMapping cm=new ConstraintMapping();
  cm.setConstraint(new Constraint());
  cm.getConstraint().setAuthenticate(true);
  cm.getConstraint().setDataConstraint(Constraint.DC_NONE);
  cm.getConstraint().setRoles(new String[]{role});
  cm.setPathSpec("String_Node_Str");
  ConstraintSecurityHandler sec=new ConstraintSecurityHandler();
  sec.setRealmName(realm);
  sec.setAuthenticator(authType);
  sec.setLoginService(users);
  sec.setConstraintMappings(new ConstraintMapping[]{cm});
  sec.setHandler(ctx);
  contexts.removeHandler(ctx);
  contexts.addHandler(sec);
}
Program: 91279
Project: 91279
Buggy source:
protected String[] loadRoleInfo(KnownUser user){
  return null;
}

Fixed version (ground truth):
protected String[] loadRoleInfo(@SuppressWarnings("String_Node_Str") KnownUser user){
  return null;
}
Program: 91280
Project: 91280
Buggy source:
/** 
 * Sets the recommendation for shallowness.
 * @since 4.4
 */
public void setRecommendShallow(String recommendShallow){
  this.recommendShallow=recommendShallow;
}

Fixed version (ground truth):
/** 
 * Sets the recommendation for shallowness.
 * @param recommendShallow recommendation for shallowness
 * @since 4.4
 */
public void setRecommendShallow(String recommendShallow){
  this.recommendShallow=recommendShallow;
}
Program: 91281
Project: 91281
Buggy source:
/** 
 * Set the url of the sub repo.
 * @param url
 * @return this for chaining.
 * @since 4.4
 */
public RepoProject setGroups(String groups){
  this.groups.clear();
  this.groups.addAll(Arrays.asList(groups.split("String_Node_Str")));
  return this;
}

Fixed version (ground truth):
/** 
 * Set the url of the sub repo.
 * @param groups comma separated group list
 * @return this for chaining.
 * @since 4.4
 */
public RepoProject setGroups(String groups){
  this.groups.clear();
  this.groups.addAll(Arrays.asList(groups.split("String_Node_Str")));
  return this;
}
Program: 91282
Project: 91282
Buggy source:
private static void addHostHeader(URL url,Map<String,String> headers){
  String hostHeader=url.getHost();
  int port=url.getPort();
  if (port > -1) {
    hostHeader.concat("String_Node_Str" + Integer.toString(port));
  }
  headers.put("String_Node_Str",hostHeader);
}

Fixed version (ground truth):
private static void addHostHeader(URL url,Map<String,String> headers){
  StringBuilder hostHeader=new StringBuilder(url.getHost());
  int port=url.getPort();
  if (port > -1) {
    hostHeader.append("String_Node_Str").append(port);
  }
  headers.put("String_Node_Str",hostHeader.toString());
}
Program: 91283
Project: 91283
Buggy source:
/** 
 * Get the HTTP response code from the request. <p> Roughly the same as <code>c.getResponseCode()</code> but the ConnectException is translated to be more understandable.
 * @param c connection the code should be obtained from.
 * @return r HTTP status code, usually 200 to indicate success. See{@link HttpConnection} for other defined constants.
 * @throws IOException communications error prevented obtaining the response code.
 */
public static int response(final java.net.HttpURLConnection c) throws IOException {
  try {
    return c.getResponseCode();
  }
 catch (  ConnectException ce) {
    final String host=c.getURL().getHost();
    if ("String_Node_Str".equals(ce.getMessage()))     throw new ConnectException(MessageFormat.format(JGitText.get().connectionTimeOut,host));
    throw new ConnectException(ce.getMessage() + "String_Node_Str" + host);
  }
}

Fixed version (ground truth):
/** 
 * Get the HTTP response code from the request. <p> Roughly the same as <code>c.getResponseCode()</code> but the ConnectException is translated to be more understandable.
 * @param c connection the code should be obtained from.
 * @return r HTTP status code, usually 200 to indicate success. See{@link HttpConnection} for other defined constants.
 * @throws IOException communications error prevented obtaining the response code.
 */
public static int response(final java.net.HttpURLConnection c) throws IOException {
  try {
    return c.getResponseCode();
  }
 catch (  ConnectException ce) {
    final URL url=c.getURL();
    final String host=(url == null) ? "String_Node_Str" : url.getHost();
    if ("String_Node_Str".equals(ce.getMessage()))     throw new ConnectException(MessageFormat.format(JGitText.get().connectionTimeOut,host));
    throw new ConnectException(ce.getMessage() + "String_Node_Str" + host);
  }
}
Program: 91285
Project: 91285
Buggy source:
@Override protected void run() throws Exception {
  if (all) {
    Map<String,Ref> allRefs=db.getRefDatabase().getRefs(ALL);
    for (    final Ref r : allRefs.values()) {
      outw.println(r.getObjectId().name());
    }
  }
 else {
    if (verify && commits.size() > 1) {
      throw new CmdLineException(CLIText.get().needSingleRevision);
    }
    for (    final ObjectId o : commits) {
      outw.println(o.name());
    }
  }
}

Fixed version (ground truth):
@Override protected void run() throws Exception {
  if (all) {
    Map<String,Ref> allRefs=db.getRefDatabase().getRefs(ALL);
    for (    final Ref r : allRefs.values()) {
      ObjectId objectId=r.getObjectId();
      if (objectId == null) {
        throw new NullPointerException();
      }
      outw.println(objectId.name());
    }
  }
 else {
    if (verify && commits.size() > 1) {
      throw new CmdLineException(CLIText.get().needSingleRevision);
    }
    for (    final ObjectId o : commits) {
      outw.println(o.name());
    }
  }
}
Program: 91289
Project: 91289
Buggy source:
/** 
 * Returns information about the conflicts which occurred during a  {@link MergeCommand}. The returned value maps the path of a conflicting file to a two-dimensional int-array of line-numbers telling where in the file conflict markers for which merged commit can be found. <p> If the returned value contains a mapping "path"-&gt;[x][y]=z then this means <ul> <li>the file with path "path" contains conflicts</li> <li>if y &lt; "number of merged commits": for conflict number x in this file the chunk which was copied from commit number y starts on line number z. All numberings and line numbers start with 0.</li> <li>if y == "number of merged commits": the first non-conflicting line after conflict number x starts at line number z</li> </ul> <p> Example code how to parse this data: <pre> MergeResult m=...; Map&lt;String, int[][]&gt; allConflicts = m.getConflicts(); for (String path : allConflicts.keySet()) { int[][] c = allConflicts.get(path); System.out.println("Conflicts in file " + path); for (int i = 0; i < c.length; ++i) { System.out.println("  Conflict #" + i); for (int j = 0; j &lt;	 (c[i].length) - 1; ++j) { if (c[i][j] >= 0) System.out.println("    Chunk for " + m.getMergedCommits()[j] + " starts on line #" + c[i][j]); } } } </pre>
 * @return the conflicts or <code>null</code> if no conflict occurred
 */
public Map<String,int[][]> getConflicts(){
  return conflicts;
}

Fixed version (ground truth):
/** 
 * Returns information about the conflicts which occurred during a  {@link MergeCommand}. The returned value maps the path of a conflicting file to a two-dimensional int-array of line-numbers telling where in the file conflict markers for which merged commit can be found. <p> If the returned value contains a mapping "path"-&gt;[x][y]=z then this means <ul> <li>the file with path "path" contains conflicts</li> <li>if y &lt; "number of merged commits": for conflict number x in this file the chunk which was copied from commit number y starts on line number z. All numberings and line numbers start with 0.</li> <li>if y == "number of merged commits": the first non-conflicting line after conflict number x starts at line number z</li> </ul> <p> Example code how to parse this data: <pre> MergeResult m=...; Map&lt;String, int[][]&gt; allConflicts = m.getConflicts(); for (String path : allConflicts.keySet()) { int[][] c = allConflicts.get(path); System.out.println("Conflicts in file " + path); for (int i = 0; i &lt; c.length; ++i) { System.out.println("  Conflict #" + i); for (int j = 0; j &lt; (c[i].length) - 1; ++j) { if (c[i][j] &gt;= 0) System.out.println("    Chunk for " + m.getMergedCommits()[j] + " starts on line #" + c[i][j]); } } } </pre>
 * @return the conflicts or <code>null</code> if no conflict occurred
 */
public Map<String,int[][]> getConflicts(){
  return conflicts;
}
Program: 91291
Project: 91291
Buggy source:
/** 
 * Get the default SSH session
 * @return a remote session
 * @throws TransportException in case of error with opening SSH session
 */
protected RemoteSession getSession() throws TransportException {
  if (sock != null)   return sock;
  final int tms=getTimeout() > 0 ? getTimeout() * 1000 : 0;
  sock=sch.getSession(uri,getCredentialsProvider(),local.getFS(),tms);
  return sock;
}

Fixed version (ground truth):
/** 
 * Get the default SSH session
 * @return a remote session
 * @throws TransportException in case of error with opening SSH session
 */
protected RemoteSession getSession() throws TransportException {
  if (sock != null)   return sock;
  final int tms=getTimeout() > 0 ? getTimeout() * 1000 : 0;
  final FS fs=local == null ? FS.detect() : local.getFS();
  sock=sch.getSession(uri,getCredentialsProvider(),fs,tms);
  return sock;
}
Program: 91292
Project: 91292
Buggy source:
/** 
 * Create a new transport instance.
 * @param local the repository this instance will fetch into, or push out of. This must be the repository passed to {@link #open(Repository,URIish)}.
 * @param uri the URI used to access the remote repository. This must be the URI passed to  {@link #open(Repository,URIish)}.
 */
protected SshTransport(Repository local,URIish uri){
  super(local,uri);
  sch=SshSessionFactory.getInstance();
}

Fixed version (ground truth):
/** 
 * Create a new transport instance without a local repository.
 * @param uri the URI used to access the remote repository. This must be theURI passed to  {@link #open(URIish)}.
 * @since 3.5
 */
protected SshTransport(URIish uri){
  super(uri);
  sch=SshSessionFactory.getInstance();
}
Program: 91293
Project: 91293
Buggy source:
/** 
 * Create a new transport instance.
 * @param local the repository this instance will fetch into, or push out of. This must be the repository passed to {@link #open(Repository,URIish)}.
 * @param uri the URI used to access the remote repository. This must be the URI passed to  {@link #open(Repository,URIish)}.
 */
protected TcpTransport(Repository local,URIish uri){
  super(local,uri);
}

Fixed version (ground truth):
/** 
 * Create a new transport instance without a local repository.
 * @param uri the URI used to access the remote repository. This must be theURI passed to  {@link #open(URIish)}.
 * @since 3.5
 */
protected TcpTransport(URIish uri){
  super(uri);
}
Program: 91294
Project: 91294
Buggy source:
TransportGitAnon(final Repository local,final URIish uri){
  super(local,uri);
}

Fixed version (ground truth):
TransportGitAnon(final URIish uri){
  super(uri);
}
Program: 91295
Project: 91295
Buggy source:
public Transport open(URIish uri,Repository local,String remoteName) throws NotSupportedException {
  return new TransportGitAnon(local,uri);
}

Fixed version (ground truth):
@Override public Transport open(URIish uri) throws NotSupportedException, TransportException {
  return new TransportGitAnon(uri);
}
Program: 91296
Project: 91296
Buggy source:
TransportGitSsh(final Repository local,final URIish uri){
  super(local,uri);
  if (useExtSession()) {
    setSshSessionFactory(new SshSessionFactory(){
      @Override public RemoteSession getSession(      URIish uri2,      CredentialsProvider credentialsProvider,      FS fs,      int tms) throws TransportException {
        return new ExtSession();
      }
    }
);
  }
}

Fixed version (ground truth):
TransportGitSsh(final URIish uri){
  super(uri);
  initSshSessionFactory();
}
Program: 91297
Project: 91297
Buggy source:
public Transport open(URIish uri,Repository local,String remoteName) throws NotSupportedException {
  return new TransportGitSsh(local,uri);
}

Fixed version (ground truth):
@Override public Transport open(URIish uri) throws NotSupportedException, TransportException {
  return new TransportGitSsh(uri);
}
Program: 91298
Project: 91298
Buggy source:
/** 
 * Get the default SSH session
 * @return a remote session
 * @throws TransportException in case of error with opening SSH session
 */
protected RemoteSession getSession() throws TransportException {
  if (sock != null)   return sock;
  final int tms=getTimeout() > 0 ? getTimeout() * 1000 : 0;
  sock=sch.getSession(uri,getCredentialsProvider(),local.getFS(),tms);
  return sock;
}

Fixed version (ground truth):
/** 
 * Get the default SSH session
 * @return a remote session
 * @throws TransportException in case of error with opening SSH session
 */
protected RemoteSession getSession() throws TransportException {
  if (sock != null)   return sock;
  final int tms=getTimeout() > 0 ? getTimeout() * 1000 : 0;
  final FS fs=local == null ? FS.detect() : local.getFS();
  sock=sch.getSession(uri,getCredentialsProvider(),fs,tms);
  return sock;
}
Program: 91299
Project: 91299
Buggy source:
/** 
 * Create a new transport instance.
 * @param local the repository this instance will fetch into, or push out of. This must be the repository passed to {@link #open(Repository,URIish)}.
 * @param uri the URI used to access the remote repository. This must be the URI passed to  {@link #open(Repository,URIish)}.
 */
protected SshTransport(Repository local,URIish uri){
  super(local,uri);
  sch=SshSessionFactory.getInstance();
}

Fixed version (ground truth):
/** 
 * Create a new transport instance without a local repository.
 * @param uri the URI used to access the remote repository. This must be theURI passed to  {@link #open(URIish)}.
 * @since 3.5
 */
protected SshTransport(URIish uri){
  super(uri);
  sch=SshSessionFactory.getInstance();
}
Program: 91300
Project: 91300
Buggy source:
/** 
 * Create a new transport instance.
 * @param local the repository this instance will fetch into, or push out of. This must be the repository passed to {@link #open(Repository,URIish)}.
 * @param uri the URI used to access the remote repository. This must be the URI passed to  {@link #open(Repository,URIish)}.
 */
protected TcpTransport(Repository local,URIish uri){
  super(local,uri);
}

Fixed version (ground truth):
/** 
 * Create a new transport instance without a local repository.
 * @param uri the URI used to access the remote repository. This must be theURI passed to  {@link #open(URIish)}.
 * @since 3.5
 */
protected TcpTransport(URIish uri){
  super(uri);
}
Program: 91301
Project: 91301
Buggy source:
TransportGitAnon(final Repository local,final URIish uri){
  super(local,uri);
}

Fixed version (ground truth):
TransportGitAnon(final URIish uri){
  super(uri);
}
Program: 91302
Project: 91302
Buggy source:
public Transport open(URIish uri,Repository local,String remoteName) throws NotSupportedException {
  return new TransportGitAnon(local,uri);
}

Fixed version (ground truth):
@Override public Transport open(URIish uri) throws NotSupportedException, TransportException {
  return new TransportGitAnon(uri);
}
Program: 91303
Project: 91303
Buggy source:
TransportGitSsh(final Repository local,final URIish uri){
  super(local,uri);
  if (useExtSession()) {
    setSshSessionFactory(new SshSessionFactory(){
      @Override public RemoteSession getSession(      URIish uri2,      CredentialsProvider credentialsProvider,      FS fs,      int tms) throws TransportException {
        return new ExtSession();
      }
    }
);
  }
}

Fixed version (ground truth):
TransportGitSsh(final URIish uri){
  super(uri);
  initSshSessionFactory();
}
Program: 91304
Project: 91304
Buggy source:
public Transport open(URIish uri,Repository local,String remoteName) throws NotSupportedException {
  return new TransportGitSsh(local,uri);
}

Fixed version (ground truth):
@Override public Transport open(URIish uri) throws NotSupportedException, TransportException {
  return new TransportGitSsh(uri);
}
Program: 91305
Project: 91305
Buggy source:
static void carryFlags(RevCommit c,final int carry){
  for (; ; ) {
    final RevCommit[] pList=c.parents;
    if (pList == null)     return;
    final int n=pList.length;
    if (n == 0)     return;
    for (int i=1; i < n; i++) {
      final RevCommit p=pList[i];
      if ((p.flags & carry) == carry)       continue;
      p.flags|=carry;
      carryFlags(p,carry);
    }
    c=pList[0];
    if ((c.flags & carry) == carry)     return;
    c.flags|=carry;
  }
}

Fixed version (ground truth):
static void carryFlags(RevCommit c,int carry){
  FIFORevQueue q=carryFlags1(c,carry,0);
  if (q != null)   slowCarryFlags(q,carry);
}
Program: 91306
Project: 91306
Buggy source:
/** 
 * Test if the supplied path matches (being suffix of) the current entry's path. <p> This method tests that the supplied path is exactly equal to the current entry, or is relative to one of entry's parent directories. It is faster to use this method then to use   {@link #getPathString()} to first createa String object, then test <code>endsWith</code> or some other type of string match function.
 * @param p path buffer to test.
 * @param pLen number of bytes from <code>buf</code> to test.
 * @return true if p is suffix of the current path;false if otherwise
 */
public boolean isPathSuffix(final byte[] p,final int pLen){
  final AbstractTreeIterator t=currentHead;
  final byte[] c=t.path;
  final int cLen=t.pathLen;
  int ci;
  for (ci=1; ci < cLen && ci < pLen; ci++) {
    if (c[cLen - ci] != p[pLen - ci])     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Test if the supplied path matches (being suffix of) the current entry's path. <p> This method tests that the supplied path is exactly equal to the current entry, or is relative to one of entry's parent directories. It is faster to use this method then to use   {@link #getPathString()} to first createa String object, then test <code>endsWith</code> or some other type of string match function.
 * @param p path buffer to test.
 * @param pLen number of bytes from <code>buf</code> to test.
 * @return true if p is suffix of the current path;false if otherwise
 */
public boolean isPathSuffix(final byte[] p,final int pLen){
  final AbstractTreeIterator t=currentHead;
  final byte[] c=t.path;
  final int cLen=t.pathLen;
  for (int i=1; i <= pLen; i++) {
    if (i > cLen)     return false;
    if (c[cLen - i] != p[pLen - i])     return false;
  }
  return true;
}
Program: 91307
Project: 91307
Buggy source:
/** 
 * Test if the supplied path matches (being suffix of) the current entry's path. <p> This method tests that the supplied path is exactly equal to the current entry, or is relative to one of entry's parent directories. It is faster to use this method then to use   {@link #getPathString()} to first createa String object, then test <code>endsWith</code> or some other type of string match function.
 * @param p path buffer to test.
 * @param pLen number of bytes from <code>buf</code> to test.
 * @return true if p is suffix of the current path;false if otherwise
 */
public boolean isPathSuffix(final byte[] p,final int pLen){
  final AbstractTreeIterator t=currentHead;
  final byte[] c=t.path;
  final int cLen=t.pathLen;
  int ci;
  for (ci=1; ci < cLen && ci < pLen; ci++) {
    if (c[cLen - ci] != p[pLen - ci])     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Test if the supplied path matches (being suffix of) the current entry's path. <p> This method tests that the supplied path is exactly equal to the current entry, or is relative to one of entry's parent directories. It is faster to use this method then to use   {@link #getPathString()} to first createa String object, then test <code>endsWith</code> or some other type of string match function.
 * @param p path buffer to test.
 * @param pLen number of bytes from <code>buf</code> to test.
 * @return true if p is suffix of the current path;false if otherwise
 */
public boolean isPathSuffix(final byte[] p,final int pLen){
  final AbstractTreeIterator t=currentHead;
  final byte[] c=t.path;
  final int cLen=t.pathLen;
  for (int i=1; i <= pLen; i++) {
    if (i > cLen)     return false;
    if (c[cLen - i] != p[pLen - i])     return false;
  }
  return true;
}
Program: 91308
Project: 91308
Buggy source:
/** 
 * Test if the supplied path matches (being suffix of) the current entry's path. <p> This method tests that the supplied path is exactly equal to the current entry, or is relative to one of entry's parent directories. It is faster to use this method then to use   {@link #getPathString()} to first createa String object, then test <code>endsWith</code> or some other type of string match function.
 * @param p path buffer to test.
 * @param pLen number of bytes from <code>buf</code> to test.
 * @return true if p is suffix of the current path;false if otherwise
 */
public boolean isPathSuffix(final byte[] p,final int pLen){
  final AbstractTreeIterator t=currentHead;
  final byte[] c=t.path;
  final int cLen=t.pathLen;
  int ci;
  for (ci=1; ci < cLen && ci < pLen; ci++) {
    if (c[cLen - ci] != p[pLen - ci])     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Test if the supplied path matches (being suffix of) the current entry's path. <p> This method tests that the supplied path is exactly equal to the current entry, or is relative to one of entry's parent directories. It is faster to use this method then to use   {@link #getPathString()} to first createa String object, then test <code>endsWith</code> or some other type of string match function.
 * @param p path buffer to test.
 * @param pLen number of bytes from <code>buf</code> to test.
 * @return true if p is suffix of the current path;false if otherwise
 */
public boolean isPathSuffix(final byte[] p,final int pLen){
  final AbstractTreeIterator t=currentHead;
  final byte[] c=t.path;
  final int cLen=t.pathLen;
  for (int i=1; i <= pLen; i++) {
    if (i > cLen)     return false;
    if (c[cLen - i] != p[pLen - i])     return false;
  }
  return true;
}
Program: 91309
Project: 91309
Buggy source:
/** 
 * Match a character sequence against this pattern.
 * @param rcs the sequence to match. Must not be null but the length of the sequence is permitted to be 0.
 * @return offset within <code>rcs</code> of the first occurrence of thispattern; -1 if this pattern does not appear at any position of <code>rcs</code>.
 */
public int match(final RawCharSequence rcs){
  final int needleLen=needle.length;
  final byte first=needle[0];
  final byte[] text=rcs.buffer;
  int matchPos=rcs.startPtr;
  final int maxPos=rcs.endPtr - needleLen;
  OUTER:   for (; matchPos < maxPos; matchPos++) {
    if (neq(first,text[matchPos])) {
      while (++matchPos < maxPos && neq(first,text[matchPos])) {
      }
      if (matchPos == maxPos)       return -1;
    }
    int si=++matchPos;
    for (int j=1; j < needleLen; j++, si++) {
      if (neq(needle[j],text[si]))       continue OUTER;
    }
    return matchPos - 1;
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Match a character sequence against this pattern.
 * @param rcs the sequence to match. Must not be null but the length of the sequence is permitted to be 0.
 * @return offset within <code>rcs</code> of the first occurrence of thispattern; -1 if this pattern does not appear at any position of <code>rcs</code>.
 */
public int match(final RawCharSequence rcs){
  final int needleLen=needle.length;
  final byte first=needle[0];
  final byte[] text=rcs.buffer;
  int matchPos=rcs.startPtr;
  final int maxPos=rcs.endPtr - needleLen;
  OUTER:   for (; matchPos <= maxPos; matchPos++) {
    if (neq(first,text[matchPos])) {
      while (++matchPos <= maxPos && neq(first,text[matchPos])) {
      }
      if (matchPos > maxPos)       return -1;
    }
    int si=matchPos + 1;
    for (int j=1; j < needleLen; j++, si++) {
      if (neq(needle[j],text[si]))       continue OUTER;
    }
    return matchPos;
  }
  return -1;
}