nus-yam/ex-repair huggingface dataset:
Program: 101557
Project: 101557
Buggy source:
public void testMatchFromText(){
  String strp="String_Node_Str";
  assertEquals("String_Node_Str",strp,new PatchEntry(strp).toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  String text1="String_Node_Str";
  String text2="String_Node_Str";
  Patch patch=new Patch(text1,text2);
  String patchText=patch.toText();
  Patch patch2=new Patch();
  patch2=patch2.fromText(patchText);
  System.out.println(patch2.apply(text1).getText());
}

Fixed version (ground truth):
public void testMatchFromText(){
  String strp="String_Node_Str";
  assertEquals("String_Node_Str",strp,new PatchEntry(strp).toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
}
Program: 101558
Project: 101558
Buggy source:
public void testMatchFromText(){
  String strp="String_Node_Str";
  assertEquals("String_Node_Str",strp,new PatchEntry(strp).toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
}

Fixed version (ground truth):
public void testMatchFromText(){
  String strp="String_Node_Str";
  assertEquals("String_Node_Str",strp,new PatchEntry(strp).toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  assertEquals("String_Node_Str","String_Node_Str",new PatchEntry("String_Node_Str").toString());
  String text1="String_Node_Str";
  String text2="String_Node_Str";
  Patch patch=new Patch(text1,text2);
  String patchText=patch.toText();
  Patch patch2=new Patch();
  patch2=patch2.fromText(patchText);
  System.out.println(patch2.apply(text1).getText());
}
Program: 101559
Project: 101559
Buggy source:
/** 
 * Locate the best instance of 'pattern' in 'text' near 'loc'.
 * @return Best match index or -1, if no match found
 */
public int locate(){
  if (text.length() == 0) {
    return -1;
  }
  if (text.equals(pattern)) {
    return 0;
  }
  loc=Math.max(0,Math.min(loc,text.length() - pattern.length()));
  if (text.substring(loc,loc + pattern.length()).equals(pattern)) {
    return loc;
  }
  return locator.locate();
}

Fixed version (ground truth):
/** 
 * Locate the best instance of 'pattern' in 'text' near 'loc'.
 * @return Best match index or -1, if no match found
 */
public int locate(){
  if (text.equals(pattern)) {
    return 0;
  }
  if (text.length() == 0) {
    return -1;
  }
  loc=Math.max(0,Math.min(loc,text.length() - pattern.length()));
  if (text.substring(loc,loc + pattern.length()).equals(pattern)) {
    return loc;
  }
  return locator.locate();
}
Program: 101560
Project: 101560
Buggy source:
/** 
 * Parse a textual representation of patches and return a List of Patch objects.
 * @param input Text representation of patches
 * @return List of Patch objects
 */
public Patch fromText(String input){
  patches.clear();
  String[] text=patchBoundaryPattern.split(input);
  StringBuffer buf=new StringBuffer();
  for (int patchCount=0; patchCount < text.length; patchCount++) {
    if (patchCount > 0) {
      buf.replace(0,buf.length(),"String_Node_Str").append(text[patchCount]);
      text[patchCount]=buf.toString();
    }
    patches.add(new PatchEntry(text[patchCount]));
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Parse a textual representation of patches and return a List of Patch objects.
 * @param input Text representation of patches
 * @return List of Patch objects
 */
public Patch fromText(String input){
  patches.clear();
  Matcher m=patchBoundaryPattern.matcher(input);
  int index=0;
  while (m.find()) {
    int start=m.start();
    String match=input.substring(index,start);
    patches.add(new PatchEntry(match));
    index=start + 1;
  }
  if (index == 0) {
    patches.add(new PatchEntry(input));
  }
 else {
    patches.add(new PatchEntry(input.substring(index)));
  }
  return this;
}
Program: 101561
Project: 101561
Buggy source:
public void testMatchApply(){
  Patch p=new Patch("String_Node_Str","String_Node_Str");
  PatchResults results=p.apply("String_Node_Str");
  boolean[] boolArray=results.getResults();
  String resultStr=results.getText() + "String_Node_Str" + boolArray[0]+ "String_Node_Str"+ boolArray[1];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
  results=p.apply("String_Node_Str");
  boolArray=results.getResults();
  resultStr=results.getText() + "String_Node_Str" + boolArray[0]+ "String_Node_Str"+ boolArray[1];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
  results=p.apply("String_Node_Str");
  boolArray=results.getResults();
  resultStr=results.getText() + "String_Node_Str" + boolArray[0]+ "String_Node_Str"+ boolArray[1];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
}

Fixed version (ground truth):
public void testMatchApply(){
  Patch p=new Patch("String_Node_Str","String_Node_Str");
  PatchResults results=p.apply("String_Node_Str");
  boolean[] boolArray=results.getResults();
  String resultStr=results.getText() + "String_Node_Str" + boolArray[0]+ "String_Node_Str"+ boolArray[1];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
  results=p.apply("String_Node_Str");
  boolArray=results.getResults();
  resultStr=results.getText() + "String_Node_Str" + boolArray[0]+ "String_Node_Str"+ boolArray[1];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
  results=p.apply("String_Node_Str");
  boolArray=results.getResults();
  resultStr=results.getText() + "String_Node_Str" + boolArray[0]+ "String_Node_Str"+ boolArray[1];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
  p=new Patch("String_Node_Str","String_Node_Str");
  results=p.apply("String_Node_Str");
  boolArray=results.getResults();
  resultStr=results.getText() + "String_Node_Str" + boolArray[0];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
  p=new Patch("String_Node_Str","String_Node_Str");
  results=p.apply("String_Node_Str");
  boolArray=results.getResults();
  resultStr=results.getText() + "String_Node_Str" + boolArray[0];
  assertEquals("String_Node_Str","String_Node_Str",resultStr);
}
Program: 101562
Project: 101562
Buggy source:
/** 
 * Establishes the user's project directory.
 */
public URI getUserProjectDir(){
  if (home == null) {
    String jswordhome=System.getProperty(PROPERTY_JSWORD_HOME);
    if (jswordhome != null) {
      try {
        home=new URI(NetUtil.PROTOCOL_FILE,null,jswordhome,null);
        if (!NetUtil.canWrite(home)) {
          home=null;
        }
      }
 catch (      URISyntaxException e) {
        home=null;
      }
    }
  }
  if (home == null) {
    URI path=getUserProjectDir(DIR_PROJECT,DIR_PROJECT_ALT);
    URI oldPath=getDeprecatedUserProjectDir();
    home=migrateUserProjectDir(oldPath,path);
  }
  return home;
}

Fixed version (ground truth):
/** 
 * Establishes the user's project directory.
 */
public URI getUserProjectDir(){
  if (home == null) {
    String jswordhome=System.getProperty(PROPERTY_JSWORD_HOME);
    if (jswordhome != null) {
      home=NetUtil.getURI(new File(jswordhome));
      if (!NetUtil.canWrite(home)) {
        home=null;
      }
    }
  }
  if (home == null) {
    URI path=getUserProjectDir(DIR_PROJECT,DIR_PROJECT_ALT);
    URI oldPath=getDeprecatedUserProjectDir();
    home=migrateUserProjectDir(oldPath,path);
  }
  return home;
}
Program: 101563
Project: 101563
Buggy source:
/** 
 * Get a the URI of a (potentially non-existant) properties file that we can write to. This method of aquiring properties files is preferred over getResourceProperties() as this is writable and can take into account user preferences. This method makes no promise that the URI returned is valid. It is totally untested, so reading may well cause errors.
 * @param subject The name (minus the .properties extension)
 * @return The resource as a URI
 */
public URI getWritablePropertiesURI(String subject){
  return NetUtil.lengthenURI(getUserProjectDir(),subject + FileUtil.EXTENSION_PROPERTIES);
}

Fixed version (ground truth):
/** 
 * Get a the URI of a (potentially non-existent) properties file that we can write to. This method of acquiring properties files is preferred over getResourceProperties() as this is writable and can take into account user preferences. This method makes no promise that the URI returned is valid. It is totally untested, so reading may well cause errors.
 * @param subject The name (minus the .properties extension)
 * @return The resource as a URI
 */
public URI getWritablePropertiesURI(String subject){
  return NetUtil.lengthenURI(getUserProjectDir(),subject + FileUtil.EXTENSION_PROPERTIES);
}
Program: 101564
Project: 101564
Buggy source:
public void setString(String value) throws ConfigException {
  Exception ex=null;
  try {
    Object object=convertToObject(value);
    setter.invoke(null,new Object[]{object.toString()});
  }
 catch (  InvocationTargetException e) {
    ex=e;
  }
catch (  IllegalArgumentException e) {
    ex=e;
  }
catch (  IllegalAccessException e) {
    ex=e;
  }
  if (ex != null) {
    log.info("String_Node_Str" + setter.toString());
    throw new ConfigException(Msg.CONFIG_SETFAIL,ex,new Object[]{setter});
  }
}

Fixed version (ground truth):
public void setString(String value) throws ConfigException {
  Exception ex=null;
  try {
    Object object=convertToObject(value);
    if (object != null) {
      setter.invoke(null,new Object[]{object});
    }
  }
 catch (  InvocationTargetException e) {
    ex=e;
  }
catch (  IllegalArgumentException e) {
    ex=e;
  }
catch (  IllegalAccessException e) {
    ex=e;
  }
catch (  NullPointerException e) {
    ex=e;
  }
  if (ex != null) {
    log.info("String_Node_Str" + setter.toString());
    throw new ConfigException(Msg.CONFIG_SETFAIL,ex,new Object[]{setter});
  }
}
Program: 101565
Project: 101565
Buggy source:
public Object convertToObject(String orig){
  try {
    return new Integer(orig);
  }
 catch (  NumberFormatException ex) {
    Iterator iter=options.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry mapEntry=(Map.Entry)iter.next();
      if (mapEntry.getValue().equals(orig)) {
        return mapEntry.getKey();
      }
    }
    Reporter.informUser(this,Msg.IGNORE,new Object[]{orig});
    return null;
  }
}

Fixed version (ground truth):
public Object convertToObject(String orig){
  try {
    return new Integer(orig);
  }
 catch (  NumberFormatException ex) {
    Iterator iter=options.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry mapEntry=(Map.Entry)iter.next();
      if (mapEntry.getValue().equals(orig)) {
        return mapEntry.getKey();
      }
    }
    return new Integer(0);
  }
}
Program: 101566
Project: 101566
Buggy source:
public Object convertToObject(String orig){
  Iterator iter=options.entrySet().iterator();
  Map.Entry mapEntry=null;
  while (iter.hasNext()) {
    mapEntry=(Map.Entry)iter.next();
    if (mapEntry.getValue().toString().equals(orig) || mapEntry.getKey().toString().equals(orig)) {
      return mapEntry.getKey();
    }
  }
  Reporter.informUser(this,Msg.IGNORE,new Object[]{orig});
  return "String_Node_Str";
}

Fixed version (ground truth):
public Object convertToObject(String orig){
  Iterator iter=options.entrySet().iterator();
  Map.Entry mapEntry=null;
  while (iter.hasNext()) {
    mapEntry=(Map.Entry)iter.next();
    if (mapEntry.getValue().toString().equals(orig) || mapEntry.getKey().toString().equals(orig)) {
      return mapEntry.getKey().toString();
    }
  }
  Reporter.informUser(this,Msg.IGNORE,new Object[]{orig});
  return "String_Node_Str";
}
Program: 101567
Project: 101567
Buggy source:
/** 
 * Parse a textual representation of patches and return a List of Patch objects.
 * @param input Text representation of patches
 * @return List of Patch objects
 */
public Patch fromText(String input){
  patches.clear();
  String[] text=patchBoundaryPattern.split(input);
  for (int patchCount=0; patchCount < text.length; patchCount++) {
    patches.add(new PatchEntry(text[patchCount]));
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Parse a textual representation of patches and return a List of Patch objects.
 * @param input Text representation of patches
 * @return List of Patch objects
 */
public Patch fromText(String input){
  patches.clear();
  String[] text=patchBoundaryPattern.split(input);
  StringBuffer buf=new StringBuffer();
  for (int patchCount=0; patchCount < text.length; patchCount++) {
    if (patchCount > 0) {
      buf.replace(0,buf.length(),"String_Node_Str").append(text[patchCount]);
      text[patchCount]=buf.toString();
    }
    patches.add(new PatchEntry(text[patchCount]));
  }
  return this;
}
Program: 101568
Project: 101568
Buggy source:
public void testMatchFromText(){
  String strp="String_Node_Str";
  assertEquals("String_Node_Str",strp,new Patch(strp).toText());
  assertEquals("String_Node_Str","String_Node_Str",new Patch("String_Node_Str").toText());
  assertEquals("String_Node_Str","String_Node_Str",new Patch("String_Node_Str").toText());
  assertEquals("String_Node_Str","String_Node_Str",new Patch("String_Node_Str").toText());
}

Fixed version (ground truth):
public void testMatchFromText(){
  String strp="String_Node_Str";
  assertEquals("String_Node_Str",strp,new Patch(strp).toText());
  assertEquals("String_Node_Str","String_Node_Str",new Patch("String_Node_Str").toText());
  assertEquals("String_Node_Str","String_Node_Str",new Patch("String_Node_Str").toText());
  assertEquals("String_Node_Str","String_Node_Str",new Patch("String_Node_Str").toText());
  assertEquals("String_Node_Str","String_Node_Str",new Patch("String_Node_Str").toText());
}
Program: 101569
Project: 101569
Buggy source:
/** 
 * Set the timeout for the diff operation. 0 for infinity. Default is 1 second.
 * @param newTimeout
 */
public static void setTimeout(float newTimeout){
  timeout=newTimeout;
}

Fixed version (ground truth):
/** 
 * Set the timeout for the diff operation. The default is 1 second. Use 0 for infinity.
 * @param newTimeout
 */
public static void setTimeout(float newTimeout){
  timeout=newTimeout;
}
Program: 101572
Project: 101572
Buggy source:
/** 
 * Add the OSIS elements to the div element. Note, this assumes that the data is fully marked up.
 * @param key The key being added
 * @param div The div element to which the key is being added
 * @param osisContent The OSIS representation of the key being added.
 */
public void addOSIS(Key key,List content,List osisContent){
}

Fixed version (ground truth):
/** 
 * Add the OSIS elements to the div element. Note, this assumes that the data is fully marked up.
 * @param key The key being added
 * @param content The list to which the key's OSIS representation is being added
 * @param osisContent The OSIS representation of the key being added.
 */
public void addOSIS(Key key,List content,List osisContent){
}
Program: 101573
Project: 101573
Buggy source:
/** 
 * Get the preferred name of a book. Altered by the case setting (see setBookCase() and isLongBookName())
 * @param book The book number (1-66)
 * @return The full name of the book
 * @exception NoSuchVerseException If the book number is not valid
 */
public String getPreferredName(){
  if (BibleInfo.isFullBookName()) {
    return getLongName();
  }
  return getShortName();
}

Fixed version (ground truth):
/** 
 * Get the preferred name of a book. Altered by the case setting (see setBookCase() and isLongBookName())
 * @return The preferred name of the book
 */
public String getPreferredName(){
  if (BibleInfo.isFullBookName()) {
    return getLongName();
  }
  return getShortName();
}
Program: 101574
Project: 101574
Buggy source:
/** 
 * Create a BookName for a Book of the Bible in a given language.
 * @param locale the language of this BookName
 * @param bookNumber the Book's canonical number
 * @param longName the Book's long name
 * @param shortName the Book's short name, if any
 * @param alternateNames optional alternates for the Book
 */
public BookName(Locale locale,int bookNumber,String longName,String shortName,String alternateNames){
  this.locale=locale;
  this.bookNumber=bookNumber;
  this.longName=longName;
  this.normalizedLongName=normalize(longName,locale);
  this.shortName=shortName;
  this.normalizedShortName=normalize(shortName,locale);
  if (alternateNames != null) {
    this.alternateNames=StringUtil.split(normalize(alternateNames,locale),',');
  }
}

Fixed version (ground truth):
/** 
 * Create a BookName for a Book of the Bible in a given language.
 * @param locale the language of this BookName
 * @param bookNumber the Book's canonical number
 * @param longName the Book's long name
 * @param shortName the Book's short name, if any
 * @param alternateNames optional comma separated list of alternates for the Book
 */
public BookName(Locale locale,int bookNumber,String longName,String shortName,String alternateNames){
  this.locale=locale;
  this.bookNumber=bookNumber;
  this.longName=longName;
  this.normalizedLongName=normalize(longName,locale);
  this.shortName=shortName;
  this.normalizedShortName=normalize(shortName,locale);
  if (alternateNames != null) {
    this.alternateNames=StringUtil.split(normalize(alternateNames,locale),',');
  }
}
Program: 101575
Project: 101575
Buggy source:
/** 
 * @param name
 * @return return a GBF Tag for the given tag name
 */
public static Tag getTag(Book book,Key key,String name){
  Tag tag=null;
  int length=name.length();
  if (length > 0) {
    TagBuilder builder=null;
    if (length == 2) {
      builder=(TagBuilder)BUILDERS.get(name);
    }
 else {
      builder=(TagBuilder)BUILDERS.get(name.substring(0,2));
    }
    Tag reply=null;
    if (builder != null) {
      reply=builder.createTag(name);
    }
    if (reply == null) {
      log.warn("String_Node_Str" + book.getInitials() + "String_Node_Str"+ key.getName()+ "String_Node_Str"+ name+ "String_Node_Str");
    }
  }
  return tag;
}

Fixed version (ground truth):
/** 
 * @param name
 * @return return a GBF Tag for the given tag name
 */
public static Tag getTag(Book book,Key key,String name){
  Tag tag=null;
  int length=name.length();
  if (length > 0) {
    TagBuilder builder=null;
    if (length == 2) {
      builder=(TagBuilder)BUILDERS.get(name);
    }
 else {
      builder=(TagBuilder)BUILDERS.get(name.substring(0,2));
    }
    if (builder != null) {
      tag=builder.createTag(name);
    }
    if (tag == null) {
      log.warn("String_Node_Str" + book.getInitials() + "String_Node_Str"+ key.getName()+ "String_Node_Str"+ name+ "String_Node_Str");
    }
  }
  return tag;
}
Program: 101576
Project: 101576
Buggy source:
/** 
 * Take the data stored permanently and copy it to the local storage area, using the configured storage area
 * @throws IOException
 */
public void permanentToLocal(URI uri) throws IOException {
  InputStream is=null;
  try {
    is=NetUtil.getInputStream(uri);
    Properties prop=new Properties();
    prop.load(is);
    is.close();
    setProperties(prop);
  }
  finally {
    IOUtil.close(is);
  }
}

Fixed version (ground truth):
/** 
 * Take the data stored permanently and copy it to the local storage area, using the configured storage area
 * @throws IOException
 */
public void permanentToLocal(URI uri) throws IOException {
  setProperties(NetUtil.loadProperties(uri));
}
Program: 101577
Project: 101577
Buggy source:
/** 
 * Take the data in the local storage area and store it permanently, using the configured storage area.
 */
public void localToPermanent(URI url) throws IOException {
  OutputStream out=null;
  try {
    out=new FileOutputStream(url.getPath());
    getProperties().store(out,title);
  }
  finally {
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Take the data in the local storage area and store it permanently, using the configured storage area.
 */
public void localToPermanent(URI uri) throws IOException {
  NetUtil.storeProperties(getProperties(),uri,title);
}
Program: 101578
Project: 101578
Buggy source:
/** 
 * Load the predictive timings if any
 */
private synchronized void loadPredictions(){
  InputStream in=null;
  try {
    in=NetUtil.getInputStream(predictURI);
    if (in != null) {
      predicted=new HashMap();
      Properties temp=new Properties();
      temp.load(in);
      Iterator iter=temp.keySet().iterator();
      while (iter.hasNext()) {
        String title=(String)iter.next();
        String timestr=temp.getProperty(title);
        try {
          Integer time=new Integer(timestr);
          predicted.put(title,time);
          int age=time.intValue();
          if (age > predictedLength) {
            predictedLength=age;
          }
        }
 catch (        NumberFormatException ex) {
          log.error("String_Node_Str",ex);
        }
      }
    }
  }
 catch (  IOException ex) {
    log.debug("String_Node_Str");
  }
 finally {
    IOUtil.close(in);
  }
}

Fixed version (ground truth):
/** 
 * Load the predictive timings if any
 */
private synchronized void loadPredictions(){
  try {
    predicted=new HashMap();
    Properties temp=NetUtil.loadProperties(predictURI);
    Iterator iter=temp.keySet().iterator();
    while (iter.hasNext()) {
      String title=(String)iter.next();
      String timestr=temp.getProperty(title);
      try {
        Integer time=new Integer(timestr);
        predicted.put(title,time);
        int age=time.intValue();
        if (age > predictedLength) {
          predictedLength=age;
        }
      }
 catch (      NumberFormatException ex) {
        log.error("String_Node_Str",ex);
      }
    }
  }
 catch (  IOException ex) {
    log.debug("String_Node_Str");
  }
}
Program: 101579
Project: 101579
Buggy source:
/** 
 * Save the known timings to a properties file.
 */
private synchronized void savePredictions(){
  long end=start;
  Iterator iter=current.keySet().iterator();
  while (iter.hasNext()) {
    String message=(String)iter.next();
    int age=getAgeFromMap(current,message);
    if (age > end) {
      end=age;
    }
  }
  Properties predictions=new Properties();
  iter=current.keySet().iterator();
  while (iter.hasNext()) {
    String message=(String)iter.next();
    int age=getAgeFromMap(current,message);
    predictions.setProperty(message,Integer.toString(age));
  }
  try {
    OutputStream out=NetUtil.getOutputStream(predictURI);
    predictions.store(out,"String_Node_Str");
  }
 catch (  IOException ex) {
    log.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Save the known timings to a properties file.
 */
private synchronized void savePredictions(){
  long end=start;
  Iterator iter=current.keySet().iterator();
  while (iter.hasNext()) {
    String message=(String)iter.next();
    int age=getAgeFromMap(current,message);
    if (age > end) {
      end=age;
    }
  }
  Properties predictions=new Properties();
  iter=current.keySet().iterator();
  while (iter.hasNext()) {
    String message=(String)iter.next();
    int age=getAgeFromMap(current,message);
    predictions.setProperty(message,Integer.toString(age));
  }
  try {
    NetUtil.storeProperties(predictions,predictURI,"String_Node_Str");
  }
 catch (  IOException ex) {
    log.error("String_Node_Str",ex);
  }
}
Program: 101580
Project: 101580
Buggy source:
public static Map properties2Map(URI propUri) throws IOException {
  InputStream in=null;
  try {
    in=NetUtil.getInputStream(propUri);
    Properties prop=new Properties();
    prop.load(in);
    in.close();
    return properties2Map(prop);
  }
  finally {
    IOUtil.close(in);
  }
}

Fixed version (ground truth):
/** 
 * Convert a <code>Properties</code> located at <code>propURI</code> into a <code>Map</code>.
 * @param propUri The URI of the Properties to convert
 * @return The map
 */
public static Map properties2Map(URI propUri) throws IOException {
  return properties2Map(NetUtil.loadProperties(propUri));
}
Program: 101581
Project: 101581
Buggy source:
/** 
 * Save all properties to the user's local area. Uses the same property name so as to override it.
 */
public void save(){
  Properties props=new Properties();
  StringBuffer buf=new StringBuffer();
  int i=1;
  for (Iterator it=installers.keySet().iterator(); it.hasNext(); ) {
    String name=(String)it.next();
    Installer installer=(Installer)installers.get(name);
    buf.delete(0,buf.length());
    buf.append(installer.getType());
    buf.append(',');
    buf.append(name);
    buf.append(',');
    buf.append(installer.getInstallerDefinition());
    props.setProperty(PREFIX + i++,buf.toString());
  }
  URI outputURI=Project.instance().getWritablePropertiesURI(getClass().getName());
  try {
    OutputStream out=NetUtil.getOutputStream(outputURI);
    props.store(out,"String_Node_Str");
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Save all properties to the user's local area. Uses the same property name so as to override it.
 */
public void save(){
  Properties props=new Properties();
  StringBuffer buf=new StringBuffer();
  int i=1;
  for (Iterator it=installers.keySet().iterator(); it.hasNext(); ) {
    String name=(String)it.next();
    Installer installer=(Installer)installers.get(name);
    buf.delete(0,buf.length());
    buf.append(installer.getType());
    buf.append(',');
    buf.append(name);
    buf.append(',');
    buf.append(installer.getInstallerDefinition());
    props.setProperty(PREFIX + i++,buf.toString());
  }
  URI outputURI=Project.instance().getWritablePropertiesURI(getClass().getName());
  try {
    NetUtil.storeProperties(props,outputURI,"String_Node_Str");
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 101582
Project: 101582
Buggy source:
/** 
 * Create a Book appropriate for the BookMetaData
 */
private Book createBook(SwordBookMetaData sbmd) throws BookException {
  BookType modtype=sbmd.getBookType();
  if (modtype.getBookCategory() == null) {
    throw new BookException(Msg.TYPE_UNSUPPORTED);
  }
  return modtype.createBook(sbmd);
}

Fixed version (ground truth):
/** 
 * Create a Book appropriate for the BookMetaData
 */
private Book createBook(SwordBookMetaData sbmd) throws BookException {
  BookType modtype=sbmd.getBookType();
  if (modtype == null || modtype.getBookCategory() == null) {
    throw new BookException(Msg.TYPE_UNSUPPORTED);
  }
  return modtype.createBook(sbmd);
}
Program: 101583
Project: 101583
Buggy source:
private void getBooks(List valid,File bookDir){
  File mods=new File(bookDir,SwordConstants.DIR_CONF);
  if (mods.isDirectory()) {
    String[] bookConfs=SwordBookPath.getBookList(mods);
    for (int i=0; i < bookConfs.length; i++) {
      String bookConf=bookConfs[i];
      try {
        File configfile=new File(mods,bookConf);
        String internal=bookConf;
        if (internal.endsWith(SwordConstants.EXTENSION_CONF)) {
          internal=internal.substring(0,internal.length() - 5);
        }
        SwordBookMetaData sbmd=new SwordBookMetaData(configfile,internal,NetUtil.getURI(bookDir));
        sbmd.setDriver(this);
        Book book=createBook(sbmd);
        if (!valid.contains(book)) {
          valid.add(book);
          IndexManager imanager=IndexManagerFactory.getIndexManager();
          if (imanager.isIndexed(book)) {
            sbmd.setIndexStatus(IndexStatus.DONE);
          }
 else {
            sbmd.setIndexStatus(IndexStatus.UNDONE);
          }
        }
      }
 catch (      IOException e) {
        log.warn("String_Node_Str",e);
      }
catch (      BookException e) {
        log.warn("String_Node_Str",e);
      }
    }
  }
 else {
    log.debug("String_Node_Str" + mods + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void getBooks(List valid,File bookDir){
  File mods=new File(bookDir,SwordConstants.DIR_CONF);
  if (mods.isDirectory()) {
    String[] bookConfs=SwordBookPath.getBookList(mods);
    for (int i=0; i < bookConfs.length; i++) {
      String bookConf=bookConfs[i];
      try {
        File configfile=new File(mods,bookConf);
        String internal=bookConf;
        if (internal.endsWith(SwordConstants.EXTENSION_CONF)) {
          internal=internal.substring(0,internal.length() - 5);
        }
        SwordBookMetaData sbmd=new SwordBookMetaData(configfile,internal,NetUtil.getURI(bookDir));
        if (!sbmd.isSupported()) {
          continue;
        }
        sbmd.setDriver(this);
        Book book=createBook(sbmd);
        if (!valid.contains(book)) {
          valid.add(book);
          IndexManager imanager=IndexManagerFactory.getIndexManager();
          if (imanager.isIndexed(book)) {
            sbmd.setIndexStatus(IndexStatus.DONE);
          }
 else {
            sbmd.setIndexStatus(IndexStatus.UNDONE);
          }
        }
      }
 catch (      IOException e) {
        log.warn("String_Node_Str",e);
      }
catch (      BookException e) {
        log.warn("String_Node_Str",e);
      }
    }
  }
 else {
    log.debug("String_Node_Str" + mods + "String_Node_Str");
  }
}
Program: 101584
Project: 101584
Buggy source:
public void setLibrary(URI library){
  cet.add(ConfigEntryType.LIBRARY_URL,library.toString());
  super.setLibrary(library);
  String datapath=getProperty(ConfigEntryType.DATA_PATH);
  int lastSlash=datapath.lastIndexOf('/');
  if (lastSlash == -1) {
    return;
  }
  datapath=datapath.substring(0,lastSlash);
  URI location=NetUtil.lengthenURI(library,datapath);
  cet.add(ConfigEntryType.LOCATION_URL,location.toString());
  super.setLocation(location);
}

Fixed version (ground truth):
public void setLibrary(URI library){
  if (!isSupported()) {
    return;
  }
  cet.add(ConfigEntryType.LIBRARY_URL,library.toString());
  super.setLibrary(library);
  String datapath=getProperty(ConfigEntryType.DATA_PATH);
  int lastSlash=datapath.lastIndexOf('/');
  if (lastSlash == -1) {
    return;
  }
  datapath=datapath.substring(0,lastSlash);
  URI location=NetUtil.lengthenURI(library,datapath);
  cet.add(ConfigEntryType.LOCATION_URL,location.toString());
  super.setLocation(location);
}
Program: 101585
Project: 101585
Buggy source:
/** 
 * Return the orientation of the language of the Book. If a book contains more than one language, it refers to the dominate language of the book. This will be used to present Arabic and Hebrew in their propper orientation.
 * @return true if the orientation for the dominate language is LeftToRight.
 */
boolean isLeftToRight();

Fixed version (ground truth):
/** 
 * Return the orientation of the language of the Book. If a book contains more than one language, it refers to the dominate language of the book. This will be used to present Arabic and Hebrew in their proper orientation.
 * @return true if the orientation for the dominate language is LeftToRight.
 */
boolean isLeftToRight();
Program: 101586
Project: 101586
Buggy source:
private void adjustDataPath(){
  String datapath=(String)getValue(ConfigEntryType.DATA_PATH);
  if (datapath.startsWith("String_Node_Str")) {
    add(ConfigEntryType.DATA_PATH,datapath.substring(2));
  }
}

Fixed version (ground truth):
private void adjustDataPath(){
  String datapath=(String)getValue(ConfigEntryType.DATA_PATH);
  if (datapath == null) {
    datapath="String_Node_Str";
  }
  if (datapath.startsWith("String_Node_Str")) {
    add(ConfigEntryType.DATA_PATH,datapath.substring(2));
  }
}
Program: 101587
Project: 101587
Buggy source:
/** 
 * Loads a sword config from a buffer. The returned BookMetaData object will not be associated with a Book so setBook() should be called before getBook() is expected to return anything other than null.
 * @param buffer
 * @param internal
 * @throws IOException
 */
public SwordBookMetaData(byte[] buffer,String internal) throws IOException {
  cet=new ConfigEntryTable(internal);
  cet.load(buffer);
  buildProperties();
}

Fixed version (ground truth):
/** 
 * Loads a sword config from a buffer.
 * @param buffer
 * @param internal
 * @throws IOException
 */
public SwordBookMetaData(byte[] buffer,String internal) throws IOException {
  cet=new ConfigEntryTable(internal);
  cet.load(buffer);
  buildProperties();
}
Program: 101588
Project: 101588
Buggy source:
public void setLibrary(URI library){
  String datapath=getProperty(ConfigEntryType.DATA_PATH);
  int lastSlash=datapath.lastIndexOf('/');
  if (lastSlash == -1) {
    return;
  }
  datapath=datapath.substring(0,lastSlash);
  URI location=NetUtil.lengthenURI(library,datapath);
  cet.add(ConfigEntryType.LIBRARY_URL,library.toString());
  super.setLibrary(library);
  cet.add(ConfigEntryType.LOCATION_URL,location.toString());
  super.setLocation(location);
}

Fixed version (ground truth):
public void setLibrary(URI library){
  cet.add(ConfigEntryType.LIBRARY_URL,library.toString());
  super.setLibrary(library);
  String datapath=getProperty(ConfigEntryType.DATA_PATH);
  int lastSlash=datapath.lastIndexOf('/');
  if (lastSlash == -1) {
    return;
  }
  datapath=datapath.substring(0,lastSlash);
  URI location=NetUtil.lengthenURI(library,datapath);
  cet.add(ConfigEntryType.LOCATION_URL,location.toString());
  super.setLocation(location);
}
Program: 101589
Project: 101589
Buggy source:
public Key find(Index index) throws BookException {
  Key left=getLeftQuery().find(index);
  if (left.isEmpty()) {
    return left;
  }
  Key right=getRightQuery().find(index);
  if (right.isEmpty()) {
    return right;
  }
  left.retainAll(right);
  return left;
}

Fixed version (ground truth):
public Key find(Index index) throws BookException {
  Key left=getLeftQuery().find(index);
  if (left.isEmpty()) {
    return left;
  }
  Key right=getRightQuery().find(index);
  if (right.isEmpty()) {
    return right;
  }
  if (right instanceof PassageTally) {
    right.retainAll(left);
    return right;
  }
  left.retainAll(right);
  return left;
}
Program: 101590
Project: 101590
Buggy source:
public Key find(Index index) throws BookException {
  Key left=getLeftQuery().find(index);
  Key right=getRightQuery().find(index);
  if (left.isEmpty()) {
    return right;
  }
  if (right.isEmpty()) {
    return left;
  }
  left.addAll(right);
  return left;
}

Fixed version (ground truth):
public Key find(Index index) throws BookException {
  Key left=getLeftQuery().find(index);
  Key right=getRightQuery().find(index);
  if (left.isEmpty()) {
    return right;
  }
  if (right.isEmpty()) {
    return left;
  }
  if (right instanceof PassageTally) {
    right.addAll(left);
    return right;
  }
  left.addAll(right);
  return left;
}
Program: 101591
Project: 101591
Buggy source:
/** 
 * Do the actual parsing. Anything that does not match causes a BookException.
 * @param input
 * @throws BookException
 */
private void parse(String input) throws BookException {
}

Fixed version (ground truth):
/** 
 * Do the actual parsing. Anything that does not match causes a BookException.
 * @param input
 * @throws BookException
 */
private void parse(String input) throws BookException {
  String text=input;
  Matcher m=STRONGS_PATTERN.matcher(text);
  if (!m.lookingAt()) {
    throw new BookException(Msg.STRONGS_ERROR_NUMBER,new Object[]{input});
  }
  String lang=m.group(1);
  language=lang.charAt(0);
switch (language) {
case 'g':
    language='G';
  break;
case 'h':
language='H';
break;
default :
}
strongsNumber=Short.parseShort(m.group(2));
}
Program: 101592
Project: 101592
Buggy source:
/** 
 * Add an element to history. If there is any "forward" list, the element replaces it.
 * @param obj
 */
public void add(Object obj){
  if (nav.size() > 0) {
    nav.subList(backCount,nav.size()).clear();
  }
  nav.add(obj);
  backCount++;
  visit(obj);
  fireHistoryChanged();
}

Fixed version (ground truth):
/** 
 * Add an element to history. If the element is in the forward list, then it replaces everything in the forward list upto it. Otherwise, it replaces the forward list.
 * @param obj the object to add
 */
public void add(Object obj){
  Object current=getCurrent();
  if (obj == null || obj.equals(current)) {
    return;
  }
  int size=nav.size();
  if (size > backCount) {
    int pos=backCount;
    while (pos < size && !obj.equals(nav.get(pos))) {
      pos++;
    }
    nav.subList(backCount,Math.min(pos++,size)).clear();
  }
  if (!obj.equals(peek(1))) {
    nav.add(backCount,obj);
  }
  backCount++;
  visit(obj);
  fireHistoryChanged();
}
Program: 101593
Project: 101593
Buggy source:
/** 
 * Make a particular element in the navigation list the current item in history.
 * @param index the index of item to make the last one in the back list,-1 (or lower) will put everything in the forward list. Indexes beyond the end of the list will put everything in the back list.
 */
public Object select(int index){
  int i=index;
  int size=nav.size();
  if (i > size) {
    i=size;
  }
 else   if (i < 1) {
    i=1;
  }
  backCount=i;
  fireHistoryChanged();
  return getCurrent();
}

Fixed version (ground truth):
/** 
 * Make a particular element in the navigation list the current item in history.
 * @param index the index of item to make the last one in the back list,-1 (or lower) will put everything in the forward list. Indexes beyond the end of the list will put everything in the back list.
 */
public Object select(int index){
  int i=index;
  int size=nav.size();
  if (i > size) {
    i=size;
  }
 else   if (i < 1) {
    i=1;
  }
  if (i != backCount) {
    backCount=i;
    fireHistoryChanged();
  }
  return getCurrent();
}
Program: 101594
Project: 101594
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.addTest(org.crosswire.common.util.AllTests.suite());
  suite.addTest(org.crosswire.common.progress.AllTests.suite());
  suite.addTest(org.crosswire.common.diff.AllTests.suite());
  suite.addTest(org.crosswire.common.xml.AllTests.suite());
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.addTest(org.crosswire.common.util.AllTests.suite());
  suite.addTest(org.crosswire.common.progress.AllTests.suite());
  suite.addTest(org.crosswire.common.diff.AllTests.suite());
  suite.addTest(org.crosswire.common.history.AllTests.suite());
  suite.addTest(org.crosswire.common.xml.AllTests.suite());
  return suite;
}
Program: 101595
Project: 101595
Buggy source:
public URI getLocation(){
  URI uri=null;
  try {
    String loc=getProperty(KEY_LOCATION_URL);
    if (loc != null) {
      uri=new URI(loc);
    }
    return uri;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}

Fixed version (ground truth):
public URI getLocation(){
  URI uri=null;
  try {
    String loc=getProperty(KEY_LOCATION_URI);
    if (loc != null) {
      uri=new URI(loc);
    }
    return uri;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}
Program: 101596
Project: 101596
Buggy source:
public void setLocation(URI location){
  putProperty(KEY_LOCATION_URL,location.toString());
}

Fixed version (ground truth):
public void setLocation(URI location){
  putProperty(KEY_LOCATION_URI,location.toString());
}
Program: 101597
Project: 101597
Buggy source:
public void setLibrary(URI library){
  putProperty(KEY_LIBRARY_URL,library.toString());
}

Fixed version (ground truth):
public void setLibrary(URI library){
  putProperty(KEY_LIBRARY_URI,library.toString());
}
Program: 101598
Project: 101598
Buggy source:
public URI getLibrary(){
  URI uri=null;
  try {
    String loc=getProperty(KEY_LIBRARY_URL);
    if (loc != null) {
      uri=new URI(loc);
    }
    return uri;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}

Fixed version (ground truth):
public URI getLibrary(){
  URI uri=null;
  try {
    String loc=getProperty(KEY_LIBRARY_URI);
    if (loc != null) {
      uri=new URI(loc);
    }
    return uri;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}
Program: 101599
Project: 101599
Buggy source:
public void run(){
  URI predicturl=Project.instance().getWritablePropertiesURI("String_Node_Str");
  Progress job=JobManager.createJob(Msg.INSTALLING.toString(sbmd.getName()),predicturl,this,true);
  yield();
  try {
    job.setSectionName(Msg.JOB_INIT.toString());
    URI temp=NetUtil.getTemporaryURI("String_Node_Str",ZIP_SUFFIX);
    download(job,packageDirectory,sbmd.getInitials() + ZIP_SUFFIX,temp);
    job.setCancelable(false);
    if (!job.isFinished()) {
      File dldir=SwordBookPath.getSwordDownloadDir();
      IOUtil.unpackZip(NetUtil.getAsFile(temp),dldir);
      job.setSectionName(Msg.JOB_CONFIG.toString());
      sbmd.setLibrary(NetUtil.getURI(dldir));
      SwordBookDriver.registerNewBook(sbmd);
    }
  }
 catch (  IOException e) {
    Reporter.informUser(this,e);
    job.cancel();
  }
catch (  InstallException e) {
    Reporter.informUser(this,e);
    job.cancel();
  }
catch (  BookException e) {
    Reporter.informUser(this,e);
    job.cancel();
  }
 finally {
    job.done();
  }
}

Fixed version (ground truth):
public void run(){
  URI predictURI=Project.instance().getWritablePropertiesURI("String_Node_Str");
  Progress job=JobManager.createJob(Msg.INSTALLING.toString(sbmd.getName()),predictURI,this,true);
  yield();
  try {
    job.setSectionName(Msg.JOB_INIT.toString());
    URI temp=NetUtil.getTemporaryURI("String_Node_Str",ZIP_SUFFIX);
    download(job,packageDirectory,sbmd.getInitials() + ZIP_SUFFIX,temp);
    job.setCancelable(false);
    if (!job.isFinished()) {
      File dldir=SwordBookPath.getSwordDownloadDir();
      IOUtil.unpackZip(NetUtil.getAsFile(temp),dldir);
      job.setSectionName(Msg.JOB_CONFIG.toString());
      sbmd.setLibrary(NetUtil.getURI(dldir));
      SwordBookDriver.registerNewBook(sbmd);
    }
  }
 catch (  IOException e) {
    Reporter.informUser(this,e);
    job.cancel();
  }
catch (  InstallException e) {
    Reporter.informUser(this,e);
    job.cancel();
  }
catch (  BookException e) {
    Reporter.informUser(this,e);
    job.cancel();
  }
 finally {
    job.done();
  }
}
Program: 101600
Project: 101600
Buggy source:
public boolean isNewer(Book book){
}

Fixed version (ground truth):
public boolean isNewer(Book book){
  File dldir=SwordBookPath.getSwordDownloadDir();
  SwordBookMetaData sbmd=(SwordBookMetaData)book.getBookMetaData();
  File conf=new File(dldir,sbmd.getConfPath());
  if (!conf.exists()) {
    return false;
  }
  URI configURI=NetUtil.getURI(conf);
  URI remote=toRemoteURI(book);
  return NetUtil.isNewer(remote,configURI,proxyHost,proxyPort);
}
Program: 101601
Project: 101601
Buggy source:
public void install(Book book){
  if (Books.installed().getBook(book.getName()) != null) {
    return;
  }
  final SwordBookMetaData sbmd=(SwordBookMetaData)book.getBookMetaData();
  final Thread worker=new Thread("String_Node_Str"){
    public void run(){
      URI predicturl=Project.instance().getWritablePropertiesURI("String_Node_Str");
      Progress job=JobManager.createJob(Msg.INSTALLING.toString(sbmd.getName()),predicturl,this,true);
      yield();
      try {
        job.setSectionName(Msg.JOB_INIT.toString());
        URI temp=NetUtil.getTemporaryURI("String_Node_Str",ZIP_SUFFIX);
        download(job,packageDirectory,sbmd.getInitials() + ZIP_SUFFIX,temp);
        job.setCancelable(false);
        if (!job.isFinished()) {
          File dldir=SwordBookPath.getSwordDownloadDir();
          IOUtil.unpackZip(NetUtil.getAsFile(temp),dldir);
          job.setSectionName(Msg.JOB_CONFIG.toString());
          sbmd.setLibrary(NetUtil.getURI(dldir));
          SwordBookDriver.registerNewBook(sbmd);
        }
      }
 catch (      IOException e) {
        Reporter.informUser(this,e);
        job.cancel();
      }
catch (      InstallException e) {
        Reporter.informUser(this,e);
        job.cancel();
      }
catch (      BookException e) {
        Reporter.informUser(this,e);
        job.cancel();
      }
 finally {
        job.done();
      }
    }
  }
;
  worker.setPriority(Thread.MIN_PRIORITY);
  worker.start();
}

Fixed version (ground truth):
public void install(Book book){
  if (Books.installed().getBook(book.getName()) != null) {
    return;
  }
  final SwordBookMetaData sbmd=(SwordBookMetaData)book.getBookMetaData();
  final Thread worker=new Thread("String_Node_Str"){
    public void run(){
      URI predictURI=Project.instance().getWritablePropertiesURI("String_Node_Str");
      Progress job=JobManager.createJob(Msg.INSTALLING.toString(sbmd.getName()),predictURI,this,true);
      yield();
      try {
        job.setSectionName(Msg.JOB_INIT.toString());
        URI temp=NetUtil.getTemporaryURI("String_Node_Str",ZIP_SUFFIX);
        download(job,packageDirectory,sbmd.getInitials() + ZIP_SUFFIX,temp);
        job.setCancelable(false);
        if (!job.isFinished()) {
          File dldir=SwordBookPath.getSwordDownloadDir();
          IOUtil.unpackZip(NetUtil.getAsFile(temp),dldir);
          job.setSectionName(Msg.JOB_CONFIG.toString());
          sbmd.setLibrary(NetUtil.getURI(dldir));
          SwordBookDriver.registerNewBook(sbmd);
        }
      }
 catch (      IOException e) {
        Reporter.informUser(this,e);
        job.cancel();
      }
catch (      InstallException e) {
        Reporter.informUser(this,e);
        job.cancel();
      }
catch (      BookException e) {
        Reporter.informUser(this,e);
        job.cancel();
      }
 finally {
        job.done();
      }
    }
  }
;
  worker.setPriority(Thread.MIN_PRIORITY);
  worker.start();
}
Program: 101602
Project: 101602
Buggy source:
/** 
 * Get a list of the available readings sets
 */
public String[] getInstalledReadingsSets(){
  try {
    URL index=ResourceUtil.getResource(ReadingsBookDriver.class,"String_Node_Str");
    return NetUtil.listByIndexFile(NetUtil.toURI(index),new URLFilter(){
      public boolean accept(      String name){
        return true;
      }
    }
);
  }
 catch (  IOException ex) {
    return new String[0];
  }
}

Fixed version (ground truth):
/** 
 * Get a list of the available readings sets
 */
public String[] getInstalledReadingsSets(){
  try {
    URL index=ResourceUtil.getResource(ReadingsBookDriver.class,"String_Node_Str");
    return NetUtil.listByIndexFile(NetUtil.toURI(index),new URIFilter(){
      public boolean accept(      String name){
        return true;
      }
    }
);
  }
 catch (  IOException ex) {
    return new String[0];
  }
}
Program: 101603
Project: 101603
Buggy source:
/** 
 * We have downloaded a search index to a zip file. It should be installed from here.
 * @param book The book that we downloaded an index for
 * @param tempDest The URL of a zip file to install
 */
void installDownloadedIndex(Book book,URI tempDest) throws BookException ;

Fixed version (ground truth):
/** 
 * We have downloaded a search index to a zip file. It should be installed from here.
 * @param book The book that we downloaded an index for
 * @param tempDest The URI of a zip file to install
 */
void installDownloadedIndex(Book book,URI tempDest) throws BookException ;