nus-yam/ex-repair huggingface dataset:
Program: 130963
Project: 130963
Buggy source:
@Override public void run(){
  Log.debug(isAboutToExpire ? "String_Node_Str" : "String_Node_Str");
  Tokens tokens=null;
  try {
    tokens=oauthClient.getTokensForClient(tokenEndpoint,clientID,clientSecret,"String_Node_Str" + projectID).get();
  }
 catch (  Exception e) {
    update(null,e);
    return;
  }
  update(tokens,null);
}

Fixed version (ground truth):
@Override public void run(){
  beginRefresh();
}
Program: 130964
Project: 130964
Buggy source:
public String accessToken(){
synchronized (accessTokenLock) {
    while (!accessToken.isPresent()) {
      try {
        accessTokenLock.wait();
      }
 catch (      InterruptedException e) {
      }
    }
    Validation<AccessToken> tokenValidation=accessToken.get();
    if (tokenValidation.isError()) {
      beginRefresh(false);
      throw tokenValidation.exception();
    }
    AccessToken token=tokenValidation.value();
    if (token.remainingMs().isPresent()) {
      if (token.remainingMs().get() < Defaults.tokenAboutToExpireMs) {
        beginRefresh(true);
      }
    }
    return token.accessToken();
  }
}

Fixed version (ground truth):
public String accessToken(){
synchronized (accessTokenLock) {
    Optional<Validation<AccessToken>> token=waitForTokenAndClearIfExpired();
    if (!token.isPresent()) {
      Log.warn("String_Node_Str");
      beginRefresh();
      token=waitForTokenAndClearIfExpired();
    }
    if (!token.isPresent()) {
      throw new AssertionError("String_Node_Str");
    }
    if (token.get().isError()) {
      beginRefresh();
      throw token.get().exception();
    }
    return token.get().value().accessToken();
  }
}
Program: 130965
Project: 130965
Buggy source:
/** 
 * {@inheritDoc}  
 */
public CommandRequestBuilder<Order> order(String cartId,String cartVersion){
  return order(cartId,cartVersion,null);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}  
 */
public CommandRequestBuilder<Order> order(String cartId,int cartVersion){
  return order(cartId,cartVersion,null);
}
Program: 130966
Project: 130966
Buggy source:
public UpdateShipmentState(String id,String version,ShipmentState shipmentState){
  super(id,version);
  this.shipmentState=shipmentState;
}

Fixed version (ground truth):
public UpdateShipmentState(String id,int version,ShipmentState shipmentState){
  super(id,version);
  this.shipmentState=shipmentState;
}
Program: 130967
Project: 130967
Buggy source:
public UpdatePaymentState(String id,String version,PaymentState paymentState){
  super(id,version);
  this.paymentState=paymentState;
}

Fixed version (ground truth):
public UpdatePaymentState(String id,int version,PaymentState paymentState){
  super(id,version);
  this.paymentState=paymentState;
}
Program: 130968
Project: 130968
Buggy source:
/** 
 * {@inheritDoc}  
 */
public CommandRequestBuilder<Order> updateShipmentState(String orderId,String orderVersion,ShipmentState shipmentState){
  return createCommandRequest(endpoints.updateShipmentState(),new OrderCommands.UpdateShipmentState(orderId,orderVersion,shipmentState));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}  
 */
public CommandRequestBuilder<Order> updateShipmentState(String orderId,int orderVersion,ShipmentState shipmentState){
  return createCommandRequest(endpoints.updateShipmentState(),new OrderCommands.UpdateShipmentState(orderId,orderVersion,shipmentState));
}
Program: 130969
Project: 130969
Buggy source:
/** 
 * {@inheritDoc}  
 */
public CommandRequestBuilder<Order> updatePaymentState(String orderId,String orderVersion,PaymentState paymentState){
  return createCommandRequest(endpoints.updatePaymentState(),new OrderCommands.UpdatePaymentState(orderId,orderVersion,paymentState));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}  
 */
public CommandRequestBuilder<Order> updatePaymentState(String orderId,int orderVersion,PaymentState paymentState){
  return createCommandRequest(endpoints.updatePaymentState(),new OrderCommands.UpdatePaymentState(orderId,orderVersion,paymentState));
}
Program: 130970
Project: 130970
Buggy source:
/** 
 * Sets the shipment state of the order. 
 */
public CommandRequestBuilder<Order> updateShipmentState(String orderId,String orderVersion,ShipmentState shipmentState);

Fixed version (ground truth):
/** 
 * Sets the shipment state of the order. 
 */
public CommandRequestBuilder<Order> updateShipmentState(String orderId,int orderVersion,ShipmentState shipmentState);
Program: 130971
Project: 130971
Buggy source:
/** 
 * Sets the payment state of the order. 
 */
public CommandRequestBuilder<Order> updatePaymentState(String orderId,String orderVersion,PaymentState paymentState);

Fixed version (ground truth):
/** 
 * Sets the payment state of the order. 
 */
public CommandRequestBuilder<Order> updatePaymentState(String orderId,int orderVersion,PaymentState paymentState);
Program: 130972
Project: 130972
Buggy source:
@Override public void onAnimationEnd(Animator animation){
  if (mCardStackListener != null) {
    boolean choice=getStackChoice();
    mCardStackListener.onChoiceMade(choice,last);
  }
  recycleView(last);
  final ViewGroup parent=(ViewGroup)view.getParent();
  if (null != parent) {
    parent.removeView(view);
    parent.addView(view,0);
  }
  last.setScaleX(1);
  last.setScaleY(1);
  setTranslationY(0);
  setTranslationX(0);
  requestLayout();
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animator animation){
  if (mCardStackListener != null) {
    boolean choice=finalChoice;
    mCardStackListener.onChoiceMade(choice,last);
  }
  recycleView(last);
  final ViewGroup parent=(ViewGroup)view.getParent();
  if (null != parent) {
    parent.removeView(view);
    parent.addView(view,0);
  }
  last.setScaleX(1);
  last.setScaleY(1);
  setTranslationY(0);
  setTranslationX(0);
  requestLayout();
}
Program: 130974
Project: 130974
Buggy source:
private boolean adapterHasMoreItems(){
  return mCurrentPosition < mAdapter.getCount() - 1;
}

Fixed version (ground truth):
private boolean adapterHasMoreItems(){
  return mCurrentPosition < mAdapter.getCount();
}
Program: 130975
Project: 130975
Buggy source:
protected void setSignaturePolicy(){
  Policy signaturePolicy=new Policy();
  if (policyDefinedByUser != null && isDefinedAllPolicyValues()) {
    signaturePolicy=policyDefinedByUser;
  }
  facade.setSignaturePolicy(signaturePolicy);
}

Fixed version (ground truth):
protected void setSignaturePolicy(){
  if (policyDefinedByUser != null && isDefinedAllPolicyValues()) {
    facade.setSignaturePolicy(policyDefinedByUser);
  }
}
Program: 130976
Project: 130976
Buggy source:
protected void setSignaturePolicy(){
  Policy signaturePolicy=new Policy();
  if (policyDefinedByUser != null && isDefinedAllPolicyValues()) {
    signaturePolicy=policyDefinedByUser;
  }
  facade.setSignaturePolicy(signaturePolicy);
}

Fixed version (ground truth):
protected void setSignaturePolicy(){
  if (policyDefinedByUser != null && isDefinedAllPolicyValues()) {
    facade.setSignaturePolicy(policyDefinedByUser);
  }
}
Program: 130977
Project: 130977
Buggy source:
private DSSDocument extractStreamDocument(ZipEntry entry){
  logger.debug("String_Node_Str" + entry.getSize() + "String_Node_Str");
  InputStream zipFileInputStream=getZipEntryInputStream(entry);
  String fileName=entry.getName();
  String lMimeType=getDataFileMimeType(fileName);
  if ("String_Node_Str".equals(lMimeType))   lMimeType="String_Node_Str";
  MimeType mimeTypeCode=MimeType.fromMimeTypeString(lMimeType);
  DSSDocument document;
  if (storeDataFilesOnlyInMemory || entry.getSize() <= maxDataFileCachedInBytes) {
    document=new InMemoryDocument(zipFileInputStream,fileName,mimeTypeCode);
  }
 else {
    document=new StreamDocument(zipFileInputStream,fileName,mimeTypeCode);
  }
  return document;
}

Fixed version (ground truth):
private DSSDocument extractStreamDocument(ZipEntry entry){
  logger.debug("String_Node_Str",entry.getSize());
  MimeType mimeTypeCode=MimeTypeUtil.mimeTypeOf(this.getDataFileMimeType(entry.getName()));
  if (this.storeDataFilesOnlyInMemory || entry.getSize() <= this.maxDataFileCachedInBytes) {
    return new InMemoryDocument(this.getZipEntryInputStream(entry),entry.getName(),mimeTypeCode);
  }
 else {
    return new StreamDocument(this.getZipEntryInputStream(entry),entry.getName(),mimeTypeCode);
  }
}
Program: 130978
Project: 130978
Buggy source:
private void validateSignatures(List<Signature> signatures){
  List<SignatureValidationData> validationDatas=startSignatureValidationInParallelTest(signatures);
  extractValidatedSignatureErrorsTest(validationDatas);
}

Fixed version (ground truth):
private void validateSignatures(List<Signature> signatures){
  List<Future<SignatureValidationData>> validationData=startSignatureValidationInParallel(signatures);
  extractValidatedSignatureErrors(validationData);
}
Program: 130979
Project: 130979
Buggy source:
private boolean containsPolicyId(XAdESSignature xAdESSignature){
  SignaturePolicyProvider signaturePolicyProvider=Helper.getBdocSignaturePolicyProvider();
  xAdESSignature.checkSignaturePolicy(signaturePolicyProvider);
  SignaturePolicy policyId=xAdESSignature.getPolicyId();
  if (policyId == null) {
    return false;
  }
  return StringUtils.isNotBlank(policyId.getIdentifier());
}

Fixed version (ground truth):
private boolean containsPolicyId(XAdESSignature xAdESSignature){
  xAdESSignature.checkSignaturePolicy(new SignaturePolicyProvider());
  SignaturePolicy policyId=xAdESSignature.getPolicyId();
  if (policyId == null) {
    return false;
  }
  return StringUtils.isNotBlank(policyId.getIdentifier());
}
Program: 130980
Project: 130980
Buggy source:
public byte[] getDataToSign(Collection<DataFile> dataFiles){
  logger.debug("String_Node_Str");
  DetachedContentCreator detachedContentCreator=new DetachedContentCreator().populate(dataFiles);
  DSSDocument dssDocumentToSign=detachedContentCreator.getFirstDetachedContent();
  logger.debug("String_Node_Str" + xAdESSignatureParameters.toString());
  ToBeSigned dataToSign=service.getDataToSign(dssDocumentToSign,xAdESSignatureParameters);
  logger.debug("String_Node_Str");
  return dataToSign.getBytes();
}

Fixed version (ground truth):
public byte[] getDataToSign(Collection<DataFile> dataFiles){
  logger.debug("String_Node_Str");
  DetachedContentCreator detachedContentCreator=new DetachedContentCreator().populate(dataFiles);
  DSSDocument dssDocumentToSign=detachedContentCreator.getFirstDetachedContent();
  logger.debug("String_Node_Str" + xAdESSignatureParameters.toString());
  List<DSSDocument> detachedContentList=detachedContentCreator.getDetachedContentList();
  ToBeSigned dataToSign=xAdESService.getDataToSign(detachedContentList,xAdESSignatureParameters);
  logger.debug("String_Node_Str");
  return dataToSign.getBytes();
}
Program: 130981
Project: 130981
Buggy source:
public XadesSigningDssFacade(){
  initDefaultXadesParameters();
  initCertificateVerifier();
  initXadesService();
}

Fixed version (ground truth):
public XadesSigningDssFacade(){
  initDefaultXadesParameters();
  initCertificateVerifier();
  initXadesMultipleService();
}
Program: 130982
Project: 130982
Buggy source:
public void setTspSource(TSPSource tspSource){
  service.setTspSource(tspSource);
}

Fixed version (ground truth):
public void setTspSource(TSPSource tspSource){
  xAdESService.setTspSource(tspSource);
}
Program: 130983
Project: 130983
Buggy source:
private void initDefaultXadesParameters(){
  xAdESSignatureParameters.clearCertificateChain();
  xAdESSignatureParameters.bLevel().setSigningDate(new Date());
  xAdESSignatureParameters.setSignaturePackaging(SignaturePackaging.DETACHED);
  xAdESSignatureParameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_LT);
  xAdESSignatureParameters.setDigestAlgorithm(DigestAlgorithm.SHA256);
  xAdESSignatureParameters.setSigningCertificateDigestMethod(DigestAlgorithm.SHA256);
}

Fixed version (ground truth):
private void initDefaultXadesParameters(){
  xAdESSignatureParameters.clearCertificateChain();
  xAdESSignatureParameters.bLevel().setSigningDate(new Date());
  xAdESSignatureParameters.setSignaturePackaging(SignaturePackaging.DETACHED);
  xAdESSignatureParameters.setSignatureLevel(SignatureLevel.XAdES_BASELINE_LT);
  xAdESSignatureParameters.setDigestAlgorithm(DigestAlgorithm.SHA256);
  xAdESSignatureParameters.setSigningCertificateDigestMethod(DigestAlgorithm.SHA256);
  xAdESSignatureParameters.setEn319132(false);
}
Program: 130984
Project: 130984
Buggy source:
public DSSDocument signDocument(byte[] signatureValue,Collection<DataFile> dataFiles){
  logger.debug("String_Node_Str");
  SignatureValue dssSignatureValue=new SignatureValue(xAdESSignatureParameters.getSignatureAlgorithm(),signatureValue);
  DetachedContentCreator detachedContentCreator=new DetachedContentCreator().populate(dataFiles);
  DSSDocument dssDocument=detachedContentCreator.getFirstDetachedContent();
  logger.debug("String_Node_Str" + xAdESSignatureParameters.toString());
  DSSDocument signedDocument=service.signDocument(dssDocument,xAdESSignatureParameters,dssSignatureValue);
  logger.debug("String_Node_Str");
  DSSDocument correctedSignedDocument=surroundWithXadesXmlTag(signedDocument);
  return correctedSignedDocument;
}

Fixed version (ground truth):
public DSSDocument signDocument(byte[] signatureValue,Collection<DataFile> dataFiles){
  logger.debug("String_Node_Str");
  SignatureValue dssSignatureValue=new SignatureValue(xAdESSignatureParameters.getSignatureAlgorithm(),signatureValue);
  DetachedContentCreator detachedContentCreator=new DetachedContentCreator().populate(dataFiles);
  DSSDocument dssDocument=detachedContentCreator.getFirstDetachedContent();
  List<DSSDocument> detachedContentList=detachedContentCreator.getDetachedContentList();
  logger.debug("String_Node_Str" + xAdESSignatureParameters.toString());
  xAdESSignatureParameters.setDetachedContents(detachedContentCreator.getDetachedContentList());
  DSSDocument signedDocument=xAdESService.signDocument(detachedContentList,xAdESSignatureParameters,dssSignatureValue);
  logger.debug("String_Node_Str");
  DSSDocument correctedSignedDocument=surroundWithXadesXmlTag(signedDocument);
  return correctedSignedDocument;
}
Program: 130985
Project: 130985
Buggy source:
public DSSDocument extendSignature(DSSDocument xadesSignature,DSSDocument detachedContent){
  logger.debug("String_Node_Str");
  xAdESSignatureParameters.setDetachedContents(Arrays.asList(detachedContent));
  DSSDocument extendedSignature=service.extendDocument(xadesSignature,xAdESSignatureParameters);
  logger.debug("String_Node_Str");
  return extendedSignature;
}

Fixed version (ground truth):
public DSSDocument extendSignature(DSSDocument xadesSignature,DSSDocument detachedContent){
  logger.debug("String_Node_Str");
  xAdESSignatureParameters.setDetachedContents(Arrays.asList(detachedContent));
  DSSDocument extendedSignature=xAdESService.extendDocument(xadesSignature,xAdESSignatureParameters);
  logger.debug("String_Node_Str");
  return extendedSignature;
}
Program: 130986
Project: 130986
Buggy source:
public static String getIdentifier(String identifier){
  String id=identifier.trim();
  if (DSSXMLUtils.isOid(id)) {
    id=identifier.substring(id.lastIndexOf(':') + 1);
  }
 else {
    return id;
  }
  return id;
}

Fixed version (ground truth):
public static String getIdentifier(String identifier){
  String id=identifier.trim();
  if (DSSXMLUtils.isOid(id)) {
    id=id.substring(id.lastIndexOf(':') + 1);
  }
 else {
    return id;
  }
  return id;
}
Program: 130987
Project: 130987
Buggy source:
@Test(expected=InvalidDataFileException.class) public void encodeDataFileWithSpecialCharacters() throws Exception {
  String fileName="String_Node_Str";
  String expectedEncoding="String_Node_Str";
  signAndAssertEncoding(fileName,expectedEncoding);
}

Fixed version (ground truth):
@Test public void encodeDataFileWithSpecialCharacters() throws Exception {
  String fileName="String_Node_Str";
  String expectedEncoding="String_Node_Str";
  signAndAssertEncoding(fileName,expectedEncoding);
}
Program: 130988
Project: 130988
Buggy source:
private DigiDocException getFatalError(List<DigiDocException> openContainerExceptions){
  DigiDocException exception=null;
  for (  DigiDocException openContainerException : openContainerExceptions) {
    if (openContainerException.getCode() == DigiDocException.ERR_PARSE_XML) {
      exception=new DigiDocException(DigiDocException.ERR_PARSE_XML,"String_Node_Str",openContainerException.getNestedException());
    }
  }
  return exception;
}

Fixed version (ground truth):
private DigiDocException getFatalError(List<DigiDocException> openContainerExceptions){
  DigiDocException exception=null;
  for (  DigiDocException openContainerException : openContainerExceptions) {
    if (openContainerException.getCode() == DigiDocException.ERR_PARSE_XML && openContainerException.getMessage() != null && openContainerException.getMessage().contains("String_Node_Str")) {
      exception=new DigiDocException(DigiDocException.ERR_PARSE_XML,"String_Node_Str",openContainerException.getNestedException());
    }
 else {
      exception=openContainerException;
    }
  }
  return exception;
}
Program: 130989
Project: 130989
Buggy source:
/** 
 * Constructor
 * @param exceptions              add description
 * @param openContainerExceptions list of exceptions encountered when opening the container
 */
public ValidationResultForDDoc(List<DigiDocException> exceptions,List<DigiDocException> openContainerExceptions){
  logger.debug("String_Node_Str");
  initXMLReport();
  if (openContainerExceptions != null) {
    for (    DigiDocException exception : openContainerExceptions) {
      DigiDoc4JException digiDoc4JException=new DigiDoc4JException(exception.getCode(),exception.getMessage());
      if (!exception.getMessage().contains("String_Node_Str")) {
        containerExceptions.add(digiDoc4JException);
      }
      if (SignedDoc.hasFatalErrs((ArrayList)openContainerExceptions)) {
        hasFatalErrors=true;
      }
    }
    exceptions.addAll(0,openContainerExceptions);
  }
  for (  DigiDocException exception : exceptions) {
    if (exception.getMessage().contains("String_Node_Str") || exception.getMessage().contains("String_Node_Str")) {
      generateReport(exception,false);
    }
 else {
      generateReport(exception,true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param exceptions              add description
 * @param openContainerExceptions list of exceptions encountered when opening the container
 */
public ValidationResultForDDoc(List<DigiDocException> exceptions,List<DigiDocException> openContainerExceptions){
  logger.debug("String_Node_Str");
  initXMLReport();
  if (openContainerExceptions != null) {
    for (    DigiDocException exception : openContainerExceptions) {
      DigiDoc4JException digiDoc4JException=new DigiDoc4JException(exception.getCode(),exception.getMessage());
      containerExceptions.add(digiDoc4JException);
      if (SignedDoc.hasFatalErrs((ArrayList)openContainerExceptions)) {
        hasFatalErrors=true;
      }
    }
    exceptions.addAll(0,openContainerExceptions);
  }
  for (  DigiDocException exception : exceptions) {
    if (exception.getMessage().contains("String_Node_Str") || exception.getMessage().contains("String_Node_Str")) {
      generateReport(exception,false);
    }
 else {
      generateReport(exception,true);
    }
  }
}
Program: 130990
Project: 130990
Buggy source:
@Override public String getCountryName(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getCountryName();
}

Fixed version (ground truth):
@Override public String getCountryName(){
  logger.debug("String_Node_Str");
  String countryName=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    countryName=origin.getSignedProperties().getSignatureProductionPlace().getCountryName();
  }
  return countryName;
}
Program: 130991
Project: 130991
Buggy source:
@Override public String getStateOrProvince(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getStateOrProvince();
}

Fixed version (ground truth):
@Override public String getStateOrProvince(){
  logger.debug("String_Node_Str");
  String stateOrProvince=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    stateOrProvince=origin.getSignedProperties().getSignatureProductionPlace().getStateOrProvince();
    ;
  }
  return stateOrProvince;
}
Program: 130992
Project: 130992
Buggy source:
@Override public String getCity(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getCity();
}

Fixed version (ground truth):
@Override public String getCity(){
  logger.debug("String_Node_Str");
  String city=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    city=origin.getSignedProperties().getSignatureProductionPlace().getCity();
  }
  return city;
}
Program: 130993
Project: 130993
Buggy source:
@Override public String getPostalCode(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getPostalCode();
}

Fixed version (ground truth):
@Override public String getPostalCode(){
  logger.debug("String_Node_Str");
  String postalCode=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    postalCode=origin.getSignedProperties().getSignatureProductionPlace().getPostalCode();
  }
  return postalCode;
}
Program: 130994
Project: 130994
Buggy source:
@Override public String getCountryName(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getCountryName();
}

Fixed version (ground truth):
@Override public String getCountryName(){
  logger.debug("String_Node_Str");
  String countryName=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    countryName=origin.getSignedProperties().getSignatureProductionPlace().getCountryName();
  }
  return countryName;
}
Program: 130995
Project: 130995
Buggy source:
@Override public String getStateOrProvince(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getStateOrProvince();
}

Fixed version (ground truth):
@Override public String getStateOrProvince(){
  logger.debug("String_Node_Str");
  String stateOrProvince=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    stateOrProvince=origin.getSignedProperties().getSignatureProductionPlace().getStateOrProvince();
    ;
  }
  return stateOrProvince;
}
Program: 130996
Project: 130996
Buggy source:
@Override public String getCity(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getCity();
}

Fixed version (ground truth):
@Override public String getCity(){
  logger.debug("String_Node_Str");
  String city=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    city=origin.getSignedProperties().getSignatureProductionPlace().getCity();
  }
  return city;
}
Program: 130997
Project: 130997
Buggy source:
@Override public String getPostalCode(){
  logger.debug("String_Node_Str");
  return origin.getSignedProperties().getSignatureProductionPlace().getPostalCode();
}

Fixed version (ground truth):
@Override public String getPostalCode(){
  logger.debug("String_Node_Str");
  String postalCode=null;
  if (origin.getSignedProperties().getSignatureProductionPlace() != null) {
    postalCode=origin.getSignedProperties().getSignatureProductionPlace().getPostalCode();
  }
  return postalCode;
}
Program: 130998
Project: 130998
Buggy source:
private static Container populateContainerBuilderWithFile(ContainerBuilder builder,TemporaryFolder testFolder) throws IOException {
  File testFile=testFolder.newFile("String_Node_Str");
  FileUtils.writeStringToFile(testFile,"String_Node_Str");
  Container container=builder.withConfiguration(new Configuration(Configuration.Mode.TEST)).withDataFile(testFile.getPath(),"String_Node_Str").build();
  return container;
}

Fixed version (ground truth):
private static Container populateContainerBuilderWithFile(ContainerBuilder builder,TemporaryFolder testFolder) throws IOException {
  File testFile=createTestFile(testFolder);
  Container container=builder.withConfiguration(new Configuration(Configuration.Mode.TEST)).withDataFile(testFile.getPath(),"String_Node_Str").build();
  return container;
}
Program: 130999
Project: 130999
Buggy source:
private Map<String,SimpleReport> loadValidationResults(SignedDocumentValidator validator){
  logger.debug("String_Node_Str");
  Map<String,SimpleReport> simpleReports=new HashMap<>();
  Reports report=validate(validator);
  dssSignatureParameters.setDigestAlgorithm(report.getDiagnosticData().getSignatureDigestAlgorithm());
  do {
    SimpleReport simpleReport=report.getSimpleReport();
    if (simpleReport.getSignatureIdList().size() > 0)     simpleReports.put(simpleReport.getSignatureIdList().get(0),simpleReport);
    report=report.getNextReports();
  }
 while (report != null);
  return simpleReports;
}

Fixed version (ground truth):
private Map<String,SimpleReport> loadValidationResults(SignedDocumentValidator validator){
  logger.debug("String_Node_Str");
  Map<String,SimpleReport> simpleReports=new LinkedHashMap<>();
  Reports report=validate(validator);
  dssSignatureParameters.setDigestAlgorithm(report.getDiagnosticData().getSignatureDigestAlgorithm());
  do {
    SimpleReport simpleReport=report.getSimpleReport();
    if (simpleReport.getSignatureIdList().size() > 0)     simpleReports.put(simpleReport.getSignatureIdList().get(0),simpleReport);
    report=report.getNextReports();
  }
 while (report != null);
  return simpleReports;
}
Program: 131000
Project: 131000
Buggy source:
private DSSDocument getAttachment(){
  logger.debug("String_Node_Str");
  DSSDocument attachment;
  if (dataFiles.size() == 0) {
    String errorMessage="String_Node_Str";
    logger.error(errorMessage);
    throw new DigiDoc4JException(errorMessage);
  }
  Iterator<String> iterator=dataFiles.keySet().iterator();
  attachment=getDssDocumentFromDataFile(dataFiles.get(iterator.next()));
  while (iterator.hasNext()) {
    String fileName=iterator.next();
    attachment.setNextDocument(getDssDocumentFromDataFile(dataFiles.get(fileName)));
  }
  return attachment;
}

Fixed version (ground truth):
private DSSDocument getAttachment(){
  logger.debug("String_Node_Str");
  if (dataFiles.size() == 0) {
    String errorMessage="String_Node_Str";
    logger.error(errorMessage);
    throw new DigiDoc4JException(errorMessage);
  }
  Iterator<String> iterator=dataFiles.keySet().iterator();
  DSSDocument firstAttachment=getDssDocumentFromDataFile(dataFiles.get(iterator.next()));
  DSSDocument lastAttachment=firstAttachment;
  while (iterator.hasNext()) {
    String fileName=iterator.next();
    DSSDocument newAttachment=getDssDocumentFromDataFile(dataFiles.get(fileName));
    lastAttachment.setNextDocument(newAttachment);
    lastAttachment=newAttachment;
  }
  return firstAttachment;
}
Program: 131001
Project: 131001
Buggy source:
private void loadSignatures(SignedDocumentValidator validator){
  logger.debug("String_Node_Str");
  Map<String,SimpleReport> simpleReports=loadValidationResults(validator);
  List<AdvancedSignature> signatureList=validator.getSignatures();
  additionalVerificationErrors=new HashMap<>();
  for (  AdvancedSignature advancedSignature : signatureList) {
    List<DigiDoc4JException> validationErrors=new ArrayList<>();
    String reportSignatureId=advancedSignature.getId();
    additionalVerificationErrors.put(reportSignatureId,validatePolicy(advancedSignature));
    DigiDoc4JException referenceError=validateSignedPropertiesReference(advancedSignature);
    if (referenceError != null)     additionalVerificationErrors.get(reportSignatureId).add(referenceError);
    SimpleReport simpleReport=getSimpleReport(simpleReports,reportSignatureId);
    if (simpleReport != null) {
      for (      Conclusion.BasicInfo error : simpleReport.getErrors(reportSignatureId)) {
        String errorMessage=error.toString();
        logger.info(errorMessage);
        if (errorMessage.contains(MessageTag.BBB_XCV_ISCR_ANS.getMessage()))         validationErrors.add(new CertificateRevokedException(errorMessage));
 else         validationErrors.add(new DigiDoc4JException(errorMessage));
      }
    }
    validationErrors.addAll(additionalVerificationErrors.get(reportSignatureId));
    signatures.add(new BDocSignature((XAdESSignature)advancedSignature,validationErrors));
  }
}

Fixed version (ground truth):
private void loadSignatures(SignedDocumentValidator validator){
  logger.debug("String_Node_Str");
  Map<String,SimpleReport> simpleReports=loadValidationResults(validator);
  List<AdvancedSignature> signatureList=validator.getSignatures();
  additionalVerificationErrors=new LinkedHashMap<>();
  for (  AdvancedSignature advancedSignature : signatureList) {
    List<DigiDoc4JException> validationErrors=new ArrayList<>();
    String reportSignatureId=advancedSignature.getId();
    additionalVerificationErrors.put(reportSignatureId,validatePolicy(advancedSignature));
    DigiDoc4JException referenceError=validateSignedPropertiesReference(advancedSignature);
    if (referenceError != null)     additionalVerificationErrors.get(reportSignatureId).add(referenceError);
    SimpleReport simpleReport=getSimpleReport(simpleReports,reportSignatureId);
    if (simpleReport != null) {
      for (      Conclusion.BasicInfo error : simpleReport.getErrors(reportSignatureId)) {
        String errorMessage=error.toString();
        logger.info(errorMessage);
        if (errorMessage.contains(MessageTag.BBB_XCV_ISCR_ANS.getMessage()))         validationErrors.add(new CertificateRevokedException(errorMessage));
 else         validationErrors.add(new DigiDoc4JException(errorMessage));
      }
    }
    validationErrors.addAll(additionalVerificationErrors.get(reportSignatureId));
    signatures.add(new BDocSignature((XAdESSignature)advancedSignature,validationErrors));
  }
}
Program: 131002
Project: 131002
Buggy source:
private void extend(SignatureLevel signatureLevel){
  if (signatureLevel == dssSignatureParameters.getSignatureLevel())   throw new DigiDoc4JException("String_Node_Str");
  commonCertificateVerifier.setTrustedCertSource(configuration.getTSL());
  SKOnlineOCSPSource ocspSource=new SKOnlineOCSPSource(configuration);
  ocspSource.setUserAgent(Helper.createUserAgent(this));
  commonCertificateVerifier.setOcspSource(ocspSource);
  asicService.setTspSource(new OnlineTSPSource(getConfiguration().getTspSource()));
  dssSignatureParameters.setSignatureLevel(signatureLevel);
  signedDocument=new InMemoryDocument(asicService.extendDocument(signedDocument,dssSignatureParameters).getBytes(),signedDocument.getName(),signedDocument.getMimeType());
  signatures=new ArrayList<>();
  SignedDocumentValidator validator=ASiCXMLDocumentValidator.fromDocument(signedDocument);
  validate(validator);
  List<AdvancedSignature> signatureList=validator.getSignatures();
  for (  AdvancedSignature advancedSignature : signatureList) {
    signatures.add(new BDocSignature((XAdESSignature)advancedSignature));
  }
}

Fixed version (ground truth):
private void extend(SignatureLevel signatureLevel){
  if (signatureLevel == dssSignatureParameters.getSignatureLevel())   throw new DigiDoc4JException("String_Node_Str");
  commonCertificateVerifier.setTrustedCertSource(configuration.getTSL());
  SKOnlineOCSPSource ocspSource=new SKOnlineOCSPSource(configuration);
  ocspSource.setUserAgent(Helper.createUserAgent(this));
  commonCertificateVerifier.setOcspSource(ocspSource);
  asicService.setTspSource(new OnlineTSPSource(getConfiguration().getTspSource()));
  dssSignatureParameters.setSignatureLevel(signatureLevel);
  DSSDocument extendedDocument=asicService.extendDocument(signedDocument,dssSignatureParameters);
  signedDocument=new InMemoryDocument(extendedDocument.getBytes(),signedDocument.getName(),signedDocument.getMimeType());
  signatures=new ArrayList<>();
  SignedDocumentValidator validator=ASiCXMLDocumentValidator.fromDocument(signedDocument);
  validate(validator);
  List<AdvancedSignature> signatureList=validator.getSignatures();
  for (  AdvancedSignature advancedSignature : signatureList) {
    signatures.add(new BDocSignature((XAdESSignature)advancedSignature));
  }
}
Program: 131003
Project: 131003
Buggy source:
/** 
 * Creates in memory document container.
 * @param data     file content
 * @param fileName file name with path
 * @param mimeType MIME type of the data file, for example 'text/plain' or 'application/msword'
 */
public DataFile(byte[] data,String fileName,String mimeType){
  document=new InMemoryDocument(data,fileName,MimeType.fromCode(mimeType));
}

Fixed version (ground truth):
/** 
 * Creates in memory document container.
 * @param data     file content
 * @param fileName file name with path
 * @param mimeType MIME type of the data file, for example 'text/plain' or 'application/msword'
 */
public DataFile(byte[] data,String fileName,String mimeType){
  loadDocument(data,fileName,mimeType);
}
Program: 131004
Project: 131004
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  Object item=adapter.getItem(position);
  ((MainActivity)getActivity()).playRadio((Radio)item);
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  Object item=list.getAdapter().getItem(position);
  ((MainActivity)getActivity()).playRadio((Radio)item);
}
Program: 131005
Project: 131005
Buggy source:
@Override public void gotoPlayingItemPosition(PlayableItem playingItem){
  Radio playingRadio=(Radio)playingItem;
  for (int i=0; i < adapter.getCount(); i++) {
    Object item=adapter.getItem(i);
    if (item instanceof Radio) {
      if (item.equals(playingRadio)) {
        final int position=i;
        list.post(new Runnable(){
          @Override public void run(){
            list.smoothScrollToPosition(position);
          }
        }
);
        break;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void gotoPlayingItemPosition(PlayableItem playingItem){
  Radio playingRadio=(Radio)playingItem;
  for (int i=0; i < list.getAdapter().getCount(); i++) {
    Object item=list.getAdapter().getItem(i);
    if (item instanceof Radio) {
      if (item.equals(playingRadio)) {
        final int position=i;
        list.post(new Runnable(){
          @Override public void run(){
            list.smoothScrollToPosition(position);
          }
        }
);
        break;
      }
    }
  }
}
Program: 131006
Project: 131006
Buggy source:
@Override public void updateListView(){
  MainActivity activity=(MainActivity)getActivity();
  Radio playingRadio=null;
  if (activity.getCurrentPlayingItem() instanceof Radio)   playingRadio=(Radio)activity.getCurrentPlayingItem();
  adapter=new RadioArrayAdapter(this,Radio.getRadios(),playingRadio);
  list.setAdapter(adapter);
}

Fixed version (ground truth):
@Override public void updateListView(){
  MainActivity activity=(MainActivity)getActivity();
  Radio playingRadio=null;
  if (activity.getCurrentPlayingItem() instanceof Radio)   playingRadio=(Radio)activity.getCurrentPlayingItem();
  RadioArrayAdapter adapter=new RadioArrayAdapter(this,Radio.getRadios(),playingRadio);
  list.setAdapter(adapter);
}
Program: 131007
Project: 131007
Buggy source:
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null) {
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null && item.hasImage()) {
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}
Program: 131008
Project: 131008
Buggy source:
public ImagesCache(Context context){
  imagesSize=(int)context.getResources().getDimension(R.dimen.songImageSize);
  cache=new LruCache<String,Bitmap>(Constants.IMAGES_CACHE_SIZE);
}

Fixed version (ground truth):
public ImagesCache(Context context){
  imagesSize=(int)context.getResources().getDimension(R.dimen.songImageSize);
  cache=new LruCache<>(Constants.IMAGES_CACHE_SIZE);
}
Program: 131009
Project: 131009
Buggy source:
@Override protected void onPostExecute(Bitmap image){
  if (image != null) {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
 else {
    imageView.setImageDrawable(null);
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(Bitmap image){
  if (image != null) {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}
Program: 131010
Project: 131010
Buggy source:
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image=null;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null) {
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null) {
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}
Program: 131011
Project: 131011
Buggy source:
public BrowserArrayAdapter(BrowserFragment fragment,ArrayList<Object> values,BrowserSong playingSong){
  super(fragment.getActivity(),R.layout.song_item,values);
  this.values=values;
  this.playingSong=playingSong;
  this.fragment=fragment;
  activity=(MainActivity)fragment.getActivity();
  this.imagesCache=((MusicPlayerApplication)activity.getApplication()).imagesCache;
  inflater=activity.getLayoutInflater();
  songImage=activity.getResources().getDrawable(R.drawable.audio);
}

Fixed version (ground truth):
public BrowserArrayAdapter(BrowserFragment fragment,ArrayList<Object> values,BrowserSong playingSong){
  super(fragment.getActivity(),R.layout.song_item,values);
  this.values=values;
  this.playingSong=playingSong;
  this.fragment=fragment;
  activity=(MainActivity)fragment.getActivity();
  this.imagesCache=((MusicPlayerApplication)activity.getApplication()).imagesCache;
  inflater=activity.getLayoutInflater();
}
Program: 131013
Project: 131013
Buggy source:
@Override public View getView(int position,View view,ViewGroup parent){
  final BrowserSong song=songs.get(position);
  ViewHolder viewHolder;
  if (view == null) {
    viewHolder=new ViewHolder();
    view=inflater.inflate(R.layout.song_item,parent,false);
    viewHolder.title=(TextView)view.findViewById(R.id.textViewSongItemTitle);
    viewHolder.artist=(TextView)view.findViewById(R.id.textViewSongItemArtist);
    viewHolder.image=(ImageView)view.findViewById(R.id.imageViewItemImage);
    viewHolder.menu=(ImageButton)view.findViewById(R.id.buttonMenu);
  }
 else {
    viewHolder=(ViewHolder)view.getTag();
  }
  viewHolder.title.setText(song.getTitle());
  viewHolder.artist.setText(song.getArtist());
  imagesCache.getImageAsync(song,viewHolder.image);
  viewHolder.menu.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      AddToPlaylistDialog.showDialog(activity,song);
    }
  }
);
  viewHolder.menu.setFocusable(false);
  view.setTag(viewHolder);
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View view,ViewGroup parent){
  final BrowserSong song=songs.get(position);
  ViewHolder viewHolder;
  if (view == null) {
    viewHolder=new ViewHolder();
    view=inflater.inflate(R.layout.song_item,parent,false);
    viewHolder.title=(TextView)view.findViewById(R.id.textViewSongItemTitle);
    viewHolder.artist=(TextView)view.findViewById(R.id.textViewSongItemArtist);
    viewHolder.image=(ImageView)view.findViewById(R.id.imageViewItemImage);
    viewHolder.menu=(ImageButton)view.findViewById(R.id.buttonMenu);
  }
 else {
    viewHolder=(ViewHolder)view.getTag();
  }
  viewHolder.title.setText(song.getTitle());
  viewHolder.artist.setText(song.getArtist());
  viewHolder.image.setImageResource(R.drawable.audio);
  imagesCache.getImageAsync(song,viewHolder.image);
  viewHolder.menu.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      AddToPlaylistDialog.showDialog(activity,song);
    }
  }
);
  viewHolder.menu.setFocusable(false);
  view.setTag(viewHolder);
  return view;
}
Program: 131014
Project: 131014
Buggy source:
public void quitApplication(){
  stopService(serviceIntent);
  finish();
}

Fixed version (ground truth):
public void quitApplication(){
  app.currentPage=-1;
  stopService(serviceIntent);
  finish();
}
Program: 131015
Project: 131015
Buggy source:
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image=null;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null) {
    imageView.setImageDrawable(songImage);
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
  }
}

Fixed version (ground truth):
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image=null;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null) {
    imageView.setImageDrawable(songImage);
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}
Program: 131016
Project: 131016
Buggy source:
private void startRoutine(){
  updatePlayingItem();
  updateExtendedMenu();
  if (searchSong != null) {
    boolean ok=musicService.playItem(searchSong);
    if (!ok)     Utils.showMessageDialog(this,R.string.errorSong,R.string.errorSongMessage);
    gotoPlayingItemPosition();
    searchSong=null;
  }
  if (intentFile != null) {
    BrowserSong song=new BrowserSong(intentFile);
    playItem(song);
    intentFile=null;
  }
  if (startPollingThread)   startPollingThread();
}

Fixed version (ground truth):
private void startRoutine(){
  updateExtendedMenu();
  if (searchSong != null) {
    playItem(searchSong);
    gotoPlayingItemPosition();
    searchSong=null;
  }
 else {
    updatePlayingItem();
  }
  if (intentFile != null) {
    BrowserSong song=new BrowserSong(intentFile);
    playItem(song);
    intentFile=null;
  }
 else {
    updatePlayingItem();
  }
  if (startPollingThread)   startPollingThread();
}
Program: 131017
Project: 131017
Buggy source:
public ImagesCache(Context context){
  imagesSize=(int)context.getResources().getDimension(R.dimen.songImageSize);
  cache=new LruCache<String,Bitmap>(Constants.IMAGES_CACHE_SIZE);
  songImage=context.getResources().getDrawable(R.drawable.audio);
}

Fixed version (ground truth):
public ImagesCache(Context context){
  imagesSize=(int)context.getResources().getDimension(R.dimen.songImageSize);
  cache=new LruCache<String,Bitmap>(Constants.IMAGES_CACHE_SIZE);
}
Program: 131018
Project: 131018
Buggy source:
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image=null;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null) {
    imageView.setImageDrawable(songImage);
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
public void getImageAsync(PlayableItem item,ImageView imageView){
  Bitmap image=null;
synchronized (cache) {
    image=cache.get(item.getPlayableUri());
  }
  if (image == null) {
    ImageLoaderTask imageLoader=new ImageLoaderTask(item,imageView);
    imageLoader.execute();
  }
 else {
    imageView.setImageBitmap(image);
    imageView.setVisibility(View.VISIBLE);
  }
}
Program: 131019
Project: 131019
Buggy source:
public BrowserArrayAdapter(MainActivity activity,ArrayList<Object> values,BrowserSong playingSong){
  super(activity,values);
  this.playingSong=playingSong;
  this.imagesCache=((MusicPlayerApplication)activity.getApplication()).imagesCache;
}

Fixed version (ground truth):
public BrowserArrayAdapter(MainActivity activity,ArrayList<Object> values,BrowserSong playingSong){
  super(activity,values);
  this.playingSong=playingSong;
  this.imagesCache=((MusicPlayerApplication)activity.getApplication()).imagesCache;
  songImage=activity.getResources().getDrawable(R.drawable.audio);
}
Program: 131023
Project: 131023
Buggy source:
public boolean setBlockIDWithMetadata(int x,int y,int z,Block block,int meta){
  if (block == null)   return false;
  ExtendedBlockStorage storage=getBlockStorageOrCreate(x,y,z);
  int i=x & 15;
  int j=y & 15;
  int k=z & 15;
  Block currentblock=storage.getBlockByExtId(i,j,k);
  int currentmeta=storage.getExtBlockMetadata(i,j,k);
  if (currentblock == block && currentmeta == meta) {
    return false;
  }
  storage.func_150818_a(i,j,k,block);
  storage.setExtBlockMetadata(i,j,k,meta);
  if (boundsInit) {
    minX=Math.min(minX,x);
    minY=Math.min(minY,y);
    minZ=Math.min(minZ,z);
    maxX=Math.max(maxX,x + 1);
    maxY=Math.max(maxY,y + 1);
    maxZ=Math.max(maxZ,z + 1);
  }
 else {
    boundsInit=true;
    minX=x;
    minY=y;
    minZ=z;
    maxX=x + 1;
    maxY=y + 1;
    maxZ=z + 1;
  }
  blockCount++;
  setChunkModified();
  TileEntity tileentity;
  if (block.hasTileEntity(meta)) {
    tileentity=getTileEntity(x,y,z);
    if (tileentity == null) {
      tileentity=block.createTileEntity(worldObj,meta);
      setTileEntity(x,y,z,tileentity);
    }
    if (tileentity != null) {
      tileentity.updateContainingBlockInfo();
      tileentity.blockType=block;
      tileentity.blockMetadata=meta;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean setBlockIDWithMetadata(int x,int y,int z,Block block,int meta){
  if (block == null)   return false;
  ExtendedBlockStorage storage=getBlockStorageOrCreate(x,y,z);
  int i=x & 15;
  int j=y & 15;
  int k=z & 15;
  Block currentblock=storage.getBlockByExtId(i,j,k);
  int currentmeta=storage.getExtBlockMetadata(i,j,k);
  if (currentblock == block && currentmeta == meta) {
    return false;
  }
  storage.func_150818_a(i,j,k,block);
  storage.setExtBlockMetadata(i,j,k,meta);
  if (boundsInit) {
    minX=Math.min(minX,x);
    minY=Math.min(minY,y);
    minZ=Math.min(minZ,z);
    maxX=Math.max(maxX,x + 1);
    maxY=Math.max(maxY,y + 1);
    maxZ=Math.max(maxZ,z + 1);
  }
 else {
    boundsInit=true;
    minX=x;
    minY=y;
    minZ=z;
    maxX=x + 1;
    maxY=y + 1;
    maxZ=z + 1;
  }
  blockCount++;
  setChunkModified();
  TileEntity tileentity;
  if (block.hasTileEntity(meta)) {
    tileentity=getTileEntity(x,y,z);
    if (tileentity == null) {
      setTileEntity(x,y,z,tileentity);
    }
    if (tileentity != null) {
      tileentity.updateContainingBlockInfo();
      tileentity.blockType=block;
      tileentity.blockMetadata=meta;
    }
  }
  return true;
}