nus-yam/ex-repair huggingface dataset:
Program: 145846
Project: 145846
Buggy source:
private List storageByRecent(int size){
  PreparedStatement statement=null;
  ResultSet result=null;
  Connection connection=ConnectionManager.getConnection();
  List snips=new ArrayList();
  try {
    statement=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    result=statement.executeQuery();
    Snip snip=null;
    while (result.next() && --size > 0) {
      snip=cacheLoad(result);
      snips.add(snip);
    }
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
 finally {
    ConnectionManager.close(result);
    ConnectionManager.close(statement);
    ConnectionManager.close(connection);
  }
  return snips;
}

Fixed version (ground truth):
private List storageByRecent(int size){
  PreparedStatement statement=null;
  ResultSet result=null;
  Connection connection=ConnectionManager.getConnection();
  List snips=new ArrayList();
  try {
    statement=connection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    snips=find(statement,size);
  }
 catch (  SQLException e) {
    e.printStackTrace();
  }
 finally {
    ConnectionManager.close(result);
    ConnectionManager.close(statement);
    ConnectionManager.close(connection);
  }
  return snips;
}
Program: 145847
Project: 145847
Buggy source:
public String execute(String[] params,String content,Snip snip) throws IllegalArgumentException {
  if (params.length == 0) {
    buffer.setLength(0);
    List snips=snip.getChildren();
    Iterator iterator=snips.iterator();
    while (iterator.hasNext()) {
      Snip entry=(Snip)iterator.next();
      buffer.append("String_Node_Str");
      buffer.append(Snip.toDate(entry.getName()));
      buffer.append("String_Node_Str");
      buffer.append(entry.getContent());
      buffer.append("String_Node_Str");
      buffer.append(snip.getComments().getCommentString());
      buffer.append("String_Node_Str");
    }
    return buffer.toString();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
public String execute(String[] params,String content,Snip snip) throws IllegalArgumentException {
  if (params.length == 0) {
    buffer.setLength(0);
    List snips=SnipSpace.getInstance().getChildrenDateOrder(snip,10);
    Iterator iterator=snips.iterator();
    while (iterator.hasNext()) {
      Snip entry=(Snip)iterator.next();
      buffer.append("String_Node_Str");
      buffer.append(Snip.toDate(entry.getName()));
      buffer.append("String_Node_Str");
      buffer.append(entry.getContent());
      buffer.append("String_Node_Str");
      buffer.append(snip.getComments().getCommentString());
      buffer.append("String_Node_Str");
    }
    return buffer.toString();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 145848
Project: 145848
Buggy source:
private Snip createSnip(ResultSet result) throws SQLException {
  String name=result.getString("String_Node_Str");
  String content=result.getString("String_Node_Str");
  Snip snip=new Snip(name,content);
  snip.setCTime(result.getTimestamp("String_Node_Str"));
  snip.setMTime(result.getTimestamp("String_Node_Str"));
  snip.setCUser(result.getString("String_Node_Str"));
  snip.setMUser(result.getString("String_Node_Str"));
  String commentString=result.getString("String_Node_Str");
  if (!result.wasNull()) {
    snip.setComment(load(commentString));
  }
  String parentString=result.getString("String_Node_Str");
  if (!result.wasNull()) {
    snip.setParent(load(parentString));
  }
  return snip;
}

Fixed version (ground truth):
private Snip createSnip(ResultSet result) throws SQLException {
  String name=result.getString("String_Node_Str");
  String content=result.getString("String_Node_Str");
  Snip snip=new Snip(name,content);
  snip.setCTime(result.getTimestamp("String_Node_Str"));
  snip.setMTime(result.getTimestamp("String_Node_Str"));
  snip.setCUser(result.getString("String_Node_Str"));
  snip.setMUser(result.getString("String_Node_Str"));
  String commentString=result.getString("String_Node_Str");
  if (!result.wasNull()) {
    snip.setComment(load(commentString));
  }
  String parentString=result.getString("String_Node_Str");
  if (!result.wasNull()) {
    snip.parent=load(parentString);
  }
  return snip;
}
Program: 145853
Project: 145853
Buggy source:
@Test public void testShouldReturnNoKeysWhenNoDataInParsedSentence() throws Exception {
  HashMap<String,String> parsedSentence=new HashMap<>();
  GPSSensor ublox=mock(GPSSensor.class);
  HashSet<String> supportedNmeaSentences=new HashSet<>();
  supportedNmeaSentences.add("String_Node_Str");
  supportedNmeaSentences.add("String_Node_Str");
  when(ublox.getNmeaSentence(anyString())).thenReturn("String_Node_Str");
  when(ublox.getSupportedNmeaSentences()).thenReturn(supportedNmeaSentences);
  mockStatic(NMEASentenceParser.class);
  when(NMEASentenceParser.parse(anyString())).thenReturn(parsedSentence);
  GPSSensorController mController=new GPSSensorController(ublox,properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"));
  HashMap<String,Object> result=mController.getCurrentData();
  assert(result.isEmpty());
}

Fixed version (ground truth):
@Test public void testShouldReturnNoKeysWhenNoDataInParsedSentence() throws Exception {
  HashMap<String,String> parsedSentence=new HashMap<>();
  GPSSensor ublox=mock(GPSSensor.class);
  HashSet<String> supportedNmeaSentences=new HashSet<>();
  supportedNmeaSentences.add("String_Node_Str");
  supportedNmeaSentences.add("String_Node_Str");
  when(ublox.getNmeaSentence(anyString())).thenReturn("String_Node_Str");
  when(ublox.getSupportedNmeaSentences()).thenReturn(supportedNmeaSentences);
  mockStatic(NMEASentenceParser.class);
  when(NMEASentenceParser.parse(anyString())).thenReturn(parsedSentence);
  GPSSensorController mController=new GPSSensorController(ublox,properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"),properties.getProperty("String_Node_Str"));
  HashMap<String,Object> result=mController.getCurrentData();
  assertTrue(result.isEmpty());
}
Program: 145854
Project: 145854
Buggy source:
@Test public void testShouldReturnNoKeysWhenNoKeysAreGiven() throws Exception {
  HashMap<String,String> parsedSentence=new HashMap<>();
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  GPSSensor ublox=mock(GPSSensor.class);
  HashSet<String> supportedNmeaSentences=new HashSet<>();
  supportedNmeaSentences.add("String_Node_Str");
  supportedNmeaSentences.add("String_Node_Str");
  when(ublox.getNmeaSentence(anyString())).thenReturn("String_Node_Str");
  when(ublox.getSupportedNmeaSentences()).thenReturn(supportedNmeaSentences);
  mockStatic(NMEASentenceParser.class);
  when(NMEASentenceParser.parse(anyString())).thenReturn(parsedSentence);
  GPSSensorController mController=new GPSSensorController(ublox);
  HashMap<String,Object> result=mController.getCurrentData();
  assert(result.isEmpty());
}

Fixed version (ground truth):
@Test public void testShouldReturnNoKeysWhenNoKeysAreGiven() throws Exception {
  HashMap<String,String> parsedSentence=new HashMap<>();
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  parsedSentence.put("String_Node_Str","String_Node_Str");
  GPSSensor ublox=mock(GPSSensor.class);
  HashSet<String> supportedNmeaSentences=new HashSet<>();
  supportedNmeaSentences.add("String_Node_Str");
  supportedNmeaSentences.add("String_Node_Str");
  when(ublox.getNmeaSentence(anyString())).thenReturn("String_Node_Str");
  when(ublox.getSupportedNmeaSentences()).thenReturn(supportedNmeaSentences);
  mockStatic(NMEASentenceParser.class);
  when(NMEASentenceParser.parse(anyString())).thenReturn(parsedSentence);
  GPSSensorController mController=new GPSSensorController(ublox);
  HashMap<String,Object> result=mController.getCurrentData();
  assertTrue(result.isEmpty());
}
Program: 145856
Project: 145856
Buggy source:
@Test public void testShouldGetSentenceIfSupported() throws Exception {
  Serial serial=mock(Serial.class);
  when(serial.read()).thenReturn('1').thenReturn('2').thenReturn('$').thenReturn('G').thenReturn('P').thenReturn('R').thenReturn('M').thenReturn('C').thenReturn('$');
  when(serial.availableBytes()).thenReturn(1);
  GPSSensor mGps=new GPSSensor(serial,"String_Node_Str");
  String expected="String_Node_Str";
  String result=mGps.getNmeaSentence("String_Node_Str");
  assert(expected.equals(result));
}

Fixed version (ground truth):
@Test public void testShouldGetSentenceIfSupported() throws Exception {
  Serial serial=mock(Serial.class);
  when(serial.read()).thenReturn('1').thenReturn('2').thenReturn('$').thenReturn('G').thenReturn('P').thenReturn('R').thenReturn('M').thenReturn('C').thenReturn('$');
  when(serial.availableBytes()).thenReturn(1);
  GPSSensor mGps=new GPSSensor(serial,"String_Node_Str");
  String expected="String_Node_Str";
  String result=mGps.getNmeaSentence("String_Node_Str");
  assertTrue(expected.equals(result));
}
Program: 145857
Project: 145857
Buggy source:
@Test public void testShouldReturnEmptyHashMapForUnsupportedSentence() throws Exception {
  String NMEASentence="String_Node_Str";
  HashMap<String,String> result=NMEASentenceParser.parse(NMEASentence);
  assert(result.isEmpty());
}

Fixed version (ground truth):
@Test public void testShouldReturnEmptyHashMapForUnsupportedSentence() throws Exception {
  String NMEASentence="String_Node_Str";
  HashMap<String,String> result=NMEASentenceParser.parse(NMEASentence);
  assertTrue(result.isEmpty());
}
Program: 145858
Project: 145858
Buggy source:
@Override public void writeData(Map<String,Object> dataModel) throws DataWriteFailedException {
  logger.info(dataModel);
}

Fixed version (ground truth):
@Override public void writeData(Map<String,Object> dataModel){
  logger.info(dataModel);
}
Program: 145859
Project: 145859
Buggy source:
public void post(Object evt){
  if (!(evt instanceof Event)) {
    INpurePreLoader.print("String_Node_Str");
  }
  for (  Listener l : listeners) {
    l.handleEvent(evt);
  }
}

Fixed version (ground truth):
public void post(Object evt){
  if (!(evt instanceof Event)) {
    log.warn("String_Node_Str");
  }
  for (  Listener l : listeners) {
    l.handleEvent(evt);
  }
}
Program: 145860
Project: 145860
Buggy source:
public void register(Object o){
  Listener l=new Listener(o);
  for (  Method m : o.getClass().getDeclaredMethods()) {
    if (m.getAnnotation(INpureSubscribe.class) != null) {
      if (m.getParameterTypes().length > 1) {
        INpurePreLoader.print("String_Node_Str");
        return;
      }
      Class eventType=m.getParameterTypes()[0];
      l.handlers.put(eventType,m);
    }
  }
  listeners.add(l);
}

Fixed version (ground truth):
public void register(Object o){
  Listener l=new Listener(o);
  for (  Method m : o.getClass().getDeclaredMethods()) {
    if (m.getAnnotation(INpureSubscribe.class) != null) {
      if (m.getParameterTypes().length > 1) {
        log.warn("String_Node_Str");
        return;
      }
      Class eventType=m.getParameterTypes()[0];
      l.handlers.put(eventType,m);
    }
  }
  listeners.add(l);
}
Program: 145861
Project: 145861
Buggy source:
@Override public void run(){
  INpureCore.proxy.print("String_Node_Str");
  try {
    LinkedList<ItemStack> facades=(LinkedList)Class.forName("String_Node_Str").getDeclaredField("String_Node_Str").get(null);
    API.setItemListEntries(facades.get(0).getItem(),Arrays.asList(new ItemStack[]{facades.get(new Random().nextInt(facades.size()))}));
  }
 catch (  Throwable t) {
    INpureCore.proxy.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  INpureCore.proxy.print("String_Node_Str");
  try {
    LinkedList<ItemStack> facades=(LinkedList)Class.forName("String_Node_Str").getDeclaredField("String_Node_Str").get(null);
    API.setItemListEntries(facades.get(0).getItem(),Arrays.asList(new ItemStack[]{facades.get(new Random().nextInt(facades.size()))}));
  }
 catch (  Throwable t) {
    INpureCore.proxy.warning("String_Node_Str");
    t.printStackTrace();
  }
}
Program: 145863
Project: 145863
Buggy source:
/** 
 * compares to language-property-files.
 * @param messagePropertiesKey the properties form one language used for the keys in the test
 * @param messagePropertiesValue the properties from an other language used for the values
 * @param language as a string
 * @return true, if all keys are in the value-properties included.
 */
private boolean writeDifferent(Properties messagePropertiesKey,Properties messagePropertiesValue,String language){
  boolean allKeysInValueProperties=true;
  Enumeration<Object> keys=messagePropertiesKey.keys();
  while (keys.hasMoreElements()) {
    String key=keys.nextElement().toString();
    if (messagePropertiesValue.getProperty(key) == null) {
      allKeysInValueProperties=false;
    }
  }
  return allKeysInValueProperties;
}

Fixed version (ground truth):
/** 
 * compares to language-property-files.
 * @param messagePropertiesKey the properties form one language used for the keys in the test
 * @param messagePropertiesValue the properties from an other language used for the values
 * @param language as a string
 * @return true, if all keys are in the value-properties included.
 */
private boolean writeDifferent(Properties messagePropertiesKey,Properties messagePropertiesValue,String language){
  boolean allKeysInValueProperties=true;
  Enumeration<Object> keys=messagePropertiesKey.keys();
  while (keys.hasMoreElements()) {
    String key=keys.nextElement().toString();
    if (messagePropertiesValue.getProperty(key) == null) {
      logger.error("String_Node_Str" + key + "String_Node_Str"+ language);
      allKeysInValueProperties=false;
    }
  }
  return allKeysInValueProperties;
}
Program: 145864
Project: 145864
Buggy source:
/** 
 * adds a parameterLine into the dataTable.
 * @param paramLine String. Parameters are separated by |
 * @throws SystemException throws if data row count higher than title roe count
 */
public void addParameterLine(String paramLine) throws SystemException {
  String[] elementListTemp=paramLine.substring(1).split("String_Node_Str",-1);
  String[] elementList=Arrays.copyOf(elementListTemp,elementListTemp.length - 1);
  TestDataRow actParams=new TestDataRow(elementList);
  if (getDataTable().hasTitleRow()) {
    int headerColumnCount=getDataTable().getTitleRow().getColumnCount();
    if (actParams.getColumnCount() != headerColumnCount) {
      LOGGER.info("String_Node_Str" + actParams.toString() + "String_Node_Str"+ headerColumnCount+ "String_Node_Str");
      TestDataEvaluationReturnList testDataEvaluationReturnList=new TestDataEvaluationReturnList();
      testDataEvaluationReturnList.setDataRowColumnCountEqualsHeaderRowColumnCount(false);
      setTestDataEvaluationReturnList(testDataEvaluationReturnList);
    }
  }
  getDataTable().addRow(actParams);
}

Fixed version (ground truth):
/** 
 * adds a parameterLine into the dataTable.
 * @param paramLine String. Parameters are separated by |
 * @throws SystemException throws if data row count higher than title roe count
 */
public void addParameterLine(String paramLine) throws SystemException {
  String[] elementListTemp=paramLine.substring(1).split("String_Node_Str",-1);
  String[] elementList=Arrays.copyOf(elementListTemp,elementListTemp.length - 1);
  TestDataRow actParams=new TestDataRow(elementList);
  if (getDataTable().hasTitleRow()) {
    int headerColumnCount=getDataTable().getTitleRow().getColumnCount();
    if (actParams.getColumnCount() > headerColumnCount) {
      LOGGER.error("String_Node_Str" + actParams.toString() + "String_Node_Str"+ headerColumnCount+ "String_Node_Str");
      TestDataEvaluationReturnList testDataEvaluationReturnList=new TestDataEvaluationReturnList();
      testDataEvaluationReturnList.setDataRowColumnCountEqualsHeaderRowColumnCount(false);
      setTestDataEvaluationReturnList(testDataEvaluationReturnList);
    }
  }
  getDataTable().addRow(actParams);
}
Program: 145865
Project: 145865
Buggy source:
@Override public void move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  testStructureServices.get(testStructure.getRootElement().getTestProjectConfig().getTestServerID()).move(testStructure,newParent);
}

Fixed version (ground truth):
@Override public List<String> move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  return testStructureServices.get(testStructure.getRootElement().getTestProjectConfig().getTestServerID()).move(testStructure,newParent);
}
Program: 145866
Project: 145866
Buggy source:
@Override public void rename(TestStructure testStructure,String newName) throws SystemException {
  testStructureServices.get(testStructure.getRootElement().getTestProjectConfig().getTestServerID()).rename(testStructure,newName);
}

Fixed version (ground truth):
@Override public List<String> rename(TestStructure testStructure,String newName) throws SystemException {
  return testStructureServices.get(testStructure.getRootElement().getTestProjectConfig().getTestServerID()).rename(testStructure,newName);
}
Program: 145867
Project: 145867
Buggy source:
/** 
 * Moves a given test structure to a new parent.
 * @param testStructure test structure which should be moved
 * @param newParent the new parent of the testcase.
 * @throws SystemException is thrown if a system exception occurred
 */
void move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException ;

Fixed version (ground truth):
/** 
 * Moves a given test structure to a new parent.
 * @param testStructure test structure which should be moved
 * @param newParent the new parent of the testcase.
 * @return a list of changed items
 * @throws SystemException is thrown if a system exception occurred
 */
List<String> move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException ;
Program: 145868
Project: 145868
Buggy source:
/** 
 * Renames a given test structure.
 * @param testStructure test structure which should be renamed (contains the old/current name)
 * @param newName new name
 * @throws SystemException is thrown if a system exception occurred
 */
void rename(TestStructure testStructure,String newName) throws SystemException ;

Fixed version (ground truth):
/** 
 * Renames a given test structure.
 * @param testStructure test structure which should be renamed (contains the old/current name)
 * @param newName new name
 * @return - the list of changed items
 * @throws SystemException is thrown if a system exception occurred
 */
List<String> rename(TestStructure testStructure,String newName) throws SystemException ;
Program: 145869
Project: 145869
Buggy source:
@Override public void move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  testStructureContentService.refreshTestCaseComponents(testStructure);
  List<TestFlow> changedFlows=null;
  if (testStructure instanceof TestScenario) {
    List<String> usages=testScenarioService.getUsedOfTestSceneario((TestScenario)testStructure);
    changedFlows=updateScenarioCalls(testStructure.getRootElement(),testStructure.getName(),newParent.getFullName() + "String_Node_Str" + testStructure.getName(),testStructure.getFullName(),usages);
  }
 else {
    clearTestHistory(testStructure);
  }
  if (testStructure.getRootElement().getTestProjectConfig().getTeamShareConfig() != null) {
    moveStructureWithTeamShare(testStructure,newParent);
  }
 else {
    new FitnesseFileSystemTestStructureService().move(testStructure,newParent);
  }
  if (changedFlows != null) {
    updateChangedFlows(changedFlows);
  }
  if (eventBroker != null) {
    eventBroker.send(TestEditorCoreEventConstants.TESTSTRUCTURE_MODEL_CHANGED_UPDATE_BY_MODIFY,testStructure.getRootElement().getName());
  }
}

Fixed version (ground truth):
@Override public List<String> move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  List<String> changedItems=new ArrayList<String>();
  testStructureContentService.refreshTestCaseComponents(testStructure);
  List<TestFlow> changedFlows=null;
  if (testStructure instanceof TestScenario) {
    List<String> usages=testScenarioService.getUsedOfTestSceneario((TestScenario)testStructure);
    changedFlows=updateScenarioCalls(testStructure.getRootElement(),testStructure.getName(),newParent.getFullName() + "String_Node_Str" + testStructure.getName(),testStructure.getFullName(),usages);
  }
 else {
    clearTestHistory(testStructure);
  }
  if (testStructure.getRootElement().getTestProjectConfig().getTeamShareConfig() != null) {
    moveStructureWithTeamShare(testStructure,newParent);
  }
 else {
    new FitnesseFileSystemTestStructureService().move(testStructure,newParent);
  }
  if (changedFlows != null) {
    updateChangedFlows(changedFlows);
    for (    TestFlow testFlow : changedFlows) {
      changedItems.add(testFlow.getFullName());
    }
  }
  if (eventBroker != null) {
    eventBroker.send(TestEditorCoreEventConstants.TESTSTRUCTURE_MODEL_CHANGED_UPDATE_BY_MODIFY,testStructure.getRootElement().getName());
  }
  return changedItems;
}
Program: 145870
Project: 145870
Buggy source:
/** 
 * Update the URL for all children of a testsuite.
 * @param testSuite - the testsuite to replace the children
 * @throws SystemException - the exception
 */
private void updateAllChildren(TestSuite testSuite) throws SystemException {
  for (  TestStructure testStructure : testSuite.getAllTestChildren()) {
    Path path=Paths.get(FitnesseFileSystemUtility.getPathToTestStructureDirectory(testStructure));
    try {
      testStructure.setUrl(path.toUri().toURL());
    }
 catch (    MalformedURLException e) {
      throw new SystemException(e.getMessage(),e);
    }
    if (testStructure instanceof TestSuite) {
      updateAllChildren((TestSuite)testStructure);
    }
  }
}

Fixed version (ground truth):
/** 
 * Update the URL for all children of a testsuite.
 * @param testSuite - the testsuite to replace the children
 * @throws SystemException - the exception
 * @return - list of changed items
 */
private List<String> updateAllChildren(TestSuite testSuite) throws SystemException {
  List<String> changedItems=new ArrayList<String>();
  for (  TestStructure testStructure : testSuite.getAllTestChildren()) {
    Path path=Paths.get(FitnesseFileSystemUtility.getPathToTestStructureDirectory(testStructure));
    try {
      testStructure.setUrl(path.toUri().toURL());
      changedItems.add(testStructure.getFullName());
    }
 catch (    MalformedURLException e) {
      throw new SystemException(e.getMessage(),e);
    }
    if (testStructure instanceof TestSuite) {
      changedItems.addAll(updateAllChildren((TestSuite)testStructure));
    }
  }
  return changedItems;
}
Program: 145871
Project: 145871
Buggy source:
/** 
 * Renames a testcase. This is just a change of filenames.
 * @param testStructure - the testStructure to be renamed
 * @param newName - the newName of the tescase
 * @throws SystemException - any excpetion during renaming
 */
private void renameTestCase(TestStructure testStructure,String newName) throws SystemException {
  clearTestHistory(testStructure);
  renameFiles(testStructure,newName);
  testStructure.setName(newName);
  Path path=Paths.get(FitnesseFileSystemUtility.getPathToTestStructureDirectory(testStructure));
  try {
    testStructure.setUrl(path.toUri().toURL());
  }
 catch (  MalformedURLException e) {
    throw new SystemException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Renames a testcase. This is just a change of filenames.
 * @param testStructure - the testStructure to be renamed
 * @param newName - the newName of the tescase
 * @return - list of changed items
 * @throws SystemException - any excpetion during renaming
 */
private List<String> renameTestCase(TestStructure testStructure,String newName) throws SystemException {
  clearTestHistory(testStructure);
  renameFiles(testStructure,newName);
  testStructure.setName(newName);
  Path path=Paths.get(FitnesseFileSystemUtility.getPathToTestStructureDirectory(testStructure));
  try {
    testStructure.setUrl(path.toUri().toURL());
  }
 catch (  MalformedURLException e) {
    throw new SystemException(e.getMessage(),e);
  }
  return new ArrayList<String>();
}
Program: 145872
Project: 145872
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void rename(TestStructure testStructure,String newName) throws SystemException {
  if (testStructure instanceof TestScenario) {
    renameScenario((TestScenario)testStructure,newName);
  }
 else   if (testStructure instanceof TestSuite) {
    renameTestSuite((TestSuite)testStructure,newName);
  }
 else {
    renameTestCase(testStructure,newName);
  }
  if (eventBroker != null) {
    eventBroker.post(TestEditorCoreEventConstants.TESTSTRUCTURE_MODEL_CHANGED_UPDATE_BY_MODIFY,testStructure.getFullName());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<String> rename(TestStructure testStructure,String newName) throws SystemException {
  List<String> changedItems=null;
  if (testStructure instanceof TestScenario) {
    changedItems=renameScenario((TestScenario)testStructure,newName);
  }
 else   if (testStructure instanceof TestSuite) {
    changedItems=renameTestSuite((TestSuite)testStructure,newName);
  }
 else {
    changedItems=renameTestCase(testStructure,newName);
  }
  if (eventBroker != null) {
    eventBroker.post(TestEditorCoreEventConstants.TESTSTRUCTURE_MODEL_CHANGED_UPDATE_BY_MODIFY,testStructure.getFullName());
  }
  return changedItems;
}
Program: 145873
Project: 145873
Buggy source:
/** 
 * Renames a suite. All childrens of the node are updated.
 * @param testSuite -the suite to be renamed.
 * @param newName -the new name of the suite
 * @throws SystemException - any excpetion during renaming.
 */
private void renameTestSuite(TestSuite testSuite,String newName) throws SystemException {
  renameFiles(testSuite,newName);
  setName(testSuite,newName);
  updateAllChildren(testSuite);
}

Fixed version (ground truth):
/** 
 * Renames a suite. All childrens of the node are updated.
 * @param testSuite -the suite to be renamed.
 * @param newName -the new name of the suite
 * @return - the list of all changed items
 * @throws SystemException - any excpetion during renaming.
 */
private List<String> renameTestSuite(TestSuite testSuite,String newName) throws SystemException {
  renameFiles(testSuite,newName);
  setName(testSuite,newName);
  return updateAllChildren(testSuite);
}
Program: 145874
Project: 145874
Buggy source:
/** 
 * renames a scenario.
 * @param scenario -the scenario to be renamed
 * @param newName - the new name of the scenario
 * @throws SystemException - any exception during execution.
 */
private void renameScenario(TestScenario scenario,String newName) throws SystemException {
  List<String> usages=testScenarioService.getUsedOfTestSceneario(scenario);
  TestProject testProject=scenario.getRootElement();
  String oldName=scenario.getFullName();
  List<TestFlow> changedFlows=updateScenarioCalls(testProject,newName,scenario.getParent().getFullName() + "String_Node_Str" + newName,oldName,usages);
  renameFiles(scenario,newName);
  setName(scenario,newName);
  testStructureContentService.refreshTestCaseComponents(scenario);
  testStructureContentService.saveTestStructureData(scenario);
  updateChangedFlows(changedFlows);
}

Fixed version (ground truth):
/** 
 * renames a scenario.
 * @param scenario -the scenario to be renamed
 * @param newName - the new name of the scenario
 * @throws SystemException - any exception during execution.
 */
private List<String> renameScenario(TestScenario scenario,String newName) throws SystemException {
  List<String> usages=testScenarioService.getUsedOfTestSceneario(scenario);
  TestProject testProject=scenario.getRootElement();
  String oldName=scenario.getFullName();
  List<TestFlow> changedFlows=updateScenarioCalls(testProject,newName,scenario.getParent().getFullName() + "String_Node_Str" + newName,oldName,usages);
  renameFiles(scenario,newName);
  setName(scenario,newName);
  testStructureContentService.refreshTestCaseComponents(scenario);
  testStructureContentService.saveTestStructureData(scenario);
  updateChangedFlows(changedFlows);
  List<String> changedItems=new ArrayList<String>();
  for (  TestFlow flow : changedFlows) {
    changedItems.add(flow.getFullName());
  }
  return changedItems;
}
Program: 145875
Project: 145875
Buggy source:
@Override public void move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  delete(testStructure);
  newParent.addChild(testStructure);
  create(testStructure);
}

Fixed version (ground truth):
@Override public List<String> move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  List<String> changedItems=new ArrayList<String>();
  delete(testStructure);
  newParent.addChild(testStructure);
  create(testStructure);
  return changedItems;
}
Program: 145876
Project: 145876
Buggy source:
@Override public void rename(TestStructure testStructure,String newName) throws SystemException {
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + testStructure.getFullName() + "String_Node_Str"+ newName);
  }
  Path oldName=Paths.get(FitnesseFileSystemUtility.getPathToTestStructureDirectory(testStructure));
  try {
    Path targetPath=oldName.resolveSibling(newName);
    Files.move(oldName,targetPath);
    testStructure.setUrl(targetPath.toUri().toURL());
  }
 catch (  IOException e) {
    String message="String_Node_Str" + oldName + "String_Node_Str"+ newName;
    LOGGER.error(message,e);
    throw new SystemException(message + "String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public List<String> rename(TestStructure testStructure,String newName) throws SystemException {
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("String_Node_Str" + testStructure.getFullName() + "String_Node_Str"+ newName);
  }
  Path oldName=Paths.get(FitnesseFileSystemUtility.getPathToTestStructureDirectory(testStructure));
  try {
    Path targetPath=oldName.resolveSibling(newName);
    Files.move(oldName,targetPath);
    testStructure.setUrl(targetPath.toUri().toURL());
  }
 catch (  IOException e) {
    String message="String_Node_Str" + oldName + "String_Node_Str"+ newName;
    LOGGER.error(message,e);
    throw new SystemException(message + "String_Node_Str" + e.getMessage(),e);
  }
  return new ArrayList<String>();
}
Program: 145878
Project: 145878
Buggy source:
/** 
 * @param scenarioNameSplittedByCapitals array of scenario names.
 * @return stringBuilder with the scenario names separated by spaces.
 */
private StringBuilder buildScenarioNameWithSpaces(String[] scenarioNameSplittedByCapitals){
  StringBuilder scenarioNameWithSpaces=new StringBuilder("String_Node_Str");
  for (  String part : scenarioNameSplittedByCapitals) {
    scenarioNameWithSpaces.append(part.trim()).append("String_Node_Str");
  }
  return scenarioNameWithSpaces;
}

Fixed version (ground truth):
/** 
 * @param scenarioNameSplittedByCapitals array of scenario names.
 * @return stringBuilder with the scenario names separated by spaces.
 */
private StringBuilder buildScenarioNameWithSpaces(String[] scenarioNameSplittedByCapitals){
  StringBuilder scenarioNameWithSpaces=new StringBuilder("String_Node_Str");
  for (  String part : scenarioNameSplittedByCapitals) {
    String partTrim=part.trim();
    if (partTrim.length() > 0) {
      scenarioNameWithSpaces.append(partTrim).append("String_Node_Str");
    }
  }
  return scenarioNameWithSpaces;
}
Program: 145880
Project: 145880
Buggy source:
@Override public void move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
}

Fixed version (ground truth):
@Override public List<String> move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  return null;
}
Program: 145881
Project: 145881
Buggy source:
@Override public void rename(TestStructure testStructure,String newName) throws SystemException {
}

Fixed version (ground truth):
@Override public List<String> rename(TestStructure testStructure,String newName) throws SystemException {
  return null;
}
Program: 145882
Project: 145882
Buggy source:
@Override public void move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
}

Fixed version (ground truth):
@Override public List<String> move(TestStructure testStructure,TestCompositeStructure newParent) throws SystemException {
  return null;
}
Program: 145883
Project: 145883
Buggy source:
@Override public void rename(TestStructure testStructure,String newName) throws SystemException {
}

Fixed version (ground truth):
@Override public List<String> rename(TestStructure testStructure,String newName) throws SystemException {
  return null;
}
Program: 145884
Project: 145884
Buggy source:
/** 
 * @return the titleline.
 */
public TestDataRow getTitleRow(){
  return testDataRows.get(0);
}

Fixed version (ground truth):
/** 
 * @return the titleline.
 */
public TestDataRow getTitleRow(){
  if (testDataRows.size() > 0) {
    return testDataRows.get(0);
  }
  return new TestDataRow();
}
Program: 145885
Project: 145885
Buggy source:
@Override public int availableUpdatesCount(TestProject testProject) throws SystemException {
  logger.trace("String_Node_Str" + testProject.getFullName() + "String_Node_Str");
  SVNClientManager clientManager=getSVNClientManager(testProject);
  try {
    SvnGetInfo info=clientManager.getWCClient().getOperationsFactory().createGetInfo();
    info.setSingleTarget(SvnTarget.fromFile(getFile(testProject)));
    SVNRevision localRevision=SVNRevision.create(info.run().getLastChangedRevision());
    SvnLog log=clientManager.getWCClient().getOperationsFactory().createLog();
    log.addRange(SvnRevisionRange.create(SVNRevision.HEAD,SVNRevision.HEAD));
    SVNTeamShareConfig cfg=(SVNTeamShareConfig)testProject.getTestProjectConfig().getTeamShareConfig();
    log.setSingleTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded(cfg.getUrl() + "String_Node_Str" + testProject.getName())));
    SVNLogEntry run=log.run();
    logger.trace("String_Node_Str" + testProject.getFullName() + "String_Node_Str");
    if (run != null) {
      return (int)(run.getRevision() - localRevision.getNumber());
    }
    return 0;
  }
 catch (  SVNException e) {
    logger.error(e.getMessage(),e);
    throw new SystemException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
@Override public int availableUpdatesCount(TestProject testProject) throws SystemException {
  logger.trace("String_Node_Str" + testProject.getFullName() + "String_Node_Str");
  SVNClientManager clientManager=getSVNClientManager(testProject);
  try {
    File rootDir=new File(testProject.getTestProjectConfig().getProjectPath() + "String_Node_Str");
    SVNRevision localRevision=clientManager.getStatusClient().doStatus(rootDir,false).getRevision();
    SVNTeamShareConfig teamShareConfig=(SVNTeamShareConfig)testProject.getTestProjectConfig().getTeamShareConfig();
    String url=teamShareConfig.getUrl();
    SVNRepository repository=SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url));
    ISVNAuthenticationManager authManager=SVNWCUtil.createDefaultAuthenticationManager();
    repository.setAuthenticationManager(authManager);
    repository.getRepositoryUUID(true);
    Collection<SVNLogEntry> logEntries=repository.log(new String[]{"String_Node_Str"},null,localRevision.getNumber(),SVNRevision.HEAD.getNumber(),true,true);
    String currentUser=System.getProperty("String_Node_Str");
    if (logEntries != null) {
      int changes=0;
      for (      SVNLogEntry logEntry : logEntries) {
        if (!logEntry.getAuthor().equals(currentUser)) {
          changes++;
        }
      }
      return changes;
    }
    return 0;
  }
 catch (  SVNException e) {
    logger.error(e.getMessage(),e);
    throw new SystemException(e.getLocalizedMessage(),e);
  }
}
Program: 145886
Project: 145886
Buggy source:
@Override protected Control createContents(Composite parent){
  if (getShell() != null) {
    getShell().setText(translationService.translate("String_Node_Str"));
  }
  testStructureTree=createTestStructureTree();
  testStructureTree.createUI(parent,testProjectService);
  testStructureTree.getTreeViewer().getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  testStructureTree.getTreeViewer().getTree().addSelectionListener(getTreeSelectionListener());
  for (  ViewerFilter filter : filters) {
    testStructureTree.getTreeViewer().addFilter(filter);
  }
  createButtonBar(parent);
  getButton(IDialogConstants.OK_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_OK);
  getButton(IDialogConstants.CANCEL_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_CANCEL);
  if (selectedTestStrucutures != null) {
    testStructureTree.selectTestStructure((TestStructure)selectedTestStrucutures.getFirstElement());
  }
  return testStructureTree.getTreeViewer().getControl();
}

Fixed version (ground truth):
@Override protected Control createContents(Composite parent){
  if (getShell() != null) {
    getShell().setText(translationService.translate("String_Node_Str"));
  }
  testStructureTree=createTestStructureTree();
  testStructureTree.createUI(parent,testProjectService);
  testStructureTree.getTreeViewer().getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  testStructureTree.getTreeViewer().getTree().addSelectionListener(getTreeSelectionListener());
  testStructureTree.getTreeViewer().getTree().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.TEST_EXPLORER_TREE);
  for (  ViewerFilter filter : filters) {
    testStructureTree.getTreeViewer().addFilter(filter);
  }
  createButtonBar(parent);
  getButton(IDialogConstants.OK_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_OK);
  getButton(IDialogConstants.CANCEL_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_CANCEL);
  if (selectedTestStrucutures != null) {
    testStructureTree.selectTestStructure((TestStructure)selectedTestStrucutures.getFirstElement());
  }
  return testStructureTree.getTreeViewer().getControl();
}
Program: 145887
Project: 145887
Buggy source:
/** 
 * Creates a Tree with Testssuites to allow the selection of the parent node.
 */
protected void createLocationTree(){
  Label treeLabel=new Label(getWidgetContainer(),SWT.NORMAL);
  treeLabel.setText(translationService.translate("String_Node_Str"));
  GridData gdLabel=new GridData();
  gdLabel.verticalAlignment=GridData.BEGINNING;
  treeLabel.setLayoutData(gdLabel);
  testStructureTree=ContextInjectionFactory.make(TestStructureTree.class,context);
  testStructureTree.createUI(getWidgetContainer(),testProjectService);
  GridData gdTree=new GridData(GridData.FILL_BOTH);
  testStructureTree.getTreeViewer().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.NEW_TEST_STRUCTUR_TREE);
  testStructureTree.getTreeViewer().getTree().setLayoutData(gdTree);
  testStructureTree.selectTestStructure(selectedTS);
  testStructureTree.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      validatePageAndSetComplete();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates a Tree with Testssuites to allow the selection of the parent node.
 */
protected void createLocationTree(){
  Label treeLabel=new Label(getWidgetContainer(),SWT.NORMAL);
  treeLabel.setText(translationService.translate("String_Node_Str"));
  GridData gdLabel=new GridData();
  gdLabel.verticalAlignment=GridData.BEGINNING;
  treeLabel.setLayoutData(gdLabel);
  testStructureTree=ContextInjectionFactory.make(TestStructureTree.class,context);
  testStructureTree.createUI(getWidgetContainer(),testProjectService);
  testStructureTree.getTreeViewer().getTree().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.TEST_EXPLORER_TREE);
  GridData gdTree=new GridData(GridData.FILL_BOTH);
  testStructureTree.getTreeViewer().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.TEST_EXPLORER_TREE);
  testStructureTree.getTreeViewer().getTree().setLayoutData(gdTree);
  testStructureTree.selectTestStructure(selectedTS);
  testStructureTree.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      validatePageAndSetComplete();
    }
  }
);
}
Program: 145888
Project: 145888
Buggy source:
@Override protected Control createContents(Composite parent){
  if (getShell() != null) {
    getShell().setText(translationService.translate("String_Node_Str"));
  }
  testStructureTree=createTestStructureTree();
  testStructureTree.createUI(parent,testProjectService);
  testStructureTree.getTreeViewer().getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  testStructureTree.getTreeViewer().getTree().addSelectionListener(getTreeSelectionListener());
  for (  ViewerFilter filter : filters) {
    testStructureTree.getTreeViewer().addFilter(filter);
  }
  createButtonBar(parent);
  getButton(IDialogConstants.OK_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_OK);
  getButton(IDialogConstants.CANCEL_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_CANCEL);
  if (selectedTestStrucutures != null) {
    testStructureTree.selectTestStructure((TestStructure)selectedTestStrucutures.getFirstElement());
  }
  return testStructureTree.getTreeViewer().getControl();
}

Fixed version (ground truth):
@Override protected Control createContents(Composite parent){
  if (getShell() != null) {
    getShell().setText(translationService.translate("String_Node_Str"));
  }
  testStructureTree=createTestStructureTree();
  testStructureTree.createUI(parent,testProjectService);
  testStructureTree.getTreeViewer().getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  testStructureTree.getTreeViewer().getTree().addSelectionListener(getTreeSelectionListener());
  testStructureTree.getTreeViewer().getTree().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.TEST_EXPLORER_TREE);
  for (  ViewerFilter filter : filters) {
    testStructureTree.getTreeViewer().addFilter(filter);
  }
  createButtonBar(parent);
  getButton(IDialogConstants.OK_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_OK);
  getButton(IDialogConstants.CANCEL_ID).setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.SELECTION_DIALOG_TESTCASE_CANCEL);
  if (selectedTestStrucutures != null) {
    testStructureTree.selectTestStructure((TestStructure)selectedTestStrucutures.getFirstElement());
  }
  return testStructureTree.getTreeViewer().getControl();
}
Program: 145889
Project: 145889
Buggy source:
/** 
 * Creates a Tree with Testssuites to allow the selection of the parent node.
 */
protected void createLocationTree(){
  Label treeLabel=new Label(getWidgetContainer(),SWT.NORMAL);
  treeLabel.setText(translationService.translate("String_Node_Str"));
  GridData gdLabel=new GridData();
  gdLabel.verticalAlignment=GridData.BEGINNING;
  treeLabel.setLayoutData(gdLabel);
  testStructureTree=ContextInjectionFactory.make(TestStructureTree.class,context);
  testStructureTree.createUI(getWidgetContainer(),testProjectService);
  GridData gdTree=new GridData(GridData.FILL_BOTH);
  testStructureTree.getTreeViewer().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.NEW_TEST_STRUCTUR_TREE);
  testStructureTree.getTreeViewer().getTree().setLayoutData(gdTree);
  testStructureTree.selectTestStructure(selectedTS);
  testStructureTree.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      validatePageAndSetComplete();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates a Tree with Testssuites to allow the selection of the parent node.
 */
protected void createLocationTree(){
  Label treeLabel=new Label(getWidgetContainer(),SWT.NORMAL);
  treeLabel.setText(translationService.translate("String_Node_Str"));
  GridData gdLabel=new GridData();
  gdLabel.verticalAlignment=GridData.BEGINNING;
  treeLabel.setLayoutData(gdLabel);
  testStructureTree=ContextInjectionFactory.make(TestStructureTree.class,context);
  testStructureTree.createUI(getWidgetContainer(),testProjectService);
  testStructureTree.getTreeViewer().getTree().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.TEST_EXPLORER_TREE);
  GridData gdTree=new GridData(GridData.FILL_BOTH);
  testStructureTree.getTreeViewer().setData(CustomWidgetIdConstants.TEST_EDITOR_WIDGET_ID_SWT_BOT_KEY,CustomWidgetIdConstants.TEST_EXPLORER_TREE);
  testStructureTree.getTreeViewer().getTree().setLayoutData(gdTree);
  testStructureTree.selectTestStructure(selectedTS);
  testStructureTree.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      validatePageAndSetComplete();
    }
  }
);
}
Program: 145890
Project: 145890
Buggy source:
@Override public int availableUpdatesCount(TestProject testProject) throws SystemException {
  SVNClientManager clientManager=getSVNClientManager(testProject);
  try {
    SvnGetInfo info=clientManager.getWCClient().getOperationsFactory().createGetInfo();
    info.setSingleTarget(SvnTarget.fromFile(getFile(testProject)));
    SVNRevision localRevision=SVNRevision.create(info.run().getLastChangedRevision());
    SvnLog log=clientManager.getWCClient().getOperationsFactory().createLog();
    log.addRange(SvnRevisionRange.create(SVNRevision.HEAD,SVNRevision.HEAD));
    SVNTeamShareConfig cfg=(SVNTeamShareConfig)testProject.getTestProjectConfig().getTeamShareConfig();
    log.setSingleTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded(cfg.getUrl() + "String_Node_Str" + testProject.getName())));
    SVNLogEntry run=log.run();
    return (int)(run.getRevision() - localRevision.getNumber());
  }
 catch (  SVNException e) {
    logger.error(e.getMessage(),e);
    throw new SystemException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
@Override public int availableUpdatesCount(TestProject testProject) throws SystemException {
  logger.trace("String_Node_Str" + testProject.getFullName() + "String_Node_Str");
  SVNClientManager clientManager=getSVNClientManager(testProject);
  try {
    SvnGetInfo info=clientManager.getWCClient().getOperationsFactory().createGetInfo();
    info.setSingleTarget(SvnTarget.fromFile(getFile(testProject)));
    SVNRevision localRevision=SVNRevision.create(info.run().getLastChangedRevision());
    SvnLog log=clientManager.getWCClient().getOperationsFactory().createLog();
    log.addRange(SvnRevisionRange.create(SVNRevision.HEAD,SVNRevision.HEAD));
    SVNTeamShareConfig cfg=(SVNTeamShareConfig)testProject.getTestProjectConfig().getTeamShareConfig();
    log.setSingleTarget(SvnTarget.fromURL(SVNURL.parseURIEncoded(cfg.getUrl() + "String_Node_Str" + testProject.getName())));
    SVNLogEntry run=log.run();
    logger.trace("String_Node_Str" + testProject.getFullName() + "String_Node_Str");
    return (int)(run.getRevision() - localRevision.getNumber());
  }
 catch (  SVNException e) {
    logger.error(e.getMessage(),e);
    throw new SystemException(e.getLocalizedMessage(),e);
  }
}