nus-yam/ex-repair huggingface dataset:
Program: 48043
Project: 48043
Buggy source:
@Override public ServiceResponse stop() throws RemoteException {
  LOG.info("String_Node_Str");
  ServiceContext ctx=(ServiceContext)service.getApplicationContext();
  ShutdownTask task=new ShutdownTask(ctx,(ShutdownTaskResult)service);
  try {
    ShutdownTaskResponse response=task.execute().get();
    stopSelf();
    return response.getResponse();
  }
 catch (  ExecutionException|InterruptedException ex) {
    LOG.warn(ex.getMessage(),ex);
    stopSelf();
    return new ServiceErrorResponse(ServiceResponseStatusCodes.INTERNAL_ERROR,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public ServiceResponse stop() throws RemoteException {
  LOG.info("String_Node_Str");
  ServiceContext ctx=ServiceContext.getServiceContext();
  ShutdownTask task=new ShutdownTask(ctx,(ShutdownTaskResult)service);
  try {
    ShutdownTaskResponse response=task.execute().get();
    stopSelf();
    return response.getResponse();
  }
 catch (  ExecutionException|InterruptedException ex) {
    LOG.warn(ex.getMessage(),ex);
    stopSelf();
    return new ServiceErrorResponse(ServiceResponseStatusCodes.INTERNAL_ERROR,ex.getMessage());
  }
}
Program: 48044
Project: 48044
Buggy source:
public void enableNFCDispatch(Activity activity){
  if (isNFCAvailable && isNFCEnabled && isContextInitialized()) {
    LOG.debug("String_Node_Str");
    Intent activityIntent=new Intent(activity,activity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent pendingIntent=PendingIntent.getActivity(activity,0,activityIntent,0);
    NfcAdapter.getDefaultAdapter(ctx).enableForegroundDispatch(activity,pendingIntent,null,null);
  }
}

Fixed version (ground truth):
public void enableNFCDispatch(Activity activity){
  if (isNFCAvailable && isNFCEnabled && isContextInitialized()) {
    LOG.debug("String_Node_Str");
    Intent activityIntent=new Intent(activity,activity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent pendingIntent=PendingIntent.getActivity(activity,0,activityIntent,0);
    Context appCtx=ctx.getApplicationContext();
    NfcAdapter.getDefaultAdapter(appCtx).enableForegroundDispatch(activity,pendingIntent,null,null);
  }
}
Program: 48045
Project: 48045
Buggy source:
public void disableNFCDispatch(Activity activity){
  if (isNFCAvailable && isNFCEnabled && isContextInitialized()) {
    LOG.debug("String_Node_Str");
    NfcAdapter.getDefaultAdapter(ctx).disableForegroundDispatch(activity);
  }
}

Fixed version (ground truth):
public void disableNFCDispatch(Activity activity){
  if (isNFCAvailable && isNFCEnabled && isContextInitialized()) {
    LOG.debug("String_Node_Str");
    Context appCtx=ctx.getApplicationContext();
    NfcAdapter.getDefaultAdapter(appCtx).disableForegroundDispatch(activity);
  }
}
Program: 48046
Project: 48046
Buggy source:
public static void prepare(){
  serviceImpl=new Promise<>();
}

Fixed version (ground truth):
public static void prepare(){
  if (serviceImpl.isDelivered()) {
    initialise();
  }
}
Program: 48047
Project: 48047
Buggy source:
@Override public void close(){
  EacGuiService.prepare();
}

Fixed version (ground truth):
@Override public void close(){
  EacGuiService.close();
}
Program: 48048
Project: 48048
Buggy source:
@AfterMethod public void tearDown(){
  EacGuiService.prepare();
}

Fixed version (ground truth):
@AfterMethod public void tearDown(){
  EacGuiService.close();
}
Program: 48049
Project: 48049
Buggy source:
@Test public void testPinOkFirstTime() throws InterruptedException, RemoteException {
  EacGuiService.prepare();
  final EacGuiImpl anyGuiImpl=new EacGuiImpl();
  Thread t=new Thread(new Runnable(){
    @Override public void run(){
      UserConsentDescription uc=new UserConsentDescription("String_Node_Str");
      uc.getSteps().addAll(createInitialSteps());
      EacNavigator nav=new EacNavigator(anyGuiImpl,uc);
      ExecutionEngine exe=new ExecutionEngine(nav);
      exe.process();
    }
  }
,"String_Node_Str");
  t.start();
  ServerData sd=anyGuiImpl.getServerData();
  assertEquals(sd.getSubject(),"String_Node_Str");
  anyGuiImpl.selectAttributes(sd.getReadAccessAttributes(),sd.getWriteAccessAttributes());
  assertEquals(anyGuiImpl.getPinStatus(),"String_Node_Str");
  assertTrue(anyGuiImpl.enterPin(null,"String_Node_Str"));
  t.join();
}

Fixed version (ground truth):
@Test public void testPinOkFirstTime() throws InterruptedException, RemoteException {
  final EacGuiImpl anyGuiImpl=new EacGuiImpl();
  Thread t=new Thread(new Runnable(){
    @Override public void run(){
      UserConsentDescription uc=new UserConsentDescription("String_Node_Str");
      uc.getSteps().addAll(createInitialSteps());
      EacNavigator nav=new EacNavigator(anyGuiImpl,uc);
      ExecutionEngine exe=new ExecutionEngine(nav);
      exe.process();
    }
  }
,"String_Node_Str");
  t.start();
  ServerData sd=anyGuiImpl.getServerData();
  assertEquals(sd.getSubject(),"String_Node_Str");
  anyGuiImpl.selectAttributes(sd.getReadAccessAttributes(),sd.getWriteAccessAttributes());
  assertEquals(anyGuiImpl.getPinStatus(),"String_Node_Str");
  assertTrue(anyGuiImpl.enterPin(null,"String_Node_Str"));
  t.join();
}
Program: 48050
Project: 48050
Buggy source:
@AfterMethod public void tearDown(){
  EacGuiService.prepare();
}

Fixed version (ground truth):
@AfterMethod public void tearDown(){
  EacGuiService.close();
}
Program: 48051
Project: 48051
Buggy source:
@Test public void givenBindingStartsBeforeGuiAssignmentThenBindingWaitsForGuiAssignment(@Tested final EacGuiService sut,@Mocked final Intent inputIntent,@Mocked EacGuiImpl inputGui) throws InterruptedException, ExecutionException {
  Future<IBinder> future=callBindAsync(sut,inputIntent);
  TimeUnit.MILLISECONDS.sleep(2);
  EacGuiService.setGuiImpl(inputGui);
  IBinder result=future.get();
  assertEquals(result,inputGui);
}

Fixed version (ground truth):
@Test public void givenBindingStartsBeforeGuiAssignmentThenBindingWaitsForGuiAssignment(@Tested final EacGuiService sut,@Mocked final Intent inputIntent,@Mocked EacGuiImpl inputGui) throws InterruptedException, ExecutionException, TimeoutException {
  Future<IBinder> future=callBindAsync(sut,inputIntent);
  TimeUnit.MILLISECONDS.sleep(2);
  EacGuiService.setGuiImpl(inputGui);
  IBinder result=getValueImmediately(future);
  assertEquals(result,inputGui);
}
Program: 48052
Project: 48052
Buggy source:
@AfterMethod public void tearDown(){
  EacGuiService.prepare();
}

Fixed version (ground truth):
@AfterMethod public void tearDown(){
  EacGuiService.close();
}
Program: 48053
Project: 48053
Buggy source:
@Override public void disconnect(boolean arg0) throws SCIOException {
  try {
    nfcCardChannel.close();
    if (isodep != null) {
      isodep.close();
      isodep=null;
    }
  }
 catch (  IOException e) {
    throw new SCIOException("String_Node_Str",SCIOErrorCode.SCARD_F_UNKNOWN_ERROR,e);
  }
}

Fixed version (ground truth):
@Override public void disconnect(boolean arg0) throws SCIOException {
  try {
    nfcCardChannel.close();
synchronized (this) {
      if (isodep != null) {
        isodep.close();
        isodep=null;
      }
    }
  }
 catch (  IOException e) {
    throw new SCIOException("String_Node_Str",SCIOErrorCode.SCARD_F_UNKNOWN_ERROR,e);
  }
}
Program: 48054
Project: 48054
Buggy source:
public List<OutputInfoUnit> getPinResult(Step pinStep) throws InterruptedException {
  boolean hasPin=false;
  boolean hasCan=false;
  for (  InputInfoUnit nextIn : pinStep.getInputInfoUnits()) {
    if (nextIn.getID().equals("String_Node_Str")) {
      hasPin=true;
    }
 else     if (nextIn.getID().equals("String_Node_Str")) {
      hasCan=true;
    }
  }
  if (hasPin && !hasCan) {
    this.pinStatus.deliver(PinStatus.PIN.name());
  }
 else   if (hasPin && hasCan) {
    this.pinStatus.deliver(PinStatus.CAN.name());
  }
 else {
    this.pinStatus.deliver(PinStatus.BLOCKED.name());
    return Collections.EMPTY_LIST;
  }
  String pinValue=this.userPin.deref();
  String canValue=this.userCan.deref();
  ArrayList<OutputInfoUnit> result=new ArrayList<>();
  for (  InputInfoUnit nextIn : pinStep.getInputInfoUnits()) {
    if (pinValue != null && nextIn instanceof PasswordField && nextIn.getID().equals("String_Node_Str")) {
      PasswordField pw=new PasswordField(nextIn.getID());
      pw.copyContentFrom(nextIn);
      pw.setValue(pinValue.toCharArray());
    }
 else     if (canValue != null && nextIn instanceof PasswordField && nextIn.getID().equals("String_Node_Str")) {
      PasswordField pw=new PasswordField(nextIn.getID());
      pw.copyContentFrom(nextIn);
      pw.setValue(canValue.toCharArray());
    }
  }
  return result;
}

Fixed version (ground truth):
public List<OutputInfoUnit> getPinResult(Step pinStep) throws InterruptedException {
  boolean hasPin=false;
  boolean hasCan=false;
  for (  InputInfoUnit nextIn : pinStep.getInputInfoUnits()) {
    if (nextIn.getID().equals("String_Node_Str")) {
      hasPin=true;
    }
 else     if (nextIn.getID().equals("String_Node_Str")) {
      hasCan=true;
    }
  }
  if (hasPin && !hasCan) {
    this.pinStatus.deliver(PinStatus.PIN.name());
  }
 else   if (hasPin && hasCan) {
    this.pinStatus.deliver(PinStatus.CAN.name());
  }
 else {
    this.pinStatus.deliver(PinStatus.BLOCKED.name());
    return Collections.EMPTY_LIST;
  }
  String pinValue=this.userPin.deref();
  String canValue=this.userCan.deref();
  ArrayList<OutputInfoUnit> result=new ArrayList<>();
  for (  InputInfoUnit nextIn : pinStep.getInputInfoUnits()) {
    if (pinValue != null && nextIn instanceof PasswordField && nextIn.getID().equals("String_Node_Str")) {
      PasswordField pw=new PasswordField(nextIn.getID());
      pw.copyContentFrom(nextIn);
      pw.setValue(pinValue.toCharArray());
      result.add(pw);
    }
 else     if (canValue != null && nextIn instanceof PasswordField && nextIn.getID().equals("String_Node_Str")) {
      PasswordField pw=new PasswordField(nextIn.getID());
      pw.copyContentFrom(nextIn);
      pw.setValue(canValue.toCharArray());
      result.add(pw);
    }
  }
  return result;
}
Program: 48055
Project: 48055
Buggy source:
public static synchronized Promise<EacGuiImpl> getServiceImpl(){
  return serviceImpl;
}

Fixed version (ground truth):
static synchronized Promise<EacGuiImpl> getServiceImpl(){
  return serviceImpl;
}
Program: 48056
Project: 48056
Buggy source:
private void writeBackValues(List<InputInfoUnit> inInfo,List<OutputInfoUnit> outInfo){
  for (  InputInfoUnit infoInUnit : inInfo) {
    for (    OutputInfoUnit infoOutUnit : outInfo) {
      if (infoInUnit.getID().equals(infoOutUnit.getID())) {
        infoOutUnit.copyContentFrom(infoInUnit);
      }
    }
  }
}

Fixed version (ground truth):
private void writeBackValues(List<InputInfoUnit> inInfo,List<OutputInfoUnit> outInfo){
  for (  InputInfoUnit infoInUnit : inInfo) {
    for (    OutputInfoUnit infoOutUnit : outInfo) {
      if (infoInUnit.getID().equals(infoOutUnit.getID())) {
        infoInUnit.copyContentFrom(infoOutUnit);
      }
    }
  }
}
Program: 48058
Project: 48058
Buggy source:
/** 
 * Returns the encoded APDU: CLA | INS | P1 | P2 | (EXT)LC | DATA | (EXT)LE
 * @return Encoded APDU
 */
public final byte[] toByteArray(){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    baos.write(header);
    if (lc > 255 || (le > 256 && lc > 0)) {
      baos.write(x00);
      baos.write((byte)(lc >> 8));
      baos.write((byte)lc);
    }
 else     if (lc > 0) {
      baos.write((byte)lc);
    }
    baos.write(data);
    if (le > 256) {
      if (lc == 0 || lc == -1) {
        baos.write(x00);
      }
      if (le >= 65536) {
        baos.write(x00);
        baos.write(x00);
      }
 else {
        baos.write((byte)(le >> 8));
        baos.write((byte)le);
      }
    }
 else     if (le > 0) {
      if (lc > 255) {
        baos.write((byte)(le >> 8));
        baos.write((byte)le);
      }
 else {
        baos.write((byte)le);
      }
    }
  }
 catch (  IOException ex) {
    logger.error("String_Node_Str",ex);
  }
  return baos.toByteArray();
}

Fixed version (ground truth):
/** 
 * Returns the encoded APDU: CLA | INS | P1 | P2 | (EXT)LC | DATA | (EXT)LE
 * @return Encoded APDU
 */
public final byte[] toByteArray(){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  try {
    baos.write(header);
    if (lc > 255 || (le > 256 && lc > 0)) {
      baos.write(x00);
      baos.write((byte)(lc >> 8));
      baos.write((byte)lc);
    }
 else     if (lc > 0) {
      baos.write((byte)lc);
    }
    baos.write(data);
    if (le > 256) {
      if (lc == 0 || lc == -1) {
        baos.write(x00);
      }
      if (le >= 65536) {
        baos.write(x00);
        baos.write(x00);
      }
 else {
        baos.write((byte)(le >> 8));
        baos.write((byte)le);
      }
    }
 else     if (le > 0) {
      if (lc > 255) {
        baos.write((byte)(le >> 8));
        baos.write((byte)le);
      }
 else {
        baos.write((byte)le);
      }
    }
  }
 catch (  IOException ex) {
    LOG.error("String_Node_Str",ex);
  }
  return baos.toByteArray();
}
Program: 48059
Project: 48059
Buggy source:
private void revalidate(JComponent c){
  for (int i=0; i < c.getComponentCount(); i++) {
    this.revalidate((JComponent)c.getComponent(i));
  }
  c.revalidate();
  c.repaint();
}

Fixed version (ground truth):
private void revalidate(Component c){
  c.revalidate();
  c.repaint();
}
Program: 48061
Project: 48061
Buggy source:
/** 
 * Creates a new EAC2InputType.
 * @param baseType DIDAuthenticationDataType
 * @throws Exception
 */
public EAC2InputType(DIDAuthenticationDataType baseType) throws Exception {
  this.authMap=new AuthDataMap(baseType);
  certificates=new ArrayList<>();
  for (  Element element : baseType.getAny()) {
    if (element.getLocalName().equals(CERTIFICATE)) {
      byte[] value=StringUtils.toByteArray(element.getTextContent());
      CardVerifiableCertificate cvc=new CardVerifiableCertificate(value);
      certificates.add(cvc);
    }
  }
  ephemeralPublicKey=authMap.getContentAsBytes(EPHEMERAL_PUBLIC_KEY);
  signature=authMap.getContentAsBytes(SIGNATURE);
}

Fixed version (ground truth):
/** 
 * Creates a new EAC2InputType.
 * @param baseType DIDAuthenticationDataType
 * @throws Exception Thrown in cause the type iss errornous.
 */
public EAC2InputType(DIDAuthenticationDataType baseType) throws Exception {
  this.authMap=new AuthDataMap(baseType);
  certificates=new ArrayList<>();
  for (  Element element : baseType.getAny()) {
    if (element.getLocalName().equals(CERTIFICATE)) {
      byte[] value=StringUtils.toByteArray(element.getTextContent());
      CardVerifiableCertificate cvc=new CardVerifiableCertificate(value);
      certificates.add(cvc);
    }
  }
  ephemeralPublicKey=authMap.getContentAsBytes(EPHEMERAL_PUBLIC_KEY);
  signature=authMap.getContentAsBytes(SIGNATURE);
}
Program: 48062
Project: 48062
Buggy source:
/** 
 * Sets the challenge.
 * @param challenge
 */
public void setChallenge(byte[] challenge){
  this.challenge=challenge;
}

Fixed version (ground truth):
/** 
 * Sets the challenge.
 * @param challenge Challenge value.
 */
public void setChallenge(byte[] challenge){
  this.challenge=challenge;
}
Program: 48063
Project: 48063
Buggy source:
/** 
 * Creates a new EACAdditionalInputType.
 * @param baseType DIDAuthenticationDataType
 * @throws ParserConfigurationException
 */
public EACAdditionalInputType(DIDAuthenticationDataType baseType) throws ParserConfigurationException {
  authMap=new AuthDataMap(baseType);
  signature=authMap.getContentAsBytes(SIGNATURE);
}

Fixed version (ground truth):
/** 
 * Creates a new EACAdditionalInputType.
 * @param baseType DIDAuthenticationDataType
 * @throws ParserConfigurationException Thrown in case the parser couldn't be loaded.
 */
public EACAdditionalInputType(DIDAuthenticationDataType baseType) throws ParserConfigurationException {
  authMap=new AuthDataMap(baseType);
  signature=authMap.getContentAsBytes(SIGNATURE);
}
Program: 48064
Project: 48064
Buggy source:
/** 
 * Creates a new PACEInputType.
 * @param baseType DIDAuthenticationDataType
 * @throws ParserConfigurationException
 */
public PACEInputType(DIDAuthenticationDataType baseType) throws ParserConfigurationException {
  authMap=new AuthDataMap(baseType);
  pinID=authMap.getContentAsBytes(PIN_ID)[0];
  chat=authMap.getContentAsBytes(CHAT);
  pin=authMap.getContentAsString(PIN);
  certDesc=authMap.getContentAsBytes(CERTIFICATE_DESCRIPTION);
}

Fixed version (ground truth):
/** 
 * Creates a new PACEInputType.
 * @param baseType DIDAuthenticationDataType
 * @throws ParserConfigurationException Thrown in case the parser couldn't be loaded.
 */
public PACEInputType(DIDAuthenticationDataType baseType) throws ParserConfigurationException {
  authMap=new AuthDataMap(baseType);
  pinID=authMap.getContentAsBytes(PIN_ID)[0];
  chat=authMap.getContentAsBytes(CHAT);
  pin=authMap.getContentAsString(PIN);
  certDesc=authMap.getContentAsBytes(CERTIFICATE_DESCRIPTION);
}
Program: 48066
Project: 48066
Buggy source:
/** 
 * Replace minor code for use in refresh URLs. BSI TR-03124-1 defines non URL versions of the ResultMinor codes from BSI TR-03112.
 * @param minor
 * @return
 */
public static String fixResultMinor(@Nonnull String minor){
  int idx=minor.lastIndexOf("String_Node_Str");
  if (idx != -1) {
    idx++;
    if (idx < minor.length()) {
      minor=minor.substring(idx);
    }
  }
  return minor;
}

Fixed version (ground truth):
/** 
 * Replace minor code for use in refresh URLs. BSI TR-03124-1 defines non URL versions of the ResultMinor codes from BSI TR-03112.
 * @param minor
 * @return Code part of the minor code URL.
 */
@Nonnull public static String fixResultMinor(@Nonnull String minor){
  int idx=minor.lastIndexOf("String_Node_Str");
  if (idx != -1) {
    idx++;
    if (idx < minor.length()) {
      minor=minor.substring(idx);
    }
  }
  return minor;
}
Program: 48068
Project: 48068
Buggy source:
/** 
 * Get the translated value for the given key. The implementation tries to find the key in the requested language, then the default language and if nothing is specified at all, a special string in the form of &lt;No translation for key &lt;requested.key&gt;&gt; is returned.
 * @param key Key as defined in language properties file.
 * @param parameters If any parameters are given here, the string is interpreted as a template and the parametersare applied. The template interpretation uses  {@link String#format()} as the rendering method.
 * @return Translation as specified in the translation, or default file.
 */
public String translationForKey(I18nKey key,Object... parameters){
  return translationForKey(key.getKey(),parameters);
}

Fixed version (ground truth):
/** 
 * Get the translated value for the given key. The implementation tries to find the key in the requested language, then the default language and if nothing is specified at all, a special string in the form of &lt;No translation for key &lt;requested.key&gt;&gt; is returned.
 * @param key Key as defined in language properties file.
 * @param parameters If any parameters are given here, the string is interpreted as a template and the parametersare applied. The template interpretation uses  {@link String#format(String,Object)} as the rendering method.
 * @return Translation as specified in the translation, or default file.
 */
public String translationForKey(I18nKey key,Object... parameters){
  return translationForKey(key.getKey(),parameters);
}
Program: 48069
Project: 48069
Buggy source:
/** 
 * Returns a iterator over the chaining APDUs.
 * @return
 */
public final Iterable getChainingIterator(){
  throw new IllegalAccessError("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Returns a iterator over the chaining APDUs.
 * @return Iterator containing the APDUs.
 */
public final Iterable getChainingIterator(){
  throw new IllegalAccessError("String_Node_Str");
}
Program: 48070
Project: 48070
Buggy source:
/** 
 * Select an application by the application identifier. This method requests the FCP of the application.
 * @param dispatcher
 * @param slotHandle
 * @param aid Application identifier
 * @return
 * @throws APDUException
 */
public static CardResponseAPDU selectApplicationByAID(Dispatcher dispatcher,byte[] slotHandle,byte[] aid) throws APDUException {
  Select selectApp=new Select((byte)0x04,(byte)0x04);
  selectApp.setData(aid);
  selectApp.setLE((byte)0xFF);
  CardResponseAPDU result=selectApp.transmit(dispatcher,slotHandle);
  return result;
}

Fixed version (ground truth):
/** 
 * Select an application by the application identifier. This method requests the FCP of the application.
 * @param dispatcher
 * @param slotHandle
 * @param aid Application identifier
 * @return Response APDU of the select command.
 * @throws APDUException Thrown in case there was an error while processing the command APDU.
 */
public static CardResponseAPDU selectApplicationByAID(Dispatcher dispatcher,byte[] slotHandle,byte[] aid) throws APDUException {
  Select selectApp=new Select((byte)0x04,(byte)0x04);
  selectApp.setData(aid);
  selectApp.setLE((byte)0xFF);
  CardResponseAPDU result=selectApp.transmit(dispatcher,slotHandle);
  return result;
}
Program: 48071
Project: 48071
Buggy source:
/** 
 * Get the value of the identifier property. The identifier is here a credential identifier.
 * @return
 */
public TLV getIdentifier(){
  return identifier;
}

Fixed version (ground truth):
/** 
 * Get the value of the identifier property. The identifier here is a credential identifier.
 * @return Identifier structure.
 */
public TLV getIdentifier(){
  return identifier;
}
Program: 48072
Project: 48072
Buggy source:
/** 
 * List of credential identifiers.
 * @return
 */
public TLV getIdentifiers(){
  return identifiers;
}

Fixed version (ground truth):
/** 
 * List of credential identifiers.
 * @return Identifiers structure.
 */
public TLV getIdentifiers(){
  return identifiers;
}
Program: 48073
Project: 48073
Buggy source:
/** 
 * Get the uniform resource locator which points to part of the software required in the interface device to  communicate with the application in the card.
 * @return 
 */
public String getURL(){
  return uniformResourceLocator;
}

Fixed version (ground truth):
/** 
 * Get the uniform resource locator which points to the part of the software required in the interface device to communicate with the application in the card.
 * @return The URL contained in the FMD.
 */
public String getURL(){
  return uniformResourceLocator;
}
Program: 48075
Project: 48075
Buggy source:
/** 
 * Uninstall an add-on. This i primarily a wrapper method for the  {@link FileRegistry#uninstallAddon(org.openecard.addon.manifest.AddonSpecification)}
 * @param addonSpec The {@link AddonSpecification} of the add-on to uninstall.
 */
public void uninstallAddon(@Nonnull AddonSpecification addonSpec){
  registry.getFileRegistry().uninstallAddon(addonSpec);
}

Fixed version (ground truth):
/** 
 * Uninstall an add-on. This is primarily a wrapper method for the   {@link FileRegistry#uninstallAddon(AddonSpecification)}
 * @param addonSpec The specification of the add-on to uninstall.
 */
public void uninstallAddon(@Nonnull AddonSpecification addonSpec){
  registry.getFileRegistry().uninstallAddon(addonSpec);
}
Program: 48076
Project: 48076
Buggy source:
/** 
 * Get the additional label. <br /> This value might be null because it is optional.
 * @return The additional label.
 */
private String getAddLabel(){
  return addLabel;
}

Fixed version (ground truth):
/** 
 * Get the additional label. <br> This value might be null because it is optional.
 * @return The additional label.
 */
private String getAddLabel(){
  return addLabel;
}
Program: 48077
Project: 48077
Buggy source:
/** 
 * The constructor parses a string as semantic version. <br /> If the string does not contain a semantic version major, minor and patch version are set to zero and the
 * @param version The version string which should be parsed as semantic version.
 */
private SemanticVersion(String version){
  String[] groups=new String[4];
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(version);
  if (m.matches() && m.groupCount() >= 3) {
    groups[0]=m.group(1);
    groups[1]=m.group(2);
    groups[2]=m.group(3);
    groups[3]=m.group(4);
    if (groups[3] != null) {
      groups[3]=groups[3].substring(1);
    }
    major=Integer.parseInt(groups[0]);
    minor=Integer.parseInt(groups[1]);
    patch=Integer.parseInt(groups[2]);
    addLabel=groups[3];
    isSemVersion=true;
  }
 else {
    major=0;
    minor=0;
    patch=0;
    addLabel=null;
    isSemVersion=false;
  }
}

Fixed version (ground truth):
/** 
 * The constructor parses a string as semantic version. <br> If the string does not contain a semantic version major, minor and patch version are set to zero and the
 * @param version The version string which should be parsed as semantic version.
 */
private SemanticVersion(String version){
  String[] groups=new String[4];
  Pattern p=Pattern.compile("String_Node_Str");
  Matcher m=p.matcher(version);
  if (m.matches() && m.groupCount() >= 3) {
    groups[0]=m.group(1);
    groups[1]=m.group(2);
    groups[2]=m.group(3);
    groups[3]=m.group(4);
    if (groups[3] != null) {
      groups[3]=groups[3].substring(1);
    }
    major=Integer.parseInt(groups[0]);
    minor=Integer.parseInt(groups[1]);
    patch=Integer.parseInt(groups[2]);
    addLabel=groups[3];
    isSemVersion=true;
  }
 else {
    major=0;
    minor=0;
    patch=0;
    addLabel=null;
    isSemVersion=false;
  }
}
Program: 48078
Project: 48078
Buggy source:
/** 
 * Get a byte array containing the logo. <br /> Note: This method creates always a new input stream and does not store the byte array internally.
 * @return A byte array containing the logo bytes or null if no logo is present or an error occurred.
 */
public byte[] getLogoBytes(){
  if (logo != null && !logo.isEmpty()) {
    try {
      InputStream logoStream=FileUtils.resolveResourceAsStream(AddonSpecification.class,logo);
      return FileUtils.toByteArray(logoStream);
    }
 catch (    FileNotFoundException e) {
      logger.error("String_Node_Str",e);
      return null;
    }
catch (    IOException|NullPointerException e) {
      logger.error("String_Node_Str",e);
      return null;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get a byte array containing the logo. <br> Note: This method creates always a new input stream and does not store the byte array internally.
 * @return A byte array containing the logo bytes or null if no logo is present or an error occurred.
 */
public byte[] getLogoBytes(){
  if (logo != null && !logo.isEmpty()) {
    try {
      InputStream logoStream=FileUtils.resolveResourceAsStream(AddonSpecification.class,logo);
      return FileUtils.toByteArray(logoStream);
    }
 catch (    FileNotFoundException e) {
      logger.error("String_Node_Str",e);
      return null;
    }
catch (    IOException|NullPointerException e) {
      logger.error("String_Node_Str",e);
      return null;
    }
  }
  return null;
}
Program: 48079
Project: 48079
Buggy source:
public synchronized IFDStatusType getStatus() throws IFDException {
  try {
    IFDStatusType status=new IFDStatusType();
    status.setIFDName(getName());
    status.setConnected(true);
    SlotStatusType stype=new SlotStatusType();
    status.getSlotStatus().add(stype);
    boolean cardPresent=isCardPresent();
    stype.setCardAvailable(cardPresent);
    stype.setIndex(IFDUtils.getSlotIndex(getName()));
    if (cardPresent) {
      if (isConnected()) {
        SCIOATR atr=scCard.getATR();
        stype.setATRorATS(atr.getBytes());
      }
 else {
        SCIOCard c=terminal.connect("String_Node_Str");
        SCIOATR atr=c.getATR();
        stype.setATRorATS(atr.getBytes());
        c.disconnect(false);
      }
    }
    return status;
  }
 catch (  Exception ex) {
    IFDException ifdex=new IFDException(ex);
    _logger.warn(ifdex.getMessage(),ifdex);
    throw ifdex;
  }
}

Fixed version (ground truth):
public synchronized IFDStatusType getStatus() throws IFDException {
  try {
    IFDStatusType status=new IFDStatusType();
    status.setIFDName(getName());
    status.setConnected(true);
    SlotStatusType stype=new SlotStatusType();
    status.getSlotStatus().add(stype);
    boolean cardPresent=isCardPresent();
    stype.setCardAvailable(cardPresent);
    stype.setIndex(IFDUtils.getSlotIndex(getName()));
    if (cardPresent) {
      if (isConnected()) {
        SCIOATR atr=scCard.getATR();
        stype.setATRorATS(atr.getBytes());
      }
 else {
        SCIOCard c=terminal.connect("String_Node_Str");
        SCIOATR atr=c.getATR();
        stype.setATRorATS(atr.getBytes());
        c.disconnect(false);
        scCard=new SCCard(c,this);
      }
    }
    return status;
  }
 catch (  Exception ex) {
    IFDException ifdex=new IFDException(ex);
    _logger.warn(ifdex.getMessage(),ifdex);
    throw ifdex;
  }
}
Program: 48080
Project: 48080
Buggy source:
/** 
 * Returns the byte encoded APDU: TRAILER | DATA
 * @return Encoded APDU
 */
public byte[] toByteArray(){
  ByteArrayOutputStream baos=new ByteArrayOutputStream(data.length + 2);
  try {
    baos.write(trailer);
    baos.write(data);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return baos.toByteArray();
}

Fixed version (ground truth):
/** 
 * Returns the byte encoded APDU: TRAILER | DATA
 * @return Encoded APDU
 */
public byte[] toByteArray(){
  ByteArrayOutputStream baos=new ByteArrayOutputStream(data.length + 2);
  try {
    baos.write(data);
    baos.write(trailer);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return baos.toByteArray();
}
Program: 48081
Project: 48081
Buggy source:
Object initialize();

Fixed version (ground truth):
void initialize();
Program: 48082
Project: 48082
Buggy source:
public EventTypeFilter(EventType... eventType){
  if (eventType.length == 0) {
    this.eventType=new ArrayList<EventType>(Arrays.asList(EventType.values()));
  }
 else {
    this.eventType=new ArrayList<EventType>(Arrays.asList(eventType));
  }
}

Fixed version (ground truth):
public EventTypeFilter(EventType... eventType){
  if (eventType.length == 0) {
    this.eventType=new ArrayList<>(Arrays.asList(EventType.values()));
  }
 else {
    this.eventType=new ArrayList<>(Arrays.asList(eventType));
  }
}
Program: 48083
Project: 48083
Buggy source:
public EventDispatcher(EventManager manager){
  this.manager=manager;
  this.guard=new Semaphore(1);
  this.eventFilter=new ConcurrentHashMap<EventCallback,ArrayList<EventFilter>>();
}

Fixed version (ground truth):
public EventDispatcher(EventManager manager){
  this.manager=manager;
  this.guard=new Semaphore(1);
  this.eventFilter=new ConcurrentHashMap<>();
}
Program: 48084
Project: 48084
Buggy source:
protected List<IFDStatusType> ifdStatus() throws WSException {
  GetStatus status=new GetStatus();
  status.setContextHandle(ctx);
  GetStatusResponse statusResponse=env.getIFD().getStatus(status);
  List<IFDStatusType> result;
  WSHelper.checkResult(statusResponse);
  result=statusResponse.getIFDStatus();
  return result;
}

Fixed version (ground truth):
@Nonnull protected List<IFDStatusType> ifdStatus() throws WSException {
  GetStatus status=new GetStatus();
  status.setContextHandle(ctx);
  GetStatusResponse statusResponse=env.getIFD().getStatus(status);
  List<IFDStatusType> result;
  WSHelper.checkResult(statusResponse);
  result=statusResponse.getIFDStatus();
  return result;
}
Program: 48085
Project: 48085
Buggy source:
@Override public synchronized Object initialize(){
  threadPool=Executors.newCachedThreadPool();
  watcher=threadPool.submit(new EventRunner(this,builder));
  return new ArrayList<ConnectionHandleType>();
}

Fixed version (ground truth):
@Override public synchronized void initialize(){
  threadPool=Executors.newCachedThreadPool();
  try {
    watcher=threadPool.submit(new EventRunner(this,builder));
  }
 catch (  WSException ex) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 48086
Project: 48086
Buggy source:
/** 
 * @param ifdName
 * @return
 * @throws NoSuchTerminal
 * @throws SCIOException
 * @throws IllegalStateException
 * @throws NullPointerException
 * @throws SecurityException
 */
@Nonnull public byte[] openChannel(@Nonnull String ifdName) throws NoSuchTerminal, SCIOException, IllegalStateException {
  SCIOTerminal t=terminals.getTerminal(ifdName);
  SCIOCard card=t.connect(SCIOProtocol.ANY);
  SCIOChannel channel=card.getBasicChannel();
  byte[] slotHandle=createSlotHandle();
  HandledChannel ch=new HandledChannel(slotHandle,channel);
  channels.put(slotHandle,ch);
  return slotHandle.clone();
}

Fixed version (ground truth):
/** 
 * @param ifdName
 * @return
 * @throws NoSuchTerminal
 * @throws SCIOException
 * @throws IllegalStateException
 * @throws NullPointerException
 * @throws SecurityException
 */
@Nonnull public byte[] openChannel(@Nonnull String ifdName) throws NoSuchTerminal, SCIOException, IllegalStateException {
  SCIOTerminal t=getTerminals().getTerminal(ifdName);
  SCIOCard card=t.connect(SCIOProtocol.ANY);
  SCIOChannel channel=card.getBasicChannel();
  byte[] slotHandle=createSlotHandle();
  HandledChannel ch=new HandledChannel(slotHandle,channel);
  channels.put(slotHandle,ch);
  return slotHandle.clone();
}
Program: 48091
Project: 48091
Buggy source:
/** 
 * Check the status code returned from the server. If the status code indicates an error, a PAOSException will be thrown.
 * @param statusCode The status code we received from the server
 * @throws PAOSException If the server returned a HTTP error code
 */
private void checkHTTPStatusCode(int statusCode) throws PAOSException {
  if (statusCode != 200 && statusCode != 202) {
    throw new PAOSException(INVALID_HTTP_STATUS,statusCode);
  }
 else   if (statusCode == 200) {
    String msg2="String_Node_Str" + "String_Node_Str";
    logger.warn(msg2);
  }
}

Fixed version (ground truth):
/** 
 * Check the status code returned from the server. If the status code indicates an error, a PAOSException will be thrown.
 * @param statusCode The status code we received from the server
 * @throws PAOSException If the server returned a HTTP error code
 */
private void checkHTTPStatusCode(int statusCode) throws PAOSConnectionException {
  if (statusCode != 200 && statusCode != 202) {
    throw new PAOSConnectionException(INVALID_HTTP_STATUS,statusCode);
  }
 else   if (statusCode == 200) {
    String msg2="String_Node_Str" + "String_Node_Str";
    logger.warn(msg2);
  }
}
Program: 48092
Project: 48092
Buggy source:
public PAOSConnectionException(Throwable cause){
  super(lang,PAOS_CONNECTION_EXCEPTION,cause);
}

Fixed version (ground truth):
/** 
 * Creates an instance and initializes the exception with a localized message.
 * @param key Translation key.
 * @param params Parameters adding values into the translation.
 */
public PAOSConnectionException(I18nKey key,Object... params){
  super(lang,key,params);
}
Program: 48093
Project: 48093
Buggy source:
/** 
 * Transform query parameters into a java map. The parameters are not decoded, but taken as is. The query string has the form <pre>key(=value)?&key((=value)?)*</pre>. If a key does not have a value, null is taken as value.
 * @param queryStr Query string as found in the HTTP request line.
 * @return Map with key value pairs of the query parameters.
 */
public static Map<String,String> transformRaw(String queryStr){
  HashMap<String,String> result=new HashMap<>();
  if (queryStr != null) {
    String[] queries=queryStr.split("String_Node_Str");
    for (    String query : queries) {
      String[] kv=query.split("String_Node_Str");
      if (kv.length == 1) {
        result.put(kv[0],null);
      }
 else       if (kv.length == 2) {
        result.put(kv[0],kv[1]);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Transform query parameters into a java map. The parameters are not decoded, but taken as is. The query string has the form <pre>key(=value)?&key((=value)?)*</pre>. If a key does not have a value, null is taken as value.
 * @param queryStr Query string as found in the HTTP request line.
 * @return Map with key value pairs of the query parameters.
 */
public static Map<String,String> transformRaw(String queryStr){
  HashMap<String,String> result=new HashMap<>();
  if (queryStr != null) {
    String[] queries=queryStr.split("String_Node_Str");
    for (    String query : queries) {
      int first=query.indexOf('=');
      if (first == -1) {
        result.put(query,"String_Node_Str");
      }
 else {
        String key=query.substring(0,first);
        String value=query.substring(first + 1,query.length());
        result.put(key,value);
      }
    }
  }
  return result;
}
Program: 48096
Project: 48096
Buggy source:
/** 
 * Writes the changes, not the defaults in the given Properties instance to the user's config file. This function preserves the property values already present in the config file.
 * @param changes Properties to be written.
 * @throws IOException Thrown in case there was a problem reading or writing the config file.
 */
public static synchronized void writeChanges(Properties changes) throws IOException {
  Properties homeProps=new Properties();
  InputStream homeStream=loadHomeProps();
  homeProps.load(homeStream);
  homeStream.close();
  for (  Map.Entry<Object,Object> next : changes.entrySet()) {
    homeProps.put(next.getKey(),next.getValue());
  }
  saveHomeProps(homeProps);
}

Fixed version (ground truth):
/** 
 * Writes the changes, not the defaults in the given Properties instance to the user's config file. This function preserves the property values already present in the config file.
 * @param changes Properties to be written.
 * @throws IOException Thrown in case there was a problem reading or writing the config file.
 */
public static synchronized void writeChanges(Properties changes) throws IOException {
  Properties homeProps=new Properties();
  InputStream homeStream=loadHomeProps();
  if (homeStream != null) {
    homeProps.load(homeStream);
    homeStream.close();
  }
  for (  Map.Entry<Object,Object> next : changes.entrySet()) {
    homeProps.put(next.getKey(),next.getValue());
  }
  saveHomeProps(homeProps);
}
Program: 48097
Project: 48097
Buggy source:
/** 
 * Replace minor code for use in refresh URLs. BSI TR-03124-1 defines non URL versions of the ResultMinor codes from BSI TR-03112.
 * @param minor
 * @return
 */
public static String fixResultMinor(@Nonnull String minor){
switch (minor) {
case ECardConstants.Minor.App.UNKNOWN_ERROR:
    minor="String_Node_Str";
  break;
default :
}
return minor;
}

Fixed version (ground truth):
/** 
 * Replace minor code for use in refresh URLs. BSI TR-03124-1 defines non URL versions of the ResultMinor codes from BSI TR-03112.
 * @param minor
 * @return
 */
public static String fixResultMinor(@Nonnull String minor){
switch (minor) {
case ECardConstants.Minor.App.UNKNOWN_ERROR:
    minor="String_Node_Str";
  break;
case ECardConstants.Minor.App.INT_ERROR:
minor="String_Node_Str";
break;
case ECardConstants.Minor.App.COMMUNICATION_ERROR:
minor="String_Node_Str";
default :
}
return minor;
}
Program: 48098
Project: 48098
Buggy source:
/** 
 * Creates a new PACE protocol step.
 * @param dispatcher Dispatcher
 * @param gui GUI
 */
public PACEStep(Dispatcher dispatcher,UserConsent gui){
  this.dispatcher=dispatcher;
  this.gui=gui;
}

Fixed version (ground truth):
/** 
 * Creates a new PACE protocol step.
 * @param dispatcher Dispatcher
 * @param gui GUI
 */
public PACEStep(Dispatcher dispatcher,UserConsent gui){
  this.dispatcher=dispatcher;
  this.gui=gui;
  pin=langPace.translationForKey("String_Node_Str");
  puk=langPace.translationForKey("String_Node_Str");
}
Program: 48100
Project: 48100
Buggy source:
public PINStepAction(EACData eacData,boolean capturePin,byte[] slotHandle,Dispatcher dispatcher,PINStep step,byte[] status){
  super(step);
  this.eacData=eacData;
  this.capturePin=capturePin;
  this.slotHandle=slotHandle;
  this.dispatcher=dispatcher;
  this.step=step;
  if (Arrays.equals(status,BLOCKED)) {
    retryCounter=3;
  }
 else   if (Arrays.equals(status,RC3)) {
    retryCounter=0;
  }
 else   if (Arrays.equals(status,RC2)) {
    retryCounter=1;
    step.updateAttemptsDisplay(2);
  }
 else   if (Arrays.equals(status,RC1)) {
    retryCounter=2;
    step.updateAttemptsDisplay(1);
    if (capturePin) {
      step.addCANEntry();
    }
 else {
      step.addNativeCANNotice();
    }
  }
 else   if (Arrays.equals(status,DEAKTIVATED)) {
    retryCounter=-1;
  }
}

Fixed version (ground truth):
public PINStepAction(EACData eacData,boolean capturePin,byte[] slotHandle,Dispatcher dispatcher,PINStep step,byte[] status){
  super(step);
  this.eacData=eacData;
  this.capturePin=capturePin;
  this.slotHandle=slotHandle;
  this.dispatcher=dispatcher;
  this.step=step;
  if (Arrays.equals(status,RC3)) {
    retryCounter=0;
  }
 else   if (Arrays.equals(status,RC2)) {
    retryCounter=1;
    step.updateAttemptsDisplay(2);
  }
 else   if (Arrays.equals(status,RC1)) {
    retryCounter=2;
    step.updateAttemptsDisplay(1);
    if (capturePin) {
      step.addCANEntry();
    }
 else {
      step.addNativeCANNotice();
    }
  }
 else   if (Arrays.equals(status,DEAKTIVATED)) {
    retryCounter=-1;
  }
  pin=lang.translationForKey("String_Node_Str");
  puk=lang.translationForKey("String_Node_Str");
}
Program: 48102
Project: 48102
Buggy source:
private EstablishChannelResponse performPACEWithPIN(Map<String,ExecutionResults> oldResults) throws DispatcherException, InvocationTargetException {
  DIDAuthenticationDataType protoData=eacData.didRequest.getAuthenticationProtocolData();
  AuthDataMap paceAuthMap;
  try {
    paceAuthMap=new AuthDataMap(protoData);
  }
 catch (  ParserConfigurationException ex) {
    logger.error("String_Node_Str",ex);
    return null;
  }
  AuthDataResponse paceInputMap=paceAuthMap.createResponse(protoData);
  if (capturePin) {
    ExecutionResults executionResults=oldResults.get(getStepID());
    PasswordField p=(PasswordField)executionResults.getResult(PINStep.PIN_FIELD);
    String pin=p.getValue();
    if (pin.isEmpty()) {
      return null;
    }
 else {
      paceInputMap.addElement(PACEInputType.PIN,pin);
    }
  }
  paceInputMap.addElement(PACEInputType.PIN_ID,PasswordID.parse(eacData.pinID).getByteAsString());
  paceInputMap.addElement(PACEInputType.CHAT,eacData.selectedCHAT.toString());
  String certDesc=ByteUtils.toHexString(eacData.rawCertificateDescription);
  paceInputMap.addElement(PACEInputType.CERTIFICATE_DESCRIPTION,certDesc);
  EstablishChannel eChannel=createEstablishChannelStructure(paceInputMap);
  return (EstablishChannelResponse)dispatcher.deliver(eChannel);
}

Fixed version (ground truth):
private EstablishChannelResponse performPACEWithPIN(Map<String,ExecutionResults> oldResults) throws DispatcherException, InvocationTargetException {
  DIDAuthenticationDataType protoData=eacData.didRequest.getAuthenticationProtocolData();
  AuthDataMap paceAuthMap;
  try {
    paceAuthMap=new AuthDataMap(protoData);
  }
 catch (  ParserConfigurationException ex) {
    logger.error("String_Node_Str",ex);
    return null;
  }
  AuthDataResponse paceInputMap=paceAuthMap.createResponse(protoData);
  if (capturePin) {
    ExecutionResults executionResults=oldResults.get(getStepID());
    PasswordField p=(PasswordField)executionResults.getResult(PINStep.PIN_FIELD);
    String pinIn=p.getValue();
    if (pinIn.isEmpty()) {
      return null;
    }
 else {
      paceInputMap.addElement(PACEInputType.PIN,pinIn);
    }
  }
  paceInputMap.addElement(PACEInputType.PIN_ID,PasswordID.parse(eacData.pinID).getByteAsString());
  paceInputMap.addElement(PACEInputType.CHAT,eacData.selectedCHAT.toString());
  String certDesc=ByteUtils.toHexString(eacData.rawCertificateDescription);
  paceInputMap.addElement(PACEInputType.CERTIFICATE_DESCRIPTION,certDesc);
  EstablishChannel eChannel=createEstablishChannelStructure(paceInputMap);
  return (EstablishChannelResponse)dispatcher.deliver(eChannel);
}
Program: 48103
Project: 48103
Buggy source:
/** 
 * Verifies the ServerAddress element of the TCToken.
 * @throws TCTokenException
 */
public void verifyServerAddress() throws TCTokenException {
  String value=token.getServerAddress();
  assertRequired("String_Node_Str",value);
  assertURL("String_Node_Str",value);
}

Fixed version (ground truth):
/** 
 * Verifies the ServerAddress element of the TCToken.
 * @throws TCTokenException
 */
public void verifyServerAddress() throws TCTokenException {
  String value=token.getServerAddress();
  assertRequired("String_Node_Str",value);
  assertHttpsURL("String_Node_Str",value);
}
Program: 48106
Project: 48106
Buggy source:
/** 
 * Creates a PAOS instance and configures it for a given endpoint. If tlsClient is not null the connection must be HTTPs, else HTTP.
 * @param dispatcher The dispatcher instance capable of dispatching the received messages.
 * @param tlsHandler The TlsClient containing the configuration of the yet to be established TLS channel, or{@code null} if TLS should not be used.
 * @throws PAOSException In case the PAOS module could not be initialized.
 */
public PAOS(@Nonnull Dispatcher dispatcher,@Nonnull TlsConnectionHandler tlsHandler) throws PAOSException {
  this.dispatcher=dispatcher;
  this.tlsHandler=tlsHandler;
  try {
    this.idGenerator=new MessageIdGenerator();
    this.m=WSMarshallerFactory.createInstance();
  }
 catch (  WSMarshallerException e) {
    logger.error(e.getMessage(),e);
    throw new PAOSException(e);
  }
}

Fixed version (ground truth):
/** 
 * Creates a PAOS instance and configures it for a given endpoint. If tlsClient is not null the connection must be HTTPs, else HTTP.
 * @param dispatcher The dispatcher instance capable of dispatching the received messages.
 * @param tlsHandler The TlsClient containing the configuration of the yet to be established TLS channel, or{@code null} if TLS should not be used.
 * @throws PAOSException In case the PAOS module could not be initialized.
 */
public PAOS(@Nonnull Dispatcher dispatcher,@Nonnull TlsConnectionHandler tlsHandler) throws PAOSException {
  this.dispatcher=dispatcher.getFilter();
  this.tlsHandler=tlsHandler;
  serviceString=buildServiceString();
  headerValuePaos="String_Node_Str" + ECardConstants.PAOS_VERSION_20 + "String_Node_Str"+ serviceString;
  try {
    this.idGenerator=new MessageIdGenerator();
    this.m=WSMarshallerFactory.createInstance();
  }
 catch (  WSMarshallerException e) {
    logger.error(e.getMessage(),e);
    throw new PAOSException(e);
  }
}
Program: 48107
Project: 48107
Buggy source:
/** 
 * Check the status code returned from the server.  If the status code indicates an error, a PAOSException will be thrown.
 * @param msg The last message we sent to the server
 * @param statusCode The status code we received from the server
 * @throws PAOSException If the server returned a HTTP error code
 */
private void checkHTTPStatusCode(Object msg,int statusCode) throws PAOSException {
  if (statusCode < 200 || statusCode > 299) {
    if (msg instanceof ResponseType) {
      ResponseType resp=(ResponseType)msg;
      try {
        WSHelper.checkResult(resp);
      }
 catch (      WSException ex) {
        throw new PAOSException("String_Node_Str" + statusCode,ex);
      }
    }
    throw new PAOSException("String_Node_Str" + statusCode);
  }
}

Fixed version (ground truth):
/** 
 * Check the status code returned from the server. If the status code indicates an error, a PAOSException will be thrown.
 * @param msg The last message we sent to the server
 * @param statusCode The status code we received from the server
 * @throws PAOSException If the server returned a HTTP error code
 */
private void checkHTTPStatusCode(Object msg,int statusCode) throws PAOSException {
  if (statusCode < 200 || statusCode > 299) {
    if (msg instanceof ResponseType) {
      ResponseType resp=(ResponseType)msg;
      try {
        WSHelper.checkResult(resp);
      }
 catch (      WSException ex) {
        throw new PAOSException("String_Node_Str" + statusCode,ex);
      }
    }
    throw new PAOSException("String_Node_Str" + statusCode);
  }
}
Program: 48108
Project: 48108
Buggy source:
@XmlElement(name="String_Node_Str") public String getVersion(){
  return version;
}

Fixed version (ground truth):
public String getVersion(){
  return version;
}