nus-yam/ex-repair huggingface dataset:
Program: 2953
Project: 2953
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.folder_selector);
  i=getIntent();
  selectedFolders=new ArrayList<File>();
  new FolderIterator();
  folderSelect=new ArrayList<WipeSelector>();
  folderSelect=FolderIterator.getFolderList(this);
  folderList=(ListView)findViewById(R.id.folderSelectionHolder);
  folderList.setAdapter(new WipeArrayAdaptor(this,folderSelect));
  if (i.hasExtra("String_Node_Str")) {
    selectedFolders.clear();
    selectedFolders=(ArrayList<File>)i.getSerializableExtra("String_Node_Str");
    Log.d(ITCConstants.Log.ITC,"String_Node_Str" + selectedFolders.size() + "String_Node_Str");
    if (selectedFolders.size() > 0) {
      for (      WipeSelector w : folderSelect) {
        if (selectedFolders.contains(w.getFilePath())) {
          w.setSelected(true);
        }
      }
    }
  }
  confirmSelection=(Button)findViewById(R.id.confirmSelection);
  confirmSelection.setOnClickListener(this);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.folder_selector);
  i=getIntent();
  selectedFolders=new ArrayList<File>();
  new FolderIterator();
  folderSelect=new ArrayList<WipeSelector>();
  folderSelect=FolderIterator.getFolderList(this);
  folderList=(ListView)findViewById(R.id.folderSelectionHolder);
  folderList.setAdapter(new WipeArrayAdaptor(this,folderSelect));
  if (i.hasExtra("String_Node_Str")) {
    selectedFolders.clear();
    selectedFolders=(ArrayList<File>)i.getSerializableExtra("String_Node_Str");
    if (selectedFolders.size() > 0) {
      for (      WipeSelector w : folderSelect) {
        if (selectedFolders.contains(w.getFilePath())) {
          w.setSelected(true);
        }
      }
    }
  }
  confirmSelection=(Button)findViewById(R.id.confirmSelection);
  confirmSelection.setOnClickListener(this);
}
Program: 2954
Project: 2954
Buggy source:
public static ArgumentMatcher<ClassContext> isClassContextFor(final String simpleClassName){
  return new ArgumentMatcher<ClassContext>(){
    @Override public boolean matches(    Object argument){
      if (!(argument instanceof ClassContext)) {
        return false;
      }
 else {
        return ((ClassContext)argument).getClassDescriptor().getSimpleName().equals(simpleClassName);
      }
    }
  }
;
}

Fixed version (ground truth):
public static ArgumentMatcher<ClassContext> isClassContextFor(final String simpleClassName){
  return new ArgumentMatcher<ClassContext>(){
    @Override public boolean matches(    ClassContext argument){
      return argument.getClassDescriptor().getSimpleName().equals(simpleClassName);
    }
  }
;
}
Program: 2955
Project: 2955
Buggy source:
@Override public boolean matches(Object argument){
  if (!(argument instanceof ClassDescriptor)) {
    return false;
  }
 else {
    return ((ClassDescriptor)argument).getSimpleName().equals(simpleClassName);
  }
}

Fixed version (ground truth):
@Override public boolean matches(ClassDescriptor argument){
  return argument.getSimpleName().equals(simpleClassName);
}
Program: 2956
Project: 2956
Buggy source:
private ArgumentMatcher<ClassDescriptor> isClassDescriptorFor(final String simpleClassName){
  return new ArgumentMatcher<ClassDescriptor>(){
    @Override public boolean matches(    Object argument){
      if (!(argument instanceof ClassDescriptor)) {
        return false;
      }
 else {
        return ((ClassDescriptor)argument).getSimpleName().equals(simpleClassName);
      }
    }
  }
;
}

Fixed version (ground truth):
private ArgumentMatcher<ClassDescriptor> isClassDescriptorFor(final String simpleClassName){
  return new ArgumentMatcher<ClassDescriptor>(){
    @Override public boolean matches(    ClassDescriptor argument){
      return argument.getSimpleName().equals(simpleClassName);
    }
  }
;
}
Program: 2957
Project: 2957
Buggy source:
public static BugReporter bugReporterForTesting(){
  return TestingBugReporter.tddBugReporter();
}

Fixed version (ground truth):
public static BugReporter bugReporterForTesting(){
  detectorRunner.assertInitialised();
  return TestingBugReporter.tddBugReporter();
}
Program: 2958
Project: 2958
Buggy source:
public static void assertBugReported(Class<?> classToTest,Detector2 detector,BugReporter bugReporter,Matcher<BugInstance> bugInstanceMatcher) throws Exception {
  runDetectorOnClass(detector,classToTest,bugReporter);
  asserter.assertBugReported(bugReporter,bugInstanceMatcher);
}

Fixed version (ground truth):
public static void assertBugReported(Class<?> classToTest,Detector2 detector,BugReporter bugReporter,Matcher<BugInstance> bugInstanceMatcher) throws Exception {
  detectorRunner.runDetectorOnClass(detector,classToTest,bugReporter);
  asserter.assertBugReported(bugReporter,bugInstanceMatcher);
}
Program: 2959
Project: 2959
Buggy source:
public static void assertAllBugsReported(Class<?> classToTest,Detector2 detector,BugReporter bugReporter,Matcher<BugInstance>... bugInstanceMatchers) throws Exception {
  runDetectorOnClass(detector,classToTest,bugReporter);
  asserter.assertAllBugsReported(bugReporter,bugInstanceMatchers);
}

Fixed version (ground truth):
public static void assertAllBugsReported(Class<?> classToTest,Detector2 detector,BugReporter bugReporter,Matcher<BugInstance>... bugInstanceMatchers) throws Exception {
  detectorRunner.runDetectorOnClass(detector,classToTest,bugReporter);
  asserter.assertAllBugsReported(bugReporter,bugInstanceMatchers);
}
Program: 2960
Project: 2960
Buggy source:
public static void assertNoBugsReported(Class<?> classToTest,Detector2 detector,BugReporter bugReporter) throws Exception {
  runDetectorOnClass(detector,classToTest,bugReporter);
  asserter.assertNoBugsReported(bugReporter);
}

Fixed version (ground truth):
public static void assertNoBugsReported(Class<?> classToTest,Detector2 detector,BugReporter bugReporter) throws Exception {
  detectorRunner.runDetectorOnClass(detector,classToTest,bugReporter);
  asserter.assertNoBugsReported(bugReporter);
}
Program: 2961
Project: 2961
Buggy source:
public static void clearRegistrar(){
  DetectorRunner.clearRegistrar();
}

Fixed version (ground truth):
public static void clearRegistrar(){
  detectorRunner.clearRegistrar();
}
Program: 2962
Project: 2962
Buggy source:
public static void addRegistrar(IAnalysisEngineRegistrar registrar){
  DetectorRunner.addRegistrar(registrar);
}

Fixed version (ground truth):
public static void addRegistrar(IAnalysisEngineRegistrar registrar){
  detectorRunner.addRegistrar(registrar);
}
Program: 2963
Project: 2963
Buggy source:
private void registerUserDefined(IAnalysisCache analysisCache){
  for (  IAnalysisEngineRegistrar registrar : userDefined) {
    registrar.registerAnalysisEngines(analysisCache);
  }
}

Fixed version (ground truth):
private static void registerUserDefined(IAnalysisCache analysisCache){
  for (  IAnalysisEngineRegistrar registrar : USER_DEFINED_ENGINE_REGISTRARS) {
    registrar.registerAnalysisEngines(analysisCache);
  }
}
Program: 2965
Project: 2965
Buggy source:
static void clearRegistrar(){
  Singleton.DETECTOR_RUNNER.userDefined.clear();
}

Fixed version (ground truth):
void clearRegistrar(){
  assertInitialised();
  Singleton.USER_DEFINED_ENGINE_REGISTRARS.clear();
}
Program: 2966
Project: 2966
Buggy source:
private void addAuxCodeBasesFromClassPath(ClassPathImpl classPath) throws IOException, ResourceNotFoundException {
  Iterable<ICodeBaseLocator> codeBaseLocators=auxCodeBaseLocatorProvider.get(classPathEntries());
  for (  ICodeBaseLocator auxCodeBaseLocator : codeBaseLocators) {
    ICodeBase auxCodeBase=auxCodeBaseLocator.openCodeBase();
    classPath.addCodeBase(auxCodeBase);
  }
}

Fixed version (ground truth):
private static void addAuxCodeBasesFromClassPath(ClassPathImpl classPath) throws Exception {
  Iterable<ICodeBaseLocator> codeBaseLocators=AUX_CODEBASE_LOCATOR_PROVIDER.get(classPathEntries());
  for (  ICodeBaseLocator auxCodeBaseLocator : codeBaseLocators) {
    ICodeBase auxCodeBase=auxCodeBaseLocator.openCodeBase();
    classPath.addCodeBase(auxCodeBase);
  }
}
Program: 2967
Project: 2967
Buggy source:
public static void runDetectorOnClass(Detector pluginDetector,Class<?> classToTest,BugReporter bugReporter) throws CheckedAnalysisException, IOException, InterruptedException {
  Singleton.DETECTOR_RUNNER.doRunDetectorOnClass(new DetectorToDetector2Adapter(pluginDetector),classToTest,bugReporter);
}

Fixed version (ground truth):
public void runDetectorOnClass(Detector pluginDetector,Class<?> classToTest,BugReporter bugReporter) throws Exception {
  assertInitialised();
  Singleton.doRunDetectorOnClass(new DetectorToDetector2Adapter(pluginDetector),classToTest,bugReporter);
}
Program: 2968
Project: 2968
Buggy source:
private Iterable<String> classPathEntries(){
  return asList(getProperty("String_Node_Str").split(File.pathSeparator));
}

Fixed version (ground truth):
private static Iterable<String> classPathEntries(){
  return asList(getProperty("String_Node_Str").split(File.pathSeparator));
}
Program: 2969
Project: 2969
Buggy source:
static void addRegistrar(IAnalysisEngineRegistrar registrar){
  Singleton.DETECTOR_RUNNER.userDefined.add(registrar);
}

Fixed version (ground truth):
void addRegistrar(IAnalysisEngineRegistrar registrar){
  assertInitialised();
  Singleton.USER_DEFINED_ENGINE_REGISTRARS.add(registrar);
}
Program: 2970
Project: 2970
Buggy source:
private void doRunDetectorOnClass(Detector2 pluginDetector,Class<?> classToTest,BugReporter bugReporter) throws CheckedAnalysisException, IOException, InterruptedException {
  String dottedClassName=classToTest.getName();
  ClassDescriptor classDescriptor=createClassDescriptorFromDottedClassName(dottedClassName);
  pluginDetector.visitClass(classDescriptor);
}

Fixed version (ground truth):
private static void doRunDetectorOnClass(Detector2 pluginDetector,Class<?> classToTest,BugReporter bugReporter) throws Exception {
  String dottedClassName=classToTest.getName();
  ClassDescriptor classDescriptor=createClassDescriptorFromDottedClassName(dottedClassName);
  pluginDetector.visitClass(classDescriptor);
}
Program: 2971
Project: 2971
Buggy source:
@Test public void runDetectorOnClassVisitsDetectorWithClassContextOfSpecifiedClass() throws Exception {
  Detector detector=mock(Detector.class);
  BugReporter bugReporter=TestingBugReporter.tddBugReporter();
  DetectorRunner.runDetectorOnClass(detector,DetectorRunner.class,bugReporter);
  verify(detector).visitClassContext(argThat(isClassContextFor("String_Node_Str")));
}

Fixed version (ground truth):
@Test public void runDetectorOnClassVisitsDetectorWithClassContextOfSpecifiedClass() throws Exception {
  new DetectorRunner().runDetectorOnClass(detector,DetectorRunner.class,bugReporter);
  verify(detector).visitClassContext(argThat(isClassContextFor("String_Node_Str")));
}
Program: 2972
Project: 2972
Buggy source:
@Test public void runDetector2OnClassVisitsDetectorWithClassContextOfSpecifiedClass() throws Exception {
  Detector2 detector=mock(Detector2.class);
  BugReporter bugReporter=TestingBugReporter.tddBugReporter();
  DetectorRunner.runDetectorOnClass(detector,DetectorRunner.class,bugReporter);
  verify(detector).visitClass(argThat(isClassDescriptorFor("String_Node_Str")));
}

Fixed version (ground truth):
@Test public void runDetector2OnClassVisitsDetectorWithClassContextOfSpecifiedClass() throws Exception {
  new DetectorRunner().runDetectorOnClass(detector2,DetectorRunner.class,bugReporter);
  verify(detector2).visitClass(argThat(isClassDescriptorFor("String_Node_Str")));
}
Program: 2973
Project: 2973
Buggy source:
private SlotFilterBuilder createFilterBuilder(){
  SlotFilterBuilder slotFilterBuilder=SlotFilterBuilder.builder();
  for (  String binaryGlob : binary) {
    slotFilterBuilder.addBinaryGlobFilter(binaryGlob);
  }
  for (  String configGlob : binary) {
    slotFilterBuilder.addConfigGlobFilter(configGlob);
  }
  for (  String hostGlob : host) {
    slotFilterBuilder.addHostGlobFilter(hostGlob);
  }
  for (  String stateFilter : state) {
    slotFilterBuilder.addStateFilter(stateFilter);
  }
  for (  String shortId : uuid) {
    slotFilterBuilder.addSlotUuidFilter(shortId);
  }
  if (selectAll) {
    slotFilterBuilder.selectAll();
  }
  return slotFilterBuilder;
}

Fixed version (ground truth):
private SlotFilterBuilder createFilterBuilder(){
  SlotFilterBuilder slotFilterBuilder=SlotFilterBuilder.builder();
  for (  String binaryGlob : binary) {
    slotFilterBuilder.addBinaryGlobFilter(binaryGlob);
  }
  for (  String configGlob : config) {
    slotFilterBuilder.addConfigGlobFilter(configGlob);
  }
  for (  String hostGlob : host) {
    slotFilterBuilder.addHostGlobFilter(hostGlob);
  }
  for (  String stateFilter : state) {
    slotFilterBuilder.addStateFilter(stateFilter);
  }
  for (  String shortId : uuid) {
    slotFilterBuilder.addSlotUuidFilter(shortId);
  }
  if (selectAll) {
    slotFilterBuilder.selectAll();
  }
  return slotFilterBuilder;
}
Program: 2974
Project: 2974
Buggy source:
public void verifySlotExecution(Commander commander,SlotFilter slotFilter,String question,boolean defaultValue,SlotExecution slotExecution){
  Preconditions.checkArgument(slotFilter.isFiltered(),"String_Node_Str");
  if (globalOptions.batch) {
    slotExecution.execute(commander,slotFilter,null);
  }
  CommanderResponse<List<SlotStatusRepresentation>> response=commander.show(slotFilter);
  displaySlots(response.getValue());
  if (response.getValue().isEmpty()) {
    return;
  }
  System.out.println();
  if (!ask(question,defaultValue)) {
    return;
  }
  SlotFilter uuidFilter=new SlotFilter();
  for (  SlotStatusRepresentation slot : response.getValue()) {
    uuidFilter.uuid.add(slot.getId().toString());
  }
  slotExecution.execute(commander,uuidFilter,response.getVersion());
}

Fixed version (ground truth):
public void verifySlotExecution(Commander commander,SlotFilter slotFilter,String question,boolean defaultValue,SlotExecution slotExecution){
  Preconditions.checkArgument(slotFilter.isFiltered(),"String_Node_Str");
  if (globalOptions.batch) {
    slotExecution.execute(commander,slotFilter,null);
    return;
  }
  CommanderResponse<List<SlotStatusRepresentation>> response=commander.show(slotFilter);
  displaySlots(response.getValue());
  if (response.getValue().isEmpty()) {
    return;
  }
  System.out.println();
  if (!ask(question,defaultValue)) {
    return;
  }
  SlotFilter uuidFilter=new SlotFilter();
  for (  SlotStatusRepresentation slot : response.getValue()) {
    uuidFilter.uuid.add(slot.getId().toString());
  }
  slotExecution.execute(commander,uuidFilter,response.getVersion());
}
Program: 2975
Project: 2975
Buggy source:
@Override public void deleteExpectedState(UUID slotId){
  Preconditions.checkNotNull(slotId,"String_Node_Str");
  if (!isDomainCreate()) {
    List<Attribute> attributes=newArrayList();
    attributes.add(new Attribute("String_Node_Str",null));
    attributes.add(new Attribute("String_Node_Str",null));
    attributes.add(new Attribute("String_Node_Str",null));
    try {
      simpleDb.deleteAttributes(new DeleteAttributesRequest().withDomainName(domainName).withItemName(slotId.toString()).withAttributes(attributes));
      expectedStateStoreUp();
    }
 catch (    Exception e) {
      expectedStateStoreDown(e);
    }
  }
}

Fixed version (ground truth):
@Override public void deleteExpectedState(UUID slotId){
  Preconditions.checkNotNull(slotId,"String_Node_Str");
  if (isDomainCreated()) {
    List<Attribute> attributes=newArrayList();
    attributes.add(new Attribute("String_Node_Str",null));
    attributes.add(new Attribute("String_Node_Str",null));
    attributes.add(new Attribute("String_Node_Str",null));
    try {
      simpleDb.deleteAttributes(new DeleteAttributesRequest().withDomainName(domainName).withItemName(slotId.toString()).withAttributes(attributes));
      expectedStateStoreUp();
    }
 catch (    Exception e) {
      expectedStateStoreDown(e);
    }
  }
}
Program: 2976
Project: 2976
Buggy source:
@Override public void setExpectedState(ExpectedSlotStatus slotStatus){
  Preconditions.checkNotNull(slotStatus,"String_Node_Str");
  if (!isDomainCreate()) {
    List<ReplaceableAttribute> attributes=newArrayList();
    attributes.add(new ReplaceableAttribute("String_Node_Str",slotStatus.getStatus().toString(),true));
    if (slotStatus.getAssignment() != null) {
      attributes.add(new ReplaceableAttribute("String_Node_Str",slotStatus.getAssignment().getBinary(),true));
      attributes.add(new ReplaceableAttribute("String_Node_Str",slotStatus.getAssignment().getConfig(),true));
    }
    try {
      simpleDb.putAttributes(new PutAttributesRequest().withDomainName(domainName).withItemName(slotStatus.getId().toString()).withAttributes(attributes));
      expectedStateStoreUp();
    }
 catch (    Exception e) {
      expectedStateStoreDown(e);
    }
  }
}

Fixed version (ground truth):
@Override public void setExpectedState(ExpectedSlotStatus slotStatus){
  Preconditions.checkNotNull(slotStatus,"String_Node_Str");
  if (isDomainCreated()) {
    List<ReplaceableAttribute> attributes=newArrayList();
    attributes.add(new ReplaceableAttribute("String_Node_Str",slotStatus.getStatus().toString(),true));
    if (slotStatus.getAssignment() != null) {
      attributes.add(new ReplaceableAttribute("String_Node_Str",slotStatus.getAssignment().getBinary(),true));
      attributes.add(new ReplaceableAttribute("String_Node_Str",slotStatus.getAssignment().getConfig(),true));
    }
    try {
      simpleDb.putAttributes(new PutAttributesRequest().withDomainName(domainName).withItemName(slotStatus.getId().toString()).withAttributes(attributes));
      expectedStateStoreUp();
    }
 catch (    Exception e) {
      expectedStateStoreDown(e);
    }
  }
}
Program: 2977
Project: 2977
Buggy source:
@Override public Collection<ExpectedSlotStatus> getAllExpectedStates(){
  List<ExpectedSlotStatus> slots=newArrayList();
  if (!isDomainCreate()) {
    try {
      String query=String.format("String_Node_Str",domainName);
      SelectResult select=simpleDb.select(new SelectRequest(query,true));
      for (      Item item : select.getItems()) {
        ExpectedSlotStatus expectedSlotStatus=loadSlotStatus(item);
        if (expectedSlotStatus != null) {
          slots.add(expectedSlotStatus);
        }
      }
      expectedStateStoreUp();
    }
 catch (    Exception e) {
      expectedStateStoreDown(e);
    }
  }
  return slots;
}

Fixed version (ground truth):
@Override public Collection<ExpectedSlotStatus> getAllExpectedStates(){
  List<ExpectedSlotStatus> slots=newArrayList();
  if (isDomainCreated()) {
    try {
      String query=String.format("String_Node_Str",domainName);
      SelectResult select=simpleDb.select(new SelectRequest(query,true));
      for (      Item item : select.getItems()) {
        ExpectedSlotStatus expectedSlotStatus=loadSlotStatus(item);
        if (expectedSlotStatus != null) {
          slots.add(expectedSlotStatus);
        }
      }
      expectedStateStoreUp();
    }
 catch (    Exception e) {
      expectedStateStoreDown(e);
    }
  }
  return slots;
}
Program: 2978
Project: 2978
Buggy source:
public Assignment upgradeAssignment(Repository repository,Assignment assignment){
  Preconditions.checkNotNull(assignment,"String_Node_Str");
  String binary=assignment.getBinary();
  if (binaryVersion != null) {
    binary=repository.binaryUpgrade(binary,binaryVersion);
    Preconditions.checkArgument(binary != null,"String_Node_Str" + binary + "String_Node_Str"+ binaryVersion);
  }
  String config=assignment.getConfig();
  if (configVersion != null) {
    config=repository.configUpgrade(config,configVersion);
    Preconditions.checkArgument(binary != null,"String_Node_Str" + config + "String_Node_Str"+ configVersion);
  }
  return new Assignment(binary,config);
}

Fixed version (ground truth):
public Assignment upgradeAssignment(Repository repository,Assignment assignment){
  Preconditions.checkNotNull(assignment,"String_Node_Str");
  String binary=assignment.getBinary();
  if (binaryVersion != null) {
    binary=repository.binaryUpgrade(binary,binaryVersion);
    Preconditions.checkArgument(binary != null,"String_Node_Str" + assignment.getBinary() + "String_Node_Str"+ binaryVersion);
  }
 else {
    Preconditions.checkArgument(repository.binaryToHttpUri(assignment.getBinary()) != null,"String_Node_Str" + assignment.getBinary() + "String_Node_Str");
  }
  String config=assignment.getConfig();
  if (configVersion != null) {
    config=repository.configUpgrade(config,configVersion);
    Preconditions.checkArgument(config != null,"String_Node_Str" + assignment.getConfig() + "String_Node_Str"+ configVersion);
  }
 else {
    Preconditions.checkArgument(repository.configToHttpUri(assignment.getConfig()) != null,"String_Node_Str" + assignment.getConfig() + "String_Node_Str");
  }
  return new Assignment(binary,config);
}
Program: 2979
Project: 2979
Buggy source:
private MavenCoordinates resolveSnapshotTimestamp(MavenCoordinates coordinates,String groupId){
  for (  URI repositoryBase : repositoryBases) {
    try {
      StringBuilder builder=new StringBuilder();
      builder.append(groupId.replace('.','/')).append('/');
      builder.append(coordinates.getArtifactId()).append('/');
      builder.append(coordinates.getVersion()).append('/');
      builder.append("String_Node_Str");
      URI uri=repositoryBase.resolve(builder.toString());
      MavenMetadata metadata=MavenMetadata.unmarshalMavenMetadata(Resources.toString(uri.toURL(),Charsets.UTF_8));
      for (      SnapshotVersion snapshotVersion : metadata.versioning.snapshotVersions) {
        if (coordinates.getPackaging().equals(snapshotVersion.extension) && Objects.equal(coordinates.getClassifier(),snapshotVersion.classifier)) {
          MavenCoordinates timestampSpec=new MavenCoordinates(groupId,coordinates.getArtifactId(),coordinates.getVersion(),coordinates.getPackaging(),coordinates.getClassifier(),snapshotVersion.value);
          return timestampSpec;
        }
      }
    }
 catch (    Exception ignored) {
    }
  }
  return null;
}

Fixed version (ground truth):
private MavenCoordinates resolveSnapshotTimestamp(MavenCoordinates coordinates,String groupId){
  for (  URI repositoryBase : repositoryBases) {
    try {
      StringBuilder builder=new StringBuilder();
      builder.append(groupId.replace('.','/')).append('/');
      builder.append(coordinates.getArtifactId()).append('/');
      builder.append(coordinates.getVersion()).append('/');
      builder.append("String_Node_Str");
      URI uri=repositoryBase.resolve(builder.toString());
      MavenMetadata metadata=MavenMetadata.unmarshalMavenMetadata(toString(uri));
      for (      SnapshotVersion snapshotVersion : metadata.versioning.snapshotVersions) {
        if (coordinates.getPackaging().equals(snapshotVersion.extension) && Objects.equal(coordinates.getClassifier(),snapshotVersion.classifier)) {
          MavenCoordinates timestampSpec=new MavenCoordinates(groupId,coordinates.getArtifactId(),coordinates.getVersion(),coordinates.getPackaging(),coordinates.getClassifier(),snapshotVersion.value);
          return timestampSpec;
        }
      }
    }
 catch (    Exception ignored) {
    }
  }
  return null;
}
Program: 2980
Project: 2980
Buggy source:
@Override public String configShortName(String config){
  if (!config.startsWith("String_Node_Str")) {
    return null;
  }
  config=config.substring(1);
  MavenCoordinates coordinates=MavenCoordinates.fromConfigGAV(config);
  if (coordinates == null) {
    return config;
  }
  return coordinates.getArtifactId();
}

Fixed version (ground truth):
@Override public String configShortName(String config){
  if (!config.startsWith("String_Node_Str")) {
    return null;
  }
  MavenCoordinates coordinates=MavenCoordinates.fromConfigGAV(config);
  if (coordinates == null) {
    return config.substring(0).replaceAll("String_Node_Str","String_Node_Str");
  }
  return coordinates.getArtifactId();
}
Program: 2981
Project: 2981
Buggy source:
public URI toHttpUri(MavenCoordinates coordinates,boolean required){
  coordinates=resolve(coordinates);
  List<URI> checkedUris=newArrayList();
  for (  URI repositoryBase : repositoryBases) {
    StringBuilder builder=new StringBuilder();
    builder.append(coordinates.getGroupId().replace('.','/')).append('/');
    builder.append(coordinates.getArtifactId()).append('/');
    builder.append(coordinates.getVersion()).append('/');
    builder.append(coordinates.getArtifactId()).append('-').append(coordinates.getFileVersion());
    if (coordinates.getClassifier() != null) {
      builder.append('-').append(coordinates.getClassifier());
    }
    builder.append('.').append(coordinates.getPackaging());
    URI uri=repositoryBase.resolve(builder.toString());
    if (isValidBinary(uri)) {
      return uri;
    }
    checkedUris.add(uri);
  }
  if (required) {
    throw new RuntimeException("String_Node_Str" + coordinates + "String_Node_Str"+ checkedUris);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public URI toHttpUri(MavenCoordinates coordinates,boolean required){
  coordinates=resolve(coordinates);
  if (coordinates == null) {
    return null;
  }
  List<URI> checkedUris=newArrayList();
  for (  URI repositoryBase : repositoryBases) {
    StringBuilder builder=new StringBuilder();
    builder.append(coordinates.getGroupId().replace('.','/')).append('/');
    builder.append(coordinates.getArtifactId()).append('/');
    builder.append(coordinates.getVersion()).append('/');
    builder.append(coordinates.getArtifactId()).append('-').append(coordinates.getFileVersion());
    if (coordinates.getClassifier() != null) {
      builder.append('-').append(coordinates.getClassifier());
    }
    builder.append('.').append(coordinates.getPackaging());
    URI uri=repositoryBase.resolve(builder.toString());
    if (isValidBinary(uri)) {
      return uri;
    }
    checkedUris.add(uri);
  }
  if (required) {
    throw new RuntimeException("String_Node_Str" + coordinates + "String_Node_Str"+ checkedUris);
  }
 else {
    return null;
  }
}
Program: 2982
Project: 2982
Buggy source:
@Inject public MavenRepository(CoordinatorConfig config) throws Exception {
  this.defaultGroupIds=ImmutableList.copyOf(Splitter.on("String_Node_Str").trimResults().omitEmptyStrings().split(config.getDefaultRepositoryGroupId()));
  Builder<URI> builder=ImmutableList.builder();
  for (  String binaryRepoBase : config.getMavenRepoBases()) {
    if (!binaryRepoBase.endsWith("String_Node_Str")) {
      binaryRepoBase=binaryRepoBase + "String_Node_Str";
    }
    builder.add(URI.create(binaryRepoBase));
  }
  repositoryBases=builder.build();
}

Fixed version (ground truth):
@Inject public MavenRepository(CoordinatorConfig config){
  if (config.getDefaultRepositoryGroupId() != null) {
    this.defaultGroupIds=ImmutableList.copyOf(config.getDefaultRepositoryGroupId());
  }
 else {
    this.defaultGroupIds=ImmutableList.of();
  }
  Builder<URI> builder=ImmutableList.builder();
  for (  String binaryRepoBase : config.getRepositories()) {
    if (!binaryRepoBase.endsWith("String_Node_Str")) {
      binaryRepoBase=binaryRepoBase + "String_Node_Str";
    }
    builder.add(URI.create(binaryRepoBase));
  }
  repositoryBases=builder.build();
}
Program: 2983
Project: 2983
Buggy source:
public List<SlotStatus> install(Predicate<AgentStatus> filter,int limit,Assignment assignment){
  assignment=assignment.resolve(repository);
  Map<String,Integer> resources=readResources(assignment);
  Installation installation=new Installation(repository.configShortName(assignment.getConfig()),assignment,repository.binaryToHttpUri(assignment.getBinary()),repository.configToHttpUri(assignment.getConfig()),resources);
  List<SlotStatus> slots=newArrayList();
  List<RemoteAgent> agents=newArrayList(filter(this.agents.values(),Predicates.and(filterAgentsBy(filter),filterAgentsWithAssignment(assignment))));
  Collections.shuffle(agents);
  for (  RemoteAgent agent : agents) {
    if (slots.size() >= limit) {
      break;
    }
    AgentStatus status=agent.status();
    if (status.getState() != ONLINE) {
      continue;
    }
    Map<String,Integer> availableResources=getAvailableResources(status);
    if (!resourcesAreAvailable(availableResources,installation.getResources())) {
      continue;
    }
    SlotStatus slotStatus=agent.install(installation);
    stateManager.setExpectedState(new ExpectedSlotStatus(slotStatus.getId(),STOPPED,installation.getAssignment()));
    slots.add(slotStatus);
  }
  return ImmutableList.copyOf(slots);
}

Fixed version (ground truth):
public List<SlotStatus> install(Predicate<AgentStatus> filter,int limit,Assignment assignment){
  assignment=assignment.resolve(repository);
  Map<String,Integer> resources=readResources(assignment);
  URI binaryUri=repository.binaryToHttpUri(assignment.getBinary());
  Preconditions.checkNotNull(binaryUri,"String_Node_Str",binaryUri);
  URI configUri=repository.configToHttpUri(assignment.getConfig());
  Preconditions.checkNotNull(configUri,"String_Node_Str",configUri);
  Installation installation=new Installation(repository.configShortName(assignment.getConfig()),assignment,binaryUri,configUri,resources);
  List<SlotStatus> slots=newArrayList();
  List<RemoteAgent> agents=newArrayList(filter(this.agents.values(),Predicates.and(filterAgentsBy(filter),filterAgentsWithAssignment(assignment))));
  Collections.shuffle(agents);
  for (  RemoteAgent agent : agents) {
    if (slots.size() >= limit) {
      break;
    }
    AgentStatus status=agent.status();
    if (status.getState() != ONLINE) {
      continue;
    }
    Map<String,Integer> availableResources=getAvailableResources(status);
    if (!resourcesAreAvailable(availableResources,installation.getResources())) {
      continue;
    }
    SlotStatus slotStatus=agent.install(installation);
    stateManager.setExpectedState(new ExpectedSlotStatus(slotStatus.getId(),STOPPED,installation.getAssignment()));
    slots.add(slotStatus);
  }
  return ImmutableList.copyOf(slots);
}
Program: 2984
Project: 2984
Buggy source:
public SlotStatus install(Installation installation){
  String slotName=getNextSlotName(installation.getAssignment().getConfig().getComponent());
  URI slotUri=httpServerInfo.getHttpUri().resolve("String_Node_Str").resolve(slotName);
  Slot slot=new DeploymentSlot(slotUri,deploymentManagerFactory.createDeploymentManager(slotName),lifecycleManager,installation,config.getMaxLockWait());
  SlotStatus status;
  try {
    status=slot.assign(installation);
    slots.put(slotName,slot);
  }
 catch (  Exception e) {
    slot.terminate();
    throw Throwables.propagate(e);
  }
  return status;
}

Fixed version (ground truth):
public SlotStatus install(Installation installation){
  String slotName=getNextSlotName(installation.getAssignment().getConfig().getComponent());
  URI slotUri=httpServerInfo.getHttpUri().resolve("String_Node_Str").resolve(slotName);
  Slot slot=new DeploymentSlot(slotUri,deploymentManagerFactory.createDeploymentManager(slotName),lifecycleManager,installation,config.getMaxLockWait());
  slots.put(slotName,slot);
  return slot.getLastSlotStatus();
}
Program: 2985
Project: 2985
Buggy source:
@Test public void testGetAllSlotStatus(){
  SlotStatus slotStatus1=agent.install(APPLE_INSTALLATION);
  SlotStatus slotStatus2=agent.install(APPLE_INSTALLATION);
  Response response=resource.getAllSlotsStatus(uriInfo);
  assertEquals(response.getStatus(),Response.Status.OK.getStatusCode());
  assertInstanceOf(response.getEntity(),Collection.class);
  ExtraAssertions.assertEqualsNoOrder((Collection<?>)response.getEntity(),ImmutableMultiset.of(SlotStatusRepresentation.from(slotStatus1),SlotStatusRepresentation.from(slotStatus2)));
}

Fixed version (ground truth):
@Test public void testGetAllSlotStatus(){
  SlotStatus slotStatus1=agent.install(APPLE_INSTALLATION);
  SlotStatus slotStatus2=agent.install(APPLE_INSTALLATION);
  Response response=resource.getAllSlotsStatus(uriInfo);
  assertEquals(response.getStatus(),Response.Status.OK.getStatusCode());
  assertInstanceOf(response.getEntity(),Collection.class);
  assertEqualsNoOrder((Collection<?>)response.getEntity(),ImmutableMultiset.of(SlotStatusRepresentation.from(slotStatus1),SlotStatusRepresentation.from(slotStatus2)));
}
Program: 2986
Project: 2986
Buggy source:
@Inject public GitConfigRepository(GitConfigRepositoryConfig config,HttpServerInfo httpServerInfo) throws Exception {
  Preconditions.checkNotNull(config,"String_Node_Str");
  if (config.getRemoteUri() == null) {
    repository=null;
    blobUri=null;
    localRepository=null;
    refreshInterval=null;
    executorService=null;
  }
 else {
    localRepository=new File(config.getLocalConfigRepo());
    log.info("String_Node_Str",localRepository.getAbsolutePath());
    Git git;
    if (!localRepository.isDirectory()) {
      git=Git.cloneRepository().setURI(config.getRemoteUri()).setBranch("String_Node_Str").setDirectory(localRepository).setBare(true).call();
    }
 else {
      git=Git.open(localRepository);
    }
    repository=git.getRepository();
    if (httpServerInfo.getHttpsUri() != null) {
      blobUri=httpServerInfo.getHttpsUri().resolve("String_Node_Str");
    }
 else {
      blobUri=httpServerInfo.getHttpUri().resolve("String_Node_Str");
    }
    refreshInterval=config.getRefreshInterval();
    executorService=Executors.newScheduledThreadPool(1,new ThreadFactoryBuilder().setNameFormat("String_Node_Str").setDaemon(true).build());
  }
}

Fixed version (ground truth):
@Inject public GitConfigRepository(GitConfigRepositoryConfig config,HttpServerInfo httpServerInfo) throws Exception {
  Preconditions.checkNotNull(config,"String_Node_Str");
  if (config.getRemoteUri() == null) {
    blobUri=null;
    localRepository=null;
    refreshInterval=null;
    executorService=null;
    repositoryUpdater=null;
  }
 else {
    localRepository=new File(config.getLocalConfigRepo());
    log.info("String_Node_Str",localRepository.getAbsolutePath());
    if (httpServerInfo.getHttpsUri() != null) {
      blobUri=httpServerInfo.getHttpsUri().resolve("String_Node_Str");
    }
 else {
      blobUri=httpServerInfo.getHttpUri().resolve("String_Node_Str");
    }
    refreshInterval=config.getRefreshInterval();
    executorService=Executors.newScheduledThreadPool(1,new ThreadFactoryBuilder().setNameFormat("String_Node_Str").setDaemon(true).build());
    repositoryUpdater=new RepositoryUpdater(config);
  }
}
Program: 2987
Project: 2987
Buggy source:
@PostConstruct public void start(){
  if (executorService != null) {
    executorService.scheduleWithFixedDelay(new FetchGitConfigRepository(localRepository),0,(long)refreshInterval.toMillis(),TimeUnit.MILLISECONDS);
  }
}

Fixed version (ground truth):
@PostConstruct public void start(){
  if (executorService != null) {
    executorService.scheduleWithFixedDelay(repositoryUpdater,0,(long)refreshInterval.toMillis(),MILLISECONDS);
  }
}
Program: 2988
Project: 2988
Buggy source:
@Override public void run(){
  try {
    Git.open(localRepository).fetch().setTimeout(60).call();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    if (!localRepository.isDirectory()) {
      Git.cloneRepository().setURI(remoteGitUri).setDirectory(localRepository).setTimeout(60).call();
    }
 else {
      Git git=Git.open(localRepository);
      git.fetch().setRemote("String_Node_Str").setTimeout(60).call();
      git.merge().include(git.getRepository().getRef("String_Node_Str")).call();
    }
    failed=false;
  }
 catch (  Exception e) {
    if (!failed) {
      failed=true;
      log.error("String_Node_Str",e);
    }
  }
}
Program: 2989
Project: 2989
Buggy source:
@Override public Map<String,URI> getConfigMap(ConfigSpec configSpec){
  if (repository == null) {
    return null;
  }
  try {
    Ref headRef=repository.getRef("String_Node_Str");
    AnyObjectId headId=headRef.getObjectId();
    RevWalk revWalk=new RevWalk(repository);
    RevCommit headCommit=revWalk.parseCommit(headId);
    RevTree headTree=headCommit.getTree();
    TreeWalk treeWalk=new TreeWalk(repository);
    treeWalk.addTree(headTree);
    treeWalk.setRecursive(true);
    String pool=configSpec.getPool();
    if (pool == null) {
      pool="String_Node_Str";
    }
    String pathPrefix=String.format("String_Node_Str",configSpec.getEnvironment(),configSpec.getComponent(),pool,configSpec.getVersion());
    treeWalk.setFilter(PathFilter.create(pathPrefix));
    ImmutableMap.Builder<String,URI> blobs=ImmutableMap.builder();
    while (treeWalk.next()) {
      CanonicalTreeParser ft=treeWalk.getTree(0,CanonicalTreeParser.class);
      String path=ft.getEntryPathString();
      ObjectId objectId=treeWalk.getObjectId(0);
      String subPath=path.substring(pathPrefix.length());
      blobs.put(subPath,blobUri.resolve(objectId.getName()));
    }
    Map<String,URI> configMap=blobs.build();
    if (configMap.isEmpty()) {
      return null;
    }
 else {
      return configMap;
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private List<String> getConfigMap(String basePath,File dir){
  ImmutableList.Builder<String> builder=ImmutableList.builder();
  for (  File file : FileUtils.listFiles(dir)) {
    String path=basePath + file.getName();
    if (file.isDirectory()) {
      builder.addAll(getConfigMap(path + "String_Node_Str",file));
    }
 else {
      builder.add(path);
    }
  }
  return builder.build();
}
Program: 2990
Project: 2990
Buggy source:
public InputSupplier<InputStream> getBlob(String objectIdString){
  if (repository == null) {
    return null;
  }
  final ObjectId objectId;
  try {
    objectId=ObjectId.fromString(objectIdString);
  }
 catch (  Exception e) {
    return null;
  }
  if (!repository.hasObject(objectId)) {
    return null;
  }
  return new InputSupplier<InputStream>(){
    @Override public InputStream getInput() throws IOException {
      ObjectLoader objectLoader=repository.open(objectId);
      return objectLoader.openStream();
    }
  }
;
}

Fixed version (ground truth):
public InputSupplier<? extends InputStream> getBlob(String objectIdString){
  if (localRepository == null) {
    return null;
  }
  File file=newFile(localRepository,objectIdString);
  if (!file.canRead()) {
    return null;
  }
  return Files.newInputStreamSupplier(file);
}
Program: 2991
Project: 2991
Buggy source:
@GET @Path("String_Node_Str") public Response getConfigFile(@PathParam("String_Node_Str") String objectId){
  InputSupplier<InputStream> blob=gitConfigRepository.getBlob(objectId);
  if (blob == null) {
    return Response.status(Status.NOT_FOUND).build();
  }
  return Response.ok(new InputSupplierStreamingOutput(blob)).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public Response getConfigFile(@PathParam("String_Node_Str") String objectId){
  InputSupplier<? extends InputStream> blob=gitConfigRepository.getBlob(objectId);
  if (blob == null) {
    return Response.status(Status.NOT_FOUND).build();
  }
  return Response.ok(new InputSupplierStreamingOutput(blob)).build();
}
Program: 2992
Project: 2992
Buggy source:
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response install(AssignmentRepresentation assignmentRepresentation,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") int limit,@Context UriInfo uriInfo){
  Preconditions.checkNotNull(assignmentRepresentation,"String_Node_Str");
  Preconditions.checkArgument(limit > 0,"String_Node_Str");
  Assignment assignment=assignmentRepresentation.toAssignment();
  Map<String,URI> configMap=localConfigRepository.getConfigMap(assignment.getConfig());
  if (configMap == null) {
    configMap=gitConfigRepository.getConfigMap(assignment.getConfig());
  }
  if (configMap == null) {
    configMap=configRepository.getConfigMap(assignment.getConfig());
  }
  Installation installation=new Installation(assignment,binaryRepository.getBinaryUri(assignment.getBinary()),configMap);
  Predicate<AgentStatus> agentFilter=AgentFilterBuilder.build(uriInfo);
  List<SlotStatus> results=coordinator.install(agentFilter,limit,installation);
  return Response.ok(transform(results,fromSlotStatus())).build();
}

Fixed version (ground truth):
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response install(AssignmentRepresentation assignmentRepresentation,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") int limit,@Context UriInfo uriInfo){
  Preconditions.checkNotNull(assignmentRepresentation,"String_Node_Str");
  Preconditions.checkArgument(limit > 0,"String_Node_Str");
  Assignment assignment=assignmentRepresentation.toAssignment();
  Map<String,URI> configMap=localConfigRepository.getConfigMap(assignment.getConfig());
  if (configMap == null) {
    configMap=gitConfigRepository.getConfigMap(assignment.getConfig());
  }
  if (configMap == null) {
    configMap=configRepository.getConfigMap(assignment.getConfig());
  }
  URI binaryUri=binaryRepository.getBinaryUri(assignment.getBinary());
  if (binaryUri == null) {
    return Response.status(Status.NOT_FOUND).entity("String_Node_Str" + assignment.getBinary()).build();
  }
  Installation installation=new Installation(assignment,binaryUri,configMap);
  Predicate<AgentStatus> agentFilter=AgentFilterBuilder.build(uriInfo);
  List<SlotStatus> results=coordinator.install(agentFilter,limit,installation);
  return Response.ok(transform(results,fromSlotStatus())).build();
}
Program: 2993
Project: 2993
Buggy source:
public static boolean isSymbolicLink(File file){
  try {
    File canonicalFile=file.getCanonicalFile();
    File absoluteFile=file.getAbsoluteFile();
    return !canonicalFile.getName().equals(absoluteFile.getName()) || !canonicalFile.getParent().equals(file.getParentFile().getCanonicalPath());
  }
 catch (  IOException e) {
    return true;
  }
}

Fixed version (ground truth):
public static boolean isSymbolicLink(File file){
  try {
    File canonicalFile=file.getCanonicalFile();
    File absoluteFile=file.getAbsoluteFile();
    return !canonicalFile.getName().equals(absoluteFile.getName()) || !canonicalFile.getParent().equals(absoluteFile.getParentFile().getCanonicalPath());
  }
 catch (  IOException e) {
    return true;
  }
}
Program: 2994
Project: 2994
Buggy source:
@Override public void onEviction(UUID id,AgentStatus agentStatus){
  try {
    slotsLock.writeLock().lock();
    for (    SlotStatus slotStatus : agentStatus.getSlots()) {
      slots.remove(slotStatus.getId());
    }
  }
  finally {
    slotsLock.writeLock().unlock();
  }
}

Fixed version (ground truth):
@Override public void onEviction(UUID id,AgentStatus agentStatus){
  slotsLock.writeLock().lock();
  try {
    for (    SlotStatus slotStatus : agentStatus.getSlots()) {
      slots.remove(slotStatus.getId());
    }
  }
  finally {
    slotsLock.writeLock().unlock();
  }
}
Program: 2995
Project: 2995
Buggy source:
@Inject public Coordinator(RemoteSlotFactory remoteSlotFactory,CoordinatorConfig config){
  Preconditions.checkNotNull(remoteSlotFactory,"String_Node_Str");
  this.remoteSlotFactory=remoteSlotFactory;
  agents=new MapMaker().expireAfterWrite((long)config.getStatusExpiration().toMillis(),TimeUnit.MILLISECONDS).evictionListener(new MapEvictionListener<UUID,AgentStatus>(){
    @Override public void onEviction(    UUID id,    AgentStatus agentStatus){
      try {
        slotsLock.writeLock().lock();
        for (        SlotStatus slotStatus : agentStatus.getSlots()) {
          slots.remove(slotStatus.getId());
        }
      }
  finally {
        slotsLock.writeLock().unlock();
      }
    }
  }
).makeMap();
  slots=new MapMaker().makeMap();
}

Fixed version (ground truth):
@Inject public Coordinator(RemoteSlotFactory remoteSlotFactory,CoordinatorConfig config){
  Preconditions.checkNotNull(remoteSlotFactory,"String_Node_Str");
  this.remoteSlotFactory=remoteSlotFactory;
  agents=new MapMaker().expireAfterWrite((long)config.getStatusExpiration().toMillis(),TimeUnit.MILLISECONDS).evictionListener(new MapEvictionListener<UUID,AgentStatus>(){
    @Override public void onEviction(    UUID id,    AgentStatus agentStatus){
      slotsLock.writeLock().lock();
      try {
        for (        SlotStatus slotStatus : agentStatus.getSlots()) {
          slots.remove(slotStatus.getId());
        }
      }
  finally {
        slotsLock.writeLock().unlock();
      }
    }
  }
).makeMap();
  slots=new MapMaker().makeMap();
}
Program: 2996
Project: 2996
Buggy source:
private String getNextSlotName(){
  int nextId=1;
  for (  String deploymentId : slots.keySet()) {
    Matcher matcher=SLOT_ID_PATTERN.matcher(deploymentId);
    if (matcher.matches()) {
      try {
        int id=Integer.parseInt(matcher.group(1));
        nextId=max(id,nextId + 1);
      }
 catch (      NumberFormatException ignored) {
      }
    }
  }
  for (int i=0; i < 10000; i++) {
    String deploymentId="String_Node_Str" + nextId++;
    if (!new File(slotsDir,deploymentId).exists()) {
      return deploymentId;
    }
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
private String getNextSlotName(){
  int nextId=1;
  for (  String deploymentId : slots.keySet()) {
    Matcher matcher=SLOT_ID_PATTERN.matcher(deploymentId);
    if (matcher.matches()) {
      try {
        int id=Integer.parseInt(matcher.group(1));
        nextId=max(nextId,id + 1);
      }
 catch (      NumberFormatException ignored) {
      }
    }
  }
  for (int i=0; i < 10000; i++) {
    String deploymentId="String_Node_Str" + (nextId + i);
    if (!new File(slotsDir,deploymentId).exists()) {
      return deploymentId;
    }
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 2997
Project: 2997
Buggy source:
@Override public URI getBinaryUri(BinarySpec binarySpec){
  String fileVersion=binarySpec.getVersion();
  if (binarySpec.getVersion().contains("String_Node_Str")) {
    StringBuilder builder=new StringBuilder();
    builder.append(binarySpec.getGroupId().replace('.','/')).append('/');
    builder.append(binarySpec.getArtifactId()).append('/');
    builder.append(binarySpec.getVersion()).append('/');
    builder.append("String_Node_Str");
    URI uri=binaryRepositoryBase.resolve(builder.toString());
    try {
      MavenMetadata metadata=MavenMetadata.unmarshalMavenMetadata(Resources.toString(toURL(uri),Charsets.UTF_8));
      fileVersion=String.format("String_Node_Str",binarySpec.getVersion().replaceAll("String_Node_Str","String_Node_Str"),metadata.versioning.snapshot.timestamp,metadata.versioning.snapshot.buildNumber);
    }
 catch (    Exception ignored) {
    }
  }
  StringBuilder builder=new StringBuilder();
  builder.append(binarySpec.getGroupId().replace('.','/')).append('/');
  builder.append(binarySpec.getArtifactId()).append('/');
  builder.append(binarySpec.getVersion()).append('/');
  builder.append(binarySpec.getArtifactId()).append('-').append(fileVersion);
  if (binarySpec.getClassifier() != null) {
    builder.append('-').append(binarySpec.getArtifactId());
  }
  builder.append('.').append(binarySpec.getPackaging());
  return binaryRepositoryBase.resolve(builder.toString());
}

Fixed version (ground truth):
@Override public URI getBinaryUri(BinarySpec binarySpec){
  String fileVersion=binarySpec.getVersion();
  if (binarySpec.getVersion().contains("String_Node_Str")) {
    StringBuilder builder=new StringBuilder();
    builder.append(binarySpec.getGroupId().replace('.','/')).append('/');
    builder.append(binarySpec.getArtifactId()).append('/');
    builder.append(binarySpec.getVersion()).append('/');
    builder.append("String_Node_Str");
    URI uri=binaryRepositoryBase.resolve(builder.toString());
    try {
      MavenMetadata metadata=MavenMetadata.unmarshalMavenMetadata(Resources.toString(toURL(uri),Charsets.UTF_8));
      fileVersion=String.format("String_Node_Str",binarySpec.getVersion().replaceAll("String_Node_Str","String_Node_Str"),metadata.versioning.snapshot.timestamp,metadata.versioning.snapshot.buildNumber);
    }
 catch (    Exception ignored) {
    }
  }
  StringBuilder builder=new StringBuilder();
  builder.append(binarySpec.getGroupId().replace('.','/')).append('/');
  builder.append(binarySpec.getArtifactId()).append('/');
  builder.append(binarySpec.getVersion()).append('/');
  builder.append(binarySpec.getArtifactId()).append('-').append(fileVersion);
  if (binarySpec.getClassifier() != null) {
    builder.append('-').append(binarySpec.getClassifier());
  }
  builder.append('.').append(binarySpec.getPackaging());
  return binaryRepositoryBase.resolve(builder.toString());
}