nus-yam/ex-repair huggingface dataset:
Program: 72407
Project: 72407
Buggy source:
/** 
 * Multithreaded FIR Gammatone filtering.
 * @param input
 * @return
 * @throws IllegalActionException
 */
private void multithreadedFeatureExtraction() throws IllegalActionException {
  ExecutorService executor=Executors.newFixedThreadPool(_numChannels);
  for (int i=0; i < _numChannels; i++) {
    executor.execute(new GammatoneFilter(i));
  }
  executor.shutdown();
  try {
    executor.awaitTermination(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Multithreaded FIR Gammatone filtering.
 * @param input
 * @return
 * @exception IllegalActionException
 */
private void multithreadedFeatureExtraction() throws IllegalActionException {
  ExecutorService executor=Executors.newFixedThreadPool(_numChannels);
  for (int i=0; i < _numChannels; i++) {
    executor.execute(new GammatoneFilter(i));
  }
  executor.shutdown();
  try {
    executor.awaitTermination(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}
Program: 72408
Project: 72408
Buggy source:
/** 
 * <<<<<<< .mine Do FFTs on all channels for this block and save to the array
 * @param startIndex Chunk Index
 * @throws IllegalActionException ======= Convert to Equivalent Rectangular Bandwidth (ERB) scale from Hz.
 * @param frequencyInHz Frequency in Hz
 * @return frequency in ERB scale>>>>>>> .r73083
 */
private void doBlockFFT(int startIndex) throws IllegalActionException {
  ExecutorService executor=Executors.newFixedThreadPool(_numChannels);
  for (int i=0; i < _numChannels; i++) {
    executor.execute(new FFTWorker(i,startIndex));
  }
  executor.shutdown();
  try {
    executor.awaitTermination(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * <<<<<<< .mine Do FFTs on all channels for this block and save to the array
 * @param startIndex Chunk Index
 * @exception IllegalActionException ======= Convert to Equivalent Rectangular Bandwidth (ERB) scale from Hz.
 * @param frequencyInHz Frequency in Hz
 * @return frequency in ERB scale>>>>>>> .r73083
 */
private void doBlockFFT(int startIndex) throws IllegalActionException {
  ExecutorService executor=Executors.newFixedThreadPool(_numChannels);
  for (int i=0; i < _numChannels; i++) {
    executor.execute(new FFTWorker(i,startIndex));
  }
  executor.shutdown();
  try {
    executor.awaitTermination(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}
Program: 72409
Project: 72409
Buggy source:
/** 
 * Multithreaded FIR Gammatone filtering.
 * @param input
 * @return
 * @throws IllegalActionException
 */
private void multithreadedFeatureExtraction() throws IllegalActionException {
  ExecutorService executor=Executors.newFixedThreadPool(_numChannels);
  for (int i=0; i < _numChannels; i++) {
    executor.execute(new GammatoneFilter(i));
  }
  executor.shutdown();
  try {
    executor.awaitTermination(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Multithreaded FIR Gammatone filtering.
 * @param input
 * @return
 * @exception IllegalActionException
 */
private void multithreadedFeatureExtraction() throws IllegalActionException {
  ExecutorService executor=Executors.newFixedThreadPool(_numChannels);
  for (int i=0; i < _numChannels; i++) {
    executor.execute(new GammatoneFilter(i));
  }
  executor.shutdown();
  try {
    executor.awaitTermination(1,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}
Program: 72410
Project: 72410
Buggy source:
/** 
 * Return the Parameter that is part of a state space model.
 * @param parameterName Name of parameter
 * @return Parameter object
 * @throws IllegalActionException
 */
protected abstract Parameter getUserDefinedParameter(String parameterName) throws IllegalActionException ;

Fixed version (ground truth):
/** 
 * Return the Parameter that is part of a state space model.
 * @param parameterName Name of parameter
 * @return Parameter object
 * @exception IllegalActionException
 */
protected abstract Parameter getUserDefinedParameter(String parameterName) throws IllegalActionException ;
Program: 72411
Project: 72411
Buggy source:
/** 
 * Return the expression for a user-defined parameter.
 * @param parameterName Name of parameter
 * @return parameter expression
 * @throws IllegalActionException
 */
protected String getUserDefinedParameterExpression(String parameterName) throws IllegalActionException {
  Parameter param=getUserDefinedParameter(parameterName);
  if (param != null) {
    return param.getExpression();
  }
 else {
    throw new IllegalActionException("String_Node_Str" + parameterName + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Return the expression for a user-defined parameter.
 * @param parameterName Name of parameter
 * @return parameter expression
 * @exception IllegalActionException
 */
protected String getUserDefinedParameterExpression(String parameterName) throws IllegalActionException {
  Parameter param=getUserDefinedParameter(parameterName);
  if (param != null) {
    return param.getExpression();
  }
 else {
    throw new IllegalActionException("String_Node_Str" + parameterName + "String_Node_Str");
  }
}
Program: 72412
Project: 72412
Buggy source:
/** 
 * Verify the signature for given input data and public key of the signer.
 * @param data The input data to be verified.
 * @param signature The signature to be verified.
 * @param publicKey The public key to be used for signature verification.
 * @param signAlgorithm The name of the algorithm to be used for signature verification.
 * @return Whether the signature is valid.
 * @throws IllegalArgumentException
 */
public boolean verifySignature(Object data,Object signature,PublicKey publicKey,String signAlgorithm) throws IllegalArgumentException {
  Signature verifier;
  try {
    verifier=Signature.getInstance(signAlgorithm);
    verifier.initVerify(publicKey);
    verifier.update(_toJavaBytes(data));
    return verifier.verify(_toJavaBytes(signature));
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException|SignatureException|IllegalActionException e) {
    throw new IllegalArgumentException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Verify the signature for given input data and public key of the signer.
 * @param data The input data to be verified.
 * @param signature The signature to be verified.
 * @param publicKey The public key to be used for signature verification.
 * @param signAlgorithm The name of the algorithm to be used for signature verification.
 * @return Whether the signature is valid.
 * @throws IllegalArgumentException
 */
public boolean verifySignature(Object data,Object signature,PublicKey publicKey,String signAlgorithm) throws IllegalArgumentException {
  Signature verifier;
  try {
    verifier=Signature.getInstance(signAlgorithm);
    verifier.initVerify(publicKey);
    verifier.update(_toJavaBytes(data));
    return verifier.verify(_toJavaBytes(signature));
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException|SignatureException|IllegalActionException e) {
    throw new IllegalArgumentException("String_Node_Str",e);
  }
}
Program: 72413
Project: 72413
Buggy source:
/** 
 * Perform asymmetric cryptography operation (encrypt or decrypt) and return the result.
 * @param operationMode Whether to encrypt or decrypt. (Cipher.ENCRYPT_MODE or Cipher.DECRYPT_MODE)
 * @param input The input data (clear text or cipher text) to be operated.
 * @param key The asymmetric cipher key to be used.
 * @param cipherAlgorithm The name of the symmetric cipher algorithm to be used. (Examples: RSA/ECB/PKCS1PADDING)
 * @return The cryptography operation result
 * @throws IllegalActionException If the cryptography operation fails.
 */
private Object _performAsymmetricCrypto(int operationMode,Object input,Key key,String cipherAlgorithm) throws IllegalActionException {
  Cipher cipher=null;
  try {
    cipher=Cipher.getInstance(cipherAlgorithm);
  }
 catch (  NoSuchAlgorithmException|NoSuchPaddingException e) {
    throw new IllegalArgumentException("String_Node_Str" + input + "String_Node_Str"+ e.getMessage());
  }
  try {
    cipher.init(operationMode,key);
  }
 catch (  InvalidKeyException e) {
    throw new IllegalArgumentException("String_Node_Str" + input + "String_Node_Str"+ e.getMessage());
  }
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  try {
    byteArrayOutputStream.write(cipher.doFinal(_toJavaBytes(input)));
  }
 catch (  IllegalBlockSizeException|BadPaddingException|IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + input + "String_Node_Str"+ e.getMessage());
  }
  return _toJSArray(byteArrayOutputStream.toByteArray());
}

Fixed version (ground truth):
/** 
 * Perform asymmetric cryptography operation (encrypt or decrypt) and return the result.
 * @param operationMode Whether to encrypt or decrypt. (Cipher.ENCRYPT_MODE or Cipher.DECRYPT_MODE)
 * @param input The input data (clear text or cipher text) to be operated.
 * @param key The asymmetric cipher key to be used.
 * @param cipherAlgorithm The name of the symmetric cipher algorithm to be used. (Examples: RSA/ECB/PKCS1PADDING)
 * @return The cryptography operation result
 * @throws IllegalActionException If the cryptography operation fails.
 */
private Object _performAsymmetricCrypto(int operationMode,Object input,Key key,String cipherAlgorithm) throws IllegalActionException {
  Cipher cipher=null;
  try {
    cipher=Cipher.getInstance(cipherAlgorithm);
  }
 catch (  NoSuchAlgorithmException|NoSuchPaddingException e) {
    throw new IllegalArgumentException("String_Node_Str" + input,e);
  }
  try {
    cipher.init(operationMode,key);
  }
 catch (  InvalidKeyException e) {
    throw new IllegalArgumentException("String_Node_Str" + input,e);
  }
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  try {
    byteArrayOutputStream.write(cipher.doFinal(_toJavaBytes(input)));
  }
 catch (  IllegalBlockSizeException|BadPaddingException|IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + input,e);
  }
  return _toJSArray(byteArrayOutputStream.toByteArray());
}
Program: 72414
Project: 72414
Buggy source:
/** 
 * Load and return a public key from a X.509 certificate file in PEM format.
 * @param filePath The path for the file that stores a X.509 certificate.
 * @return PublicKey object loaded from the certificate.
 * @throws IllegalActionException If there is a problem with loading the public key.
 */
public PublicKey loadPublicKey(String filePath) throws IllegalActionException {
  try {
    CertificateFactory certFactory=CertificateFactory.getInstance("String_Node_Str");
    File file=FileUtilities.nameToFile(filePath,null);
    FileInputStream inStream=new FileInputStream(file);
    X509Certificate cert=(X509Certificate)certFactory.generateCertificate(inStream);
    return cert.getPublicKey();
  }
 catch (  CertificateException|FileNotFoundException e) {
    throw new IllegalArgumentException("String_Node_Str" + filePath + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Load and return a public key from a X.509 certificate file in PEM format.
 * @param filePath The path for the file that stores a X.509 certificate.
 * @return PublicKey object loaded from the certificate.
 * @throws IllegalActionException If there is a problem with loading the public key.
 */
public PublicKey loadPublicKey(String filePath) throws IllegalActionException {
  FileInputStream inStream=null;
  try {
    CertificateFactory certFactory=CertificateFactory.getInstance("String_Node_Str");
    File file=FileUtilities.nameToFile(filePath,null);
    inStream=new FileInputStream(file);
    X509Certificate cert=(X509Certificate)certFactory.generateCertificate(inStream);
    return cert.getPublicKey();
  }
 catch (  CertificateException|FileNotFoundException e) {
    throw new IllegalArgumentException("String_Node_Str" + filePath,e);
  }
 finally {
    if (inStream != null) {
      try {
        inStream.close();
      }
 catch (      IOException ex) {
        throw new IllegalActionException(null,ex,"String_Node_Str" + filePath);
      }
    }
  }
}
Program: 72416
Project: 72416
Buggy source:
/** 
 * Load and return a private key from a RSA private key file in DER format.
 * @param filePath The path for the file that stores a RSA private key in DER format.
 * @return PrivateKey object loaded from the file.
 * @throws IllegalActionException If there is a problem with loading the private key.
 */
public PrivateKey loadPrivateKey(String filePath) throws IllegalActionException {
  if (!filePath.endsWith("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str" + filePath);
  }
  PKCS8EncodedKeySpec keySpec=new PKCS8EncodedKeySpec(_readBinaryFile(filePath));
  KeyFactory keyFactory;
  try {
    keyFactory=KeyFactory.getInstance("String_Node_Str");
    return keyFactory.generatePrivate(keySpec);
  }
 catch (  NoSuchAlgorithmException|InvalidKeySpecException e) {
    throw new IllegalArgumentException("String_Node_Str" + filePath + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Load and return a private key from a RSA private key file in DER format.
 * @param filePath The path for the file that stores a RSA private key in DER format.
 * @return PrivateKey object loaded from the file.
 * @throws IllegalActionException If there is a problem with loading the private key.
 */
public PrivateKey loadPrivateKey(String filePath) throws IllegalActionException {
  if (!filePath.endsWith("String_Node_Str")) {
    throw new IllegalArgumentException("String_Node_Str" + filePath);
  }
  PKCS8EncodedKeySpec keySpec=new PKCS8EncodedKeySpec(_readBinaryFile(filePath));
  KeyFactory keyFactory;
  try {
    keyFactory=KeyFactory.getInstance("String_Node_Str");
    return keyFactory.generatePrivate(keySpec);
  }
 catch (  NoSuchAlgorithmException|InvalidKeySpecException e) {
    throw new IllegalArgumentException("String_Node_Str" + filePath,e);
  }
}
Program: 72417
Project: 72417
Buggy source:
/** 
 * Return the expected hash length for the given hash algorithm.
 * @param hashAlgorithm The name of the hash algorithm.
 * @return The hash length for the hash algorithm.
 * @throws IllegalActionException If the specified hash algorithm is not available.
 */
public int getHashLength(String hashAlgorithm) throws IllegalActionException {
  try {
    MessageDigest messageDigest=MessageDigest.getInstance(hashAlgorithm);
    return messageDigest.getDigestLength();
  }
 catch (  NoSuchAlgorithmException e) {
    throw new IllegalActionException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Return the expected hash length for the given hash algorithm.
 * @param hashAlgorithm The name of the hash algorithm.
 * @return The hash length for the hash algorithm.
 * @throws IllegalActionException If the specified hash algorithm is not available.
 */
public int getHashLength(String hashAlgorithm) throws IllegalActionException {
  try {
    MessageDigest messageDigest=MessageDigest.getInstance(hashAlgorithm);
    return messageDigest.getDigestLength();
  }
 catch (  NoSuchAlgorithmException e) {
    throw new IllegalActionException(null,e,"String_Node_Str");
  }
}
Program: 72418
Project: 72418
Buggy source:
/** 
 * Sign the given input data with a private key and return the signature.
 * @param input The input data to be signed in a JavaScript object.
 * @param privateKey The public key of the entity that will decrypt the message.
 * @param signAlgorithm The name of the algorithm to be used for signing.
 * @return Signature calculated from the input data.
 * @throws IllegalActionException
 */
public Object signWithPrivateKey(Object input,PrivateKey privateKey,String signAlgorithm) throws IllegalActionException {
  try {
    Signature signer=Signature.getInstance(signAlgorithm);
    signer.initSign(privateKey);
    signer.update(_toJavaBytes(input));
    return _toJSArray(signer.sign());
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException|SignatureException e) {
    throw new IllegalArgumentException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Sign the given input data with a private key and return the signature.
 * @param input The input data to be signed in a JavaScript object.
 * @param privateKey The public key of the entity that will decrypt the message.
 * @param signAlgorithm The name of the algorithm to be used for signing.
 * @return Signature calculated from the input data.
 * @throws IllegalActionException
 */
public Object signWithPrivateKey(Object input,PrivateKey privateKey,String signAlgorithm) throws IllegalActionException {
  try {
    Signature signer=Signature.getInstance(signAlgorithm);
    signer.initSign(privateKey);
    signer.update(_toJavaBytes(input));
    return _toJSArray(signer.sign());
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException|SignatureException e) {
    throw new IllegalArgumentException("String_Node_Str",e);
  }
}
Program: 72419
Project: 72419
Buggy source:
/** 
 * Calculate HMAC (key-Hashed Message Authentication Code) for the given input and key.
 * @param input The input in the JavaScript object to be HMAC hashed.
 * @param key The key to be used for HMAC calculation.
 * @param hmacAlgorithm The name of the HMAC algorithm.
 * @return The resulting HMAC. 
 * @throws IllegalActionException If the HMAC calculation fails.
 */
public Object hmac(Object input,Object key,String hmacAlgorithm) throws IllegalActionException {
  try {
    SecretKeySpec hmacKey=new SecretKeySpec(_toJavaBytes(key),hmacAlgorithm);
    Mac hmac=Mac.getInstance(hmacAlgorithm);
    hmac.init(hmacKey);
    return _toJSArray(hmac.doFinal(_toJavaBytes(input)));
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException e) {
    throw new IllegalActionException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Calculate HMAC (key-Hashed Message Authentication Code) for the given input and key.
 * @param input The input in the JavaScript object to be HMAC hashed.
 * @param key The key to be used for HMAC calculation.
 * @param hmacAlgorithm The name of the HMAC algorithm.
 * @return The resulting HMAC. 
 * @throws IllegalActionException If the HMAC calculation fails.
 */
public Object hmac(Object input,Object key,String hmacAlgorithm) throws IllegalActionException {
  try {
    SecretKeySpec hmacKey=new SecretKeySpec(_toJavaBytes(key),hmacAlgorithm);
    Mac hmac=Mac.getInstance(hmacAlgorithm);
    hmac.init(hmacKey);
    return _toJSArray(hmac.doFinal(_toJavaBytes(input)));
  }
 catch (  NoSuchAlgorithmException|InvalidKeyException e) {
    throw new IllegalActionException(null,e,"String_Node_Str");
  }
}
Program: 72420
Project: 72420
Buggy source:
/** 
 * Decrypt the input with a symmetric cipher and return the decrypted result.
 * @param input The cipher text to be decrypted.
 * @param key The secret key for the cipher.
 * @param cipherAlgorithm The name of the symmetric cipher algorithm to be used for decryption. (examples: AES-128-CBC, DES-ECB)
 * @return The encrypted result in JavaScript byte array.
 * @throws IllegalActionException If the decryption fails.
 */
public Object symmetricDecrypt(Object input,Object key,String cipherAlgorithm) throws IllegalActionException {
  byte[] cipherText=_toJavaBytes(input);
  Cipher cipher=_getCipher(Cipher.DECRYPT_MODE,cipherAlgorithm,_toJavaBytes(key),cipherText);
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  int ivSize=0;
  if (cipher.getIV() != null) {
    ivSize=cipher.getIV().length;
  }
  try {
    byteArrayOutputStream.write(cipher.doFinal(cipherText,ivSize,cipherText.length - ivSize));
  }
 catch (  IllegalBlockSizeException|BadPaddingException|IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + input + "String_Node_Str"+ e.getMessage());
  }
  return _toJSArray(byteArrayOutputStream.toByteArray());
}

Fixed version (ground truth):
/** 
 * Decrypt the input with a symmetric cipher and return the decrypted result.
 * @param input The cipher text to be decrypted.
 * @param key The secret key for the cipher.
 * @param cipherAlgorithm The name of the symmetric cipher algorithm to be used for decryption. (examples: AES-128-CBC, DES-ECB)
 * @return The encrypted result in JavaScript byte array.
 * @throws IllegalActionException If the decryption fails.
 */
public Object symmetricDecrypt(Object input,Object key,String cipherAlgorithm) throws IllegalActionException {
  byte[] cipherText=_toJavaBytes(input);
  Cipher cipher=_getCipher(Cipher.DECRYPT_MODE,cipherAlgorithm,_toJavaBytes(key),cipherText);
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  int ivSize=0;
  if (cipher.getIV() != null) {
    ivSize=cipher.getIV().length;
  }
  try {
    byteArrayOutputStream.write(cipher.doFinal(cipherText,ivSize,cipherText.length - ivSize));
  }
 catch (  IllegalBlockSizeException|BadPaddingException|IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + input,e);
  }
  return _toJSArray(byteArrayOutputStream.toByteArray());
}
Program: 72421
Project: 72421
Buggy source:
/** 
 * Hash the input with a given hash algorithm and return the hashed result.
 * @param input The input in the JavaScript object to be hashed.
 * @param hashAlgorithm The name of the hash algorithm to be used. (Examples: MD5, SHA-1, SHA-256)
 * @return The hash digested for the given input.
 * @throws IllegalActionException If the specified hash algorithm is not available.
 */
public Object hash(Object input,String hashAlgorithm) throws IllegalActionException {
  try {
    MessageDigest messageDigest=MessageDigest.getInstance(hashAlgorithm);
    return _toJSArray(messageDigest.digest(_toJavaBytes(input)));
  }
 catch (  NoSuchAlgorithmException e) {
    throw new IllegalActionException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Hash the input with a given hash algorithm and return the hashed result.
 * @param input The input in the JavaScript object to be hashed.
 * @param hashAlgorithm The name of the hash algorithm to be used. (Examples: MD5, SHA-1, SHA-256)
 * @return The hash digested for the given input.
 * @throws IllegalActionException If the specified hash algorithm is not available.
 */
public Object hash(Object input,String hashAlgorithm) throws IllegalActionException {
  try {
    MessageDigest messageDigest=MessageDigest.getInstance(hashAlgorithm);
    return _toJSArray(messageDigest.digest(_toJavaBytes(input)));
  }
 catch (  NoSuchAlgorithmException e) {
    throw new IllegalActionException(null,e,"String_Node_Str");
  }
}
Program: 72422
Project: 72422
Buggy source:
/** 
 * Encrypt the input with a symmetric cipher and return the encrypted result.
 * @param input The clear text message to be encrypted.
 * @param key The secret key for the cipher.
 * @param cipherAlgorithm The name of the symmetric cipher algorithm to be used for encryption. (examples: AES-128-CBC, DES-ECB)
 * @return The encrypted result in JavaScript byte array.
 * @throws IllegalActionException If the encryption fails.
 */
public Object symmetricEncrypt(Object input,Object key,String cipherAlgorithm) throws IllegalActionException {
  Cipher cipher=_getCipher(Cipher.ENCRYPT_MODE,cipherAlgorithm,_toJavaBytes(key),null);
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  try {
    byte[] initVector=cipher.getIV();
    if (initVector != null) {
      byteArrayOutputStream.write(initVector);
    }
    byteArrayOutputStream.write(cipher.doFinal(_toJavaBytes(input)));
  }
 catch (  IllegalBlockSizeException|BadPaddingException|IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + input + "String_Node_Str"+ e.getMessage());
  }
  return _toJSArray(byteArrayOutputStream.toByteArray());
}

Fixed version (ground truth):
/** 
 * Encrypt the input with a symmetric cipher and return the encrypted result.
 * @param input The clear text message to be encrypted.
 * @param key The secret key for the cipher.
 * @param cipherAlgorithm The name of the symmetric cipher algorithm to be used for encryption. (examples: AES-128-CBC, DES-ECB)
 * @return The encrypted result in JavaScript byte array.
 * @throws IllegalActionException If the encryption fails.
 */
public Object symmetricEncrypt(Object input,Object key,String cipherAlgorithm) throws IllegalActionException {
  Cipher cipher=_getCipher(Cipher.ENCRYPT_MODE,cipherAlgorithm,_toJavaBytes(key),null);
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  try {
    byte[] initVector=cipher.getIV();
    if (initVector != null) {
      byteArrayOutputStream.write(initVector);
    }
    byteArrayOutputStream.write(cipher.doFinal(_toJavaBytes(input)));
  }
 catch (  IllegalBlockSizeException|BadPaddingException|IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + input,e);
  }
  return _toJSArray(byteArrayOutputStream.toByteArray());
}
Program: 72426
Project: 72426
Buggy source:
public void writeRAVsInformations(){
  if (_numberOfRAVs > 0) {
    String header="String_Node_Str";
    int count=_RAVsValues.split("String_Node_Str").length;
    for (int i=0; i < count; i++) {
      header=header + "String_Node_Str" + i+ "String_Node_Str";
    }
    _RAVsValuesFile=_createTextFile("String_Node_Str" + getDisplayName() + "String_Node_Str");
    _pRAVsTimes="String_Node_Str" + _pRAVsTimes + "String_Node_Str";
    _folRAVsTimes="String_Node_Str" + "String_Node_Str" + _folRAVsTimes + "String_Node_Str";
    writeInTextFile(_RAVsValuesFile,_date.toString() + "String_Node_Str" + header+ "String_Node_Str"+ _hlaLookAHead+ "String_Node_Str"+ _hlaTimeStep+ "String_Node_Str"+ _stopTime+ "String_Node_Str"+ _pRAVsTimes+ _folRAVsTimes+ "String_Node_Str"+ _RAVsValues+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void writeRAVsInformations(){
  if (_numberOfRAVs > 0) {
    StringBuffer header=new StringBuffer("String_Node_Str");
    int count=_RAVsValues.split("String_Node_Str").length;
    for (int i=0; i < count; i++) {
      header.append("String_Node_Str" + i + "String_Node_Str");
    }
    _RAVsValuesFile=_createTextFile("String_Node_Str" + getDisplayName() + "String_Node_Str");
    _pRAVsTimes="String_Node_Str" + _pRAVsTimes + "String_Node_Str";
    _folRAVsTimes="String_Node_Str" + "String_Node_Str" + _folRAVsTimes + "String_Node_Str";
    writeInTextFile(_RAVsValuesFile,_date.toString() + "String_Node_Str" + header.toString()+ "String_Node_Str"+ _hlaLookAHead+ "String_Node_Str"+ _hlaTimeStep+ "String_Node_Str"+ _stopTime+ "String_Node_Str"+ _pRAVsTimes+ _folRAVsTimes+ "String_Node_Str"+ _RAVsValues+ "String_Node_Str");
  }
}
Program: 72428
Project: 72428
Buggy source:
/** 
 * Verify the existence of a folder, if it doesn't exist, the function tries  to create it.
 * @param folderName The name of the folder that will be created.
 * @return The full address of the folder in a string.
 */
private String _createFolder(String folderName){
  String homeDirectory=System.getProperty("String_Node_Str");
  folderName=homeDirectory + "String_Node_Str" + folderName;
  File folder=new File(folderName);
  if (!folder.exists()) {
    try {
      folder.mkdir();
      System.out.println("String_Node_Str" + folderName + "String_Node_Str");
      return folderName;
    }
 catch (    SecurityException se) {
      System.out.println("String_Node_Str" + folderName + "String_Node_Str");
      return null;
    }
  }
 else {
    return folderName;
  }
}

Fixed version (ground truth):
/** 
 * Verify the existence of a folder, if it doesn't exist, the function tries  to create it.
 * @param folderName The name of the folder that will be created.
 * @return The full address of the folder in a string.
 * @exception IOException If the folder cannot be created.
 */
private String _createFolder(String folderName) throws IOException {
  String homeDirectory=System.getProperty("String_Node_Str");
  folderName=homeDirectory + "String_Node_Str" + folderName;
  File folder=new File(folderName);
  if (!folder.exists()) {
    try {
      if (!folder.mkdir()) {
        throw new IOException("String_Node_Str" + folder + "String_Node_Str");
      }
 else {
        System.out.println("String_Node_Str" + folderName + "String_Node_Str");
      }
      return folderName;
    }
 catch (    SecurityException se) {
      throw new IOException("String_Node_Str" + folderName + "String_Node_Str");
    }
  }
 else {
    return folderName;
  }
}
Program: 72429
Project: 72429
Buggy source:
public void writeUAVsInformations(){
  if (_numberOfUAVs > 0) {
    String header="String_Node_Str";
    int count=_UAVsValues.split("String_Node_Str").length;
    for (int i=0; i < count; i++) {
      header=header + "String_Node_Str" + i+ "String_Node_Str";
    }
    _UAVsValuesFile=_createTextFile("String_Node_Str" + getDisplayName() + "String_Node_Str");
    _pUAVsTimes="String_Node_Str" + "String_Node_Str" + _pUAVsTimes + "String_Node_Str";
    _preUAVsTimes="String_Node_Str" + _preUAVsTimes + "String_Node_Str";
    writeInTextFile(_UAVsValuesFile,_date.toString() + "String_Node_Str" + header+ "String_Node_Str"+ _hlaLookAHead+ "String_Node_Str"+ _hlaTimeStep+ "String_Node_Str"+ _stopTime+ "String_Node_Str"+ _preUAVsTimes+ _pUAVsTimes+ "String_Node_Str"+ _UAVsValues+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void writeUAVsInformations(){
  if (_numberOfUAVs > 0) {
    StringBuffer header=new StringBuffer("String_Node_Str");
    int count=_UAVsValues.split("String_Node_Str").length;
    for (int i=0; i < count; i++) {
      header.append("String_Node_Str" + i + "String_Node_Str");
    }
    _UAVsValuesFile=_createTextFile("String_Node_Str" + getDisplayName() + "String_Node_Str");
    _pUAVsTimes="String_Node_Str" + "String_Node_Str" + _pUAVsTimes + "String_Node_Str";
    _preUAVsTimes="String_Node_Str" + _preUAVsTimes + "String_Node_Str";
    writeInTextFile(_UAVsValuesFile,_date.toString() + "String_Node_Str" + header+ "String_Node_Str"+ _hlaLookAHead+ "String_Node_Str"+ _hlaTimeStep+ "String_Node_Str"+ _stopTime+ "String_Node_Str"+ _preUAVsTimes+ _pUAVsTimes+ "String_Node_Str"+ _UAVsValues+ "String_Node_Str");
  }
}
Program: 72431
Project: 72431
Buggy source:
/** 
 * Get the next data.
 * @param timeout The timeout in milliseconds.
 * @return The next data.
 */
public String getNextData(int timeout){
  HashMap<String,Object> gdp_event=GDP_GCL.get_next_event(_gcl,timeout);
  System.out.println("String_Node_Str" + timeout + "String_Node_Str"+ gdp_event);
  return _datumToData(gdp_event.get("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Get the next data.
 * @param timeout The timeout in milliseconds.
 * @return The next data.
 */
public String getNextData(int timeout){
  HashMap<String,Object> gdp_event=GDP_GCL.get_next_event(_gcl,timeout);
  System.out.println("String_Node_Str" + timeout + "String_Node_Str"+ gdp_event);
  return _datumToData((HashMap<String,Object>)gdp_event.get("String_Node_Str"));
}
Program: 72432
Project: 72432
Buggy source:
/** 
 * Terminate the process and close any associated streams.
 * @exception IllegalActionException If the closing stdin of the subprocessthrew an IOException.
 */
public void terminateProcess() throws IllegalActionException {
  if (_process != null) {
    System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str");
    System.out.println("String_Node_Str" + _hlaManager.getTotalNumberOfHLACalls() + "String_Node_Str"+ _hlaManager.getNumberOfTARs()+ "String_Node_Str"+ _hlaManager.getNumberOfNERs()+ "String_Node_Str"+ _hlaManager.getNumberOfTAGs()+ "String_Node_Str"+ HlaManager.calculateRuntime());
    try {
      _process.getOutputStream().close();
      _hlaManager.setNumberOfNERs(0);
      _hlaManager.setNumberOfTARs(0);
      _hlaManager.setTotalNumberOfHLACalls(0);
      _hlaManager.setNumberOfTAGs(0);
    }
 catch (    IOException io) {
      throw new IllegalActionException(_hlaManager,io,"String_Node_Str" + "String_Node_Str");
    }
    if (_process != null) {
      _process.destroy();
      _process=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Terminate the process and close any associated streams.
 * @exception IllegalActionException If the closing stdin of the subprocessthrew an IOException.
 */
public void terminateProcess() throws IllegalActionException {
  if (_process != null) {
    System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str");
    try {
      _process.getOutputStream().close();
    }
 catch (    IOException io) {
      throw new IllegalActionException(_hlaManager,io,"String_Node_Str" + "String_Node_Str");
    }
    if (_process != null) {
      _process.destroy();
      _process=null;
    }
  }
}
Program: 72433
Project: 72433
Buggy source:
/** 
 * Terminate the process and close any associated streams.
 * @exception IllegalActionException If the closing stdin of the subprocessthrew an IOException.
 */
public void terminateProcess() throws IllegalActionException {
  if (_process != null) {
    System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str");
    System.out.println("String_Node_Str" + _hlaManager.getTotalNumberOfHLACalls() + "String_Node_Str"+ _hlaManager.getTar()+ "String_Node_Str"+ _hlaManager.getNer()+ "String_Node_Str"+ _hlaManager.getTag()+ "String_Node_Str"+ HlaManager.calculateRuntime());
    try {
      _process.getOutputStream().close();
      _hlaManager.setNer(0);
      _hlaManager.setTar(0);
      _hlaManager.setTotalNumberOfHLACalls(0);
      _hlaManager.setTag(0);
    }
 catch (    IOException io) {
      throw new IllegalActionException(_hlaManager,io,"String_Node_Str" + "String_Node_Str");
    }
    if (_process != null) {
      _process.destroy();
      _process=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Terminate the process and close any associated streams.
 * @exception IllegalActionException If the closing stdin of the subprocessthrew an IOException.
 */
public void terminateProcess() throws IllegalActionException {
  if (_process != null) {
    System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str");
    System.out.println("String_Node_Str" + _hlaManager.getTotalNumberOfHLACalls() + "String_Node_Str"+ _hlaManager.getNumberOfTARs()+ "String_Node_Str"+ _hlaManager.getNumberOfNERs()+ "String_Node_Str"+ _hlaManager.getNumberOfTAGs()+ "String_Node_Str"+ HlaManager.calculateRuntime());
    try {
      _process.getOutputStream().close();
      _hlaManager.setNumberOfNERs(0);
      _hlaManager.setNumberOfTARs(0);
      _hlaManager.setTotalNumberOfHLACalls(0);
      _hlaManager.setNumberOfTAGs(0);
    }
 catch (    IOException io) {
      throw new IllegalActionException(_hlaManager,io,"String_Node_Str" + "String_Node_Str");
    }
    if (_process != null) {
      _process.destroy();
      _process=null;
    }
  }
}
Program: 72434
Project: 72434
Buggy source:
/** 
 * Write the number of HLA calls of each federate, along with informations about the time step and the runtime, in a file. The name and location of this file are specified in the initialization of the  variable file.
 */
public void writeNumberOfHLACalls(){
  try {
    Date date=new Date();
    String fullName=federateName.toString();
    String stopTime=_director.getModelStopTime().toString();
    String nameOfTheFederate=fullName.substring(fullName.indexOf('"'),fullName.length());
    String nameOfTheFile=fullName.substring(fullName.indexOf('{') + 1,fullName.lastIndexOf('.') - 1);
    nameOfTheFile=nameOfTheFile.substring(1,nameOfTheFile.lastIndexOf('.') - 1) + "String_Node_Str";
    String info="String_Node_Str" + nameOfTheFederate + "String_Node_Str"+ nameOfTheFile+ "String_Node_Str"+ "String_Node_Str"+ stopTime+ "String_Node_Str";
    if (_timeStepped) {
      info=info + "String_Node_Str" + _hlaTimeStep+ "String_Node_Str"+ "String_Node_Str"+ _numberOfTARs;
    }
 else     if (_eventBased) {
      info=info + "String_Node_Str" + _numberOfNERs;
    }
    info=info + "String_Node_Str" + "String_Node_Str"+ _numberOfTAGs+ "String_Node_Str"+ "String_Node_Str"+ calculateRuntime()+ "String_Node_Str";
    info=date.toString() + "String_Node_Str" + info;
    file.write(info);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Write the number of HLA calls of each federate, along with informations about the time step and the runtime, in a file. The name and location of this file are specified in the initialization of the  variable file.
 */
public void writeNumberOfHLACalls(){
  try {
    Date date=new Date();
    String fullName=federateName.toString();
    String stopTime=_director.getModelStopTime().toString();
    String nameOfTheFederate=fullName.substring(fullName.indexOf('"'));
    String nameOfTheFile=fullName.substring(fullName.indexOf('{') + 1,fullName.lastIndexOf('.'));
    nameOfTheFile=nameOfTheFile.substring(1,nameOfTheFile.lastIndexOf('.')) + "String_Node_Str";
    String info="String_Node_Str" + nameOfTheFederate + "String_Node_Str"+ nameOfTheFile+ "String_Node_Str"+ "String_Node_Str"+ stopTime+ "String_Node_Str";
    if (_timeStepped) {
      info=info + "String_Node_Str" + _hlaTimeStep+ "String_Node_Str"+ "String_Node_Str"+ _numberOfTARs;
    }
 else     if (_eventBased) {
      info=info + "String_Node_Str" + _numberOfNERs;
    }
    info=info + "String_Node_Str" + "String_Node_Str"+ _numberOfTAGs+ "String_Node_Str"+ "String_Node_Str"+ calculateRuntime()+ "String_Node_Str";
    info=date.toString() + "String_Node_Str" + info;
    _writeInTextFile(info);
    System.out.println(info);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
  }
}
Program: 72436
Project: 72436
Buggy source:
/** 
 * Override the toString of enum class.
 * @return string associated for every enumerate
 */
@Override public String toString(){
switch (this) {
case NextEventRequest:
    return "String_Node_Str";
case TimeAdvancementRequest:
  return "String_Node_Str";
default :
throw new IllegalArgumentException();
}
}

Fixed version (ground truth):
/** 
 * Override the toString of enum class.
 * @return The string associated for every enumerate.
 */
@Override public String toString(){
switch (this) {
case NextEventRequest:
    return "String_Node_Str";
case TimeAdvancementRequest:
  return "String_Node_Str";
default :
throw new IllegalArgumentException();
}
}
Program: 72437
Project: 72437
Buggy source:
/** 
 * Terminate the process and close any associated streams.
 * @exception IllegalActionException If the closing stdin of the subprocessthrew an IOException.
 */
public void terminateProcess() throws IllegalActionException {
  if (_process != null) {
    System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str");
    System.out.println("String_Node_Str" + _hlaManager.getTotalNbCalls() + "String_Node_Str"+ _hlaManager.getTar()+ "String_Node_Str"+ _hlaManager.getNer()+ "String_Node_Str"+ _hlaManager.getTag());
    try {
      _process.getOutputStream().close();
      _hlaManager.writeNbCalls();
      _hlaManager.setNer(0);
      _hlaManager.setTar(0);
      _hlaManager.setTotalNbCalls(0);
      _hlaManager.setTag(0);
    }
 catch (    IOException io) {
      throw new IllegalActionException(_hlaManager,io,"String_Node_Str" + "String_Node_Str");
    }
    if (_process != null) {
      _process.destroy();
      _process=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Terminate the process and close any associated streams.
 * @exception IllegalActionException If the closing stdin of the subprocessthrew an IOException.
 */
public void terminateProcess() throws IllegalActionException {
  if (_process != null) {
    System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str");
    System.out.println("String_Node_Str" + _hlaManager.getTotalNbCalls() + "String_Node_Str"+ _hlaManager.getTar()+ "String_Node_Str"+ _hlaManager.getNer()+ "String_Node_Str"+ _hlaManager.getTag()+ "String_Node_Str"+ HlaManager.calculateRuntime());
    try {
      _process.getOutputStream().close();
      _hlaManager.setNer(0);
      _hlaManager.setTar(0);
      _hlaManager.setTotalNbCalls(0);
      _hlaManager.setTag(0);
    }
 catch (    IOException io) {
      throw new IllegalActionException(_hlaManager,io,"String_Node_Str" + "String_Node_Str");
    }
    if (_process != null) {
      _process.destroy();
      _process=null;
    }
  }
}
Program: 72438
Project: 72438
Buggy source:
/** 
 * Execute a command, set _process to point to the subprocess and set up _errorGobbler and _outputGobbler to read data.
 * @exception IllegalActionException If the execution of the Runtime.exec()failed or if the RTIG subprocess it not running.
 */
public void exec() throws IllegalActionException {
  System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str"+ "String_Node_Str"+ java.util.Arrays.toString(_commandArray)+ "String_Node_Str"+ java.util.Arrays.toString(_environmentArray)+ "String_Node_Str"+ _directoryAsFile);
  try {
    _process=_runtime.exec(_commandArray,_environmentArray,_directoryAsFile);
  }
 catch (  IOException e) {
    throw new IllegalActionException(_hlaManager,e,"String_Node_Str");
  }
  _outputGobbler=new _StreamReaderThread(_process.getInputStream(),"String_Node_Str" + _streamReaderThreadCount++,_hlaManager);
  _errorGobbler=new _StreamReaderThread(_process.getErrorStream(),"String_Node_Str" + _streamReaderThreadCount++,_hlaManager);
  _errorGobbler.start();
  _outputGobbler.start();
  if (_streamReaderThreadCount > 1000) {
    _streamReaderThreadCount=0;
  }
}

Fixed version (ground truth):
/** 
 * Execute a command, set _process to point to the subprocess and set up _errorGobbler and _outputGobbler to read data.
 * @exception IllegalActionException If the execution of the Runtime.exec()failed or if the RTIG subprocess it not running.
 */
public void exec() throws IllegalActionException {
  HlaManager.setStartTime();
  System.out.println("String_Node_Str" + _hlaManager.getFullName() + "String_Node_Str"+ "String_Node_Str"+ java.util.Arrays.toString(_commandArray)+ "String_Node_Str"+ java.util.Arrays.toString(_environmentArray)+ "String_Node_Str"+ _directoryAsFile);
  try {
    _process=_runtime.exec(_commandArray,_environmentArray,_directoryAsFile);
  }
 catch (  IOException e) {
    throw new IllegalActionException(_hlaManager,e,"String_Node_Str");
  }
  _outputGobbler=new _StreamReaderThread(_process.getInputStream(),"String_Node_Str" + _streamReaderThreadCount++,_hlaManager);
  _errorGobbler=new _StreamReaderThread(_process.getErrorStream(),"String_Node_Str" + _streamReaderThreadCount++,_hlaManager);
  _errorGobbler.start();
  _outputGobbler.start();
  if (_streamReaderThreadCount > 1000) {
    _streamReaderThreadCount=0;
  }
}
Program: 72439
Project: 72439
Buggy source:
public void writeNbCalls(){
  try {
    String stopTime=_director.getModelStopTime().toString();
    String info=this.getFullName() + "String_Node_Str" + "String_Node_Str"+ stopTime+ "String_Node_Str"+ "String_Node_Str"+ _tar+ "String_Node_Str"+ "String_Node_Str"+ _ner+ "String_Node_Str"+ "String_Node_Str"+ _tag+ "String_Node_Str";
    file.write(info);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void writeNbCalls(){
  try {
    String stopTime=_director.getModelStopTime().toString();
    String info=this.getFullName() + "String_Node_Str" + "String_Node_Str"+ stopTime+ "String_Node_Str"+ "String_Node_Str"+ _tar+ "String_Node_Str"+ "String_Node_Str"+ _ner+ "String_Node_Str"+ "String_Node_Str"+ _tag+ "String_Node_Str"+ "String_Node_Str"+ calculateRuntime()+ "String_Node_Str";
    file.write(info);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 72440
Project: 72440
Buggy source:
public void setStopTime(String stopTime){
  this.stopTime=stopTime;
}

Fixed version (ground truth):
public void setStopTime(String stopTime){
  this._stopTime=stopTime;
}
Program: 72442
Project: 72442
Buggy source:
/** 
 * @return the tar
 */
public int getTar(){
  return _tar;
}

Fixed version (ground truth):
/** 
 * @return the number of time advance requests that this federate has made
 */
public int getTar(){
  return _tar;
}
Program: 72443
Project: 72443
Buggy source:
/** 
 * @return the tag
 */
public int getTag(){
  return _tag;
}

Fixed version (ground truth):
/** 
 * @return the number of time advance grants that this federate has received
 */
public int getTag(){
  return _tag;
}
Program: 72444
Project: 72444
Buggy source:
/** 
 * @return the ner
 */
public int getNer(){
  return _ner;
}

Fixed version (ground truth):
/** 
 * @return the number of next event requests that this federate has made
 */
public int getNer(){
  return _ner;
}
Program: 72445
Project: 72445
Buggy source:
public String getStopTime(){
  return stopTime;
}

Fixed version (ground truth):
public String getStopTime(){
  return _stopTime;
}
Program: 72446
Project: 72446
Buggy source:
/** 
 * Destroy the plotter.  This method is usually called by PlotApplet.destroy().  It does various cleanups to reduce memory usage.
 */
@Override public void destroy(){
  clear(true);
  setAutomaticRescale(false);
  setTimedRepaint(false);
  if (_printButton != null) {
    ActionListener[] listeners=_printButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _printButton.removeActionListener(listener);
    }
    _printButton=null;
  }
  if (_resetButton != null) {
    ActionListener[] listeners=_resetButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _resetButton.removeActionListener(listener);
    }
    _resetButton=null;
  }
  if (_eqAxButton != null) {
    ActionListener[] listeners=_formatButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _formatButton.removeActionListener(listener);
    }
    _eqAxButton=null;
  }
  if (_formatButton != null) {
    ActionListener[] listeners=_formatButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _formatButton.removeActionListener(listener);
    }
    _formatButton=null;
  }
  if (_fillButton != null) {
    ActionListener[] listeners=_fillButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _fillButton.removeActionListener(listener);
    }
    _fillButton=null;
  }
  removeAll();
}

Fixed version (ground truth):
/** 
 * Destroy the plotter.  This method is usually called by PlotApplet.destroy().  It does various cleanups to reduce memory usage.
 */
@Override public void destroy(){
  clear(true);
  setAutomaticRescale(false);
  setTimedRepaint(false);
  if (_printButton != null) {
    ActionListener[] listeners=_printButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _printButton.removeActionListener(listener);
    }
    _printButton=null;
  }
  if (_resetButton != null) {
    ActionListener[] listeners=_resetButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _resetButton.removeActionListener(listener);
    }
    _resetButton=null;
  }
  if (_eqAxButton != null) {
    ActionListener[] listeners=_formatButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _eqAxButton.removeActionListener(listener);
    }
    _eqAxButton=null;
  }
  if (_formatButton != null) {
    ActionListener[] listeners=_formatButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _formatButton.removeActionListener(listener);
    }
    _formatButton=null;
  }
  if (_fillButton != null) {
    ActionListener[] listeners=_fillButton.getActionListeners();
    for (    ActionListener listener : listeners) {
      _fillButton.removeActionListener(listener);
    }
    _fillButton=null;
  }
  removeAll();
}