nus-yam/ex-repair huggingface dataset:
Program: 171906
Project: 171906
Buggy source:
public DummyDCEVSEController(V2GCommunicationSessionSECC commSessionContext){
  setCommSessionContext(commSessionContext);
}

Fixed version (ground truth):
public DummyDCEVSEController(V2GCommunicationSessionSECC commSessionContext){
  setCommSessionContext(commSessionContext);
  setIsolationLevel(IsolationLevelType.INVALID);
}
Program: 171907
Project: 171907
Buggy source:
@Override public DCEVSEStatusType getDCEVSEStatus(EVSENotificationType notification){
  DCEVSEStatusType dcEvseStatus=new DCEVSEStatusType();
  dcEvseStatus.setNotificationMaxDelay(0);
  dcEvseStatus.setEVSENotification((notification != null) ? notification : EVSENotificationType.NONE);
  dcEvseStatus.setEVSEStatusCode(DCEVSEStatusCodeType.EVSE_READY);
  dcEvseStatus.setEVSEIsolationStatus(IsolationLevelType.INVALID);
  return dcEvseStatus;
}

Fixed version (ground truth):
@Override public DCEVSEStatusType getDCEVSEStatus(EVSENotificationType notification){
  DCEVSEStatusType dcEvseStatus=new DCEVSEStatusType();
  dcEvseStatus.setNotificationMaxDelay(0);
  dcEvseStatus.setEVSENotification((notification != null) ? notification : EVSENotificationType.NONE);
  dcEvseStatus.setEVSEStatusCode(DCEVSEStatusCodeType.EVSE_READY);
  dcEvseStatus.setEVSEIsolationStatus(getIsolationLevel());
  return dcEvseStatus;
}
Program: 171908
Project: 171908
Buggy source:
/** 
 * Returns the EVSE status for AC charging comprising notification, maxDelay and RCD
 * @return The EVSE specific status
 */
public DCEVSEStatusType getDCEVSEStatus(EVSENotificationType notification);

Fixed version (ground truth):
/** 
 * Returns the EVSE status for DC charging comprising notification, maxDelay and RCD
 * @return The EVSE specific status
 */
public DCEVSEStatusType getDCEVSEStatus(EVSENotificationType notification);
Program: 171909
Project: 171909
Buggy source:
protected SendMessage getSendMessage(SupportedAppProtocolRes message,V2GMessages nextExpectedMessage,org.v2gclarity.risev2g.shared.v2gMessages.appProtocol.ResponseCodeType responseCode){
  String messageName=message.getClass().getSimpleName();
  if (!responseCode.value().substring(0,2).toUpperCase().equals("String_Node_Str")) {
    getLogger().error("String_Node_Str" + responseCode.value() + "String_Node_Str");
    getCommSessionContext().setStopV2GCommunicationSession(true);
  }
  getLogger().debug("String_Node_Str" + messageName);
  return new SendMessage(message,getCommSessionContext().getStates().get(nextExpectedMessage),TimeRestrictions.V2G_SECC_SEQUENCE_TIMEOUT);
}

Fixed version (ground truth):
protected SendMessage getSendMessage(SupportedAppProtocolRes message,V2GMessages nextExpectedMessage,org.v2gclarity.risev2g.shared.v2gMessages.appProtocol.ResponseCodeType responseCode){
  String messageName=message.getClass().getSimpleName();
  if (!responseCode.value().substring(0,2).toUpperCase().equals("String_Node_Str")) {
    getLogger().error("String_Node_Str" + responseCode.value() + "String_Node_Str");
    getCommSessionContext().setStopV2GCommunicationSession(true);
  }
  getLogger().debug("String_Node_Str" + messageName);
  return new SendMessage(message,getCommSessionContext().getStates().get(nextExpectedMessage),TimeRestrictions.V2G_EVCC_COMMUNICATION_SETUP_TIMEOUT);
}
Program: 171911
Project: 171911
Buggy source:
@Override public ReactionToIncomingMessage processIncomingMessage(Object message){
  if (isIncomingMessageValid(message,CableCheckReqType.class,cableCheckRes)) {
    V2GMessage v2gMessageReq=(V2GMessage)message;
    CableCheckReqType cableCheckReq=(CableCheckReqType)v2gMessageReq.getBody().getBodyElement().getValue();
    setEvseProcessingFinished(true);
    if (isEvseProcessingFinished()) {
      cableCheckRes.setEVSEProcessing(EVSEProcessingType.FINISHED);
      cableCheckRes.setDCEVSEStatus(((IDCEVSEController)getCommSessionContext().getDCEvseController()).getDCEVSEStatus(EVSENotificationType.NONE));
      return getSendMessage(cableCheckRes,V2GMessages.PRE_CHARGE_REQ);
    }
 else {
      cableCheckRes.setEVSEProcessing(EVSEProcessingType.ONGOING);
      return getSendMessage(cableCheckRes,V2GMessages.CABLE_CHECK_REQ);
    }
  }
 else {
    if (cableCheckRes.getResponseCode().equals(ResponseCodeType.FAILED_SEQUENCE_ERROR)) {
      BodyBaseType responseMessage=getSequenceErrorResMessage(new CableCheckResType(),message);
      return getSendMessage(responseMessage,V2GMessages.NONE,cableCheckRes.getResponseCode());
    }
 else {
      setMandatoryFieldsForFailedRes(cableCheckRes,cableCheckRes.getResponseCode());
    }
  }
  return getSendMessage(cableCheckRes,V2GMessages.NONE,cableCheckRes.getResponseCode());
}

Fixed version (ground truth):
@Override public ReactionToIncomingMessage processIncomingMessage(Object message){
  if (isIncomingMessageValid(message,CableCheckReqType.class,cableCheckRes)) {
    V2GMessage v2gMessageReq=(V2GMessage)message;
    CableCheckReqType cableCheckReq=(CableCheckReqType)v2gMessageReq.getBody().getBodyElement().getValue();
    setEvseProcessingFinished(true);
    if (isEvseProcessingFinished()) {
      getCommSessionContext().getDCEvseController().setIsolationLevel(IsolationLevelType.VALID);
      cableCheckRes.setEVSEProcessing(EVSEProcessingType.FINISHED);
      cableCheckRes.setDCEVSEStatus(((IDCEVSEController)getCommSessionContext().getDCEvseController()).getDCEVSEStatus(EVSENotificationType.NONE));
      return getSendMessage(cableCheckRes,V2GMessages.PRE_CHARGE_REQ);
    }
 else {
      cableCheckRes.setEVSEProcessing(EVSEProcessingType.ONGOING);
      return getSendMessage(cableCheckRes,V2GMessages.CABLE_CHECK_REQ);
    }
  }
 else {
    if (cableCheckRes.getResponseCode().equals(ResponseCodeType.FAILED_SEQUENCE_ERROR)) {
      BodyBaseType responseMessage=getSequenceErrorResMessage(new CableCheckResType(),message);
      return getSendMessage(responseMessage,V2GMessages.NONE,cableCheckRes.getResponseCode());
    }
 else {
      setMandatoryFieldsForFailedRes(cableCheckRes,cableCheckRes.getResponseCode());
    }
  }
  return getSendMessage(cableCheckRes,V2GMessages.NONE,cableCheckRes.getResponseCode());
}
Program: 171913
Project: 171913
Buggy source:
private boolean isResponseCodeOK(CertificateInstallationReqType certificateInstallationReq,CertificateChainType saContractCertificateChain,SignatureType signature){
  if (saContractCertificateChain == null || saContractCertificateChain.getCertificate() == null) {
    certificateInstallationRes.setResponseCode(ResponseCodeType.FAILED_NO_CERTIFICATE_AVAILABLE);
    return false;
  }
  ResponseCodeType validityResponseCode=SecurityUtils.verifyValidityPeriod(SecurityUtils.getCertificate(certificateInstallationReq.getOEMProvisioningCert()));
  if (!validityResponseCode.equals(ResponseCodeType.OK)) {
    certificateInstallationRes.setResponseCode(validityResponseCode);
    return false;
  }
  HashMap<String,byte[]> verifyXMLSigRefElements=new HashMap<String,byte[]>();
  verifyXMLSigRefElements.put(certificateInstallationReq.getId(),SecurityUtils.generateDigest(getMessageHandler().getJaxbElement(certificateInstallationReq)));
  if (!SecurityUtils.verifySignature(signature,getMessageHandler().getJaxbElement(signature.getSignedInfo()),verifyXMLSigRefElements,certificateInstallationReq.getOEMProvisioningCert())) {
    certificateInstallationRes.setResponseCode(ResponseCodeType.FAILED_SIGNATURE_ERROR);
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean isResponseCodeOK(CertificateInstallationReqType certificateInstallationReq,CertificateChainType saContractCertificateChain,SignatureType signature){
  ResponseCodeType responseCode=null;
  X509Certificate oemProvCert=SecurityUtils.getCertificate(certificateInstallationReq.getOEMProvisioningCert());
  if (saContractCertificateChain == null || saContractCertificateChain.getCertificate() == null) {
    certificateInstallationRes.setResponseCode(ResponseCodeType.FAILED_NO_CERTIFICATE_AVAILABLE);
    return false;
  }
  responseCode=SecurityUtils.verifyValidityPeriod(oemProvCert);
  if (!responseCode.equals(ResponseCodeType.OK)) {
    certificateInstallationRes.setResponseCode(responseCode);
    return false;
  }
  responseCode=SecurityUtils.verifyLeafCertificateAttributes(oemProvCert,PKI.OEM);
  if (!responseCode.equals(ResponseCodeType.OK)) {
    certificateInstallationRes.setResponseCode(ResponseCodeType.FAILED);
    return false;
  }
  HashMap<String,byte[]> verifyXMLSigRefElements=new HashMap<String,byte[]>();
  verifyXMLSigRefElements.put(certificateInstallationReq.getId(),SecurityUtils.generateDigest(getMessageHandler().getJaxbElement(certificateInstallationReq)));
  if (!SecurityUtils.verifySignature(signature,getMessageHandler().getJaxbElement(signature.getSignedInfo()),verifyXMLSigRefElements,certificateInstallationReq.getOEMProvisioningCert())) {
    certificateInstallationRes.setResponseCode(ResponseCodeType.FAILED_SIGNATURE_ERROR);
    return false;
  }
  return true;
}
Program: 171914
Project: 171914
Buggy source:
public synchronized byte[] encodeEXI(Object jaxbObject,boolean supportedAppProtocolHandshake){
  InputStream inStream=marshalToInputStream(jaxbObject);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  baos=((ByteArrayOutputStream)encode(inStream,supportedAppProtocolHandshake));
  return baos.toByteArray();
}

Fixed version (ground truth):
public synchronized byte[] encodeEXI(Object jaxbObject,String xsdSchemaPath){
  Grammars grammar=null;
  if (xsdSchemaPath.equals(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString()))   grammar=getGrammarAppProtocol();
 else   if (xsdSchemaPath.equals(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()))   grammar=getGrammarMsgDef();
 else   if (xsdSchemaPath.equals(GlobalValues.SCHEMA_PATH_XMLDSIG.toString()))   grammar=getGrammarXMLDSig();
 else {
    getLogger().error("String_Node_Str");
    return null;
  }
  InputStream inStream=marshalToInputStream(jaxbObject);
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  baos=((ByteArrayOutputStream)encode(inStream,grammar));
  return baos.toByteArray();
}
Program: 171915
Project: 171915
Buggy source:
private EXIFactory getExiFactory(){
  return exiFactory;
}

Fixed version (ground truth):
public EXIFactory getExiFactory(){
  return exiFactory;
}
Program: 171916
Project: 171916
Buggy source:
private EXIficientCodec(){
  super();
  setExiFactory(DefaultEXIFactory.newInstance());
  getExiFactory().setValuePartitionCapacity(0);
  setGrammarFactory(GrammarFactory.newInstance());
  try {
    setGrammarAppProtocol(getGrammarFactory().createGrammars(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString())));
    setGrammarMsgDef(getGrammarFactory().createGrammars(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()),XSDResolver.getInstance()));
  }
 catch (  EXIException e) {
    getLogger().error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private EXIficientCodec(){
  super();
  setExiFactory(DefaultEXIFactory.newInstance());
  getExiFactory().setValuePartitionCapacity(0);
  setFragment(false);
  setGrammarFactory(GrammarFactory.newInstance());
  try {
    setGrammarAppProtocol(getGrammarFactory().createGrammars(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString())));
    setGrammarMsgDef(getGrammarFactory().createGrammars(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()),XSDResolver.getInstance()));
    setGrammarXMLDSig(getGrammarFactory().createGrammars(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_XMLDSIG.toString()),XSDResolver.getInstance()));
  }
 catch (  EXIException e) {
    getLogger().error("String_Node_Str",e);
  }
}
Program: 171917
Project: 171917
Buggy source:
public abstract byte[] encodeEXI(Object jaxbXML,boolean supportedAppProtocolHandshake);

Fixed version (ground truth):
public abstract byte[] encodeEXI(Object jaxbXML,String xsdSchemaPath);
Program: 171918
Project: 171918
Buggy source:
public Object unmarshallToMessage(String decodedExiString){
  try {
    if (getInStream() != null)     getInStream().reset();
    setInStream(new ByteArrayInputStream(decodedExiString.getBytes()));
    return getUnmarshaller().unmarshal(getInStream());
  }
 catch (  IOException|JAXBException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
public Object unmarshallToMessage(String decodedExiString){
  try {
    if (getInStream() != null)     getInStream().reset();
    setInStream(new ByteArrayInputStream(decodedExiString.getBytes()));
    return getUnmarshaller().unmarshal(getInStream());
  }
 catch (  IOException|JAXBException|RuntimeException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str",e);
    return null;
  }
}
Program: 171919
Project: 171919
Buggy source:
@Override public byte[] encodeEXI(Object jaxbObject,boolean supportedAppProtocolHandshake){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    if (supportedAppProtocolHandshake)     setGrammarCache(new GrammarCache(getExiSchemaAppProtocol(),getOptions()));
 else     setGrammarCache(new GrammarCache(getExiSchemaMsgDef(),getOptions()));
    getTransmogrifier().setGrammarCache(getGrammarCache());
    getTransmogrifier().setOutputStream(baos);
    getTransmogrifier().encode(new InputSource(marshalToInputStream(jaxbObject)));
    byte[] encodedExi=baos.toByteArray();
    baos.close();
    return encodedExi;
  }
 catch (  IOException|EXIOptionsException|TransmogrifierException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
@Override public byte[] encodeEXI(Object jaxbObject,String xsdSchemaPath){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    if (xsdSchemaPath.equals(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString()))     setGrammarCache(new GrammarCache(getExiSchemaAppProtocol(),getOptions()));
 else     if (xsdSchemaPath.equals(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()))     setGrammarCache(new GrammarCache(getExiSchemaMsgDef(),getOptions()));
 else     if (xsdSchemaPath.equals(GlobalValues.SCHEMA_PATH_XMLDSIG.toString()))     setGrammarCache(new GrammarCache(getExiSchemaXMLDSig(),getOptions()));
 else {
      getLogger().error("String_Node_Str");
      return null;
    }
    getTransmogrifier().setGrammarCache(getGrammarCache());
    getTransmogrifier().setOutputStream(baos);
    getTransmogrifier().encode(new InputSource(marshalToInputStream(jaxbObject)));
    byte[] encodedExi=baos.toByteArray();
    baos.close();
    return encodedExi;
  }
 catch (  IOException|EXIOptionsException|TransmogrifierException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str",e);
    return null;
  }
}
Program: 171920
Project: 171920
Buggy source:
private OpenEXICodec(){
  super();
  setOptions(GrammarOptions.DEFAULT_OPTIONS);
  setTransmogrifier(new Transmogrifier());
  getTransmogrifier().setValuePartitionCapacity(0);
  setSaxTransformerFactory((SAXTransformerFactory)SAXTransformerFactory.newInstance());
  setSaxParserFactory(SAXParserFactory.newInstance());
  getSaxParserFactory().setNamespaceAware(true);
  try {
    setTransformerHandler(getSaxTransformerFactory().newTransformerHandler());
  }
 catch (  TransformerConfigurationException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str");
  }
  setExiReader(new EXIReader());
  getExiReader().setValuePartitionCapacity(0);
  setExiSchemaFactory(new EXISchemaFactory());
  EXISchemaFactoryExceptionHandler esfe=new EXISchemaFactoryExceptionHandler();
  getExiSchemaFactory().setCompilerErrorHandler(esfe);
  setSchemaAppProtocolIS(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString()));
  setSchemaMsgDefIS(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()));
  try {
    setExiSchemaAppProtocol(getExiSchemaFactory().compile(new InputSource(getSchemaAppProtocolIS())));
    setExiSchemaMsgDef(new EXISchemaReader().parse(getClass().getResourceAsStream("String_Node_Str")));
  }
 catch (  IOException|EXISchemaFactoryException|EXIOptionsException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
private OpenEXICodec(){
  super();
  setOptions(GrammarOptions.DEFAULT_OPTIONS);
  setTransmogrifier(new Transmogrifier());
  getTransmogrifier().setValuePartitionCapacity(0);
  getTransmogrifier().setFragment(false);
  setSaxTransformerFactory((SAXTransformerFactory)SAXTransformerFactory.newInstance());
  setSaxParserFactory(SAXParserFactory.newInstance());
  getSaxParserFactory().setNamespaceAware(true);
  try {
    setTransformerHandler(getSaxTransformerFactory().newTransformerHandler());
  }
 catch (  TransformerConfigurationException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str");
  }
  setExiReader(new EXIReader());
  getExiReader().setValuePartitionCapacity(0);
  setExiSchemaFactory(new EXISchemaFactory());
  EXISchemaFactoryExceptionHandler esfe=new EXISchemaFactoryExceptionHandler();
  getExiSchemaFactory().setCompilerErrorHandler(esfe);
  setSchemaAppProtocolIS(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString()));
  setSchemaMsgDefIS(getClass().getResourceAsStream(GlobalValues.SCHEMA_PATH_MSG_DEF.toString()));
  try {
    setExiSchemaAppProtocol(getExiSchemaFactory().compile(new InputSource(getSchemaAppProtocolIS())));
    setExiSchemaMsgDef(new EXISchemaReader().parse(getClass().getResourceAsStream("String_Node_Str")));
  }
 catch (  IOException|EXISchemaFactoryException|EXIOptionsException e) {
    getLogger().error(e.getClass().getSimpleName() + "String_Node_Str",e);
  }
}
Program: 171921
Project: 171921
Buggy source:
public synchronized Object v2gMsgToExi(Object jaxbObject){
  byte[] encodedEXI=getExiCodec().encodeEXI(jaxbObject,false);
  return encodedEXI;
}

Fixed version (ground truth):
public synchronized Object v2gMsgToExi(Object jaxbObject){
  byte[] encodedEXI=getExiCodec().encodeEXI(jaxbObject,GlobalValues.SCHEMA_PATH_MSG_DEF.toString());
  return encodedEXI;
}
Program: 171922
Project: 171922
Buggy source:
public synchronized Object suppAppProtocolMsgToExi(Object suppAppProtocolObject){
  return getExiCodec().encodeEXI(suppAppProtocolObject,true);
}

Fixed version (ground truth):
public synchronized Object suppAppProtocolMsgToExi(Object suppAppProtocolObject){
  return getExiCodec().encodeEXI(suppAppProtocolObject,GlobalValues.SCHEMA_PATH_APP_PROTOCOL.toString());
}
Program: 171923
Project: 171923
Buggy source:
/** 
 * Generates a digest for a complete message or field (which ever is handed over as first parameter). During digest (SHA-256) generation, the parameter is converted to a JAXBElement and then EXI encoded  using the respective EXI schema-informed grammar. If the digest for the signature is to be generated,   the second parameter is to be set to true, for all other messages or fields the second parameter  needs to be set to false.
 * @param messageOrField The message or field for which a digest is to be generated
 * @param signature True if a digest for a signature is to be generated, false otherwise
 * @return The SHA-256 digest for message or field
 */
public static byte[] generateDigest(Object messageOrField,boolean signature){
  JAXBElement jaxbElement=MiscUtils.getJaxbElement(messageOrField);
  byte[] encoded;
  if (signature)   encoded=getExiCodec().encodeEXI(jaxbElement,false);
 else   encoded=getExiCodec().encodeEXI(jaxbElement,false);
  try {
    MessageDigest md=MessageDigest.getInstance("String_Node_Str");
    md.update(encoded);
    return md.digest();
  }
 catch (  NoSuchAlgorithmException e) {
    getLogger().error("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Generates a digest for a complete message or field (which ever is handed over as first parameter). During digest (SHA-256) generation, the parameter is converted to a JAXBElement and then EXI encoded  using the respective EXI schema-informed grammar. If the digest for the signature is to be generated,   the second parameter is to be set to true, for all other messages or fields the second parameter  needs to be set to false.
 * @param messageOrField The message or field for which a digest is to be generated
 * @param digestForSignedInfoElement True if a digest for the SignedInfoElement of the header's signature is to be generated, false otherwise
 * @return The SHA-256 digest for message or field
 */
public static byte[] generateDigest(Object messageOrField,boolean digestForSignedInfoElement){
  JAXBElement jaxbElement=MiscUtils.getJaxbElement(messageOrField);
  byte[] encoded;
  getExiCodec().setFragment(true);
  if (digestForSignedInfoElement)   encoded=getExiCodec().encodeEXI(jaxbElement,GlobalValues.SCHEMA_PATH_XMLDSIG.toString());
 else   encoded=getExiCodec().encodeEXI(jaxbElement,GlobalValues.SCHEMA_PATH_MSG_DEF.toString());
  getExiCodec().setFragment(false);
  try {
    MessageDigest md=MessageDigest.getInstance("String_Node_Str");
    md.update(encoded);
    return md.digest();
  }
 catch (  NoSuchAlgorithmException e) {
    getLogger().error("String_Node_Str",e);
    return null;
  }
}
Program: 171924
Project: 171924
Buggy source:
@Override public ECPrivateKey getContractCertificatePrivateKey(){
  KeyStore keyStore=SecurityUtils.getPKCS12KeyStore("String_Node_Str",GlobalValues.PASSPHRASE_FOR_CERTIFICATES_AND_KEYS.toString());
  return SecurityUtils.getPrivateKey(keyStore);
}

Fixed version (ground truth):
@Override public ECPrivateKey getContractCertificatePrivateKey(){
  KeyStore keyStore=SecurityUtils.getPKCS12KeyStore("String_Node_Str",GlobalValues.PASSPHRASE_FOR_CERTIFICATES_AND_KEYS.toString());
  ECPrivateKey privateKey=SecurityUtils.getPrivateKey(keyStore);
  if (privateKey == null)   getLogger().error("String_Node_Str");
  return privateKey;
}
Program: 171925
Project: 171925
Buggy source:
@Override public ECPrivateKey getSAProvisioningCertificatePrivateKey(){
  Path pathToPrivateKey=FileSystems.getDefault().getPath("String_Node_Str");
  byte[] moSub2PrivateKey=null;
  try {
    moSub2PrivateKey=Files.readAllBytes(pathToPrivateKey);
  }
 catch (  IOException e) {
    getLogger().error("String_Node_Str");
    return null;
  }
  return SecurityUtils.getPrivateKey(moSub2PrivateKey);
}

Fixed version (ground truth):
@Override public ECPrivateKey getSAProvisioningCertificatePrivateKey(){
  KeyStore keyStore=SecurityUtils.getPKCS12KeyStore("String_Node_Str",GlobalValues.PASSPHRASE_FOR_CERTIFICATES_AND_KEYS.toString());
  ECPrivateKey privateKey=SecurityUtils.getPrivateKey(keyStore);
  if (privateKey == null)   getLogger().error("String_Node_Str");
  return privateKey;
}
Program: 171928
Project: 171928
Buggy source:
/** 
 * Set time
 * @param hours   hours
 * @param minutes minutes
 */
public void setTime(int hours,int minutes){
  checkParams(hours,minutes);
  clockDrawable.setTime(new ClockTime(hours,minutes));
}

Fixed version (ground truth):
/** 
 * Set time
 * @param hours   hours
 * @param minutes minutes
 */
public void setTime(int hours,int minutes){
  checkParams(hours,minutes);
  clockDrawable.animate(new ClockTime(hours,minutes));
}
Program: 171929
Project: 171929
Buggy source:
public static void main(String[] args) throws ActiveMQException, InterruptedException, ExecutionException {
  if (args.length != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Logger logger=LoggerFactory.getLogger(TemplateClient.class);
  final HostAndPort nodeAddress=HostAndPort.fromString(args[0]);
  final CordaRPCClient client=new CordaRPCClient(nodeAddress,null,CordaRPCClientConfiguration.getDefault());
  final CordaRPCOps proxy=client.start("String_Node_Str","String_Node_Str").getProxy();
  final DataFeed<List<SignedTransaction>,SignedTransaction> txsAndFutureTxs=proxy.verifiedTransactionsFeed();
  final List<SignedTransaction> txs=txsAndFutureTxs.getSnapshot();
  final Observable<SignedTransaction> futureTxs=txsAndFutureTxs.getUpdates();
  futureTxs.startWith(txs).toBlocking().subscribe(transaction -> transaction.getTx().getOutputs().forEach(output -> {
    final TemplateState templateState=(TemplateState)output.getData();
    logger.info(templateState.toString());
  }
));
}

Fixed version (ground truth):
public static void main(String[] args) throws ActiveMQException, InterruptedException, ExecutionException {
  if (args.length != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Logger logger=LoggerFactory.getLogger(TemplateClient.class);
  final NetworkHostAndPort nodeAddress=NetworkHostAndPortKt.parseNetworkHostAndPort(args[0]);
  final CordaRPCClient client=new CordaRPCClient(nodeAddress,null,CordaRPCClientConfiguration.getDefault());
  final CordaRPCOps proxy=client.start("String_Node_Str","String_Node_Str").getProxy();
  final DataFeed<List<SignedTransaction>,SignedTransaction> txsAndFutureTxs=proxy.verifiedTransactionsFeed();
  final List<SignedTransaction> txs=txsAndFutureTxs.getSnapshot();
  final Observable<SignedTransaction> futureTxs=txsAndFutureTxs.getUpdates();
  futureTxs.startWith(txs).toBlocking().subscribe(transaction -> transaction.getTx().getOutputs().forEach(output -> {
    final TemplateState templateState=(TemplateState)output.getData();
    logger.info(templateState.toString());
  }
));
}
Program: 171930
Project: 171930
Buggy source:
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),null)),emptyList(),VerifierType.InMemory,emptyMap());
    try {
      NodeHandle nodeA=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeB=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeC=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      dsl.startWebserver(nodeA);
      dsl.startWebserver(nodeB);
      dsl.startWebserver(nodeC);
      dsl.waitForAllNodesToFinish();
    }
 catch (    Throwable e) {
      System.err.println("String_Node_Str" + e.getMessage());
      e.printStackTrace();
    }
    return null;
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),(X500Name)null)),emptyList(),VerifierType.InMemory,emptyMap());
    try {
      NodeHandle nodeA=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeB=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeC=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      dsl.startWebserver(nodeA);
      dsl.startWebserver(nodeB);
      dsl.startWebserver(nodeC);
      dsl.waitForAllNodesToFinish();
    }
 catch (    Throwable e) {
      System.err.println("String_Node_Str" + e.getMessage());
      e.printStackTrace();
    }
    return null;
  }
);
}
Program: 171931
Project: 171931
Buggy source:
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),null)),emptyList(),emptyMap());
    try {
      NodeHandle nodeA=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),emptyMap()).get();
      NodeHandle nodeB=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),emptyMap()).get();
      NodeHandle nodeC=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),emptyMap()).get();
      dsl.startWebserver(nodeA);
      dsl.startWebserver(nodeB);
      dsl.startWebserver(nodeC);
      dsl.waitForAllNodesToFinish();
    }
 catch (    Throwable e) {
      System.err.println("String_Node_Str" + e.getMessage());
      e.printStackTrace();
    }
    return null;
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),null)),emptyList(),VerifierType.InMemory,emptyMap());
    try {
      NodeHandle nodeA=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeB=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeC=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      dsl.startWebserver(nodeA);
      dsl.startWebserver(nodeB);
      dsl.startWebserver(nodeC);
      dsl.waitForAllNodesToFinish();
    }
 catch (    Throwable e) {
      System.err.println("String_Node_Str" + e.getMessage());
      e.printStackTrace();
    }
    return null;
  }
);
}
Program: 171932
Project: 171932
Buggy source:
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),null)),emptyList(),emptyMap());
    try {
      NodeHandle nodeA=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),emptyMap()).get();
      NodeHandle nodeB=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),emptyMap()).get();
      NodeHandle nodeC=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),emptyMap()).get();
      dsl.startWebserver(nodeA);
      dsl.startWebserver(nodeB);
      dsl.startWebserver(nodeC);
      dsl.waitForAllNodesToFinish();
    }
 catch (    Throwable e) {
      System.err.println("String_Node_Str" + e.getMessage());
      e.printStackTrace();
    }
    return null;
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),null)),emptyList(),VerifierType.InMemory,emptyMap());
    try {
      NodeHandle nodeA=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeB=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      NodeHandle nodeC=dsl.startNode("String_Node_Str",emptySet(),ImmutableList.of(user),VerifierType.InMemory,emptyMap()).get();
      dsl.startWebserver(nodeA);
      dsl.startWebserver(nodeB);
      dsl.startWebserver(nodeC);
      dsl.waitForAllNodesToFinish();
    }
 catch (    Throwable e) {
      System.err.println("String_Node_Str" + e.getMessage());
      e.printStackTrace();
    }
    return null;
  }
);
}
Program: 171933
Project: 171933
Buggy source:
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),null)),emptyList(),emptyMap());
    dsl.startNode("String_Node_Str",emptySet(),singletonList(user),emptyMap());
    dsl.startNode("String_Node_Str",emptySet(),singletonList(user),emptyMap());
    dsl.startNode("String_Node_Str",emptySet(),singletonList(user),emptyMap());
    dsl.waitForAllNodesToFinish();
    return null;
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  final User user=new User("String_Node_Str","String_Node_Str",emptySet());
  driver(true,dsl -> {
    dsl.startNode("String_Node_Str",singleton(new ServiceInfo(ValidatingNotaryService.Companion.getType(),null)),emptyList(),emptyMap());
    try {
      NodeHandle nodeA=dsl.startNode("String_Node_Str",emptySet(),singletonList(user),emptyMap()).get();
      NodeHandle nodeB=dsl.startNode("String_Node_Str",emptySet(),singletonList(user),emptyMap()).get();
      NodeHandle nodeC=dsl.startNode("String_Node_Str",emptySet(),singletonList(user),emptyMap()).get();
      dsl.startWebserver(nodeA);
      dsl.startWebserver(nodeB);
      dsl.startWebserver(nodeC);
      dsl.waitForAllNodesToFinish();
    }
 catch (    Throwable e) {
      System.err.println("String_Node_Str" + e.getMessage());
      e.printStackTrace();
    }
    return null;
  }
);
}
Program: 171934
Project: 171934
Buggy source:
public static void main(String[] args) throws ActiveMQException, InterruptedException, ExecutionException {
  if (args.length != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Logger logger=LoggerFactory.getLogger(ExampleClientRPC.class);
  final HostAndPort nodeAddress=HostAndPort.fromString(args[0]);
  final CordaRPCClient client=new CordaRPCClient(nodeAddress,ConfigUtilities.configureTestSSL());
  client.start("String_Node_Str","String_Node_Str");
  final CordaRPCOps proxy=client.proxy();
  final Pair<List<SignedTransaction>,Observable<SignedTransaction>> txsAndFutureTxs=proxy.verifiedTransactions();
  final List<SignedTransaction> txs=txsAndFutureTxs.getFirst();
  final Observable<SignedTransaction> futureTxs=txsAndFutureTxs.getSecond();
  futureTxs.startWith(txs).toBlocking().subscribe(transaction -> transaction.getTx().getOutputs().forEach(output -> {
    final PurchaseOrderState poState=(PurchaseOrderState)output.getData();
    logger.info(poState.getPurchaseOrder().toString());
  }
));
}

Fixed version (ground truth):
public static void main(String[] args) throws ActiveMQException, InterruptedException, ExecutionException {
  if (args.length != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Logger logger=LoggerFactory.getLogger(ExampleClientRPC.class);
  final HostAndPort nodeAddress=HostAndPort.fromString(args[0]);
  final CordaRPCClient client=new CordaRPCClient(nodeAddress,ConfigUtilities.configureTestSSL(),null);
  client.start("String_Node_Str","String_Node_Str");
  final CordaRPCOps proxy=client.proxy();
  final Pair<List<SignedTransaction>,Observable<SignedTransaction>> txsAndFutureTxs=proxy.verifiedTransactions();
  final List<SignedTransaction> txs=txsAndFutureTxs.getFirst();
  final Observable<SignedTransaction> futureTxs=txsAndFutureTxs.getSecond();
  futureTxs.startWith(txs).toBlocking().subscribe(transaction -> transaction.getTx().getOutputs().forEach(output -> {
    final PurchaseOrderState poState=(PurchaseOrderState)output.getData();
    logger.info(poState.getPurchaseOrder().toString());
  }
));
}
Program: 171935
Project: 171935
Buggy source:
public String removePersistentSettingString(String keyzone,String key,String defaultValue){
  String currentValue=getPersistentSettingString(keyzone,key,defaultValue);
  SharedPreferences settings=AVOSCloud.applicationContext.getSharedPreferences(keyzone,Context.MODE_PRIVATE);
  SharedPreferences.Editor editor=settings.edit();
  editor.remove(key);
  editor.commit();
  return currentValue;
}

Fixed version (ground truth):
public String removePersistentSettingString(String keyzone,String key,String defaultValue){
  if (null == AVOSCloud.applicationContext) {
    LogUtil.log.e("String_Node_Str");
    return defaultValue;
  }
  String currentValue=getPersistentSettingString(keyzone,key,defaultValue);
  SharedPreferences settings=AVOSCloud.applicationContext.getSharedPreferences(keyzone,Context.MODE_PRIVATE);
  SharedPreferences.Editor editor=settings.edit();
  editor.remove(key);
  editor.commit();
  return currentValue;
}
Program: 171936
Project: 171936
Buggy source:
public void removeKeyZonePersistentSettings(String keyzone){
  SharedPreferences settings=AVOSCloud.applicationContext.getSharedPreferences(keyzone,Context.MODE_PRIVATE);
  SharedPreferences.Editor editor=settings.edit();
  editor.clear();
  editor.commit();
}

Fixed version (ground truth):
public void removeKeyZonePersistentSettings(String keyzone){
  if (null == AVOSCloud.applicationContext) {
    LogUtil.log.e("String_Node_Str");
    return;
  }
  SharedPreferences settings=AVOSCloud.applicationContext.getSharedPreferences(keyzone,Context.MODE_PRIVATE);
  SharedPreferences.Editor editor=settings.edit();
  editor.clear();
  editor.commit();
}
Program: 171937
Project: 171937
Buggy source:
protected static void updateCurrentInstallation(){
  try {
    if (AVOSCloud.showInternalDebugLog()) {
      LogUtil.avlog.d("String_Node_Str");
    }
    AVInstallation currentInstallation=AVInstallation.readInstallationFile();
    if (currentInstallation != null && !AVUtils.isBlankString(currentInstallation.getObjectId())) {
      currentInstallation.fetchInBackground(new GetCallback<AVObject>(){
        @Override public void done(        AVObject object,        AVException e){
          AVInstallation updatedInstallation=(AVInstallation)object;
          try {
            AVInstallation.writeInstallationFile(updatedInstallation);
          }
 catch (          IOException e1) {
            if (AVOSCloud.showInternalDebugLog()) {
              e1.printStackTrace();
            }
          }
        }
      }
);
    }
  }
 catch (  Exception e) {
    if (AVOSCloud.showInternalDebugLog()) {
      LogUtil.log.e("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
protected static void updateCurrentInstallation(){
  try {
    if (AVOSCloud.showInternalDebugLog()) {
      LogUtil.avlog.d("String_Node_Str");
    }
    AVInstallation currentInstallation=AVInstallation.readInstallationFile(AVOSCloud.applicationContext);
    if (currentInstallation != null && !AVUtils.isBlankString(currentInstallation.getObjectId())) {
      currentInstallation.fetchInBackground(new GetCallback<AVObject>(){
        @Override public void done(        AVObject object,        AVException e){
          AVInstallation updatedInstallation=(AVInstallation)object;
          try {
            AVInstallation.writeInstallationFile(AVOSCloud.applicationContext,updatedInstallation);
          }
 catch (          IOException e1) {
            if (AVOSCloud.showInternalDebugLog()) {
              e1.printStackTrace();
            }
          }
        }
      }
);
    }
  }
 catch (  Exception e) {
    if (AVOSCloud.showInternalDebugLog()) {
      LogUtil.log.e("String_Node_Str",e);
    }
  }
}
Program: 171938
Project: 171938
Buggy source:
private static void createNewInstallation(){
  String id=genInstallationId();
  currentInstallation=new AVInstallation();
  currentInstallation.setInstallationId(id);
  currentInstallation.put(INSTALLATIONIDTAG,id);
  saveCurrentInstalationToLocal();
}

Fixed version (ground truth):
private static void createNewInstallation(Context ctx){
  String id=genInstallationId();
  currentInstallation=new AVInstallation();
  currentInstallation.setInstallationId(id);
  currentInstallation.put(INSTALLATIONIDTAG,id);
  saveCurrentInstalationToLocal(ctx);
}
Program: 171939
Project: 171939
Buggy source:
private static void writeInstallationFile(AVInstallation installation) throws IOException {
  if (installation != null) {
    installation.initialize();
    File installationFile=new File(AVOSCloud.applicationContext.getFilesDir(),INSTALLATION);
    String jsonString=JSON.toJSONString(installation,ObjectValueFilter.instance,SerializerFeature.WriteClassName,SerializerFeature.DisableCircularReferenceDetect);
    AVPersistenceUtils.saveContentToFile(jsonString,installationFile);
  }
}

Fixed version (ground truth):
private static void writeInstallationFile(Context ctx,AVInstallation installation) throws IOException {
  if (installation != null) {
    installation.initialize();
    File installationFile=new File(ctx.getFilesDir(),INSTALLATION);
    String jsonString=JSON.toJSONString(installation,ObjectValueFilter.instance,SerializerFeature.WriteClassName,SerializerFeature.DisableCircularReferenceDetect);
    AVPersistenceUtils.saveContentToFile(jsonString,installationFile);
  }
}
Program: 171940
Project: 171940
Buggy source:
@Override protected void onSaveSuccess(){
  super.onSaveSuccess();
  try {
    writeInstallationFile(this);
  }
 catch (  Exception e) {
    LogUtil.log.e(LOGTAG,e);
  }
}

Fixed version (ground truth):
@Override protected void onSaveSuccess(){
  super.onSaveSuccess();
  try {
    writeInstallationFile(AVOSCloud.applicationContext,this);
  }
 catch (  Exception e) {
    LogUtil.log.e(LOGTAG,e);
  }
}
Program: 171941
Project: 171941
Buggy source:
@Override public void done(AVObject object,AVException e){
  AVInstallation updatedInstallation=(AVInstallation)object;
  try {
    AVInstallation.writeInstallationFile(updatedInstallation);
  }
 catch (  IOException e1) {
    if (AVOSCloud.showInternalDebugLog()) {
      e1.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void done(AVObject object,AVException e){
  AVInstallation updatedInstallation=(AVInstallation)object;
  try {
    AVInstallation.writeInstallationFile(AVOSCloud.applicationContext,updatedInstallation);
  }
 catch (  IOException e1) {
    if (AVOSCloud.showInternalDebugLog()) {
      e1.printStackTrace();
    }
  }
}
Program: 171942
Project: 171942
Buggy source:
/** 
 * FeedbackThread.java 会反射调用此函数
 * @return
 */
public static AVInstallation getCurrentInstallation(){
  if (currentInstallation == null) {
synchronized (AVInstallation.class) {
      if (currentInstallation == null && readInstallationFile() == null) {
        createNewInstallation();
      }
    }
  }
  currentInstallation.initialize();
  return currentInstallation;
}

Fixed version (ground truth):
public static AVInstallation getCurrentInstallation(Context ctx){
  Context usingCtx=(null == ctx) ? AVOSCloud.applicationContext : ctx;
  if (currentInstallation == null) {
synchronized (AVInstallation.class) {
      if (currentInstallation == null && readInstallationFile(usingCtx) == null) {
        createNewInstallation(usingCtx);
      }
    }
  }
  if (currentInstallation != null) {
    currentInstallation.initialize();
  }
  return currentInstallation;
}
Program: 171943
Project: 171943
Buggy source:
@Override protected void onSaveFailure(){
  LogUtil.avlog.d("String_Node_Str");
synchronized (AVInstallation.class) {
    if (readInstallationFile() == null) {
      createNewInstallation();
    }
  }
}

Fixed version (ground truth):
@Override protected void onSaveFailure(){
  LogUtil.avlog.d("String_Node_Str");
synchronized (AVInstallation.class) {
    if (readInstallationFile(AVOSCloud.applicationContext) == null) {
      createNewInstallation(AVOSCloud.applicationContext);
    }
  }
}
Program: 171944
Project: 171944
Buggy source:
protected static AVInstallation readInstallationFile(){
  if (AVOSCloud.applicationContext == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  String json="String_Node_Str";
  try {
    File installationFile=new File(AVOSCloud.applicationContext.getFilesDir(),INSTALLATION);
    if (installationFile.exists()) {
      json=AVPersistenceUtils.readContentFromFile(installationFile);
      if (json.indexOf("String_Node_Str") >= 0) {
        currentInstallation=(AVInstallation)JSON.parse(json);
        return currentInstallation;
      }
 else {
        if (json.length() == UUID_LEN) {
          currentInstallation=new AVInstallation();
          currentInstallation.setInstallationId(json);
          saveCurrentInstalationToLocal();
          return currentInstallation;
        }
      }
    }
  }
 catch (  Exception e) {
    LogUtil.log.e(LOGTAG,json,e);
  }
  return null;
}

Fixed version (ground truth):
protected static AVInstallation readInstallationFile(Context usingCtx){
  if (null == usingCtx) {
    LogUtil.log.e(LOGTAG,"String_Node_Str");
    return null;
  }
  String json="String_Node_Str";
  try {
    File installationFile=new File(usingCtx.getFilesDir(),INSTALLATION);
    if (installationFile.exists()) {
      json=AVPersistenceUtils.readContentFromFile(installationFile);
      if (json.indexOf("String_Node_Str") >= 0) {
        currentInstallation=(AVInstallation)JSON.parse(json);
      }
 else {
        if (json.length() == UUID_LEN) {
          currentInstallation=new AVInstallation();
          currentInstallation.setInstallationId(json);
          saveCurrentInstalationToLocal(usingCtx);
        }
      }
      return currentInstallation;
    }
  }
 catch (  Exception e) {
    LogUtil.log.e(LOGTAG,json,e);
  }
  return null;
}
Program: 171945
Project: 171945
Buggy source:
private static void saveCurrentInstalationToLocal(){
  try {
    writeInstallationFile(currentInstallation);
  }
 catch (  Exception e) {
    LogUtil.log.e(LOGTAG,e);
  }
}

Fixed version (ground truth):
private static void saveCurrentInstalationToLocal(Context ctx){
  try {
    writeInstallationFile(ctx,currentInstallation);
  }
 catch (  Exception e) {
    LogUtil.log.e(LOGTAG,e);
  }
}
Program: 171949
Project: 171949
Buggy source:
protected Messages.DirectCommand getDirectCommand(){
  Messages.DirectCommand.Builder builder=Messages.DirectCommand.newBuilder();
  builder.setMsg(message);
  builder.setCid(conversationId);
  if (mentionAll) {
    builder.setMentionAll(mentionAll);
  }
  if (null != mentionList && mentionList.size() > 0) {
    builder.addAllMentionPids(mentionList);
  }
  if (null != messageOption) {
    if (messageOption.isReceipt()) {
      builder.setR(true);
    }
    if (messageOption.isTransient()) {
      builder.setTransient(true);
    }
    String pushData=messageOption.getPushData();
    if (!AVUtils.isBlankString(pushData)) {
      builder.setPushData(pushData);
    }
    if (messageOption.isWill()) {
      builder.setWill(true);
    }
  }
  if (!AVUtils.isBlankString(messageToken)) {
    builder.setDt(messageToken);
  }
  if (null != binaryMessage) {
    builder.setBinaryMsg(binaryMessage);
  }
  return builder.build();
}

Fixed version (ground truth):
protected Messages.DirectCommand getDirectCommand(){
  Messages.DirectCommand.Builder builder=Messages.DirectCommand.newBuilder();
  if (null != message) {
    builder.setMsg(message);
  }
  builder.setCid(conversationId);
  if (mentionAll) {
    builder.setMentionAll(mentionAll);
  }
  if (null != mentionList && mentionList.size() > 0) {
    builder.addAllMentionPids(mentionList);
  }
  if (null != messageOption) {
    if (messageOption.isReceipt()) {
      builder.setR(true);
    }
    if (messageOption.isTransient()) {
      builder.setTransient(true);
    }
    String pushData=messageOption.getPushData();
    if (!AVUtils.isBlankString(pushData)) {
      builder.setPushData(pushData);
    }
    if (messageOption.isWill()) {
      builder.setWill(true);
    }
  }
  if (!AVUtils.isBlankString(messageToken)) {
    builder.setDt(messageToken);
  }
  if (null != binaryMessage) {
    builder.setBinaryMsg(binaryMessage);
  }
  return builder.build();
}