nus-yam/ex-repair huggingface dataset:
Program: 48229
Project: 48229
Buggy source:
@Test public void testAttributeIndex() throws SirixException {
}

Fixed version (ground truth):
@Test public void testAttributeIndex() throws SirixException, PathException {
  final XdmNodeWriteTrx wtx=holder.getResourceManager().beginNodeWriteTrx();
  final IndexController indexController=holder.getResourceManager().getWtxIndexController(wtx.getRevisionNumber() - 1);
  final IndexDef idxDef=IndexDefs.createCASIdxDef(false,Optional.ofNullable(Type.STR),Collections.singleton(Path.parse("String_Node_Str")),0);
  indexController.createIndexes(ImmutableSet.of(idxDef),wtx);
  wtx.insertElementAsFirstChild(new QNm("String_Node_Str"));
  wtx.insertAttribute(new QNm("String_Node_Str"),"String_Node_Str",Movement.TOPARENT);
  wtx.insertAttribute(new QNm("String_Node_Str"),"String_Node_Str",Movement.TOPARENT);
  wtx.insertElementAsFirstChild(new QNm("String_Node_Str"));
  wtx.insertAttribute(new QNm("String_Node_Str"),"String_Node_Str",Movement.TOPARENT);
  wtx.insertAttribute(new QNm("String_Node_Str"),"String_Node_Str",Movement.TOPARENT);
  wtx.moveTo(1);
  wtx.insertElementAsFirstChild(new QNm("String_Node_Str"));
  wtx.insertAttribute(new QNm("String_Node_Str"),"String_Node_Str",Movement.TOPARENT);
  wtx.commit();
  final IndexDef indexDef=indexController.getIndexes().getIndexDef(0,IndexType.CAS);
  final AVLTreeReader<CASValue,NodeReferences> reader=AVLTreeReader.getInstance(wtx.getPageTrx(),indexDef.getType(),indexDef.getID());
  final Optional<NodeReferences> fooRefs=reader.get(new CASValue(new Str("String_Node_Str"),Type.STR,1),SearchMode.EQUAL);
  assertTrue(!fooRefs.isPresent());
  final Optional<NodeReferences> bazRefs1=reader.get(new CASValue(new Str("String_Node_Str"),Type.STR,3),SearchMode.EQUAL);
  check(bazRefs1,ImmutableSet.of(3L));
  final Optional<NodeReferences> bazRefs2=reader.get(new CASValue(new Str("String_Node_Str"),Type.STR,8),SearchMode.EQUAL);
  check(bazRefs2,ImmutableSet.of(8L));
}
Program: 48230
Project: 48230
Buggy source:
/** 
 * Providing different implementations of the   {@link ByteHandler} as Dataprovider to the testclass.
 * @return different classes of the {@link ByteHandler}
 * @throws SirixIOException if an I/O error occurs
 */
@DataProvider(name="String_Node_Str") public Object[][] instantiateStorages() throws SirixIOException {
  Object[][] returnVal={{Storage.class,new Storage[]{new FileStorage(mResourceConfig),new BerkeleyStorageFactory().createStorage(mResourceConfig),new RAMStorage(mResourceConfig)}}};
  return returnVal;
}

Fixed version (ground truth):
/** 
 * Providing different implementations of the   {@link ByteHandler} as Dataprovider to the testclass.
 * @return different classes of the {@link ByteHandler}
 * @throws SirixIOException if an I/O error occurs
 */
@DataProvider(name="String_Node_Str") public Object[][] instantiateStorages() throws SirixIOException {
  Object[][] returnVal={{Storage.class,new Storage[]{new FileStorage(mResourceConfig),BerkeleyStorageFactory.createStorage(mResourceConfig),new RAMStorage(mResourceConfig)}}};
  return returnVal;
}
Program: 48231
Project: 48231
Buggy source:
@Override public void objectToEntry(final Page page,final TupleOutput output){
  try {
    final DataOutputStream outputData=new DataOutputStream(output);
    PagePersistenter.serializePage(outputData,page);
    mByteHandler.serialize(outputData);
    output.close();
  }
 catch (  final IOException e) {
    LOGGER.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void objectToEntry(final Page page,final TupleOutput output){
  try {
    final DataOutputStream dataOutput=new DataOutputStream(mByteHandler.serialize(output));
    PagePersistenter.serializePage(dataOutput,page);
    ByteStreams.copy(new ByteArrayInputStream(output.toByteArray()),dataOutput);
    dataOutput.close();
  }
 catch (  final IOException e) {
    LOGGER.error(e.getMessage(),e);
  }
}
Program: 48234
Project: 48234
Buggy source:
@Override public AbstractTemporalNode<DBNode> add(SubtreeParser parser) throws OperationNotSupportedException, DocumentException {
  try {
    final String resource="String_Node_Str" + mResources++;
    mDatabase.createResource(ResourceConfiguration.newBuilder(resource,mDatabase.getDatabaseConfig()).useDeweyIDs().build());
    final Session session=mDatabase.getSession(SessionConfiguration.newBuilder(resource).build());
    final NodeWriteTrx wtx=session.beginNodeWriteTrx();
    final SubtreeHandler handler=new SubtreeBuilder(this,wtx,Insert.ASFIRSTCHILD,Collections.<SubtreeListener<? super AbstractTemporalNode<DBNode>>>emptyList());
    if (!(parser instanceof CollectionParser)) {
      parser=new CollectionParser(parser);
    }
    parser.parse(handler);
    return new DBNode(wtx,this);
  }
 catch (  final SirixException e) {
    LOGGER.error(e.getMessage(),e);
    return null;
  }
}

Fixed version (ground truth):
@Override public AbstractTemporalNode<DBNode> add(SubtreeParser parser) throws OperationNotSupportedException, DocumentException {
  try {
    final String resource=new StringBuilder(2).append("String_Node_Str").append(mDatabase.listResources().length + 1).toString();
    mDatabase.createResource(ResourceConfiguration.newBuilder(resource,mDatabase.getDatabaseConfig()).useDeweyIDs().build());
    final Session session=mDatabase.getSession(SessionConfiguration.newBuilder(resource).build());
    final NodeWriteTrx wtx=session.beginNodeWriteTrx();
    final SubtreeHandler handler=new SubtreeBuilder(this,wtx,Insert.ASFIRSTCHILD,Collections.<SubtreeListener<? super AbstractTemporalNode<DBNode>>>emptyList());
    if (!(parser instanceof CollectionParser)) {
      parser=new CollectionParser(parser);
    }
    parser.parse(handler);
    return new DBNode(wtx,this);
  }
 catch (  final SirixException e) {
    LOGGER.error(e.getMessage(),e);
    return null;
  }
}
Program: 48236
Project: 48236
Buggy source:
/** 
 * Constructor. Initializes the internal state.
 * @param rtx exclusive (immutable) trx to iterate with
 * @param childAxis producer axis
 */
public ConcurrentAxis(final @Nonnull NodeReadTrx rtx,final @Nonnull Axis childAxis){
  super(rtx);
  if (rtx.equals(childAxis.getTrx())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mResults=new ArrayBlockingQueue<>(M_CAPACITY);
  mFirst=true;
  mProducer=checkNotNull(childAxis);
  task=new ConcurrentAxisHelper(mProducer,mResults);
  mFinished=false;
}

Fixed version (ground truth):
/** 
 * Constructor. Initializes the internal state.
 * @param rtx exclusive (immutable) trx to iterate with
 * @param childAxis producer axis
 */
public ConcurrentAxis(final @Nonnull NodeReadTrx rtx,final @Nonnull Axis childAxis){
  super(rtx);
  if (!rtx.equals(childAxis.getTrx())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mResults=new ArrayBlockingQueue<>(M_CAPACITY);
  mFirst=true;
  mProducer=checkNotNull(childAxis);
  task=new ConcurrentAxisHelper(mProducer,mResults);
  mFinished=false;
}
Program: 48237
Project: 48237
Buggy source:
@Override public DBNode getFirst(){
  moveRtx();
  final AbstractTemporalAxis axis=new FirstAxisTest(mRtx.getSession(),mNodeKey);
  return axis.hasNext() ? new DBNode(axis.getTrx(),mCollection) : null;
}

Fixed version (ground truth):
@Override public DBNode getFirst(){
  moveRtx();
  final AbstractTemporalAxis axis=new FirstAxis(mRtx.getSession(),mNodeKey);
  return axis.hasNext() ? new DBNode(axis.getTrx(),mCollection) : null;
}
Program: 48238
Project: 48238
Buggy source:
@Override public <K extends Comparable<? super K>,V extends Record,S extends KeyValuePage<K,V>>RecordPageContainer<S> getRecordPageContainer(final @Nonnull @Nonnegative Long recordPageKey,final @Nonnull PageKind pageKind) throws SirixIOException {
  assertNotClosed();
  checkArgument(recordPageKey >= 0,"String_Node_Str");
  @SuppressWarnings("String_Node_Str") final List<S> revs=(List<S>)getSnapshotPages(checkNotNull(recordPageKey),checkNotNull(pageKind));
  if (revs.size() == 0) {
    @SuppressWarnings("String_Node_Str") final RecordPageContainer<S> emptyInstance=(RecordPageContainer<S>)RecordPageContainer.EMPTY_INSTANCE;
    return emptyInstance;
  }
  final int mileStoneRevision=mResourceConfig.mRevisionsToRestore;
  final Revisioning revisioning=mResourceConfig.mRevisionKind;
  final S completePage=revisioning.combineRecordPages(revs,mileStoneRevision,this);
  return new RecordPageContainer<S>(completePage);
}

Fixed version (ground truth):
@Override public <K extends Comparable<? super K>,V extends Record,S extends KeyValuePage<K,V>>RecordPageContainer<S> getRecordPageContainer(final @Nonnull @Nonnegative Long recordPageKey,final @Nonnull PageKind pageKind) throws SirixIOException {
  assertNotClosed();
  checkArgument(recordPageKey >= 0,"String_Node_Str");
  final List<S> revs=(List<S>)this.<K,V,S>getSnapshotPages(checkNotNull(recordPageKey),checkNotNull(pageKind));
  if (revs.size() == 0) {
    return RecordPageContainer.<S>emptyInstance();
  }
  final int mileStoneRevision=mResourceConfig.mRevisionsToRestore;
  final Revisioning revisioning=mResourceConfig.mRevisionKind;
  final S completePage=revisioning.combineRecordPages(revs,mileStoneRevision,this);
  return new RecordPageContainer<S>(completePage);
}
Program: 48239
Project: 48239
Buggy source:
@Override public Optional<Record> getRecord(final @Nonnegative long nodeKey,final @Nonnull PageKind page) throws SirixIOException {
  checkArgument(nodeKey >= Fixed.NULL_NODE_KEY.getStandardProperty());
  checkNotNull(page);
  final long nodePageKey=mPageRtx.nodePageKey(nodeKey);
  final RecordPageContainer<UnorderedKeyValuePage> pageCont=getPageContainer(page,nodePageKey);
  if (pageCont.equals(RecordPageContainer.EMPTY_INSTANCE)) {
    return mPageRtx.getRecord(nodeKey,page);
  }
 else {
    Record node=pageCont.getModified().getRecord(nodeKey);
    if (node == null) {
      node=pageCont.getComplete().getRecord(nodeKey);
    }
    return mPageRtx.checkItemIfDeleted(node);
  }
}

Fixed version (ground truth):
@Override public Optional<Record> getRecord(final @Nonnegative long nodeKey,final @Nonnull PageKind page) throws SirixIOException {
  checkArgument(nodeKey >= Fixed.NULL_NODE_KEY.getStandardProperty());
  checkNotNull(page);
  final long nodePageKey=mPageRtx.nodePageKey(nodeKey);
  final RecordPageContainer<UnorderedKeyValuePage> pageCont=getUnorderedRecordPageContainer(page,nodePageKey);
  if (pageCont.equals(RecordPageContainer.EMPTY_INSTANCE)) {
    return mPageRtx.getRecord(nodeKey,page);
  }
 else {
    Record node=pageCont.getModified().getRecord(nodeKey);
    if (node == null) {
      node=pageCont.getComplete().getRecord(nodeKey);
    }
    return mPageRtx.checkItemIfDeleted(node);
  }
}
Program: 48240
Project: 48240
Buggy source:
@SuppressWarnings("String_Node_Str") public static final <T extends KeyValuePage<?,?>>RecordPageContainer<T> emptyInstance(){
  return (RecordPageContainer<T>)EMPTY_INSTANCE;
}

Fixed version (ground truth):
/** 
 * Get the empty instance (parameterized).
 * @return the empty instance
 */
@SuppressWarnings("String_Node_Str") public static final <T extends KeyValuePage<?,?>>RecordPageContainer<T> emptyInstance(){
  return (RecordPageContainer<T>)EMPTY_INSTANCE;
}
Program: 48241
Project: 48241
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void propertyChange(final PropertyChangeEvent pEvent){
switch (pEvent.getPropertyName().toLowerCase()) {
case "String_Node_Str":
    mRevision=(long)pEvent.getNewValue();
  break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
mLastOldMaxDepth=(Integer)pEvent.getNewValue();
if (mContainer.getCompare() == ECompare.HYBRID) {
if (ECompare.HYBRID.getValue()) {
firePropertyChange("String_Node_Str",null,mLastOldMaxDepth);
}
}
 else {
firePropertyChange("String_Node_Str",null,mLastOldMaxDepth);
}
break;
case "String_Node_Str":
mLastMaxDepth=(Integer)pEvent.getNewValue();
if (mContainer.getCompare() == ECompare.HYBRID) {
if (ECompare.HYBRID.getValue()) {
firePropertyChange("String_Node_Str",null,mLastMaxDepth);
}
}
 else {
firePropertyChange("String_Node_Str",null,mLastMaxDepth);
}
break;
case "String_Node_Str":
POOL.submit(new Callable<Void>(){
@Override public Void call() throws Exception {
processDone();
return null;
}
}
);
break;
case "String_Node_Str":
mItems=(List<SunburstItem>)pEvent.getNewValue();
break;
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void propertyChange(final PropertyChangeEvent pEvent){
switch (pEvent.getPropertyName().toLowerCase()) {
case "String_Node_Str":
    mRevision=(int)pEvent.getNewValue();
  break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
firePropertyChange("String_Node_Str",null,pEvent.getNewValue());
break;
case "String_Node_Str":
mLastOldMaxDepth=(Integer)pEvent.getNewValue();
if (mContainer.getCompare() == ECompare.HYBRID) {
if (ECompare.HYBRID.getValue()) {
firePropertyChange("String_Node_Str",null,mLastOldMaxDepth);
}
}
 else {
firePropertyChange("String_Node_Str",null,mLastOldMaxDepth);
}
break;
case "String_Node_Str":
mLastMaxDepth=(Integer)pEvent.getNewValue();
if (mContainer.getCompare() == ECompare.HYBRID) {
if (ECompare.HYBRID.getValue()) {
firePropertyChange("String_Node_Str",null,mLastMaxDepth);
}
}
 else {
firePropertyChange("String_Node_Str",null,mLastMaxDepth);
}
break;
case "String_Node_Str":
POOL.submit(new Callable<Void>(){
@Override public Void call() throws Exception {
processDone();
return null;
}
}
);
break;
case "String_Node_Str":
mItems=(List<SunburstItem>)pEvent.getNewValue();
break;
}
}
Program: 48242
Project: 48242
Buggy source:
/** 
 * Draws into an off-screen buffer.
 */
private void updateBuffer(){
  mBuffer.pushMatrix();
  mBuffer.colorMode(PConstants.HSB,360,100,100,100);
  mBuffer.background(0,0,getBackgroundBrightness());
  mBuffer.ellipseMode(PConstants.RADIUS);
  mBuffer.strokeCap(PConstants.SQUARE);
  mBuffer.smooth();
  mBuffer.translate((float)mBuffer.width / 2f,(float)mBuffer.height / 2f);
  mBuffer.rotate(PApplet.radians(mRad));
  mBuffer.textFont(mFont);
  mBuffer.stroke(0);
  mBuffer.strokeWeight(2f);
  mBuffer.line(0,0,mBuffer.width * 0.5f,0);
  mBuffer.textSize(15f);
  mBuffer.fill(0f);
  mBuffer.textAlign(PConstants.LEFT,PConstants.BOTTOM);
  mBuffer.text("String_Node_Str",mBuffer.width * 0.5f - 60f,-20f + mBuffer.textAscent() - 2f);
  mBuffer.text("String_Node_Str",mBuffer.width * 0.5f - 60f,20f);
  drawArrow(mBuffer,(int)Math.round(mBuffer.width * 0.5f - 80),0,30,PConstants.PI * 0.5f);
  mBuffer.noFill();
  drawItems(EDraw.UPDATEBUFFER);
  mBuffer.popMatrix();
}

Fixed version (ground truth):
/** 
 * Draws into an off-screen buffer.
 */
private void updateBuffer(){
  mBuffer.pushMatrix();
  mBuffer.colorMode(PConstants.HSB,360,100,100,100);
  mBuffer.background(0,0,getBackgroundBrightness());
  mBuffer.ellipseMode(PConstants.RADIUS);
  mBuffer.strokeCap(PConstants.SQUARE);
  mBuffer.smooth();
  mBuffer.translate((float)mBuffer.width / 2f,(float)mBuffer.height / 2f);
  mBuffer.rotate(PApplet.radians(mRad));
  mBuffer.textFont(mFont);
  mBuffer.noFill();
  drawItems(EDraw.UPDATEBUFFER);
  mBuffer.stroke(0);
  mBuffer.strokeWeight(2f);
  mBuffer.line(0,0,mBuffer.width * 0.5f,0);
  mBuffer.textSize(15f);
  mBuffer.fill(0f);
  mBuffer.textAlign(PConstants.LEFT,PConstants.BOTTOM);
  mBuffer.text("String_Node_Str",mBuffer.width * 0.5f - 60f,-20f + mBuffer.textAscent() - 2f);
  mBuffer.text("String_Node_Str",mBuffer.width * 0.5f - 60f,20f);
  drawArrow(mBuffer,(int)Math.round(mBuffer.width * 0.5f - 80),0,30,PConstants.PI * 0.5f);
  mBuffer.popMatrix();
}
Program: 48243
Project: 48243
Buggy source:
/** 
 * Undo operation. 
 */
public void undo(){
  mDone=false;
  mLock.acquireUninterruptibly();
  if (!mImages.isEmpty()) {
    mImg=mImages.pop();
  }
  mLock.release();
  mDone=true;
}

Fixed version (ground truth):
/** 
 * Undo operation. 
 */
public void undo(){
  mDone=false;
  mLock.acquireUninterruptibly();
  if (!mImages.isEmpty()) {
    resetZoom();
    if (mUseDiffView == EView.DIFF && EView.DIFF.getValue() && mControl.getModel().getItemsSize() < ANIMATION_THRESHOLD) {
      mInit=true;
    }
 else {
      mInit=false;
    }
    mImg=mImages.pop();
  }
  mLock.release();
  mDone=true;
}
Program: 48245
Project: 48245
Buggy source:
@Override public void update(@Nonnull final IContainer<SunburstContainer> pContainer){
  mLastItems.push(new ArrayList<>(mItems));
  mLastDepths.push(mLastMaxDepth);
  traverseTree(pContainer);
}

Fixed version (ground truth):
@Override public void update(@Nonnull final IContainer<SunburstContainer> pContainer){
  mLastItems.push(new ArrayList<>(mItems));
  mLastDepths.push(mLastMaxDepth);
}
Program: 48246
Project: 48246
Buggy source:
public static void testReadWriteFirstRef(final ResourceConfiguration resourceConf) throws AbsTTException {
  final IStorage fac=EStorage.getStorage(resourceConf);
  final PageReference pageRef1=new PageReference();
  final UberPage page1=new UberPage();
  pageRef1.setPage(page1);
  final IWriter writer=fac.getWriter();
  writer.writeFirstReference(pageRef1);
  final PageReference pageRef2=writer.readFirstReference();
  assertEquals(pageRef1.getNodePageKey(),pageRef2.getNodePageKey());
  assertEquals(((UberPage)pageRef1.getPage()).getRevisionCount(),((UberPage)pageRef2.getPage()).getRevisionCount());
  writer.close();
  final IReader reader=fac.getReader();
  final PageReference pageRef3=reader.readFirstReference();
  assertEquals(pageRef1.getNodePageKey(),pageRef3.getNodePageKey());
  assertEquals(((UberPage)pageRef1.getPage()).getRevisionCount(),((UberPage)pageRef3.getPage()).getRevisionCount());
  reader.close();
  fac.close();
}

Fixed version (ground truth):
/** 
 * Test reading/writing the first reference.
 * @param resourceConf {@link ResourceConfiguration} reference
 * @throws AbsTTException if something went wrong
 */
public static void testReadWriteFirstRef(final ResourceConfiguration resourceConf) throws AbsTTException {
  final IStorage fac=EStorage.getStorage(resourceConf);
  final PageReference pageRef1=new PageReference();
  final UberPage page1=new UberPage();
  pageRef1.setPage(page1);
  final IWriter writer=fac.getWriter();
  writer.writeFirstReference(pageRef1);
  final PageReference pageRef2=writer.readFirstReference();
  assertEquals(pageRef1.getNodePageKey(),pageRef2.getNodePageKey());
  assertEquals(((UberPage)pageRef1.getPage()).getRevisionCount(),((UberPage)pageRef2.getPage()).getRevisionCount());
  writer.close();
  final IReader reader=fac.getReader();
  final PageReference pageRef3=reader.readFirstReference();
  assertEquals(pageRef1.getNodePageKey(),pageRef3.getNodePageKey());
  assertEquals(((UberPage)pageRef1.getPage()).getRevisionCount(),((UberPage)pageRef3.getPage()).getRevisionCount());
  reader.close();
  fac.close();
}
Program: 48247
Project: 48247
Buggy source:
private IOTestHelper(){
}

Fixed version (ground truth):
/** 
 * Private constructor. 
 */
private IOTestHelper(){
}
Program: 48248
Project: 48248
Buggy source:
/** 
 * Close caches.
 */
void closeCaches(){
  if (mPathLog.isPresent()) {
    mPathLog.get().close();
  }
  if (mValueLog.isPresent()) {
    mValueLog.get().close();
  }
  if (mNodeLog.isPresent()) {
    mNodeLog.get().close();
  }
  if (mPageLog.isPresent()) {
    mPageLog.get().close();
  }
}

Fixed version (ground truth):
/** 
 * Close caches.
 */
void closeCaches(){
  if (mPathLog.isPresent()) {
    mPathLog.get().close();
  }
  if (mValueLog.isPresent()) {
    mValueLog.get().close();
  }
  if (mNodeLog.isPresent()) {
    mNodeLog.get().close();
  }
  if (mPageLog.isPresent()) {
    mPageLog.get().close();
  }
  clearCaches();
}
Program: 48249
Project: 48249
Buggy source:
@Override public final boolean moveTo(final long pNodeKey){
  assertNotClosed();
  if (pNodeKey == EFixed.NULL_NODE_KEY.getStandardProperty()) {
    return false;
  }
  final INode oldNode=mCurrentNode;
  Optional<? extends INode> newNode;
  try {
    if (pNodeKey < 0) {
      if (mItemList.size() > 0) {
        newNode=mItemList.getItem(pNodeKey);
      }
 else {
        newNode=Optional.absent();
      }
    }
 else {
      @SuppressWarnings("String_Node_Str") final Optional<? extends INode> node=(Optional<? extends INode>)mPageReadTrx.getNode(pNodeKey,EPage.NODEPAGE);
      newNode=node;
    }
  }
 catch (  final TTIOException e) {
    newNode=Optional.absent();
  }
  if (newNode.isPresent()) {
    mCurrentNode=newNode.get();
    return true;
  }
 else {
    mCurrentNode=oldNode;
    return false;
  }
}

Fixed version (ground truth):
@Override public final boolean moveTo(final long pNodeKey){
  assertNotClosed();
  if (pNodeKey == EFixed.NULL_NODE_KEY.getStandardProperty()) {
    return false;
  }
  final INode oldNode=mCurrentNode;
  Optional<? extends INodeBase> newNode;
  try {
    if (pNodeKey < 0) {
      if (mItemList.size() > 0) {
        newNode=mItemList.getItem(pNodeKey);
      }
 else {
        newNode=Optional.absent();
      }
    }
 else {
      @SuppressWarnings("String_Node_Str") final Optional<? extends INodeBase> node=mPageReadTrx.getNode(pNodeKey,EPage.NODEPAGE);
      newNode=node;
    }
  }
 catch (  final TTIOException e) {
    newNode=Optional.absent();
  }
  if (newNode.isPresent()) {
    mCurrentNode=(INode)newNode.get();
    return true;
  }
 else {
    mCurrentNode=oldNode;
    return false;
  }
}
Program: 48250
Project: 48250
Buggy source:
/** 
 * Get a node from persistent storage.
 * @param pKey the unique node-ID
 * @param pPage the page from which to fetch the node
 * @return an {@link Optional} reference usually containing the node reference
 * @throws TTIOException if an I/O error occured
 */
Optional<INodeBase> getNode(@Nonnegative final long pKey,@Nonnull final EPage pPage) throws TTIOException ;

Fixed version (ground truth):
/** 
 * Get a node from persistent storage.
 * @param pKey the unique node-ID
 * @param pPage the page from which to fetch the node
 * @return an {@link Optional} reference usually containing the node reference
 * @throws TTIOException if an I/O error occured
 */
Optional<? extends INodeBase> getNode(@Nonnegative final long pKey,@Nonnull final EPage pPage) throws TTIOException ;
Program: 48251
Project: 48251
Buggy source:
private PathSummary(@Nonnull final IPageReadTrx pPageReadTrx){
  mPageReadTrx=pPageReadTrx;
  mClosed=false;
  try {
    @SuppressWarnings("String_Node_Str") final Optional<? extends INode> node=(Optional<? extends INode>)mPageReadTrx.getNode(EFixed.DOCUMENT_NODE_KEY.getStandardProperty(),EPage.PATHSUMMARYPAGE);
    if (node.isPresent()) {
      mCurrentNode=node.get();
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
  }
 catch (  final TTIOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private PathSummary(@Nonnull final IPageReadTrx pPageReadTrx){
  mPageReadTrx=pPageReadTrx;
  mClosed=false;
  try {
    final Optional<? extends INodeBase> node=mPageReadTrx.getNode(EFixed.DOCUMENT_NODE_KEY.getStandardProperty(),EPage.PATHSUMMARYPAGE);
    if (node.isPresent()) {
      mCurrentNode=(INode)node.get();
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
  }
 catch (  final TTIOException e) {
    e.printStackTrace();
  }
}
Program: 48252
Project: 48252
Buggy source:
/** 
 * Private constructor.
 * @param pPageWriteTrx {@link IPageWriteTrx} for persistent storage
 */
private AVLTree(final @Nonnull IPageWriteTrx pPageWriteTrx){
  mPageWriteTrx=pPageWriteTrx;
  mClosed=false;
  try {
    @SuppressWarnings("String_Node_Str") Optional<? extends INode> node=(Optional<? extends INode>)mPageWriteTrx.getNode(EFixed.DOCUMENT_NODE_KEY.getStandardProperty(),EPage.VALUEPAGE);
    if (node.isPresent()) {
      mCurrentNode=node.get();
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
  }
 catch (  final TTIOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Private constructor.
 * @param pPageWriteTrx {@link IPageWriteTrx} for persistent storage
 */
private AVLTree(final @Nonnull IPageWriteTrx pPageWriteTrx){
  mPageWriteTrx=pPageWriteTrx;
  mClosed=false;
  try {
    Optional<? extends INodeBase> node=mPageWriteTrx.getNode(EFixed.DOCUMENT_NODE_KEY.getStandardProperty(),EPage.VALUEPAGE);
    if (node.isPresent()) {
      mCurrentNode=(INode)node.get();
    }
 else {
      throw new IllegalStateException("String_Node_Str");
    }
  }
 catch (  final TTIOException e) {
    e.printStackTrace();
  }
}
Program: 48253
Project: 48253
Buggy source:
/** 
 * Closing a resource. This callback is necessary due to centralized handling of all sessions within a database.
 * @param pFile {@link File} to be closed
 * @return {@code true} if close successful, {@code false} otherwise
 */
protected boolean removeSession(@Nonnull final File pFile){
  return mSessions.remove(pFile) == null ? false : true;
}

Fixed version (ground truth):
/** 
 * Closing a resource. This callback is necessary due to centralized handling of all sessions within a database.
 * @param pFile {@link File} to be closed
 * @return {@code true} if close successful, {@code false} otherwise
 */
protected boolean removeSession(final @Nonnull File pFile){
  return mSessions.remove(pFile) == null ? false : true;
}
Program: 48254
Project: 48254
Buggy source:
/** 
 * Creating a database. This includes loading the database configuration, building up the structure and preparing everything for login.
 * @param pDBConfig which are used for the database, including storage location
 * @return true if creation is valid, false otherwise
 * @throws TTIOException if something odd happens within the creation process.
 */
public static synchronized boolean createDatabase(@Nonnull final DatabaseConfiguration pDBConfig) throws TTIOException {
  boolean returnVal=true;
  if (pDBConfig.getFile().exists()) {
    return false;
  }
 else {
    returnVal=pDBConfig.getFile().mkdirs();
    if (returnVal) {
      for (      DatabaseConfiguration.Paths paths : DatabaseConfiguration.Paths.values()) {
        final File toCreate=new File(pDBConfig.getFile().getAbsoluteFile(),paths.getFile().getName());
        if (paths.isFolder()) {
          returnVal=toCreate.mkdir();
        }
 else {
          try {
            returnVal=toCreate.createNewFile();
          }
 catch (          final IOException exc) {
            throw new TTIOException(exc);
          }
        }
        if (!returnVal) {
          break;
        }
      }
    }
    try {
      serializeConfiguration(pDBConfig);
    }
 catch (    final IOException exc) {
      throw new TTIOException(exc);
    }
    if (!returnVal) {
      pDBConfig.getFile().delete();
    }
    return returnVal;
  }
}

Fixed version (ground truth):
/** 
 * Creating a database. This includes loading the database configuration, building up the structure and preparing everything for login.
 * @param pDBConfig config which is used for the database, including storage location
 * @return true if creation is valid, false otherwise
 * @throws TTIOException if something odd happens within the creation process.
 */
public static synchronized boolean createDatabase(@Nonnull final DatabaseConfiguration pDBConfig) throws TTIOException {
  boolean returnVal=true;
  if (pDBConfig.getFile().exists()) {
    return false;
  }
 else {
    returnVal=pDBConfig.getFile().mkdirs();
    if (returnVal) {
      for (      DatabaseConfiguration.Paths paths : DatabaseConfiguration.Paths.values()) {
        final File toCreate=new File(pDBConfig.getFile().getAbsoluteFile(),paths.getFile().getName());
        if (paths.isFolder()) {
          returnVal=toCreate.mkdir();
        }
 else {
          try {
            returnVal=toCreate.createNewFile();
          }
 catch (          final IOException exc) {
            throw new TTIOException(exc);
          }
        }
        if (!returnVal) {
          break;
        }
      }
    }
    try {
      serializeConfiguration(pDBConfig);
    }
 catch (    final IOException exc) {
      throw new TTIOException(exc);
    }
    if (!returnVal) {
      pDBConfig.getFile().delete();
    }
    return returnVal;
  }
}
Program: 48255
Project: 48255
Buggy source:
/** 
 * Serializing any   {@link IConfigureSerializable} instance to a denotedfile.
 * @param pConf to be serializied, containing the file
 * @throws IOException if serialization fails
 */
private static void serializeConfiguration(@Nonnull final IConfigureSerializable pConf) throws IOException {
  try (final FileOutputStream os=new FileOutputStream(pConf.getConfigFile());final ObjectOutputStream en=new ObjectOutputStream(os)){
    en.writeObject(pConf);
  }
 }

Fixed version (ground truth):
/** 
 * Serializing any   {@link IConfigureSerializable} instance to a denotedfile.
 * @param pConf to be serializied, containing the file
 * @throws IOException if serialization fails
 */
private static void serializeConfiguration(final @Nonnull IConfigureSerializable pConf) throws IOException {
  try (final FileOutputStream os=new FileOutputStream(pConf.getConfigFile());final ObjectOutputStream en=new ObjectOutputStream(os)){
    en.writeObject(pConf);
  }
 }
Program: 48256
Project: 48256
Buggy source:
/** 
 * Open database. A database can be opened only once. Afterwards the singleton instance bound to the File is given back.
 * @param pFile determines where the database is located sessionConf a  {@link SessionConfiguration} object toset up the session
 * @return {@link IDatabase} instance.
 * @throws AbsTTException if something odd happens
 */
public static synchronized IDatabase openDatabase(@Nonnull final File pFile) throws AbsTTException {
  if (!pFile.exists()) {
    throw new TTUsageException("String_Node_Str",pFile.toString());
  }
  DatabaseConfiguration config=null;
  try (final FileInputStream is=new FileInputStream(new File(pFile.getAbsoluteFile(),DatabaseConfiguration.Paths.ConfigBinary.getFile().getName()));final ObjectInputStream de=new ObjectInputStream(is)){
    config=(DatabaseConfiguration)de.readObject();
  }
 catch (  final IOException exc) {
    throw new TTIOException(exc);
  }
catch (  final ClassNotFoundException exc) {
    throw new TTIOException(exc.toString());
  }
  if (config == null) {
    throw new IllegalStateException();
  }
  final Database database=new Database(config);
  final IDatabase returnVal=DATABASEMAP.putIfAbsent(pFile,database);
  if (returnVal == null) {
    return database;
  }
 else {
    return returnVal;
  }
}

Fixed version (ground truth):
/** 
 * Open database. A database can be opened only once. Afterwards a singleton instance bound to the   {@link File} is returned.
 * @param pFile determines where the database is located sessionConf a  {@link SessionConfiguration} object toset up the session
 * @return {@link IDatabase} instance.
 * @throws AbsTTException if something odd happens
 * @throws NullPointerException if  {@code pFile} is {@code null}
 */
public static synchronized IDatabase openDatabase(final @Nonnull File pFile) throws AbsTTException {
  if (!pFile.exists()) {
    throw new TTUsageException("String_Node_Str",pFile.toString());
  }
  DatabaseConfiguration config=null;
  try (final FileInputStream is=new FileInputStream(new File(pFile.getAbsoluteFile(),DatabaseConfiguration.Paths.ConfigBinary.getFile().getName()));final ObjectInputStream de=new ObjectInputStream(is)){
    config=(DatabaseConfiguration)de.readObject();
  }
 catch (  final IOException exc) {
    throw new TTIOException(exc);
  }
catch (  final ClassNotFoundException exc) {
    throw new TTIOException(exc.toString());
  }
  if (config == null) {
    throw new IllegalStateException();
  }
  final Database database=new Database(config);
  final IDatabase returnVal=DATABASEMAP.putIfAbsent(pFile,database);
  if (returnVal == null) {
    return database;
  }
 else {
    return returnVal;
  }
}
Program: 48257
Project: 48257
Buggy source:
@Override public synchronized ISession getSession(@Nonnull final SessionConfiguration pSessionConf) throws AbsTTException {
}

Fixed version (ground truth):
@Override public synchronized ISession getSession(final @Nonnull SessionConfiguration pSessionConf) throws AbsTTException {
}
Program: 48260
Project: 48260
Buggy source:
/** 
 * Insert a path node as first child.
 * @param pQName {@link QName} of the path node (not stored) twice
 * @return this {@link WriteTransaction} instance
 * @throws AbsTTException if an I/O error occurs
 */
private INodeWriteTrx insertPathAsFirstChild(@Nonnull final QName pQName,final EKind pKind,final int pLevel) throws AbsTTException {
  if (!XMLToken.isValidQName(checkNotNull(pQName))) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkAccessAndCommit();
  final long parentKey=mPathSummary.getNode().getNodeKey();
  final long leftSibKey=EFixed.NULL_NODE_KEY.getStandardProperty();
  final long rightSibKey=mPathSummary.getStructuralNode().getFirstChildKey();
  final PathNode node=createPathNode(parentKey,leftSibKey,rightSibKey,0,pQName,pKind,pLevel);
  mPathSummary.setCurrentNode(node);
  adaptForInsert(node,EInsertPos.ASFIRSTCHILD,EPage.PATHSUMMARYPAGE);
  mPathSummary.setCurrentNode(node);
  return this;
}

Fixed version (ground truth):
/** 
 * Insert a path node as first child.
 * @param pQName {@link QName} of the path node (not stored) twice
 * @param pKind kind of node to index
 * @param pLevel level in the path summary
 * @return this {@link WriteTransaction} instance
 * @throws AbsTTException if an I/O error occurs
 */
private INodeWriteTrx insertPathAsFirstChild(@Nonnull final QName pQName,final EKind pKind,final int pLevel) throws AbsTTException {
  if (!XMLToken.isValidQName(checkNotNull(pQName))) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  checkAccessAndCommit();
  final long parentKey=mPathSummary.getNode().getNodeKey();
  final long leftSibKey=EFixed.NULL_NODE_KEY.getStandardProperty();
  final long rightSibKey=mPathSummary.getStructuralNode().getFirstChildKey();
  final PathNode node=createPathNode(parentKey,leftSibKey,rightSibKey,0,pQName,pKind,pLevel);
  mPathSummary.setCurrentNode(node);
  adaptForInsert(node,EInsertPos.ASFIRSTCHILD,EPage.PATHSUMMARYPAGE);
  mPathSummary.setCurrentNode(node);
  return this;
}
Program: 48261
Project: 48261
Buggy source:
/** 
 * Checking a structure in a folder to be equal with the data in this enum.
 * @param pFile to be checked
 * @return -1 if less folders are there, 0 if the structure is equal tothe one expected, 1 if the structure has more folders
 */
public static int compareStructure(@Nonnull final File pFile){
  checkNotNull(pFile);
  int existing=0;
  for (  final Paths paths : values()) {
    final File currentFile=new File(pFile,paths.getFile().getName());
    if (currentFile.exists()) {
      existing++;
    }
  }
  return existing - values().length;
}

Fixed version (ground truth):
/** 
 * Checking a structure in a folder to be equal with the data in this enum.
 * @param pFile to be checked
 * @return -1 if less folders are there, 0 if the structure is equal tothe one expected, 1 if the structure has more folders
 */
public static int compareStructure(final @Nonnull File pFile){
  checkNotNull(pFile);
  int existing=0;
  for (  final Paths paths : values()) {
    final File currentFile=new File(pFile,paths.getFile().getName());
    if (currentFile.exists()) {
      existing++;
    }
  }
  return existing - values().length;
}
Program: 48262
Project: 48262
Buggy source:
/** 
 * Constructor with the path to be set.
 * @param pFile file to be set
 */
public DatabaseConfiguration(@Nonnull final File pFile){
  mBinaryVersion=BINARY;
  mFile=pFile.getAbsoluteFile();
}

Fixed version (ground truth):
/** 
 * Constructor with the path to be set.
 * @param pFile file to be set
 */
public DatabaseConfiguration(final @Nonnull File pFile){
  mBinaryVersion=BINARY;
  mFile=pFile.getAbsoluteFile();
}
Program: 48263
Project: 48263
Buggy source:
@Override public boolean equals(@Nullable final Object pObj){
  if (pObj instanceof DatabaseConfiguration) {
    final DatabaseConfiguration other=(DatabaseConfiguration)pObj;
    return Objects.equal(mFile,other.mFile) && Objects.equal(mBinaryVersion,other.mBinaryVersion);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(final @Nullable Object pObj){
  if (pObj instanceof DatabaseConfiguration) {
    final DatabaseConfiguration other=(DatabaseConfiguration)pObj;
    return Objects.equal(mFile,other.mFile) && Objects.equal(mBinaryVersion,other.mBinaryVersion);
  }
  return false;
}
Program: 48264
Project: 48264
Buggy source:
/** 
 * Test concurrent.
 * @throws TTXPathException
 */
@Bench @Test public final void testPartConcurrentDescAxis1(){
  final int resultNumber=55;
  try {
    final INodeReadTrx firstConcurrRtx=holder.getSession().beginNodeReadTrx();
    final IAxis axis=new NestedAxis(new NestedAxis(new ConcurrentAxis(firstConcurrRtx,new FilterAxis(new DescendantAxis(holder.getRtx(),EIncludeSelf.YES),new NameFilter(holder.getRtx(),"String_Node_Str"))),new FilterAxis(new ChildAxis(holder.getRtx()),new NameFilter(holder.getRtx(),"String_Node_Str"))),new FilterAxis(new DescendantAxis(holder.getRtx(),EIncludeSelf.YES),new NameFilter(holder.getRtx(),"String_Node_Str")));
    for (int i=0; i < resultNumber; i++) {
      assertEquals(true,axis.hasNext());
      axis.next();
    }
    assertEquals(false,axis.hasNext());
  }
 catch (  final AbsTTException e) {
    fail();
  }
}

Fixed version (ground truth):
/** 
 * Test concurrent.
 * @throws TTXPathException
 */
@Bench @Test public final void testPartConcurrentDescAxis1(){
  final int resultNumber=55;
  try {
    final INodeReadTrx firstConcurrRtx=holder.getSession().beginNodeReadTrx();
    final IAxis axis=new NestedAxis(new NestedAxis(new ConcurrentAxis(firstConcurrRtx,new FilterAxis(new DescendantAxis(holder.getRtx(),EIncludeSelf.YES),new NameFilter(holder.getRtx(),"String_Node_Str"))),new FilterAxis(new ChildAxis(firstConcurrRtx),new NameFilter(firstConcurrRtx,"String_Node_Str"))),new FilterAxis(new DescendantAxis(firstConcurrRtx,EIncludeSelf.YES),new NameFilter(firstConcurrRtx,"String_Node_Str")));
    for (int i=0; i < resultNumber; i++) {
      assertEquals(true,axis.hasNext());
      axis.next();
    }
    assertEquals(false,axis.hasNext());
  }
 catch (  final AbsTTException e) {
    fail();
  }
}
Program: 48265
Project: 48265
Buggy source:
/** 
 * Test concurrent.
 * @throws TTXPathException
 */
@Bench @Test public final void testPartConcurrentDescAxis2(){
  final int resultNumber=55;
  try {
    final INodeReadTrx firstConcurrRtx=holder.getSession().beginNodeReadTrx();
    final IAxis axis=new NestedAxis(new NestedAxis(new FilterAxis(new DescendantAxis(holder.getRtx(),EIncludeSelf.YES),new NameFilter(holder.getRtx(),"String_Node_Str")),new FilterAxis(new ChildAxis(holder.getRtx()),new NameFilter(holder.getRtx(),"String_Node_Str"))),new ConcurrentAxis(firstConcurrRtx,new FilterAxis(new DescendantAxis(holder.getRtx(),EIncludeSelf.YES),new NameFilter(holder.getRtx(),"String_Node_Str"))));
    for (int i=0; i < resultNumber; i++) {
      assertEquals(true,axis.hasNext());
      axis.next();
    }
    assertEquals(axis.hasNext(),false);
  }
 catch (  final AbsTTException e) {
    fail();
  }
}

Fixed version (ground truth):
/** 
 * Test concurrent.
 * @throws TTXPathException
 */
@Bench @Test public final void testPartConcurrentDescAxis2(){
  final int resultNumber=55;
  try {
    final INodeReadTrx firstConcurrRtx=holder.getSession().beginNodeReadTrx();
    final IAxis axis=new NestedAxis(new NestedAxis(new FilterAxis(new DescendantAxis(firstConcurrRtx,EIncludeSelf.YES),new NameFilter(firstConcurrRtx,"String_Node_Str")),new FilterAxis(new ChildAxis(firstConcurrRtx),new NameFilter(firstConcurrRtx,"String_Node_Str"))),new ConcurrentAxis(firstConcurrRtx,new FilterAxis(new DescendantAxis(holder.getRtx(),EIncludeSelf.YES),new NameFilter(holder.getRtx(),"String_Node_Str"))));
    for (int i=0; i < resultNumber; i++) {
      assertEquals(true,axis.hasNext());
      axis.next();
    }
    assertEquals(axis.hasNext(),false);
  }
 catch (  final AbsTTException e) {
    fail();
  }
}
Program: 48266
Project: 48266
Buggy source:
public String getMgtIpAddress(){
  try {
    return ipConfigs.get(NetTrafficType.MGT_NETWORK).get(0).getIpAddress();
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
public String getMgtIpAddress(){
  try {
    return ipConfigs.get(NetTrafficType.MGT_NETWORK).get(0).getIpAddress();
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + name + "String_Node_Str"+ e.getMessage());
    return null;
  }
}
Program: 48267
Project: 48267
Buggy source:
public String getHostname(){
  return hostname;
}

Fixed version (ground truth):
public String getHostname(){
  if (hostname == null || hostname.isEmpty() || "String_Node_Str".equalsIgnoreCase(hostname) || "String_Node_Str".equalsIgnoreCase(hostname)) {
    return getMgtFqdn();
  }
 else {
    return hostname;
  }
}
Program: 48269
Project: 48269
Buggy source:
private List<String> getFqdnsWithRole(ClusterBlueprint blueprint,String role){
  List<String> fqdns=new ArrayList<String>();
  for (  NodeGroupInfo group : blueprint.getNodeGroups()) {
    if (group.getRoles().contains(role)) {
      for (      NodeInfo node : group.getNodes()) {
        fqdns.add(node.getHostname());
      }
    }
  }
  return fqdns;
}

Fixed version (ground truth):
private List<String> getFqdnsWithRole(ClusterBlueprint blueprint,String role){
  List<String> fqdns=new ArrayList<String>();
  for (  NodeGroupInfo group : blueprint.getNodeGroups()) {
    if (group.getRoles().contains(role)) {
      for (      NodeInfo node : group.getNodes()) {
        fqdns.add(node.getMgtFqdn());
      }
    }
  }
  return fqdns;
}
Program: 48270
Project: 48270
Buggy source:
public String getConfigurations(String appMgrName,String distroName){
  final String path=Constants.REST_PATH_APPMANAGER + "String_Node_Str" + appMgrName+ "String_Node_Str"+ Constants.REST_PATH_DISTRO+ "String_Node_Str"+ distroName+ "String_Node_Str"+ Constants.REST_PATH_CONFIGURATIONS;
  final HttpMethod httpverb=HttpMethod.GET;
  return restClient.getAllObjects(String.class,path,httpverb,false);
}

Fixed version (ground truth):
public String getConfigurations(String appMgrName,String distroName){
  final String path=Constants.REST_PATH_APPMANAGER + "String_Node_Str" + appMgrName+ "String_Node_Str"+ Constants.REST_PATH_DISTRO+ "String_Node_Str"+ distroName+ "String_Node_Str"+ Constants.REST_PATH_CONFIGURATIONS;
  return restClient.getContentAsString(Constants.HTTPS_CONNECTION_API + path);
}
Program: 48271
Project: 48271
Buggy source:
/** 
 * Disconnect the session
 */
public void disconnect(){
  try {
    checkConnection();
    logout(Constants.REST_PATH_LOGOUT,String.class);
  }
 catch (  CliRestException cliRestException) {
    if (cliRestException.getStatus() == HttpStatus.UNAUTHORIZED) {
      writeCookieInfo("String_Node_Str");
    }
  }
catch (  Exception e) {
    System.out.println(Constants.DISCONNECT_FAILURE + "String_Node_Str" + CommandsUtils.getExceptionMessage(e));
  }
}

Fixed version (ground truth):
/** 
 * Disconnect the session
 */
public void disconnect(){
  try {
    checkConnection();
    getContentAsString(Constants.REST_PATH_LOGOUT);
  }
 catch (  CliRestException cliRestException) {
    if (cliRestException.getStatus() == HttpStatus.UNAUTHORIZED) {
      writeCookieInfo("String_Node_Str");
    }
  }
catch (  Exception e) {
    System.out.println(Constants.DISCONNECT_FAILURE + "String_Node_Str" + CommandsUtils.getExceptionMessage(e));
  }
}
Program: 48272
Project: 48272
Buggy source:
public void handleError(ClientHttpResponse response) throws IOException {
  MediaType contentType=response.getHeaders().getContentType();
  String body=getResponseContent(response.getBody());
  if (MediaType.APPLICATION_JSON.includes(contentType)) {
    ObjectMapper objectMapper=new ObjectMapper();
    BddErrorMessage errorMessage=objectMapper.readValue(body,BddErrorMessage.class);
    if (errorMessage.getErrors() != null) {
      throw new ValidationException(errorMessage.getErrors());
    }
    if (errorMessage.getCertInfo() != null) {
      throw new UntrustedCertificateException(errorMessage.getCertInfo());
    }
    if (errorMessage.isWarning()) {
      throw new WarningMessageException(errorMessage.getMessage());
    }
    throw new CliRestException(errorMessage.getMessage());
  }
 else {
    HttpStatus statusCode=response.getStatusCode();
    String errorMsg="String_Node_Str";
    if (statusCode == HttpStatus.UNAUTHORIZED) {
      errorMsg=Constants.CONNECT_SESSION_TIME_OUT;
    }
 else     if (statusCode == HttpStatus.INTERNAL_SERVER_ERROR) {
      errorMsg="String_Node_Str" + getVCConnectErrorMsg(body);
    }
 else     if (statusCode == HttpStatus.METHOD_NOT_ALLOWED) {
      errorMsg=body;
      if (errorMsg.isEmpty()) {
        errorMsg=statusCode.getReasonPhrase();
      }
    }
 else {
      errorMsg=statusCode.getReasonPhrase();
    }
    throw new CliRestException(statusCode,errorMsg);
  }
}

Fixed version (ground truth):
public void handleError(ClientHttpResponse response) throws IOException {
  MediaType contentType=response.getHeaders().getContentType();
  String body=getResponseContent(response.getBody());
  if (MediaType.APPLICATION_JSON.includes(contentType)) {
    ObjectMapper objectMapper=new ObjectMapper();
    BddErrorMessage errorMessage=objectMapper.readValue(body,BddErrorMessage.class);
    if (errorMessage.getErrors() != null) {
      throw new ValidationException(errorMessage.getErrors());
    }
    if (errorMessage.getCertInfo() != null) {
      throw new UntrustedCertificateException(errorMessage.getCertInfo());
    }
    if (errorMessage.isWarning()) {
      throw new WarningMessageException(errorMessage.getMessage());
    }
    throw new CliRestException(errorMessage.getMessage());
  }
 else {
    HttpStatus statusCode=response.getStatusCode();
    handleHttpErrCode(statusCode,body);
  }
}
Program: 48273
Project: 48273
Buggy source:
private String getVCConnectErrorMsg(String content){
  return findErrorMsg(content,"String_Node_Str");
}

Fixed version (ground truth):
private static String getVCConnectErrorMsg(String content){
  return findErrorMsg(content,"String_Node_Str");
}