nus-yam/ex-repair huggingface dataset:
Program: 1658
Project: 1658
Buggy source:
@Test public void testPBES2ConformanceTestAES128() throws Exception {
  byte[] data=Base64.decode("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  testPBES2Conformance("String_Node_Str","String_Node_Str",16,"String_Node_Str",data);
}

Fixed version (ground truth):
@Test public void testPBES2ConformanceTestAES128() throws Exception {
  byte[] data=Base64.decode("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  runTestPBES2Conformance("String_Node_Str","String_Node_Str",16,"String_Node_Str",data);
}
Program: 1659
Project: 1659
Buggy source:
@Test public void testPBES2ConformanceTestBlowfish() throws Exception {
  byte[] data=Base64.decode("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  testPBES2Conformance("String_Node_Str","String_Node_Str",-1,"String_Node_Str",data);
}

Fixed version (ground truth):
@Test public void testPBES2ConformanceTestBlowfish() throws Exception {
  byte[] data=Base64.decode("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  runTestPBES2Conformance("String_Node_Str","String_Node_Str",-1,"String_Node_Str",data);
}
Program: 1660
Project: 1660
Buggy source:
@Test public void testDSASignatureVerification() throws Exception {
  testSignatureVerification(mocker.getComponentUnderTest().getInstance(true,privateKey),mocker.getComponentUnderTest().getInstance(false,publicKey));
}

Fixed version (ground truth):
@Test public void testDSASignatureVerification() throws Exception {
  runTestSignatureVerification(mocker.getComponentUnderTest().getInstance(true,privateKey),mocker.getComponentUnderTest().getInstance(false,publicKey));
}
Program: 1661
Project: 1661
Buggy source:
@Test public void testMd5SignatureVerification() throws Exception {
  test(mockerMD5);
}

Fixed version (ground truth):
@Test public void testMd5SignatureVerification() throws Exception {
  runTest(mockerMD5);
}
Program: 1662
Project: 1662
Buggy source:
@Test public void testSha1SignatureVerification() throws Exception {
  test(mocker);
}

Fixed version (ground truth):
@Test public void testSha1SignatureVerification() throws Exception {
  runTest(mocker);
}
Program: 1663
Project: 1663
Buggy source:
@Test public void testSha512SignatureVerification() throws Exception {
  test(mockerSha512);
}

Fixed version (ground truth):
@Test public void testSha512SignatureVerification() throws Exception {
  runTest(mockerSha512);
}
Program: 1664
Project: 1664
Buggy source:
@Test public void testSha224SignatureVerification() throws Exception {
  test(mockerSha224);
}

Fixed version (ground truth):
@Test public void testSha224SignatureVerification() throws Exception {
  runTest(mockerSha224);
}
Program: 1665
Project: 1665
Buggy source:
@Test public void testSha384SignatureVerification() throws Exception {
  test(mockerSha384);
}

Fixed version (ground truth):
@Test public void testSha384SignatureVerification() throws Exception {
  runTest(mockerSha384);
}
Program: 1666
Project: 1666
Buggy source:
@Test public void testSha256SignatureVerification() throws Exception {
  test(mockerSha256);
}

Fixed version (ground truth):
@Test public void testSha256SignatureVerification() throws Exception {
  runTest(mockerSha256);
}
Program: 1667
Project: 1667
Buggy source:
@Test public void testSha512SignatureVerification() throws Exception {
  testSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}

Fixed version (ground truth):
@Test public void testSha512SignatureVerification() throws Exception {
  runTestSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}
Program: 1668
Project: 1668
Buggy source:
@Test public void testEncodedSha256SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  testSignatureVerification(signer,verifier);
}

Fixed version (ground truth):
@Test public void testEncodedSha256SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  runTestSignatureVerification(signer,verifier);
}
Program: 1669
Project: 1669
Buggy source:
@Test public void testSha224SignatureVerification() throws Exception {
  testSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}

Fixed version (ground truth):
@Test public void testSha224SignatureVerification() throws Exception {
  runTestSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}
Program: 1670
Project: 1670
Buggy source:
@Test public void testEncodedSha512SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  testSignatureVerification(signer,verifier);
}

Fixed version (ground truth):
@Test public void testEncodedSha512SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  runTestSignatureVerification(signer,verifier);
}
Program: 1671
Project: 1671
Buggy source:
@Test public void testSha256SignatureVerification() throws Exception {
  testSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}

Fixed version (ground truth):
@Test public void testSha256SignatureVerification() throws Exception {
  runTestSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}
Program: 1672
Project: 1672
Buggy source:
@Test public void testEncodedSha384SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  testSignatureVerification(signer,verifier);
}

Fixed version (ground truth):
@Test public void testEncodedSha384SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  runTestSignatureVerification(signer,verifier);
}
Program: 1673
Project: 1673
Buggy source:
@Test public void testEncodedDefaultSignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,privateKey);
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  testSignatureVerification(signer,verifier);
}

Fixed version (ground truth):
@Test public void testEncodedDefaultSignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,privateKey);
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  runTestSignatureVerification(signer,verifier);
}
Program: 1674
Project: 1674
Buggy source:
@Test public void testEncodedSha224SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  testSignatureVerification(signer,verifier);
}

Fixed version (ground truth):
@Test public void testEncodedSha224SignatureVerification() throws Exception {
  Signer signer=factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1));
  Signer verifier=factory.getInstance(false,publicKey,signer.getEncoded());
  runTestSignatureVerification(signer,verifier);
}
Program: 1675
Project: 1675
Buggy source:
@Test public void testDefaultSignatureVerification() throws Exception {
  testSignatureVerification(factory.getInstance(true,privateKey),factory.getInstance(false,publicKey));
}

Fixed version (ground truth):
@Test public void testDefaultSignatureVerification() throws Exception {
  runTestSignatureVerification(factory.getInstance(true,privateKey),factory.getInstance(false,publicKey));
}
Program: 1676
Project: 1676
Buggy source:
@Test public void testSha384SignatureVerification() throws Exception {
  testSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}

Fixed version (ground truth):
@Test public void testSha384SignatureVerification() throws Exception {
  runTestSignatureVerification(factory.getInstance(true,new PssSignerParameters(privateKey,"String_Node_Str",-1)),factory.getInstance(false,new PssSignerParameters(publicKey,"String_Node_Str",-1)));
}
Program: 1677
Project: 1677
Buggy source:
private void runTest(MockitoComponentMockingRule<SignerFactory> mocker) throws Exception {
  Signer signer=mocker.getComponentUnderTest().getInstance(true,privateKey);
  testSignatureVerification(signer,factory.getInstance(false,publicKey,signer.getEncoded()));
}

Fixed version (ground truth):
private void runTest(MockitoComponentMockingRule<SignerFactory> mocker) throws Exception {
  Signer signer=mocker.getComponentUnderTest().getInstance(true,privateKey);
  runTestSignatureVerification(signer,factory.getInstance(false,publicKey,signer.getEncoded()));
}
Program: 1678
Project: 1678
Buggy source:
/** 
 * @param rawConstraint the constraint to parse
 * @return the list of version ranges
 * @throws InvalidVersionConstraintException invalid constraint range syntax
 */
private List<VersionRangeCollection> parseRanges(String rawConstraint) throws InvalidVersionConstraintException {
  String constraint=rawConstraint;
  List<VersionRangeCollection> newRanges=new ArrayList<VersionRangeCollection>();
  while (VersionUtils.startsWith(constraint,'{')) {
    int index=constraint.indexOf('}');
    if (index < 0) {
      throw new InvalidVersionConstraintException(String.format("String_Node_Str",rawConstraint));
    }
    String range=constraint.substring(1,index);
    try {
      newRanges.add(new DefaultVersionRangeCollection(range));
    }
 catch (    InvalidVersionRangeException e) {
      throw new InvalidVersionConstraintException(String.format("String_Node_Str",range,rawConstraint,e));
    }
    constraint=constraint.substring(index + 1).trim();
    if (VersionUtils.startsWith(constraint,RANGE_SEPARATOR)) {
      constraint=constraint.substring(1).trim();
    }
  }
  if (!constraint.isEmpty()) {
    if (newRanges.isEmpty()) {
      try {
        newRanges.add(new DefaultVersionRangeCollection(constraint));
      }
 catch (      InvalidVersionRangeException e) {
        throw new InvalidVersionConstraintException(String.format("String_Node_Str",constraint),e);
      }
    }
 else {
      throw new InvalidVersionConstraintException(String.format("String_Node_Str",rawConstraint,constraint));
    }
  }
  return newRanges;
}

Fixed version (ground truth):
/** 
 * @param rawConstraint the constraint to parse
 * @return the list of version ranges
 * @throws InvalidVersionConstraintException invalid constraint range syntax
 */
private List<VersionRangeCollection> parseRanges(String rawConstraint) throws InvalidVersionConstraintException {
  String constraint=rawConstraint;
  List<VersionRangeCollection> newRanges=new ArrayList<VersionRangeCollection>();
  while (VersionUtils.startsWith(constraint,'{')) {
    int index=constraint.indexOf('}');
    if (index < 0) {
      throw new InvalidVersionConstraintException(String.format("String_Node_Str",rawConstraint));
    }
    String range=constraint.substring(1,index);
    try {
      newRanges.add(new DefaultVersionRangeCollection(range));
    }
 catch (    InvalidVersionRangeException e) {
      throw new InvalidVersionConstraintException(String.format("String_Node_Str",range,rawConstraint),e);
    }
    constraint=constraint.substring(index + 1).trim();
    if (VersionUtils.startsWith(constraint,RANGE_SEPARATOR)) {
      constraint=constraint.substring(1).trim();
    }
  }
  if (!constraint.isEmpty()) {
    if (newRanges.isEmpty()) {
      try {
        newRanges.add(new DefaultVersionRangeCollection(constraint));
      }
 catch (      InvalidVersionRangeException e) {
        throw new InvalidVersionConstraintException(String.format("String_Node_Str",constraint),e);
      }
    }
 else {
      throw new InvalidVersionConstraintException(String.format("String_Node_Str",rawConstraint,constraint));
    }
  }
  return newRanges;
}
Program: 1680
Project: 1680
Buggy source:
public URL findResource(String name){
  return this.loader.findResource(getUrls(),name);
}

Fixed version (ground truth):
@Override public URL findResource(String name){
  return this.loader.findResource(getUrls(),name);
}
Program: 1681
Project: 1681
Buggy source:
/** 
 * Returns an Enumeration of ResourceHandle objects representing all of the resources having the specified name.
 * @param name the name of the resource
 * @return the ResourceHandle of the resource
 */
protected Enumeration<ResourceHandle> getResourceHandles(final String name){
  return AccessController.doPrivileged(new PrivilegedAction<Enumeration<ResourceHandle>>(){
    public Enumeration<ResourceHandle> run(){
      return URIClassLoader.this.finder.getResources(name);
    }
  }
,this.acc);
}

Fixed version (ground truth):
/** 
 * Returns an Enumeration of ResourceHandle objects representing all of the resources having the specified name.
 * @param name the name of the resource
 * @return the ResourceHandle of the resource
 */
protected Enumeration<ResourceHandle> getResourceHandles(final String name){
  return AccessController.doPrivileged(new PrivilegedAction<Enumeration<ResourceHandle>>(){
    @Override public Enumeration<ResourceHandle> run(){
      return URIClassLoader.this.finder.getResources(name);
    }
  }
,this.acc);
}
Program: 1682
Project: 1682
Buggy source:
public ResourceHandle getResource(String name){
  return this.loader.getResource(getUrls(),name);
}

Fixed version (ground truth):
@Override public ResourceHandle getResource(String name){
  return this.loader.getResource(getUrls(),name);
}
Program: 1683
Project: 1683
Buggy source:
public Enumeration<URL> findResources(String name){
  return this.loader.findResources(getUrls(),name);
}

Fixed version (ground truth):
@Override public Enumeration<URL> findResources(String name){
  return this.loader.findResources(getUrls(),name);
}
Program: 1684
Project: 1684
Buggy source:
public Enumeration<ResourceHandle> run(){
  return URIClassLoader.this.finder.getResources(name);
}

Fixed version (ground truth):
@Override public Enumeration<ResourceHandle> run(){
  return URIClassLoader.this.finder.getResources(name);
}
Program: 1685
Project: 1685
Buggy source:
/** 
 * Finds and loads the class with the specified name.
 * @param name the name of the class
 * @return the resulting class
 * @exception ClassNotFoundException if the class could not be found
 */
@Override protected Class<?> findClass(final String name) throws ClassNotFoundException {
  try {
    return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>(){
      public Class<?> run() throws ClassNotFoundException {
        String path=name.replace('.','/').concat("String_Node_Str");
        ResourceHandle h=URIClassLoader.this.finder.getResource(path);
        if (h != null) {
          try {
            return defineClass(name,h);
          }
 catch (          IOException e) {
            throw new ClassNotFoundException(name,e);
          }
        }
 else {
          throw new ClassNotFoundException(name);
        }
      }
    }
,this.acc);
  }
 catch (  java.security.PrivilegedActionException pae) {
    throw (ClassNotFoundException)pae.getException();
  }
}

Fixed version (ground truth):
/** 
 * Finds and loads the class with the specified name.
 * @param name the name of the class
 * @return the resulting class
 * @exception ClassNotFoundException if the class could not be found
 */
@Override protected Class<?> findClass(final String name) throws ClassNotFoundException {
  try {
    return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>(){
      @Override public Class<?> run() throws ClassNotFoundException {
        String path=name.replace('.','/').concat("String_Node_Str");
        ResourceHandle h=URIClassLoader.this.finder.getResource(path);
        if (h != null) {
          try {
            return defineClass(name,h);
          }
 catch (          IOException e) {
            throw new ClassNotFoundException(name,e);
          }
        }
 else {
          throw new ClassNotFoundException(name);
        }
      }
    }
,this.acc);
  }
 catch (  java.security.PrivilegedActionException pae) {
    throw (ClassNotFoundException)pae.getException();
  }
}
Program: 1686
Project: 1686
Buggy source:
/** 
 * Finds the ResourceHandle object for the resource with the specified name.
 * @param name the name of the resource
 * @return the ResourceHandle of the resource
 */
protected ResourceHandle getResourceHandle(final String name){
  return AccessController.doPrivileged(new PrivilegedAction<ResourceHandle>(){
    public ResourceHandle run(){
      return URIClassLoader.this.finder.getResource(name);
    }
  }
,this.acc);
}

Fixed version (ground truth):
/** 
 * Finds the ResourceHandle object for the resource with the specified name.
 * @param name the name of the resource
 * @return the ResourceHandle of the resource
 */
protected ResourceHandle getResourceHandle(final String name){
  return AccessController.doPrivileged(new PrivilegedAction<ResourceHandle>(){
    @Override public ResourceHandle run(){
      return URIClassLoader.this.finder.getResource(name);
    }
  }
,this.acc);
}
Program: 1687
Project: 1687
Buggy source:
public Enumeration<ResourceHandle> getResources(String name){
  return this.loader.getResources(getUrls(),name);
}

Fixed version (ground truth):
@Override public Enumeration<ResourceHandle> getResources(String name){
  return this.loader.getResources(getUrls(),name);
}
Program: 1688
Project: 1688
Buggy source:
public boolean hasMoreElements(){
  fetchNext();
  return (this.next != null);
}

Fixed version (ground truth):
@Override public boolean hasMoreElements(){
  fetchNext();
  return (this.next != null);
}
Program: 1689
Project: 1689
Buggy source:
public T nextElement(){
  fetchNext();
  if (this.next == null) {
    throw new NoSuchElementException();
  }
  ;
  T nextElement=this.next;
  this.next=null;
  return nextElement;
}

Fixed version (ground truth):
@Override public T nextElement(){
  fetchNext();
  if (this.next == null) {
    throw new NoSuchElementException();
  }
  ;
  T nextElement=this.next;
  this.next=null;
  return nextElement;
}
Program: 1690
Project: 1690
Buggy source:
/** 
 * @param actions the actions to apply
 * @throws InstallException failed to install extension
 * @throws UninstallException failed to uninstall extension
 * @throws LocalExtensionRepositoryException failed to store extension
 * @throws ResolveException could not find extension in the local repository
 */
protected void applyActions(Collection<ExtensionPlanAction> actions) throws LocalExtensionRepositoryException, InstallException, UninstallException, ResolveException {
  notifyPushLevelProgress(actions.size());
  try {
    for (    ExtensionPlanAction action : actions) {
      if (action.getAction() != Action.NONE) {
        applyAction(action);
      }
      notifyStepPropress();
    }
  }
  finally {
    notifyPopLevelProgress();
  }
}

Fixed version (ground truth):
/** 
 * @param actions the actions to apply
 * @throws InstallException failed to install extension
 * @throws UninstallException failed to uninstall extension
 * @throws ResolveException could not find extension in the local repository
 */
protected void applyActions(Collection<ExtensionPlanAction> actions) throws InstallException, UninstallException, ResolveException {
  notifyPushLevelProgress(actions.size());
  try {
    for (    ExtensionPlanAction action : actions) {
      if (action.getAction() != Action.NONE) {
        applyAction(action);
      }
      notifyStepPropress();
    }
  }
  finally {
    notifyPopLevelProgress();
  }
}
Program: 1691
Project: 1691
Buggy source:
/** 
 * @param action the action to perform
 * @throws InstallException failed to install extension
 * @throws UninstallException failed to uninstall extension
 * @throws LocalExtensionRepositoryException failed to store extension
 * @throws ResolveException could not find extension in the local repository
 */
protected void applyAction(ExtensionPlanAction action) throws InstallException, UninstallException, LocalExtensionRepositoryException, ResolveException {
  Extension extension=action.getExtension();
  String namespace=action.getNamespace();
  if (namespace != null) {
    this.logger.info("String_Node_Str",new Object[]{action.getAction(),extension.getId(),namespace});
  }
 else {
    this.logger.info("String_Node_Str",action.getAction(),extension.getId());
  }
  notifyPushLevelProgress(2);
  try {
    if (action.getAction() == Action.UNINSTALL) {
      InstalledExtension installedExtension=(InstalledExtension)action.getExtension();
      notifyStepPropress();
      uninstallExtension(installedExtension,namespace);
    }
 else {
      LocalExtension localExtension=this.localExtensionRepository.resolve(extension.getId());
      notifyStepPropress();
      installExtension(localExtension,action.getPreviousExtension(),namespace,action.isDependency());
    }
    if (namespace != null) {
      this.logger.info("String_Node_Str",new Object[]{action.getAction(),extension.getId(),namespace});
    }
 else {
      this.logger.info("String_Node_Str",action.getAction(),extension.getId());
    }
  }
  finally {
    notifyPopLevelProgress();
  }
}

Fixed version (ground truth):
/** 
 * @param action the action to perform
 * @throws InstallException failed to install extension
 * @throws UninstallException failed to uninstall extension
 * @throws ResolveException could not find extension in the local repository
 */
protected void applyAction(ExtensionPlanAction action) throws InstallException, UninstallException, ResolveException {
  Extension extension=action.getExtension();
  String namespace=action.getNamespace();
  if (namespace != null) {
    this.logger.info("String_Node_Str",new Object[]{action.getAction(),extension.getId(),namespace});
  }
 else {
    this.logger.info("String_Node_Str",action.getAction(),extension.getId());
  }
  notifyPushLevelProgress(2);
  try {
    if (action.getAction() == Action.UNINSTALL) {
      InstalledExtension installedExtension=(InstalledExtension)action.getExtension();
      notifyStepPropress();
      uninstallExtension(installedExtension,namespace);
    }
 else {
      LocalExtension localExtension=this.localExtensionRepository.resolve(extension.getId());
      notifyStepPropress();
      installExtension(localExtension,action.getPreviousExtension(),namespace,action.isDependency());
    }
    if (namespace != null) {
      this.logger.info("String_Node_Str",new Object[]{action.getAction(),extension.getId(),namespace});
    }
 else {
      this.logger.info("String_Node_Str",action.getAction(),extension.getId());
    }
  }
  finally {
    notifyPopLevelProgress();
  }
}
Program: 1692
Project: 1692
Buggy source:
/** 
 * @param action the action containing the extension to download
 * @throws LocalExtensionRepositoryException failed to store extension
 * @throws InstallException unsupported action
 */
private void store(ExtensionPlanAction action) throws LocalExtensionRepositoryException, InstallException {
  if (action.getAction() == Action.INSTALL || action.getAction() == Action.UPGRADE || action.getAction() == Action.DOWNGRADE) {
    storeExtension(action.getExtension());
  }
}

Fixed version (ground truth):
/** 
 * @param action the action containing the extension to download
 * @throws LocalExtensionRepositoryException failed to store extension
 */
private void store(ExtensionPlanAction action) throws LocalExtensionRepositoryException {
  if (action.getAction() == Action.INSTALL || action.getAction() == Action.UPGRADE || action.getAction() == Action.DOWNGRADE) {
    storeExtension(action.getExtension());
  }
}
Program: 1693
Project: 1693
Buggy source:
/** 
 * Uninstall provided extension.
 * @param feature the feature to uninstall
 * @param namespace the namespace
 * @throws UninstallException error when trying to uninstall extension
 * @see #uninstallExtension(LocalExtension,String)
 */
private void removeInstalledFeature(String feature,String namespace) throws UninstallException {
  if (namespace == null) {
    this.extensionNamespaceByFeature.remove(feature);
  }
 else {
    Map<String,InstalledFeature> namespaceInstalledExtension=this.extensionNamespaceByFeature.get(feature);
    namespaceInstalledExtension.remove(namespace);
  }
}

Fixed version (ground truth):
/** 
 * Uninstall provided extension.
 * @param feature the feature to uninstall
 * @param namespace the namespace
 * @see #uninstallExtension(LocalExtension,String)
 */
private void removeInstalledFeature(String feature,String namespace){
  if (namespace == null) {
    this.extensionNamespaceByFeature.remove(feature);
  }
 else {
    Map<String,InstalledFeature> namespaceInstalledExtension=this.extensionNamespaceByFeature.get(feature);
    namespaceInstalledExtension.remove(namespace);
  }
}
Program: 1694
Project: 1694
Buggy source:
/** 
 * Uninstall provided extension.
 * @param installedExtension the extension to uninstall
 * @param namespace the namespace
 * @throws UninstallException error when trying to uninstall extension
 * @see #uninstallExtension(LocalExtension,String)
 */
private void removeInstalledExtension(DefaultInstalledExtension installedExtension,String namespace) throws UninstallException {
  removeInstalledFeature(installedExtension.getId().getId(),namespace);
  for (  String feature : installedExtension.getFeatures()) {
    removeInstalledFeature(feature,namespace);
  }
  removeFromBackwardDependencies(installedExtension,namespace);
  if (!installedExtension.isInstalled()) {
    removeCachedExtension(installedExtension);
  }
}

Fixed version (ground truth):
/** 
 * Uninstall provided extension.
 * @param installedExtension the extension to uninstall
 * @param namespace the namespace
 * @see #uninstallExtension(LocalExtension,String)
 */
private void removeInstalledExtension(DefaultInstalledExtension installedExtension,String namespace){
  removeInstalledFeature(installedExtension.getId().getId(),namespace);
  for (  String feature : installedExtension.getFeatures()) {
    removeInstalledFeature(feature,namespace);
  }
  removeFromBackwardDependencies(installedExtension,namespace);
  if (!installedExtension.isInstalled()) {
    removeCachedExtension(installedExtension);
  }
}
Program: 1695
Project: 1695
Buggy source:
/** 
 * @return a new collection
 */
protected Set createCollection(){
  return new HashSet();
}

Fixed version (ground truth):
/** 
 * @return a new collection
 */
@Override protected Set createCollection(){
  return new HashSet();
}
Program: 1697
Project: 1697
Buggy source:
/** 
 * Unzip xar artifact and its dependencies.
 * @throws ArchiverException error when unzip package.
 * @throws IOException error when unzip package.
 * @throws MojoExecutionException error when unzip package.
 */
private void performUnArchive() throws ArchiverException, IOException, MojoExecutionException {
  Artifact artifact=findArtifact();
  getLog().debug(String.format("String_Node_Str",artifact.getFile()));
  unpack(artifact.getFile(),this.outputDirectory,"String_Node_Str",true);
  unpackDependentXars(artifact);
}

Fixed version (ground truth):
/** 
 * Unzip xar artifact and its dependencies.
 * @throws ArchiverException error when unzip package.O
 * @throws MojoExecutionException error when unzip package.
 */
private void performUnArchive() throws ArchiverException, MojoExecutionException {
  Artifact artifact=findArtifact();
  getLog().debug(String.format("String_Node_Str",artifact.getFile()));
  unpack(artifact.getFile(),this.outputDirectory,"String_Node_Str",true);
  unpackDependentXars(artifact);
}
Program: 1698
Project: 1698
Buggy source:
/** 
 * @param directoryName the name of the directory to initialize (ensure it exists, create thedirectory)
 * @param isTemp true if we are initializing a temporary directory.
 * @param tempOrPermanent a string describing the type of directory,namely "temporary" or "permanent", to aid logging.
 * @return the initialized directory as a {@link File} or null if the directory doesn't existand cannot be created or if the process doesn't have permission to write to it.
 */
private File initializeDirectory(final String directoryName,final boolean isTemp,final String tempOrPermanent){
  final File dir=(isTemp) ? new File(directoryName,TEMP_NAME) : new File(directoryName);
  if (dir.exists()) {
    if (dir.isDirectory() && dir.canWrite()) {
      return this.initDir(dir,isTemp);
    }
    final String[] params=new String[]{tempOrPermanent,dir.getAbsolutePath(),(dir.isDirectory()) ? "String_Node_Str" : "String_Node_Str"};
    this.logger.error("String_Node_Str",params);
    return null;
  }
 else   if (dir.mkdirs()) {
    return this.initDir(dir,isTemp);
  }
  this.logger.error("String_Node_Str",tempOrPermanent,dir.getAbsolutePath());
  return null;
}

Fixed version (ground truth):
/** 
 * @param directoryName the name of the directory to initialize (ensure it exists, create thedirectory)
 * @param isTemp true if we are initializing a temporary directory.
 * @param tempOrPermanent a string describing the type of directory,namely "temporary" or "permanent", to aid logging.
 * @return the initialized directory as a {@link File} or null if the directory doesn't existand cannot be created or if the process doesn't have permission to write to it.
 */
private File initializeDirectory(final String directoryName,final boolean isTemp,final String tempOrPermanent){
  final File dir=(isTemp) ? new File(directoryName,TEMP_NAME) : new File(directoryName);
  if (dir.exists()) {
    if (dir.isDirectory() && dir.canWrite()) {
      return initDir(dir,isTemp);
    }
    final String[] params=new String[]{tempOrPermanent,dir.getAbsolutePath(),(dir.isDirectory()) ? "String_Node_Str" : "String_Node_Str"};
    this.logger.error("String_Node_Str",params);
    return null;
  }
 else   if (dir.mkdirs()) {
    return initDir(dir,isTemp);
  }
  this.logger.error("String_Node_Str",tempOrPermanent,dir.getAbsolutePath());
  return null;
}
Program: 1699
Project: 1699
Buggy source:
/** 
 * Initialize the internal xwiki-temp directory. This function clears the directory out.
 * @param tempDir the xwiki-temp subdirectory which is internal/deleted per load.
 */
private void initTempDir(final File tempDir){
  final File permDir=this.getPermanentDirectory();
  try {
    if (tempDir.equals(permDir) || FileUtils.directoryContains(tempDir,permDir)) {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",TEMP_NAME));
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
  try {
    FileUtils.cleanDirectory(tempDir);
  }
 catch (  IOException e) {
    throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str",tempDir.getAbsolutePath()));
  }
}

Fixed version (ground truth):
/** 
 * Initialize the internal xwiki-temp directory. This function clears the directory out.
 * @param tempDir the xwiki-temp subdirectory which is internal/deleted per load.
 */
private void initTempDir(final File tempDir){
  final File permDir=getPermanentDirectory();
  try {
    if (tempDir.equals(permDir) || FileUtils.directoryContains(tempDir,permDir)) {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",TEMP_NAME));
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str",e);
  }
  try {
    FileUtils.cleanDirectory(tempDir);
  }
 catch (  IOException e) {
    throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str",tempDir.getAbsolutePath()));
  }
}
Program: 1700
Project: 1700
Buggy source:
/** 
 * {@inheritDoc}Rather than overriding this, it is safer to override   {@link #getPermanentDirectoryName()}This is because this function does a number of checks to make sure the directory exists, is a directory (not a file) and the XWiki process has permission to write to it. If the directory doesn't exist it is created and if it cannot be written to, an error is printed in the log and it is passed over for the default permanent directory.
 * @see Environment#getPermanentDirectory()
 */
@Override public File getPermanentDirectory(){
  if (this.permanentDirectory == null) {
    final String classSpecified=this.getPermanentDirectoryName();
    final String configured=this.configurationProvider.get().getPermanentDirectoryPath();
    if (classSpecified == null && configured == null) {
      this.logger.warn("String_Node_Str",DEFAULT_TMP_DIRECTORY);
    }
    final String[] locations=new String[]{classSpecified,configured,this.getTemporaryDirectoryName(),DEFAULT_TMP_DIRECTORY};
    this.permanentDirectory=this.initializeDirectory(locations,false);
  }
  return this.permanentDirectory;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p> Rather than overriding this, it is safer to override   {@link #getPermanentDirectoryName()} if you need to changethe default behavior. This is because this method does a number of checks to make sure the directory exists, is a directory (not a file) and the XWiki process has permission to write to it. If the directory doesn't exist it is created and if it cannot be written to, an error is printed in the log and it is passed over for the default permanent directory. Thus by overriding {@link #getPermanentDirectoryName()} you'll still benefit from all those checks.</p>
 */
@Override public File getPermanentDirectory(){
  if (this.permanentDirectory == null) {
    final String classSpecified=getPermanentDirectoryName();
    final String configured=this.configurationProvider.get().getPermanentDirectoryPath();
    if (classSpecified == null && configured == null) {
      this.logger.warn("String_Node_Str",DEFAULT_TMP_DIRECTORY);
    }
    final String[] locations=new String[]{classSpecified,configured,getTemporaryDirectoryName(),DEFAULT_TMP_DIRECTORY};
    this.permanentDirectory=initializeDirectory(locations,false);
  }
  return this.permanentDirectory;
}
Program: 1701
Project: 1701
Buggy source:
/** 
 * {@inheritDoc}Rather than overriding this, it is safer to override   {@link #getTemporaryDirectoryName()}This is because this function does a number of checks to make sure the directory exists, is a directory (not a file) and the XWiki process has permission to write to it. If the directory doesn't exist it is created and if it cannot be written to, an erroris printed in the log and it is passed over for the default temporary directory.
 * @see Environment#getTemporaryDirectory()
 */
@Override public File getTemporaryDirectory(){
  if (this.temporaryDirectory == null) {
    final String[] locations=new String[]{this.getTemporaryDirectoryName(),DEFAULT_TMP_DIRECTORY};
    this.temporaryDirectory=this.initializeDirectory(locations,true);
  }
  return this.temporaryDirectory;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Rather than overriding this, it is safer to override   {@link #getTemporaryDirectoryName()}This is because this function does a number of checks to make sure the directory exists, is a directory (not a file) and the XWiki process has permission to write to it. If the directory doesn't exist it is created and if it cannot be written to, an erroris printed in the log and it is passed over for the default temporary directory.
 * @see Environment#getTemporaryDirectory()
 */
@Override public File getTemporaryDirectory(){
  if (this.temporaryDirectory == null) {
    final String[] locations=new String[]{getTemporaryDirectoryName(),DEFAULT_TMP_DIRECTORY};
    this.temporaryDirectory=initializeDirectory(locations,true);
  }
  return this.temporaryDirectory;
}
Program: 1702
Project: 1702
Buggy source:
/** 
 * Initialize temporary or permanent directory for use.
 * @param directory the directory to initialize.
 * @param isTemp true if it is a temporary directory.
 * @return the newly initialized directory.
 */
private File initDir(final File directory,final boolean isTemp){
  if (isTemp) {
    this.initTempDir(directory);
  }
  return directory;
}

Fixed version (ground truth):
/** 
 * Initialize temporary or permanent directory for use.
 * @param directory the directory to initialize.
 * @param isTemp true if it is a temporary directory.
 * @return the newly initialized directory.
 */
private File initDir(final File directory,final boolean isTemp){
  if (isTemp) {
    initTempDir(directory);
  }
  return directory;
}
Program: 1703
Project: 1703
Buggy source:
@Override protected String getTemporaryDirectoryName(){
  final String tmpDirectory=super.getTemporaryDirectoryName();
  try {
    if (tmpDirectory == null) {
      return ((File)this.getServletContext().getAttribute("String_Node_Str")).getCanonicalPath();
    }
  }
 catch (  IOException e) {
    this.logger.warn("String_Node_Str" + "String_Node_Str",e.getMessage());
  }
  return tmpDirectory;
}

Fixed version (ground truth):
@Override protected String getTemporaryDirectoryName(){
  final String tmpDirectory=super.getTemporaryDirectoryName();
  try {
    if (tmpDirectory == null) {
      File tempDir=(File)this.getServletContext().getAttribute("String_Node_Str");
      return tempDir == null ? null : tempDir.getCanonicalPath();
    }
  }
 catch (  IOException e) {
    this.logger.warn("String_Node_Str" + "String_Node_Str",ExceptionUtils.getMessage(e));
  }
  return tmpDirectory;
}
Program: 1704
Project: 1704
Buggy source:
@Test public void testGetTemporaryDirectoryWhenNotSet(){
  final ServletContext servletContext=getMockery().mock(ServletContext.class);
  getMockery().checking(new Expectations(){
{
      atLeast(1).of(servletContext).getAttribute("String_Node_Str");
      will(returnValue(servletTmpDir));
    }
  }
);
  this.environment.setServletContext(servletContext);
  final File tmpDir=this.environment.getTemporaryDirectory();
  Assert.assertEquals(this.servletTmpDir.listFiles()[0],tmpDir);
}

Fixed version (ground truth):
@Test public void testGetTemporaryDirectoryWhenNotSet() throws Exception {
  final ServletContext servletContext=getMockery().mock(ServletContext.class);
  getMockery().checking(new Expectations(){
{
      atLeast(1).of(servletContext).getAttribute("String_Node_Str");
      will(returnValue(servletTmpDir));
    }
  }
);
  this.environment.setServletContext(servletContext);
  final File tmpDir=this.environment.getTemporaryDirectory();
  Assert.assertEquals(this.servletTmpDir.listFiles()[0].getCanonicalFile(),tmpDir.getCanonicalFile());
}
Program: 1705
Project: 1705
Buggy source:
@Test public void testGetPermanentDirectory(){
  File permanentDirectory=new File("String_Node_Str");
  this.environment.setPermanentDirectory(permanentDirectory);
  Assert.assertEquals(permanentDirectory,this.environment.getPermanentDirectory());
}

Fixed version (ground truth):
@Test public void testGetPermanentDirectory() throws Exception {
  File permanentDirectory=new File("String_Node_Str");
  this.environment.setPermanentDirectory(permanentDirectory);
  Assert.assertEquals(permanentDirectory.getCanonicalFile(),this.environment.getPermanentDirectory().getCanonicalFile());
}
Program: 1706
Project: 1706
Buggy source:
@Test public void testGetPermanentDirectoryWhenNotSet(){
  final ServletContext servletContext=getMockery().mock(ServletContext.class);
  getMockery().checking(new Expectations(){
{
      oneOf(servletContext).getAttribute("String_Node_Str");
      will(returnValue(servletTmpDir));
    }
  }
);
  this.environment.setServletContext(servletContext);
  final Logger logger=getMockery().mock(Logger.class);
  getMockery().checking(new Expectations(){
{
      oneOf(logger).warn(with(startsWith("String_Node_Str")),with(any(String.class)));
    }
  }
);
  ReflectionUtils.setFieldValue(this.environment,"String_Node_Str",logger);
  Assert.assertEquals(this.servletTmpDir,this.environment.getPermanentDirectory());
}

Fixed version (ground truth):
@Test public void testGetPermanentDirectoryWhenNotSet() throws Exception {
  final ServletContext servletContext=getMockery().mock(ServletContext.class);
  getMockery().checking(new Expectations(){
{
      oneOf(servletContext).getAttribute("String_Node_Str");
      will(returnValue(servletTmpDir));
    }
  }
);
  this.environment.setServletContext(servletContext);
  final Logger logger=getMockery().mock(Logger.class);
  getMockery().checking(new Expectations(){
{
      oneOf(logger).warn(with(startsWith("String_Node_Str")),with(any(String.class)));
    }
  }
);
  ReflectionUtils.setFieldValue(this.environment,"String_Node_Str",logger);
  Assert.assertEquals(this.servletTmpDir.getCanonicalFile(),this.environment.getPermanentDirectory().getCanonicalFile());
}
Program: 1707
Project: 1707
Buggy source:
@Before public void setUp() throws Exception {
  EmbeddableComponentManager ecm=new EmbeddableComponentManager();
  ecm.initialize(getClass().getClassLoader());
  this.environment=(ServletEnvironment)ecm.getInstance(Environment.class);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  this.servletTmpDir=new File(System.getProperty("String_Node_Str"),"String_Node_Str");
  this.systemTmpDir=new File(System.getProperty("String_Node_Str"),"String_Node_Str");
  EmbeddableComponentManager ecm=new EmbeddableComponentManager();
  ecm.initialize(getClass().getClassLoader());
  this.environment=(ServletEnvironment)ecm.getInstance(Environment.class);
}
Program: 1708
Project: 1708
Buggy source:
@Test public void testGetTemporaryDirectory(){
  File tmpDir=new File("String_Node_Str");
  this.environment.setTemporaryDirectory(tmpDir);
  Assert.assertEquals(tmpDir,this.environment.getTemporaryDirectory());
}

Fixed version (ground truth):
@Test public void testGetTemporaryDirectory() throws Exception {
  File tmpDir=new File("String_Node_Str");
  this.environment.setTemporaryDirectory(tmpDir);
  Assert.assertEquals(tmpDir.getCanonicalFile(),this.environment.getTemporaryDirectory().getCanonicalFile());
}
Program: 1709
Project: 1709
Buggy source:
@Override public List<ExtensionRepositoryId> getRepositories(){
  List<ExtensionRepositoryId> repositories=new ArrayList<ExtensionRepositoryId>();
  List<String> repositoryStrings=this.configuration.get().getProperty("String_Node_Str");
  if (!repositoryStrings.isEmpty()) {
    for (    String repositoryString : repositoryStrings) {
      if (StringUtils.isNotBlank(repositoryString)) {
        try {
          ExtensionRepositoryId extensionRepositoryId=parseRepository(repositoryString);
          repositories.add(extensionRepositoryId);
        }
 catch (        Exception e) {
          this.logger.warn("String_Node_Str" + repositoryString + "String_Node_Str",e);
        }
      }
 else {
        this.logger.debug("String_Node_Str");
      }
    }
  }
 else {
    try {
      repositories.add(new ExtensionRepositoryId("String_Node_Str",TYPE_MAVEN,new URI("String_Node_Str")));
      repositories.add(new ExtensionRepositoryId("String_Node_Str",TYPE_XWIKI,new URI("String_Node_Str")));
    }
 catch (    Exception e) {
    }
  }
  return repositories;
}

Fixed version (ground truth):
@Override public List<ExtensionRepositoryId> getRepositories(){
  List<ExtensionRepositoryId> repositories=new ArrayList<ExtensionRepositoryId>();
  List<String> repositoryStrings=this.configuration.get().getProperty("String_Node_Str");
  if (repositoryStrings != null && !repositoryStrings.isEmpty()) {
    for (    String repositoryString : repositoryStrings) {
      if (StringUtils.isNotBlank(repositoryString)) {
        try {
          ExtensionRepositoryId extensionRepositoryId=parseRepository(repositoryString);
          repositories.add(extensionRepositoryId);
        }
 catch (        Exception e) {
          this.logger.warn("String_Node_Str" + repositoryString + "String_Node_Str",e);
        }
      }
 else {
        this.logger.debug("String_Node_Str");
      }
    }
  }
 else {
    try {
      repositories.add(new ExtensionRepositoryId("String_Node_Str",TYPE_MAVEN,new URI("String_Node_Str")));
      repositories.add(new ExtensionRepositoryId("String_Node_Str",TYPE_XWIKI,new URI("String_Node_Str")));
    }
 catch (    Exception e) {
    }
  }
  return repositories;
}