nus-yam/ex-repair huggingface dataset:
Program: 135702
Project: 135702
Buggy source:
@Override public Future<RpcResult<GetODLCertificateReqOutput>> getODLCertificateReq(){
  final SettableFuture<RpcResult<GetODLCertificateReqOutput>> futureResult=SettableFuture.create();
  final String certReq=aaaCertProvider.genODLKeyStoreCertificateReq(false);
  if (certReq != null && !certReq.isEmpty()) {
    final GetODLCertificateReqOutput odlCertReqOutput=new GetODLCertificateReqOutputBuilder().setOdlCertReq(certReq).build();
    futureResult.set(RpcResultBuilder.<GetODLCertificateReqOutput>success(odlCertReqOutput).build());
  }
 else {
    futureResult.set(RpcResultBuilder.<GetODLCertificateReqOutput>failed().build());
  }
  return futureResult;
}

Fixed version (ground truth):
@Override public Future<RpcResult<GetODLCertificateReqOutput>> getODLCertificateReq(){
  final SettableFuture<RpcResult<GetODLCertificateReqOutput>> futureResult=SettableFuture.create();
  final String certReq=aaaCertProvider.genODLKeyStoreCertificateReq(false);
  if (!Strings.isNullOrEmpty(certReq)) {
    final GetODLCertificateReqOutput odlCertReqOutput=new GetODLCertificateReqOutputBuilder().setOdlCertReq(certReq).build();
    futureResult.set(RpcResultBuilder.<GetODLCertificateReqOutput>success(odlCertReqOutput).build());
  }
 else {
    futureResult.set(RpcResultBuilder.<GetODLCertificateReqOutput>failed().build());
  }
  return futureResult;
}
Program: 135703
Project: 135703
Buggy source:
@Override public Future<RpcResult<GetODLCertificateOutput>> getODLCertificate(){
  final SettableFuture<RpcResult<GetODLCertificateOutput>> futureResult=SettableFuture.create();
  final String cert=aaaCertProvider.getODLKeyStoreCertificate(false);
  if (cert != null && !cert.isEmpty()) {
    final GetODLCertificateOutput odlCertOutput=new GetODLCertificateOutputBuilder().setOdlCert(cert).build();
    futureResult.set(RpcResultBuilder.<GetODLCertificateOutput>success(odlCertOutput).build());
  }
 else {
    futureResult.set(RpcResultBuilder.<GetODLCertificateOutput>failed().build());
  }
  return futureResult;
}

Fixed version (ground truth):
@Override public Future<RpcResult<GetODLCertificateOutput>> getODLCertificate(){
  final SettableFuture<RpcResult<GetODLCertificateOutput>> futureResult=SettableFuture.create();
  final String cert=aaaCertProvider.getODLKeyStoreCertificate(false);
  if (!Strings.isNullOrEmpty(cert)) {
    final GetODLCertificateOutput odlCertOutput=new GetODLCertificateOutputBuilder().setOdlCert(cert).build();
    futureResult.set(RpcResultBuilder.<GetODLCertificateOutput>success(odlCertOutput).build());
  }
 else {
    futureResult.set(RpcResultBuilder.<GetODLCertificateOutput>failed().build());
  }
  return futureResult;
}
Program: 135704
Project: 135704
Buggy source:
@Override public Future<RpcResult<GetNodeCertifcateOutput>> getNodeCertifcate(GetNodeCertifcateInput input){
  final SettableFuture<RpcResult<GetNodeCertifcateOutput>> futureResult=SettableFuture.create();
  final String cert=aaaCertProvider.getCertificateTrustStore(input.getNodeAlias(),false);
  if (cert != null && !cert.isEmpty()) {
    final GetNodeCertifcateOutput nodeCertOutput=new GetNodeCertifcateOutputBuilder().setNodeCert(cert).build();
    futureResult.set(RpcResultBuilder.<GetNodeCertifcateOutput>success(nodeCertOutput).build());
  }
 else {
    futureResult.set(RpcResultBuilder.<GetNodeCertifcateOutput>failed().build());
  }
  return futureResult;
}

Fixed version (ground truth):
@Override public Future<RpcResult<GetNodeCertifcateOutput>> getNodeCertifcate(GetNodeCertifcateInput input){
  final SettableFuture<RpcResult<GetNodeCertifcateOutput>> futureResult=SettableFuture.create();
  final String cert=aaaCertProvider.getCertificateTrustStore(input.getNodeAlias(),false);
  if (!Strings.isNullOrEmpty(cert)) {
    final GetNodeCertifcateOutput nodeCertOutput=new GetNodeCertifcateOutputBuilder().setNodeCert(cert).build();
    futureResult.set(RpcResultBuilder.<GetNodeCertifcateOutput>success(nodeCertOutput).build());
  }
 else {
    futureResult.set(RpcResultBuilder.<GetNodeCertifcateOutput>failed().build());
  }
  return futureResult;
}
Program: 135706
Project: 135706
Buggy source:
@Override public String getODLKeyStoreCertificate(final boolean withTag){
  return aaaCertMdsalProv.getODLStoreCertificate(bundleName,withTag);
}

Fixed version (ground truth):
@Override public String getODLKeyStoreCertificate(final boolean withTag){
  return MoreObjects.firstNonNull(aaaCertMdsalProv.getODLStoreCertificate(bundleName,withTag),"String_Node_Str");
}
Program: 135707
Project: 135707
Buggy source:
@Override public String getCertificateTrustStore(String alias,boolean withTag){
  return aaaCertMdsalProv.getTrustStoreCertificate(bundleName,alias,withTag);
}

Fixed version (ground truth):
@Override public String getCertificateTrustStore(String alias,boolean withTag){
  return MoreObjects.firstNonNull(aaaCertMdsalProv.getTrustStoreCertificate(bundleName,alias,withTag),"String_Node_Str");
}
Program: 135708
Project: 135708
Buggy source:
private String[] getCipherSuites(final List<CipherSuites> cipherSuites){
  final List<String> suites=new ArrayList<>();
  if (cipherSuites != null & !cipherSuites.isEmpty()) {
    cipherSuites.stream().forEach(cs -> {
      suites.add(cs.getSuiteName());
    }
);
  }
  return suites.toArray(new String[suites.size()]);
}

Fixed version (ground truth):
private String[] getCipherSuites(final List<CipherSuites> cipherSuites){
  final List<String> suites=new ArrayList<>();
  if (cipherSuites != null && !cipherSuites.isEmpty()) {
    cipherSuites.stream().forEach(cs -> {
      suites.add(cs.getSuiteName());
    }
);
  }
  return suites.toArray(new String[suites.size()]);
}
Program: 135709
Project: 135709
Buggy source:
public static String readFile(final String certFile){
  if (certFile == null || certFile.isEmpty()) {
    return null;
  }
  try {
    final FileInputStream fInputStream=new FileInputStream(KEY_STORE_PATH + certFile);
    final byte[] certBytes=new byte[fInputStream.available()];
    fInputStream.read(certBytes);
    fInputStream.close();
    final String cert=new String(certBytes,StandardCharsets.UTF_8);
    return cert;
  }
 catch (  final IOException e) {
    return null;
  }
}

Fixed version (ground truth):
public static String readFile(final String certFile){
  if (certFile == null || certFile.isEmpty()) {
    return null;
  }
  final String path=KEY_STORE_PATH + certFile;
  try (FileInputStream fInputStream=new FileInputStream(path)){
    final int available=fInputStream.available();
    final byte[] certBytes=new byte[available];
    final int numRead=fInputStream.read(certBytes);
    if (numRead != available) {
      LOG.warn("String_Node_Str",available,path,numRead);
    }
    return new String(certBytes,StandardCharsets.UTF_8);
  }
 catch (  final IOException e) {
    return null;
  }
}
Program: 135710
Project: 135710
Buggy source:
public static String createDir(final String dir){
  final File file=new File(dir);
  if (!file.exists()) {
    file.mkdirs();
  }
  return file.getAbsolutePath();
}

Fixed version (ground truth):
public static String createDir(final String dir){
  final File file=new File(dir);
  if (!file.exists()) {
    if (!file.mkdirs()) {
      LOG.error("String_Node_Str",file);
    }
  }
  return file.getAbsolutePath();
}
Program: 135711
Project: 135711
Buggy source:
public static boolean saveCert(final String fileName,final String cert){
  if (fileName == null || fileName.isEmpty()) {
    return false;
  }
  BufferedWriter out;
  try {
    out=new BufferedWriter(new FileWriter(KEY_STORE_PATH + fileName));
    out.write(cert);
    out.close();
    return true;
  }
 catch (  final IOException e) {
    return false;
  }
}

Fixed version (ground truth):
public static boolean saveCert(final String fileName,final String cert){
  if (fileName == null || fileName.isEmpty()) {
    return false;
  }
  try (BufferedWriter out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(KEY_STORE_PATH + fileName),StandardCharsets.UTF_8))){
    out.write(cert);
    return true;
  }
 catch (  final IOException e) {
    return false;
  }
}
Program: 135712
Project: 135712
Buggy source:
/** 
 * Load the keystore from the working directory.
 * @param keyStoreName keystore file name
 * @param keystorePassword keystore password
 * @return keystore object otherwise return null if it fails to load.
 */
public KeyStore loadKeyStore(final String keyStoreName,final String keystorePassword){
  try {
    final KeyStore keyStore=KeyStore.getInstance("String_Node_Str");
    final FileInputStream fInputStream=new FileInputStream(workingDir + keyStoreName);
    keyStore.load(fInputStream,keystorePassword.toCharArray());
    return keyStore;
  }
 catch (  NoSuchAlgorithmException|CertificateException|IOException|KeyStoreException e) {
    LOG.error("String_Node_Str",e.getMessage());
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Load the keystore from the working directory.
 * @param keyStoreName keystore file name
 * @param keystorePassword keystore password
 * @return keystore object otherwise return null if it fails to load.
 */
public KeyStore loadKeyStore(final String keyStoreName,final String keystorePassword){
  try (FileInputStream fInputStream=new FileInputStream(workingDir + keyStoreName)){
    final KeyStore keyStore=KeyStore.getInstance("String_Node_Str");
    keyStore.load(fInputStream,keystorePassword.toCharArray());
    return keyStore;
  }
 catch (  NoSuchAlgorithmException|CertificateException|IOException|KeyStoreException e) {
    LOG.error("String_Node_Str",e.getMessage());
    return null;
  }
}
Program: 135713
Project: 135713
Buggy source:
public boolean deleteUser(String userIdWithoutDomain) throws IDMStoreException {
  Preconditions.checkNotNull(userIdWithoutDomain,"String_Node_Str");
  String userID=IDMStoreUtil.createUserid(userIdWithoutDomain,DOMAIN);
  return identityStore.deleteUser(userID) != null;
}

Fixed version (ground truth):
public boolean deleteUser(String userIdWithoutDomain) throws IDMStoreException {
  Preconditions.checkNotNull(userIdWithoutDomain,"String_Node_Str");
  return storeBuilder.deleteUser(DOMAIN,userIdWithoutDomain);
}
Program: 135714
Project: 135714
Buggy source:
@Test public void testCreateNewUserAndSetPasswordAndDelete() throws Exception {
  assertThat(cli.getAllUserNames()).hasSize(0);
  cli.createNewUser("String_Node_Str","String_Node_Str",false);
  assertThat(cli.getAllUserNames()).hasSize(1);
  assertThat(cli.getAllUserNames().get(0)).isEqualTo("String_Node_Str");
  assertThat(cli.resetPassword("String_Node_Str","String_Node_Str")).isTrue();
  assertThat(cli.deleteUser("String_Node_Str")).isTrue();
  assertThat(cli.getAllUserNames()).hasSize(0);
}

Fixed version (ground truth):
@Test public void testCreateNewUserAndSetPasswordAndDelete() throws Exception {
  assertThat(cli.getAllUserNames()).isEmpty();
  cli.createNewUser("String_Node_Str","String_Node_Str",false);
  assertThat(cli.getAllUserNames()).hasSize(1);
  assertThat(cli.getAllUserNames().get(0)).isEqualTo("String_Node_Str");
  assertThat(cli.resetPassword("String_Node_Str","String_Node_Str")).isTrue();
  assertThat(cli.deleteUser("String_Node_Str")).isTrue();
  assertThat(cli.getAllUserNames()).hasSize(0);
}
Program: 135715
Project: 135715
Buggy source:
public IdmLightApplication(){
  try {
    StoreBuilder.init();
  }
 catch (  IDMStoreException e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public IdmLightApplication(){
}
Program: 135717
Project: 135717
Buggy source:
@Override public java.lang.AutoCloseable createInstance(){
  final IdmLightProxy proxy=new IdmLightProxy();
  final ServiceRegistration<?> idmService=bundleContext.registerService(IdMService.class.getName(),proxy,null);
  final ServiceRegistration<?> clientAuthService=bundleContext.registerService(CredentialAuth.class.getName(),proxy,null);
  final StoreServiceLocator locator=new StoreServiceLocator();
  locator.start();
  LOGGER.info("String_Node_Str");
  return new AutoCloseable(){
    @Override public void close() throws Exception {
      idmService.unregister();
      clientAuthService.unregister();
    }
  }
;
}

Fixed version (ground truth):
@Override public java.lang.AutoCloseable createInstance(){
  final IdmLightProxy proxy=new IdmLightProxy();
  final ServiceRegistration<?> idmService=bundleContext.registerService(IdMService.class.getName(),proxy,null);
  final ServiceRegistration<?> clientAuthService=bundleContext.registerService(CredentialAuth.class.getName(),proxy,null);
  final StoreServiceLocator locator=new StoreServiceLocator();
  locator.setDaemon(true);
  locator.start();
  LOGGER.info("String_Node_Str");
  return new AutoCloseable(){
    @Override public void close() throws Exception {
      idmService.unregister();
      clientAuthService.unregister();
    }
  }
;
}
Program: 135718
Project: 135718
Buggy source:
public void run(){
  while (store == null) {
    retryCount++;
    LOGGER.info("String_Node_Str",retryCount);
    final ServiceReference<IIDMStore> serviceReference=bundleContext.getServiceReference(IIDMStore.class);
    if (serviceReference != null) {
      store=bundleContext.getService(serviceReference);
      LOGGER.info("String_Node_Str");
      break;
    }
    try {
      Thread.sleep(WAITING_TIME);
    }
 catch (    InterruptedException e) {
      LOGGER.error("String_Node_Str",e);
      break;
    }
    if (retryCount >= NUMBER_OF_RETRYS) {
      LOGGER.error("String_Node_Str");
      break;
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (store == null) {
    retryCount++;
    LOGGER.info("String_Node_Str",retryCount);
    final ServiceReference<IIDMStore> serviceReference=bundleContext.getServiceReference(IIDMStore.class);
    if (serviceReference != null) {
      store=bundleContext.getService(serviceReference);
      LOGGER.info("String_Node_Str");
      try {
        StoreBuilder.init();
      }
 catch (      IDMStoreException e) {
        LOGGER.error("String_Node_Str",e);
      }
      break;
    }
    try {
      Thread.sleep(WAITING_TIME);
    }
 catch (    InterruptedException e) {
      LOGGER.error("String_Node_Str",e);
      break;
    }
    if (retryCount >= NUMBER_OF_RETRYS) {
      LOGGER.error("String_Node_Str");
      break;
    }
  }
}
Program: 135720
Project: 135720
Buggy source:
public User putUser(User user) throws StoreException {
  User savedUser=this.getUser(user.getUserid());
  if (savedUser == null) {
    return null;
  }
  if (user.getDescription() != null) {
    savedUser.setDescription(user.getDescription());
  }
  if (user.getName() != null) {
    savedUser.setName(user.getName());
  }
  if (user.getEnabled() != null) {
    savedUser.setEnabled(user.getEnabled());
  }
  if (user.getEmail() != null) {
    savedUser.setEmail(user.getEmail());
  }
  if (user.getPassword() != null) {
    savedUser.setPassword(user.getPassword());
  }
  Connection conn=dbConnect();
  try {
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query);
    statement.setString(1,savedUser.getName());
    statement.setString(2,savedUser.getEmail());
    statement.setString(3,savedUser.getPassword());
    statement.setString(4,savedUser.getDescription());
    statement.setInt(5,savedUser.getEnabled() ? 1 : 0);
    statement.setInt(6,savedUser.getUserid());
    statement.executeUpdate();
    statement.close();
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
  return savedUser;
}

Fixed version (ground truth):
public User putUser(User user) throws StoreException {
  User savedUser=this.getUser(user.getUserid());
  if (savedUser == null) {
    return null;
  }
  if (user.getDescription() != null) {
    savedUser.setDescription(user.getDescription());
  }
  if (user.getName() != null) {
    savedUser.setName(user.getName());
  }
  if (user.getEnabled() != null) {
    savedUser.setEnabled(user.getEnabled());
  }
  if (user.getEmail() != null) {
    savedUser.setEmail(user.getEmail());
  }
  if (user.getPassword() != null) {
    savedUser.setPassword(SHA256Calculator.getSHA256(user.getPassword(),user.getSalt()));
  }
  Connection conn=dbConnect();
  try {
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query);
    statement.setString(1,savedUser.getName());
    statement.setString(2,savedUser.getEmail());
    statement.setString(3,savedUser.getPassword());
    statement.setString(4,savedUser.getDescription());
    statement.setInt(5,savedUser.getEnabled() ? 1 : 0);
    statement.setInt(6,savedUser.getUserid());
    statement.executeUpdate();
    statement.close();
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
  return savedUser;
}
Program: 135721
Project: 135721
Buggy source:
protected Connection dbConnect() throws StoreException {
  Connection conn;
  try {
    conn=getDBConnect();
  }
 catch (  StoreException se) {
    throw se;
  }
  try {
    DatabaseMetaData dbm=conn.getMetaData();
    String[] tableTypes={"String_Node_Str"};
    ResultSet rs=dbm.getTables(null,null,"String_Node_Str",tableTypes);
    if (rs.next()) {
      debug("String_Node_Str");
    }
 else {
      logger.info("String_Node_Str");
      Statement stmt=null;
      stmt=conn.createStatement();
      String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      stmt.executeUpdate(sql);
      stmt.close();
    }
  }
 catch (  SQLException sqe) {
    throw new StoreException("String_Node_Str" + sqe);
  }
  return conn;
}

Fixed version (ground truth):
protected Connection dbConnect() throws StoreException {
  Connection conn;
  try {
    conn=getDBConnect();
  }
 catch (  StoreException se) {
    throw se;
  }
  try {
    DatabaseMetaData dbm=conn.getMetaData();
    String[] tableTypes={"String_Node_Str"};
    ResultSet rs=dbm.getTables(null,null,"String_Node_Str",tableTypes);
    if (rs.next()) {
      debug("String_Node_Str");
    }
 else {
      logger.info("String_Node_Str");
      Statement stmt=null;
      stmt=conn.createStatement();
      String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      stmt.executeUpdate(sql);
      stmt.close();
    }
  }
 catch (  SQLException sqe) {
    throw new StoreException("String_Node_Str" + sqe);
  }
  return conn;
}
Program: 135722
Project: 135722
Buggy source:
protected User rsToUser(ResultSet rs) throws SQLException {
  User user=new User();
  try {
    user.setUserid(rs.getInt(SQL_ID));
    user.setName(rs.getString(SQL_NAME));
    user.setEmail(rs.getString(SQL_EMAIL));
    user.setPassword(rs.getString(SQL_PASSWORD));
    user.setDescription(rs.getString(SQL_DESCR));
    user.setEnabled(rs.getInt(SQL_ENABLED) == 1 ? true : false);
  }
 catch (  SQLException sqle) {
    logger.error("String_Node_Str" + sqle);
    throw sqle;
  }
  return user;
}

Fixed version (ground truth):
protected User rsToUser(ResultSet rs) throws SQLException {
  User user=new User();
  try {
    user.setUserid(rs.getInt(SQL_ID));
    user.setName(rs.getString(SQL_NAME));
    user.setEmail(rs.getString(SQL_EMAIL));
    user.setPassword(rs.getString(SQL_PASSWORD));
    user.setDescription(rs.getString(SQL_DESCR));
    user.setEnabled(rs.getInt(SQL_ENABLED) == 1 ? true : false);
    user.setSalt(rs.getString(SQL_SALT));
  }
 catch (  SQLException sqle) {
    logger.error("String_Node_Str" + sqle);
    throw sqle;
  }
  return user;
}
Program: 135723
Project: 135723
Buggy source:
public User createUser(User user) throws StoreException {
  int key=0;
  Connection conn=dbConnect();
  try {
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query,Statement.RETURN_GENERATED_KEYS);
    statement.setString(1,user.getName());
    statement.setString(2,user.getEmail());
    statement.setString(3,user.getPassword());
    statement.setString(4,user.getDescription());
    statement.setInt(5,user.getEnabled() ? 1 : 0);
    int affectedRows=statement.executeUpdate();
    if (affectedRows == 0) {
      throw new StoreException("String_Node_Str");
    }
    ResultSet generatedKeys=statement.getGeneratedKeys();
    if (generatedKeys.next()) {
      key=generatedKeys.getInt(1);
    }
 else {
      throw new StoreException("String_Node_Str");
    }
    user.setUserid(key);
    generatedKeys.close();
    statement.close();
    return user;
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
}

Fixed version (ground truth):
public User createUser(User user) throws StoreException {
  int key=0;
  Connection conn=dbConnect();
  try {
    user.setSalt(SHA256Calculator.generateSALT());
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query,Statement.RETURN_GENERATED_KEYS);
    statement.setString(1,user.getName());
    statement.setString(2,user.getEmail());
    statement.setString(3,SHA256Calculator.getSHA256(user.getPassword(),user.getSalt()));
    statement.setString(4,user.getDescription());
    statement.setInt(5,user.getEnabled() ? 1 : 0);
    statement.setString(6,user.getSalt());
    int affectedRows=statement.executeUpdate();
    if (affectedRows == 0) {
      throw new StoreException("String_Node_Str");
    }
    ResultSet generatedKeys=statement.getGeneratedKeys();
    if (generatedKeys.next()) {
      key=generatedKeys.getInt(1);
    }
 else {
      throw new StoreException("String_Node_Str");
    }
    user.setUserid(key);
    generatedKeys.close();
    statement.close();
    return user;
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
}
Program: 135724
Project: 135724
Buggy source:
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public Response getUser(@PathParam("String_Node_Str") String id){
  logger.info("String_Node_Str" + id);
  User user=null;
  long longId=0;
  try {
    longId=Long.parseLong(id);
  }
 catch (  NumberFormatException nfe) {
    return new IDMError(400,"String_Node_Str" + id,"String_Node_Str").response();
  }
  try {
    user=userStore.getUser(longId);
  }
 catch (  StoreException se) {
    return new IDMError(500,"String_Node_Str",se.message).response();
  }
  if (user == null) {
    return new IDMError(404,"String_Node_Str" + id,"String_Node_Str").response();
  }
  user.setPassword(REDACTED_PASSWORD);
  return Response.ok(user).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public Response getUser(@PathParam("String_Node_Str") String id){
  logger.info("String_Node_Str" + id);
  User user=null;
  long longId=0;
  try {
    longId=Long.parseLong(id);
  }
 catch (  NumberFormatException nfe) {
    return new IDMError(400,"String_Node_Str" + id,"String_Node_Str").response();
  }
  try {
    user=userStore.getUser(longId);
  }
 catch (  StoreException se) {
    return new IDMError(500,"String_Node_Str",se.message).response();
  }
  if (user == null) {
    return new IDMError(404,"String_Node_Str" + id,"String_Node_Str").response();
  }
  user.setPassword(REDACTED_PASSWORD);
  user.setSalt(REDACTED_PASSWORD);
  return Response.ok(user).build();
}
Program: 135726
Project: 135726
Buggy source:
public User putUser(User user) throws StoreException {
  User savedUser=this.getUser(user.getUserid());
  if (savedUser == null) {
    return null;
  }
  if (user.getDescription() != null) {
    savedUser.setDescription(user.getDescription());
  }
  if (user.getName() != null) {
    savedUser.setName(user.getName());
  }
  if (user.getEnabled() != null) {
    savedUser.setEnabled(user.getEnabled());
  }
  if (user.getEmail() != null) {
    savedUser.setEmail(user.getEmail());
  }
  if (user.getPassword() != null) {
    savedUser.setPassword(user.getPassword());
  }
  Connection conn=dbConnect();
  try {
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query);
    statement.setString(1,savedUser.getName());
    statement.setString(2,savedUser.getEmail());
    statement.setString(3,savedUser.getPassword());
    statement.setString(4,savedUser.getDescription());
    statement.setInt(5,savedUser.getEnabled() ? 1 : 0);
    statement.setInt(6,savedUser.getUserid());
    statement.executeUpdate();
    statement.close();
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
  return savedUser;
}

Fixed version (ground truth):
public User putUser(User user) throws StoreException {
  User savedUser=this.getUser(user.getUserid());
  if (savedUser == null) {
    return null;
  }
  if (user.getDescription() != null) {
    savedUser.setDescription(user.getDescription());
  }
  if (user.getName() != null) {
    savedUser.setName(user.getName());
  }
  if (user.getEnabled() != null) {
    savedUser.setEnabled(user.getEnabled());
  }
  if (user.getEmail() != null) {
    savedUser.setEmail(user.getEmail());
  }
  if (user.getPassword() != null) {
    savedUser.setPassword(SHA256Calculator.getSHA256(user.getPassword(),user.getSalt()));
  }
  Connection conn=dbConnect();
  try {
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query);
    statement.setString(1,savedUser.getName());
    statement.setString(2,savedUser.getEmail());
    statement.setString(3,savedUser.getPassword());
    statement.setString(4,savedUser.getDescription());
    statement.setInt(5,savedUser.getEnabled() ? 1 : 0);
    statement.setInt(6,savedUser.getUserid());
    statement.executeUpdate();
    statement.close();
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
  return savedUser;
}
Program: 135727
Project: 135727
Buggy source:
protected Connection dbConnect() throws StoreException {
  Connection conn;
  try {
    conn=getDBConnect();
  }
 catch (  StoreException se) {
    throw se;
  }
  try {
    DatabaseMetaData dbm=conn.getMetaData();
    String[] tableTypes={"String_Node_Str"};
    ResultSet rs=dbm.getTables(null,null,"String_Node_Str",tableTypes);
    if (rs.next()) {
      debug("String_Node_Str");
    }
 else {
      logger.info("String_Node_Str");
      Statement stmt=null;
      stmt=conn.createStatement();
      String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      stmt.executeUpdate(sql);
      stmt.close();
    }
  }
 catch (  SQLException sqe) {
    throw new StoreException("String_Node_Str" + sqe);
  }
  return conn;
}

Fixed version (ground truth):
protected Connection dbConnect() throws StoreException {
  Connection conn;
  try {
    conn=getDBConnect();
  }
 catch (  StoreException se) {
    throw se;
  }
  try {
    DatabaseMetaData dbm=conn.getMetaData();
    String[] tableTypes={"String_Node_Str"};
    ResultSet rs=dbm.getTables(null,null,"String_Node_Str",tableTypes);
    if (rs.next()) {
      debug("String_Node_Str");
    }
 else {
      logger.info("String_Node_Str");
      Statement stmt=null;
      stmt=conn.createStatement();
      String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      stmt.executeUpdate(sql);
      stmt.close();
    }
  }
 catch (  SQLException sqe) {
    throw new StoreException("String_Node_Str" + sqe);
  }
  return conn;
}
Program: 135728
Project: 135728
Buggy source:
protected User rsToUser(ResultSet rs) throws SQLException {
  User user=new User();
  try {
    user.setUserid(rs.getInt(SQL_ID));
    user.setName(rs.getString(SQL_NAME));
    user.setEmail(rs.getString(SQL_EMAIL));
    user.setPassword(rs.getString(SQL_PASSWORD));
    user.setDescription(rs.getString(SQL_DESCR));
    user.setEnabled(rs.getInt(SQL_ENABLED) == 1 ? true : false);
  }
 catch (  SQLException sqle) {
    logger.error("String_Node_Str" + sqle);
    throw sqle;
  }
  return user;
}

Fixed version (ground truth):
protected User rsToUser(ResultSet rs) throws SQLException {
  User user=new User();
  try {
    user.setUserid(rs.getInt(SQL_ID));
    user.setName(rs.getString(SQL_NAME));
    user.setEmail(rs.getString(SQL_EMAIL));
    user.setPassword(rs.getString(SQL_PASSWORD));
    user.setDescription(rs.getString(SQL_DESCR));
    user.setEnabled(rs.getInt(SQL_ENABLED) == 1 ? true : false);
    user.setSalt(rs.getString(SQL_SALT));
  }
 catch (  SQLException sqle) {
    logger.error("String_Node_Str" + sqle);
    throw sqle;
  }
  return user;
}
Program: 135729
Project: 135729
Buggy source:
public User createUser(User user) throws StoreException {
  int key=0;
  Connection conn=dbConnect();
  try {
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query,Statement.RETURN_GENERATED_KEYS);
    statement.setString(1,user.getName());
    statement.setString(2,user.getEmail());
    statement.setString(3,user.getPassword());
    statement.setString(4,user.getDescription());
    statement.setInt(5,user.getEnabled() ? 1 : 0);
    int affectedRows=statement.executeUpdate();
    if (affectedRows == 0) {
      throw new StoreException("String_Node_Str");
    }
    ResultSet generatedKeys=statement.getGeneratedKeys();
    if (generatedKeys.next()) {
      key=generatedKeys.getInt(1);
    }
 else {
      throw new StoreException("String_Node_Str");
    }
    user.setUserid(key);
    generatedKeys.close();
    statement.close();
    return user;
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
}

Fixed version (ground truth):
public User createUser(User user) throws StoreException {
  int key=0;
  Connection conn=dbConnect();
  try {
    user.setSalt(SHA256Calculator.generateSALT());
    String query="String_Node_Str";
    PreparedStatement statement=conn.prepareStatement(query,Statement.RETURN_GENERATED_KEYS);
    statement.setString(1,user.getName());
    statement.setString(2,user.getEmail());
    statement.setString(3,SHA256Calculator.getSHA256(user.getPassword(),user.getSalt()));
    statement.setString(4,user.getDescription());
    statement.setInt(5,user.getEnabled() ? 1 : 0);
    statement.setString(6,user.getSalt());
    int affectedRows=statement.executeUpdate();
    if (affectedRows == 0) {
      throw new StoreException("String_Node_Str");
    }
    ResultSet generatedKeys=statement.getGeneratedKeys();
    if (generatedKeys.next()) {
      key=generatedKeys.getInt(1);
    }
 else {
      throw new StoreException("String_Node_Str");
    }
    user.setUserid(key);
    generatedKeys.close();
    statement.close();
    return user;
  }
 catch (  SQLException s) {
    throw new StoreException("String_Node_Str" + s);
  }
 finally {
    dbClose();
  }
}
Program: 135730
Project: 135730
Buggy source:
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public Response getUser(@PathParam("String_Node_Str") String id){
  logger.info("String_Node_Str" + id);
  User user=null;
  long longId=0;
  try {
    longId=Long.parseLong(id);
  }
 catch (  NumberFormatException nfe) {
    return new IDMError(400,"String_Node_Str" + id,"String_Node_Str").response();
  }
  try {
    user=userStore.getUser(longId);
  }
 catch (  StoreException se) {
    return new IDMError(500,"String_Node_Str",se.message).response();
  }
  if (user == null) {
    return new IDMError(404,"String_Node_Str" + id,"String_Node_Str").response();
  }
  user.setPassword(REDACTED_PASSWORD);
  return Response.ok(user).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public Response getUser(@PathParam("String_Node_Str") String id){
  logger.info("String_Node_Str" + id);
  User user=null;
  long longId=0;
  try {
    longId=Long.parseLong(id);
  }
 catch (  NumberFormatException nfe) {
    return new IDMError(400,"String_Node_Str" + id,"String_Node_Str").response();
  }
  try {
    user=userStore.getUser(longId);
  }
 catch (  StoreException se) {
    return new IDMError(500,"String_Node_Str",se.message).response();
  }
  if (user == null) {
    return new IDMError(404,"String_Node_Str" + id,"String_Node_Str").response();
  }
  user.setPassword(REDACTED_PASSWORD);
  user.setSalt(REDACTED_PASSWORD);
  return Response.ok(user).build();
}
Program: 135732
Project: 135732
Buggy source:
@Override public void updated(Dictionary<String,?> props) throws ConfigurationException {
  if (props == null) {
    configs.clear();
    configs.putAll(defaults);
  }
 else {
    try {
      Enumeration<String> keys=props.keys();
      while (keys.hasMoreElements()) {
        String key=keys.nextElement();
        configs.put(key,(String)props.get(key));
      }
    }
 catch (    Throwable t) {
      throw new ConfigurationException(null,FEDERATION_CONFIG_ERR);
    }
  }
}

Fixed version (ground truth):
@Override public void updated(Dictionary<String,?> props) throws ConfigurationException {
  if (props == null) {
    configs.clear();
    configs.putAll(defaults);
  }
 else {
    try {
      Enumeration<String> keys=props.keys();
      while (keys.hasMoreElements()) {
        String key=keys.nextElement();
        configs.put(key,(String)props.get(key));
      }
    }
 catch (    Throwable t) {
      throw new ConfigurationException(null,FEDERATION_CONFIG_ERR,t);
    }
  }
}
Program: 135733
Project: 135733
Buggy source:
/** 
 * Authenticate user. This implementation tracks IUserManager and delegates the decision to it. If the service is not available, IllegalStateException is thrown.
 */
@Override public synchronized boolean authenticated(final String username,final String password){
  if (nullableCredService == null) {
    logger.warn("String_Node_Str",username);
    throw new IllegalStateException("String_Node_Str");
  }
  Claim claim;
  try {
    claim=nullableCredService.authenticate(new PasswordCredentialsWrapper(username,password),DOMAIN);
  }
 catch (  AuthenticationException e) {
    logger.debug("String_Node_Str",username);
    return false;
  }
  logger.debug("String_Node_Str",username,claim.domain());
  return true;
}

Fixed version (ground truth):
/** 
 * Authenticate user. This implementation tracks IUserManager and delegates the decision to it. If the service is not available, IllegalStateException is thrown.
 */
@Override public synchronized boolean authenticated(final String username,final String password){
  if (nullableCredService == null) {
    logger.warn("String_Node_Str",username);
    throw new IllegalStateException("String_Node_Str");
  }
  Claim claim;
  try {
    claim=nullableCredService.authenticate(new PasswordCredentialsWrapper(username,password),DOMAIN);
  }
 catch (  AuthenticationException e) {
    logger.debug("String_Node_Str",username,e);
    return false;
  }
  logger.debug("String_Node_Str",username,claim.domain());
  return true;
}
Program: 135734
Project: 135734
Buggy source:
private void reconfig(@SuppressWarnings("String_Node_Str") Dictionary props) throws ConfigurationException {
  cacheLock.lock();
  try {
    long secsToIdle=Long.parseLong(props.get(SECS_TO_IDLE).toString());
    long secsToLive=Long.parseLong(props.get(SECS_TO_LIVE).toString());
    int maxMem=Integer.parseInt(props.get(MAX_CACHED_MEMORY).toString());
    int maxDisk=Integer.parseInt(props.get(MAX_CACHED_DISK).toString());
    CacheConfiguration config=tokens.getCacheConfiguration();
    config.setTimeToIdleSeconds(secsToIdle);
    config.setTimeToLiveSeconds(secsToLive);
    config.maxEntriesLocalHeap(maxMem);
    config.maxEntriesLocalDisk(maxDisk);
  }
 catch (  Throwable t) {
    throw new ConfigurationException(null,TOKEN_STORE_CONFIG_ERR);
  }
 finally {
    cacheLock.unlock();
  }
}

Fixed version (ground truth):
private void reconfig(@SuppressWarnings("String_Node_Str") Dictionary props) throws ConfigurationException {
  cacheLock.lock();
  try {
    long secsToIdle=Long.parseLong(props.get(SECS_TO_IDLE).toString());
    long secsToLive=Long.parseLong(props.get(SECS_TO_LIVE).toString());
    int maxMem=Integer.parseInt(props.get(MAX_CACHED_MEMORY).toString());
    int maxDisk=Integer.parseInt(props.get(MAX_CACHED_DISK).toString());
    CacheConfiguration config=tokens.getCacheConfiguration();
    config.setTimeToIdleSeconds(secsToIdle);
    config.setTimeToLiveSeconds(secsToLive);
    config.maxEntriesLocalHeap(maxMem);
    config.maxEntriesLocalDisk(maxDisk);
  }
 catch (  Throwable t) {
    throw new ConfigurationException(null,TOKEN_STORE_CONFIG_ERR,t);
  }
 finally {
    cacheLock.unlock();
  }
}
Program: 135735
Project: 135735
Buggy source:
@Override public List<String> listDomains(String userId){
  debug("String_Node_Str" + userId);
  List<String> domains=new ArrayList<String>();
  int uid=0;
  try {
    uid=Integer.parseInt(userId);
  }
 catch (  NumberFormatException nfe) {
    logger.warn("String_Node_Str" + userId);
    return domains;
  }
  try {
    Grants grants=grantStore.getGrants(uid);
    List<Grant> grantList=grants.getGrants();
    for (int z=0; z < grantList.size(); z++) {
      Grant grant=grantList.get(z);
      Domain domain=domainStore.getDomain(grant.getDomainid());
      domains.add(domain.getName());
    }
    return domains;
  }
 catch (  StoreException se) {
    logger.warn("String_Node_Str" + se.toString());
    return domains;
  }
}

Fixed version (ground truth):
@Override public List<String> listDomains(String userId){
  debug("String_Node_Str" + userId);
  List<String> domains=new ArrayList<String>();
  int uid=0;
  try {
    uid=Integer.parseInt(userId);
  }
 catch (  NumberFormatException nfe) {
    logger.warn("String_Node_Str",userId,nfe);
    return domains;
  }
  try {
    Grants grants=grantStore.getGrants(uid);
    List<Grant> grantList=grants.getGrants();
    for (int z=0; z < grantList.size(); z++) {
      Grant grant=grantList.get(z);
      Domain domain=domainStore.getDomain(grant.getDomainid());
      domains.add(domain.getName());
    }
    return domains;
  }
 catch (  StoreException se) {
    logger.warn("String_Node_Str",se.toString(),se);
    return domains;
  }
}
Program: 135736
Project: 135736
Buggy source:
@Override public String getUserId(String userName){
  debug("String_Node_Str" + userName);
  try {
    Users users=userStore.getUsers(userName);
    List<User> userList=users.getUsers();
    if (userList.size() == 0) {
      return null;
    }
    User user=userList.get(0);
    return user.getUserid().toString();
  }
 catch (  StoreException se) {
    logger.warn("String_Node_Str" + se.toString());
    return null;
  }
}

Fixed version (ground truth):
@Override public String getUserId(String userName){
  debug("String_Node_Str" + userName);
  try {
    Users users=userStore.getUsers(userName);
    List<User> userList=users.getUsers();
    if (userList.size() == 0) {
      return null;
    }
    User user=userList.get(0);
    return user.getUserid().toString();
  }
 catch (  StoreException se) {
    logger.warn("String_Node_Str",se.toString(),se);
    return null;
  }
}
Program: 135738
Project: 135738
Buggy source:
@Override public List<String> listRoles(String userId,String domainName){
  debug("String_Node_Str");
  List<String> roles=new ArrayList<String>();
  try {
    Domains domains=domainStore.getDomains(domainName);
    List<Domain> domainList=domains.getDomains();
    if (domainList.size() == 0) {
      debug("String_Node_Str" + domainName + "String_Node_Str");
      return roles;
    }
    int did=domainList.get(0).getDomainid();
    int uid=0;
    try {
      uid=Integer.parseInt(userId);
    }
 catch (    NumberFormatException nfe) {
      logger.warn("String_Node_Str" + userId);
      return roles;
    }
    Grants grants=grantStore.getGrants(did,uid);
    List<Grant> grantList=grants.getGrants();
    for (int z=0; z < grantList.size(); z++) {
      Grant grant=grantList.get(z);
      Role role=roleStore.getRole(grant.getRoleid());
      roles.add(role.getName());
    }
    return roles;
  }
 catch (  StoreException se) {
    logger.warn("String_Node_Str" + se.toString());
    return roles;
  }
}

Fixed version (ground truth):
@Override public List<String> listRoles(String userId,String domainName){
  debug("String_Node_Str");
  List<String> roles=new ArrayList<String>();
  try {
    Domains domains=domainStore.getDomains(domainName);
    List<Domain> domainList=domains.getDomains();
    if (domainList.size() == 0) {
      debug("String_Node_Str" + domainName + "String_Node_Str");
      return roles;
    }
    int did=domainList.get(0).getDomainid();
    int uid=0;
    try {
      uid=Integer.parseInt(userId);
    }
 catch (    NumberFormatException nfe) {
      logger.warn("String_Node_Str",userId,nfe);
      return roles;
    }
    Grants grants=grantStore.getGrants(did,uid);
    List<Grant> grantList=grants.getGrants();
    for (int z=0; z < grantList.size(); z++) {
      Grant grant=grantList.get(z);
      Role role=roleStore.getRole(grant.getRoleid());
      roles.add(role.getName());
    }
    return roles;
  }
 catch (  StoreException se) {
    logger.warn("String_Node_Str",se.toString(),se);
    return roles;
  }
}
Program: 135740
Project: 135740
Buggy source:
private Object getRawParameter(String verb,List<Object> statement,int index,Set<TokenType> tokenTypes){
  Object item;
  try {
    item=statement.get(index);
  }
 catch (  IndexOutOfBoundsException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",verb,index + 1,statement.size()));
  }
  if (tokenTypes != null) {
    TokenType itemType=Token.classify(item);
    if (!tokenTypes.contains(itemType)) {
      throw new InvalidTypeException(String.format("String_Node_Str",verb,index,tokenTypes,statement));
    }
  }
  return item;
}

Fixed version (ground truth):
private Object getRawParameter(String verb,List<Object> statement,int index,Set<TokenType> tokenTypes){
  Object item;
  try {
    item=statement.get(index);
  }
 catch (  IndexOutOfBoundsException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",verb,index + 1,statement.size(),e));
  }
  if (tokenTypes != null) {
    TokenType itemType=Token.classify(item);
    if (!tokenTypes.contains(itemType)) {
      throw new InvalidTypeException(String.format("String_Node_Str",verb,index,tokenTypes,statement));
    }
  }
  return item;
}
Program: 135741
Project: 135741
Buggy source:
private Token getParameter(String verb,List<Object> statement,int index,Map<String,Object> namespace,Set<TokenType> tokenTypes){
  Object item;
  Token token;
  try {
    item=statement.get(index);
  }
 catch (  IndexOutOfBoundsException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",verb,index + 1,statement.size()));
  }
  try {
    token=new Token(item,namespace);
  }
 catch (  Exception e) {
    throw new StatementErrorException(String.format("String_Node_Str",index,e));
  }
  token.load();
  if (tokenTypes != null) {
    try {
      token.get();
    }
 catch (    UndefinedValueException e) {
    }
    if (!tokenTypes.contains(token.type)) {
      throw new InvalidTypeException(String.format("String_Node_Str",verb,index,tokenTypes,item.getClass().getSimpleName(),statement));
    }
  }
  return token;
}

Fixed version (ground truth):
private Token getParameter(String verb,List<Object> statement,int index,Map<String,Object> namespace,Set<TokenType> tokenTypes){
  Object item;
  Token token;
  try {
    item=statement.get(index);
  }
 catch (  IndexOutOfBoundsException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",verb,index + 1,statement.size(),e));
  }
  try {
    token=new Token(item,namespace);
  }
 catch (  Exception e) {
    throw new StatementErrorException(String.format("String_Node_Str",index,e));
  }
  token.load();
  if (tokenTypes != null) {
    try {
      token.get();
    }
 catch (    UndefinedValueException e) {
    }
    if (!tokenTypes.contains(token.type)) {
      throw new InvalidTypeException(String.format("String_Node_Str",verb,index,tokenTypes,item.getClass().getSimpleName(),statement));
    }
  }
  return token;
}
Program: 135742
Project: 135742
Buggy source:
Map<String,Object> getMapping(Map<String,Object> namespace,Map<String,Object> rule){
  Map<String,Object> mapping=null;
  String mappingName=null;
  try {
    @SuppressWarnings("String_Node_Str") Map<String,Object> map=(Map<String,Object>)rule.get("String_Node_Str");
    mapping=map;
  }
 catch (  java.lang.ClassCastException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace)));
  }
  if (mapping != null) {
    return mapping;
  }
  try {
    mappingName=(String)rule.get("String_Node_Str");
  }
 catch (  java.lang.ClassCastException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace)));
  }
  if (mappingName == null) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace)));
  }
  mapping=this.mappings.get(mappingName);
  if (mapping == null) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace)));
  }
  logger.debug(String.format("String_Node_Str",mappingName,this.ruleId(namespace),mapping));
  return mapping;
}

Fixed version (ground truth):
Map<String,Object> getMapping(Map<String,Object> namespace,Map<String,Object> rule){
  Map<String,Object> mapping=null;
  String mappingName=null;
  try {
    @SuppressWarnings("String_Node_Str") Map<String,Object> map=(Map<String,Object>)rule.get("String_Node_Str");
    mapping=map;
  }
 catch (  java.lang.ClassCastException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace),e));
  }
  if (mapping != null) {
    return mapping;
  }
  try {
    mappingName=(String)rule.get("String_Node_Str");
  }
 catch (  java.lang.ClassCastException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace),e));
  }
  if (mappingName == null) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace)));
  }
  mapping=this.mappings.get(mappingName);
  if (mapping == null) {
    throw new InvalidRuleException(String.format("String_Node_Str",this.ruleId(namespace)));
  }
  logger.debug(String.format("String_Node_Str",mappingName,this.ruleId(namespace),mapping));
  return mapping;
}
Program: 135744
Project: 135744
Buggy source:
private Token getVariable(String verb,List<Object> statement,int index,Map<String,Object> namespace){
  Object item;
  Token token;
  try {
    item=statement.get(index);
  }
 catch (  IndexOutOfBoundsException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",verb,index + 1,statement.size()));
  }
  try {
    token=new Token(item,namespace);
  }
 catch (  Exception e) {
    throw new StatementErrorException(String.format("String_Node_Str",index,e));
  }
  if (token.storageType != TokenStorageType.VARIABLE) {
    throw new InvalidTypeException(String.format("String_Node_Str",verb,index,token.storageType,statement));
  }
  return token;
}

Fixed version (ground truth):
private Token getVariable(String verb,List<Object> statement,int index,Map<String,Object> namespace){
  Object item;
  Token token;
  try {
    item=statement.get(index);
  }
 catch (  IndexOutOfBoundsException e) {
    throw new InvalidRuleException(String.format("String_Node_Str",verb,index + 1,statement.size(),e));
  }
  try {
    token=new Token(item,namespace);
  }
 catch (  Exception e) {
    throw new StatementErrorException(String.format("String_Node_Str",index,e));
  }
  if (token.storageType != TokenStorageType.VARIABLE) {
    throw new InvalidTypeException(String.format("String_Node_Str",verb,index,token.storageType,statement));
  }
  return token;
}