nus-yam/ex-repair huggingface dataset:
Program: 31321
Project: 31321
Buggy source:
/** 
 * @throws org.owasp.esapi.errors.AuthenticationException
 */
public void testGetUserFromRememberToken() throws AuthenticationException {
  System.out.println("String_Node_Str");
  Authenticator instance=ESAPI.authenticator();
  instance.logout();
  String password=instance.generateStrongPassword();
  String accountName=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  User user=instance.createUser(accountName,password,password);
  user.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  System.out.println("String_Node_Str");
  request.setCookie(HTTPUtilities.REMEMBER_TOKEN_COOKIE_NAME,"String_Node_Str");
  try {
    instance.login(request,response);
  }
 catch (  AuthenticationException e) {
  }
  System.out.println("String_Node_Str");
  request=new MockHttpServletRequest();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  ESAPI.authenticator().setCurrentUser(user);
  String newToken=ESAPI.httpUtilities().setRememberToken(request,response,password,10000,"String_Node_Str",request.getContextPath());
  request.setCookie(HTTPUtilities.REMEMBER_TOKEN_COOKIE_NAME,newToken);
  user.logout();
  User test2=instance.login(request,response);
  assertSame(user,test2);
}

Fixed version (ground truth):
/** 
 * @throws org.owasp.esapi.errors.AuthenticationException
 */
public void testGetUserFromRememberToken() throws AuthenticationException {
  System.out.println("String_Node_Str");
  Authenticator instance=ESAPI.authenticator();
  instance.logout();
  String password=instance.generateStrongPassword();
  String accountName=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_ALPHANUMERICS);
  User user=instance.createUser(accountName,password,password);
  user.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  System.out.println("String_Node_Str");
  request.setCookie(HTTPUtilities.REMEMBER_TOKEN_COOKIE_NAME,"String_Node_Str");
  try {
    instance.login(request,response);
  }
 catch (  AuthenticationException e) {
  }
  System.out.println("String_Node_Str");
  request=new MockHttpServletRequest();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  ESAPI.authenticator().setCurrentUser(user);
  String newToken=ESAPI.httpUtilities().setRememberToken(request,response,password,10000,"String_Node_Str",request.getContextPath());
  request.setCookie(HTTPUtilities.REMEMBER_TOKEN_COOKIE_NAME,newToken);
  user.logout();
  User test2=instance.login(request,response);
  assertSame(user,test2);
}
Program: 31322
Project: 31322
Buggy source:
/** 
 * Test get user from session.
 * @throws AuthenticationException the authentication exception
 */
public void testGetUserFromSession() throws AuthenticationException {
  System.out.println("String_Node_Str");
  FileBasedAuthenticator instance=(FileBasedAuthenticator)ESAPI.authenticator();
  instance.logout();
  String accountName=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  String password=instance.generateStrongPassword();
  User user=instance.createUser(accountName,password,password);
  user.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  request.addParameter("String_Node_Str",accountName);
  request.addParameter("String_Node_Str",password);
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  instance.login(request,response);
  User test=instance.getUserFromSession();
  assertEquals(user,test);
}

Fixed version (ground truth):
/** 
 * Test get user from session.
 * @throws AuthenticationException the authentication exception
 */
public void testGetUserFromSession() throws AuthenticationException {
  System.out.println("String_Node_Str");
  FileBasedAuthenticator instance=(FileBasedAuthenticator)ESAPI.authenticator();
  instance.logout();
  String accountName=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_ALPHANUMERICS);
  String password=instance.generateStrongPassword();
  User user=instance.createUser(accountName,password,password);
  user.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  request.addParameter("String_Node_Str",accountName);
  request.addParameter("String_Node_Str",password);
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  instance.login(request,response);
  User test=instance.getUserFromSession();
  assertEquals(user,test);
}
Program: 31323
Project: 31323
Buggy source:
/** 
 * Test get user names.
 * @throws AuthenticationException the authentication exception
 */
public void testGetUserNames() throws AuthenticationException {
  System.out.println("String_Node_Str");
  Authenticator instance=ESAPI.authenticator();
  String password=instance.generateStrongPassword();
  String[] testnames=new String[10];
  for (int i=0; i < testnames.length; i++) {
    testnames[i]=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  }
  for (int i=0; i < testnames.length; i++) {
    instance.createUser(testnames[i],password,password);
  }
  Set names=instance.getUserNames();
  for (int i=0; i < testnames.length; i++) {
    assertTrue(names.contains(testnames[i].toLowerCase()));
  }
}

Fixed version (ground truth):
/** 
 * Test get user names.
 * @throws AuthenticationException the authentication exception
 */
public void testGetUserNames() throws AuthenticationException {
  System.out.println("String_Node_Str");
  Authenticator instance=ESAPI.authenticator();
  String password=instance.generateStrongPassword();
  String[] testnames=new String[10];
  for (int i=0; i < testnames.length; i++) {
    testnames[i]=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_ALPHANUMERICS);
  }
  for (int i=0; i < testnames.length; i++) {
    instance.createUser(testnames[i],password,password);
  }
  Set names=instance.getUserNames();
  for (int i=0; i < testnames.length; i++) {
    assertTrue(names.contains(testnames[i].toLowerCase()));
  }
}
Program: 31325
Project: 31325
Buggy source:
public void run(){
  while (true) {
    String nonce=ESAPI.randomizer().getRandomString(20,DefaultEncoder.CHAR_SPECIALS);
    String result=javaScriptEncode(nonce);
    try {
      Thread.sleep(ESAPI.randomizer().getRandomInteger(100,500));
    }
 catch (    InterruptedException e) {
    }
    assertTrue(result.equals(javaScriptEncode(nonce)));
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    String nonce=ESAPI.randomizer().getRandomString(20,EncoderConstants.CHAR_SPECIALS);
    String result=javaScriptEncode(nonce);
    try {
      Thread.sleep(ESAPI.randomizer().getRandomInteger(100,500));
    }
 catch (    InterruptedException e) {
    }
    assertTrue(result.equals(javaScriptEncode(nonce)));
  }
}
Program: 31326
Project: 31326
Buggy source:
/** 
 * Test of WindowsCodec
 */
public void testWindowsCodec(){
  System.out.println("String_Node_Str");
  Encoder instance=ESAPI.encoder();
  Codec win=new WindowsCodec();
  char[] immune=new char[0];
  assertEquals(null,instance.encodeForOS(win,null));
  PushbackString npbs=new PushbackString("String_Node_Str");
  assertEquals(null,win.decodeCharacter(npbs));
  PushbackString epbs=new PushbackString("String_Node_Str");
  assertEquals(null,win.decodeCharacter(epbs));
  Character c=Character.valueOf('<');
  PushbackString cpbs=new PushbackString(win.encodeCharacter(immune,c));
  Character decoded=win.decodeCharacter(cpbs);
  assertEquals(c,decoded);
  String orig="String_Node_Str";
  String enc=win.encode(DefaultEncoder.CHAR_ALPHANUMERICS,orig);
  assertEquals(orig,win.decode(enc));
  assertEquals(orig,win.decode(orig));
  assertEquals("String_Node_Str",instance.encodeForOS(win,"String_Node_Str"));
  assertEquals("String_Node_Str",win.encode(immune,"String_Node_Str"));
  assertEquals("String_Node_Str",instance.encodeForOS(win,"String_Node_Str"));
  assertEquals("String_Node_Str",win.encode(immune,"String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Test of WindowsCodec
 */
public void testWindowsCodec(){
  System.out.println("String_Node_Str");
  Encoder instance=ESAPI.encoder();
  Codec win=new WindowsCodec();
  char[] immune=new char[0];
  assertEquals(null,instance.encodeForOS(win,null));
  PushbackString npbs=new PushbackString("String_Node_Str");
  assertEquals(null,win.decodeCharacter(npbs));
  PushbackString epbs=new PushbackString("String_Node_Str");
  assertEquals(null,win.decodeCharacter(epbs));
  Character c=Character.valueOf('<');
  PushbackString cpbs=new PushbackString(win.encodeCharacter(immune,c));
  Character decoded=win.decodeCharacter(cpbs);
  assertEquals(c,decoded);
  String orig="String_Node_Str";
  String enc=win.encode(EncoderConstants.CHAR_ALPHANUMERICS,orig);
  assertEquals(orig,win.decode(enc));
  assertEquals(orig,win.decode(orig));
  assertEquals("String_Node_Str",instance.encodeForOS(win,"String_Node_Str"));
  assertEquals("String_Node_Str",win.encode(immune,"String_Node_Str"));
  assertEquals("String_Node_Str",instance.encodeForOS(win,"String_Node_Str"));
  assertEquals("String_Node_Str",win.encode(immune,"String_Node_Str"));
}
Program: 31327
Project: 31327
Buggy source:
/** 
 * Test of decodeFromBase64 method, of class org.owasp.esapi.Encoder.
 */
public void testDecodeFromBase64(){
  System.out.println("String_Node_Str");
  Encoder instance=ESAPI.encoder();
  for (int i=0; i < 100; i++) {
    try {
      byte[] r=ESAPI.randomizer().getRandomString(20,DefaultEncoder.CHAR_SPECIALS).getBytes(PREFERRED_ENCODING);
      String encoded=instance.encodeForBase64(r,ESAPI.randomizer().getRandomBoolean());
      byte[] decoded=instance.decodeFromBase64(encoded);
      assertTrue(Arrays.equals(r,decoded));
    }
 catch (    IOException e) {
      fail();
    }
  }
  for (int i=0; i < 100; i++) {
    try {
      byte[] r=ESAPI.randomizer().getRandomString(20,DefaultEncoder.CHAR_SPECIALS).getBytes(PREFERRED_ENCODING);
      String encoded=ESAPI.randomizer().getRandomString(1,DefaultEncoder.CHAR_ALPHANUMERICS) + instance.encodeForBase64(r,ESAPI.randomizer().getRandomBoolean());
      byte[] decoded=instance.decodeFromBase64(encoded);
      assertFalse(Arrays.equals(r,decoded));
    }
 catch (    UnsupportedEncodingException ex) {
      fail();
    }
catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
/** 
 * Test of decodeFromBase64 method, of class org.owasp.esapi.Encoder.
 */
public void testDecodeFromBase64(){
  System.out.println("String_Node_Str");
  Encoder instance=ESAPI.encoder();
  for (int i=0; i < 100; i++) {
    try {
      byte[] r=ESAPI.randomizer().getRandomString(20,EncoderConstants.CHAR_SPECIALS).getBytes(PREFERRED_ENCODING);
      String encoded=instance.encodeForBase64(r,ESAPI.randomizer().getRandomBoolean());
      byte[] decoded=instance.decodeFromBase64(encoded);
      assertTrue(Arrays.equals(r,decoded));
    }
 catch (    IOException e) {
      fail();
    }
  }
  for (int i=0; i < 100; i++) {
    try {
      byte[] r=ESAPI.randomizer().getRandomString(20,EncoderConstants.CHAR_SPECIALS).getBytes(PREFERRED_ENCODING);
      String encoded=ESAPI.randomizer().getRandomString(1,EncoderConstants.CHAR_ALPHANUMERICS) + instance.encodeForBase64(r,ESAPI.randomizer().getRandomBoolean());
      byte[] decoded=instance.decodeFromBase64(encoded);
      assertFalse(Arrays.equals(r,decoded));
    }
 catch (    UnsupportedEncodingException ex) {
      fail();
    }
catch (    IOException e) {
    }
  }
}
Program: 31328
Project: 31328
Buggy source:
/** 
 * Test of encodeForBase64 method, of class org.owasp.esapi.Encoder.
 */
public void testEncodeForBase64(){
  System.out.println("String_Node_Str");
  Encoder instance=ESAPI.encoder();
  try {
    assertEquals(null,instance.encodeForBase64(null,false));
    assertEquals(null,instance.encodeForBase64(null,true));
    assertEquals(null,instance.decodeFromBase64(null));
    for (int i=0; i < 100; i++) {
      byte[] r=ESAPI.randomizer().getRandomString(20,DefaultEncoder.CHAR_SPECIALS).getBytes(PREFERRED_ENCODING);
      String encoded=instance.encodeForBase64(r,ESAPI.randomizer().getRandomBoolean());
      byte[] decoded=instance.decodeFromBase64(encoded);
      assertTrue(Arrays.equals(r,decoded));
    }
  }
 catch (  IOException e) {
    fail();
  }
}

Fixed version (ground truth):
/** 
 * Test of encodeForBase64 method, of class org.owasp.esapi.Encoder.
 */
public void testEncodeForBase64(){
  System.out.println("String_Node_Str");
  Encoder instance=ESAPI.encoder();
  try {
    assertEquals(null,instance.encodeForBase64(null,false));
    assertEquals(null,instance.encodeForBase64(null,true));
    assertEquals(null,instance.decodeFromBase64(null));
    for (int i=0; i < 100; i++) {
      byte[] r=ESAPI.randomizer().getRandomString(20,EncoderConstants.CHAR_SPECIALS).getBytes(PREFERRED_ENCODING);
      String encoded=instance.encodeForBase64(r,ESAPI.randomizer().getRandomBoolean());
      byte[] decoded=instance.decodeFromBase64(encoded);
      assertTrue(Arrays.equals(r,decoded));
    }
  }
 catch (  IOException e) {
    fail();
  }
}
Program: 31329
Project: 31329
Buggy source:
/** 
 * @throws org.owasp.esapi.errors.AuthenticationException
 */
public void testSetRememberToken() throws AuthenticationException {
  System.out.println("String_Node_Str");
  Authenticator instance=(Authenticator)ESAPI.authenticator();
  String accountName=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  String password=instance.generateStrongPassword();
  User user=instance.createUser(accountName,password,password);
  user.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  request.addParameter("String_Node_Str",accountName);
  request.addParameter("String_Node_Str",password);
  MockHttpServletResponse response=new MockHttpServletResponse();
  instance.login(request,response);
  int maxAge=(60 * 60 * 24* 14);
  ESAPI.httpUtilities().setRememberToken(request,response,password,maxAge,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @throws org.owasp.esapi.errors.AuthenticationException
 */
public void testSetRememberToken() throws AuthenticationException {
  System.out.println("String_Node_Str");
  Authenticator instance=(Authenticator)ESAPI.authenticator();
  String accountName=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_ALPHANUMERICS);
  String password=instance.generateStrongPassword();
  User user=instance.createUser(accountName,password,password);
  user.enable();
  MockHttpServletRequest request=new MockHttpServletRequest();
  request.addParameter("String_Node_Str",accountName);
  request.addParameter("String_Node_Str",password);
  MockHttpServletResponse response=new MockHttpServletResponse();
  instance.login(request,response);
  int maxAge=(60 * 60 * 24* 14);
  ESAPI.httpUtilities().setRememberToken(request,response,password,maxAge,"String_Node_Str","String_Node_Str");
}
Program: 31330
Project: 31330
Buggy source:
public void testCSRFToken() throws Exception {
  System.out.println("String_Node_Str");
  String username=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  User user=ESAPI.authenticator().createUser(username,"String_Node_Str","String_Node_Str");
  ESAPI.authenticator().setCurrentUser(user);
  String token=ESAPI.httpUtilities().getCSRFToken();
  assertEquals(8,token.length());
  MockHttpServletRequest request=new MockHttpServletRequest();
  try {
    ESAPI.httpUtilities().verifyCSRFToken(request);
    fail();
  }
 catch (  Exception e) {
  }
  request.addParameter(DefaultHTTPUtilities.CSRF_TOKEN_NAME,token);
  ESAPI.httpUtilities().verifyCSRFToken(request);
}

Fixed version (ground truth):
public void testCSRFToken() throws Exception {
  System.out.println("String_Node_Str");
  String username=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_ALPHANUMERICS);
  User user=ESAPI.authenticator().createUser(username,"String_Node_Str","String_Node_Str");
  ESAPI.authenticator().setCurrentUser(user);
  String token=ESAPI.httpUtilities().getCSRFToken();
  assertEquals(8,token.length());
  MockHttpServletRequest request=new MockHttpServletRequest();
  try {
    ESAPI.httpUtilities().verifyCSRFToken(request);
    fail();
  }
 catch (  Exception e) {
  }
  request.addParameter(DefaultHTTPUtilities.CSRF_TOKEN_NAME,token);
  ESAPI.httpUtilities().verifyCSRFToken(request);
}
Program: 31331
Project: 31331
Buggy source:
/** 
 */
public void testSaveTooLongStateInEncryptedCookieException(){
  System.out.println("String_Node_Str");
  MockHttpServletRequest request=new MockHttpServletRequest();
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  String foo=ESAPI.randomizer().getRandomString(4096,DefaultEncoder.CHAR_ALPHANUMERICS);
  HashMap map=new HashMap();
  map.put("String_Node_Str",foo);
  try {
    ESAPI.httpUtilities().encryptStateInCookie(response,map);
    fail("String_Node_Str");
  }
 catch (  EncryptionException expected) {
  }
}

Fixed version (ground truth):
/** 
 */
public void testSaveTooLongStateInEncryptedCookieException(){
  System.out.println("String_Node_Str");
  MockHttpServletRequest request=new MockHttpServletRequest();
  MockHttpServletResponse response=new MockHttpServletResponse();
  ESAPI.httpUtilities().setCurrentHTTP(request,response);
  String foo=ESAPI.randomizer().getRandomString(4096,EncoderConstants.CHAR_ALPHANUMERICS);
  HashMap map=new HashMap();
  map.put("String_Node_Str",foo);
  try {
    ESAPI.httpUtilities().encryptStateInCookie(response,map);
    fail("String_Node_Str");
  }
 catch (  EncryptionException expected) {
  }
}
Program: 31332
Project: 31332
Buggy source:
/** 
 * Test of addCSRFToken method, of class org.owasp.esapi.HTTPUtilities.
 * @throws AuthenticationException 
 */
public void testAddCSRFToken() throws AuthenticationException {
  Authenticator instance=ESAPI.authenticator();
  String username=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  User user=instance.createUser(username,"String_Node_Str","String_Node_Str");
  instance.setCurrentUser(user);
  System.out.println("String_Node_Str");
  String csrf1=ESAPI.httpUtilities().addCSRFToken("String_Node_Str");
  System.out.println("String_Node_Str" + csrf1);
  assertTrue(csrf1.indexOf("String_Node_Str") > -1);
  String csrf2=ESAPI.httpUtilities().addCSRFToken("String_Node_Str");
  System.out.println("String_Node_Str" + csrf1);
  assertTrue(csrf2.indexOf("String_Node_Str") > -1);
}

Fixed version (ground truth):
/** 
 * Test of addCSRFToken method, of class org.owasp.esapi.HTTPUtilities.
 * @throws AuthenticationException 
 */
public void testAddCSRFToken() throws AuthenticationException {
  Authenticator instance=ESAPI.authenticator();
  String username=ESAPI.randomizer().getRandomString(8,EncoderConstants.CHAR_ALPHANUMERICS);
  User user=instance.createUser(username,"String_Node_Str","String_Node_Str");
  instance.setCurrentUser(user);
  System.out.println("String_Node_Str");
  String csrf1=ESAPI.httpUtilities().addCSRFToken("String_Node_Str");
  System.out.println("String_Node_Str" + csrf1);
  assertTrue(csrf1.indexOf("String_Node_Str") > -1);
  String csrf2=ESAPI.httpUtilities().addCSRFToken("String_Node_Str");
  System.out.println("String_Node_Str" + csrf1);
  assertTrue(csrf2.indexOf("String_Node_Str") > -1);
}
Program: 31333
Project: 31333
Buggy source:
public BeanShellRule(String fileLocation,String id,Pattern path) throws IOException, EvalError {
  i=new Interpreter();
  i.set("String_Node_Str",logger);
  this.script=getFileContents(new File(fileLocation));
  this.id=id;
  this.path=path;
}

Fixed version (ground truth):
public BeanShellRule(String fileLocation,String id,Pattern path) throws IOException, EvalError {
  i=new Interpreter();
  i.set("String_Node_Str",logger);
  this.script=getFileContents(ESAPI.securityConfiguration().getResourceFile(fileLocation));
  this.id=id;
  this.path=path;
}
Program: 31334
Project: 31334
Buggy source:
/** 
 * {@inheritDoc}
 */
public File getResourceFile(String filename){
  logSpecial("String_Node_Str" + filename + "String_Node_Str");
  if (filename == null) {
    logSpecial("String_Node_Str");
    return null;
  }
  File f=null;
  f=new File(customDirectory,filename);
  if (customDirectory != null && f.canRead()) {
    logSpecial("String_Node_Str" + f.getAbsolutePath());
    return f;
  }
 else {
    logSpecial("String_Node_Str" + f.getAbsolutePath());
  }
  URL fileUrl=ClassLoader.getSystemResource(resourceDirectory + "String_Node_Str" + filename);
  if (fileUrl != null) {
    String fileLocation=fileUrl.getFile();
    f=new File(fileLocation);
    if (f.exists()) {
      logSpecial("String_Node_Str" + f.getAbsolutePath());
      return f;
    }
 else {
      logSpecial("String_Node_Str" + f.getAbsolutePath());
    }
  }
 else {
    logSpecial("String_Node_Str" + resourceDirectory + File.separator+ filename);
  }
  String homeDir=userHome;
  if (homeDir == null) {
    homeDir="String_Node_Str";
  }
  f=new File(homeDir + "String_Node_Str",filename);
  if (f.canRead()) {
    logSpecial("String_Node_Str" + f.getAbsolutePath());
    return f;
  }
 else {
    f=new File(homeDir + "String_Node_Str",filename);
    if (f.canRead()) {
      logSpecial("String_Node_Str" + f.getAbsolutePath());
      return f;
    }
 else {
      logSpecial("String_Node_Str" + homeDir + "String_Node_Str"+ f.getAbsolutePath());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public File getResourceFile(String filename){
  logSpecial("String_Node_Str" + filename + "String_Node_Str");
  if (filename == null) {
    logSpecial("String_Node_Str");
    return null;
  }
  File f=null;
  f=new File(customDirectory,filename);
  if (customDirectory != null && f.canRead()) {
    logSpecial("String_Node_Str" + f.getAbsolutePath());
    return f;
  }
 else {
    logSpecial("String_Node_Str" + f.getAbsolutePath());
  }
  URL fileUrl=ClassLoader.getSystemResource(resourceDirectory + "String_Node_Str" + filename);
  if (fileUrl == null) {
    fileUrl=ClassLoader.getSystemResource("String_Node_Str" + filename);
  }
  if (fileUrl != null) {
    String fileLocation=fileUrl.getFile();
    f=new File(fileLocation);
    if (f.exists()) {
      logSpecial("String_Node_Str" + f.getAbsolutePath());
      return f;
    }
 else {
      logSpecial("String_Node_Str" + f.getAbsolutePath());
    }
  }
 else {
    logSpecial("String_Node_Str" + resourceDirectory + File.separator+ filename);
  }
  String homeDir=userHome;
  if (homeDir == null) {
    homeDir="String_Node_Str";
  }
  f=new File(homeDir + "String_Node_Str",filename);
  if (f.canRead()) {
    logSpecial("String_Node_Str" + f.getAbsolutePath());
    return f;
  }
 else {
    f=new File(homeDir + "String_Node_Str",filename);
    if (f.canRead()) {
      logSpecial("String_Node_Str" + f.getAbsolutePath());
      return f;
    }
 else {
      logSpecial("String_Node_Str" + homeDir + "String_Node_Str"+ f.getAbsolutePath());
    }
  }
  return null;
}
Program: 31335
Project: 31335
Buggy source:
/** 
 * {@inheritDoc}
 */
public void changePassword(User user,String currentPassword,String newPassword,String newPassword2) throws AuthenticationException {
  String accountName=user.getAccountName();
  try {
    String currentHash=getHashedPassword(user);
    String verifyHash=hashPassword(currentPassword,accountName);
    if (!currentHash.equals(verifyHash)) {
      throw new AuthenticationCredentialsException("String_Node_Str","String_Node_Str" + accountName);
    }
    if (newPassword == null || newPassword2 == null || !newPassword.equals(newPassword2)) {
      throw new AuthenticationCredentialsException("String_Node_Str","String_Node_Str" + accountName);
    }
    verifyPasswordStrength(currentPassword,newPassword);
    user.setLastPasswordChangeTime(new Date());
    String newHash=hashPassword(newPassword,accountName);
    if (getOldPasswordHashes(user).contains(newHash)) {
      throw new AuthenticationCredentialsException("String_Node_Str","String_Node_Str" + accountName);
    }
    setHashedPassword(user,newHash);
    logger.info(Logger.SECURITY_SUCCESS,"String_Node_Str" + accountName);
    saveUsers();
  }
 catch (  EncryptionException ee) {
    throw new AuthenticationException("String_Node_Str","String_Node_Str" + accountName,ee);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void changePassword(User user,String currentPassword,String newPassword,String newPassword2) throws AuthenticationException {
  String accountName=user.getAccountName();
  try {
    String currentHash=getHashedPassword(user);
    String verifyHash=hashPassword(currentPassword,accountName);
    if (!currentHash.equals(verifyHash)) {
      throw new AuthenticationCredentialsException("String_Node_Str","String_Node_Str" + accountName);
    }
    if (newPassword == null || newPassword2 == null || !newPassword.equals(newPassword2)) {
      throw new AuthenticationCredentialsException("String_Node_Str","String_Node_Str" + accountName);
    }
    verifyPasswordIsNotAccountName(accountName,newPassword);
    verifyPasswordStrength(currentPassword,newPassword);
    user.setLastPasswordChangeTime(new Date());
    String newHash=hashPassword(newPassword,accountName);
    if (getOldPasswordHashes(user).contains(newHash)) {
      throw new AuthenticationCredentialsException("String_Node_Str","String_Node_Str" + accountName);
    }
    setHashedPassword(user,newHash);
    logger.info(Logger.SECURITY_SUCCESS,"String_Node_Str" + accountName);
    saveUsers();
  }
 catch (  EncryptionException ee) {
    throw new AuthenticationException("String_Node_Str","String_Node_Str" + accountName,ee);
  }
}
Program: 31337
Project: 31337
Buggy source:
/** 
 * Test of createAccount method, of class org.owasp.esapi.Authenticator.
 * @throws AuthenticationException the authentication exception
 * @throws EncryptionException
 */
public void testCreateUser() throws AuthenticationException, EncryptionException {
  System.out.println("String_Node_Str");
  String accountName=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  Authenticator instance=ESAPI.authenticator();
  String password=instance.generateStrongPassword();
  User user=instance.createUser(accountName,password,password);
  assertTrue(user.verifyPassword(password));
  try {
    instance.createUser(accountName,password,password);
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS),"String_Node_Str","String_Node_Str");
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS),"String_Node_Str","String_Node_Str");
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(null,"String_Node_Str","String_Node_Str");
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS),null,null);
    fail();
  }
 catch (  AuthenticationException e) {
  }
}

Fixed version (ground truth):
/** 
 * Test of createAccount method, of class org.owasp.esapi.Authenticator.
 * @throws AuthenticationException the authentication exception
 * @throws EncryptionException
 */
public void testCreateUser() throws AuthenticationException, EncryptionException {
  System.out.println("String_Node_Str");
  String accountName=ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS);
  Authenticator instance=ESAPI.authenticator();
  String password=instance.generateStrongPassword();
  User user=instance.createUser(accountName,password,password);
  assertTrue(user.verifyPassword(password));
  try {
    instance.createUser(accountName,password,password);
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS),"String_Node_Str","String_Node_Str");
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS),"String_Node_Str","String_Node_Str");
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(null,"String_Node_Str","String_Node_Str");
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    instance.createUser(ESAPI.randomizer().getRandomString(8,DefaultEncoder.CHAR_ALPHANUMERICS),null,null);
    fail();
  }
 catch (  AuthenticationException e) {
  }
  try {
    String uName="String_Node_Str";
    instance.createUser(uName,uName,uName);
    fail();
  }
 catch (  AuthenticationException e) {
  }
}
Program: 31338
Project: 31338
Buggy source:
public void setAllowableContentRoot(String allowableContentRoot){
  this.allowableContentRoot=allowableContentRoot.startsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str" + allowableContentRoot;
}

Fixed version (ground truth):
public void setAllowableContentRoot(String allowableContentRoot){
  this.allowableContentRoot=allowableContentRoot.startsWith("String_Node_Str") ? allowableContentRoot : "String_Node_Str" + allowableContentRoot;
}
Program: 31339
Project: 31339
Buggy source:
private static void initKeyPair(SecureRandom prng) throws NoSuchAlgorithmException {
  KeyPairGenerator keyGen=KeyPairGenerator.getInstance(signatureAlgorithm);
  keyGen.initialize(signatureKeyLength,prng);
  KeyPair pair=keyGen.generateKeyPair();
  privateKey=pair.getPrivate();
  publicKey=pair.getPublic();
}

Fixed version (ground truth):
private static void initKeyPair(SecureRandom prng) throws NoSuchAlgorithmException {
  String sigAlg=signatureAlgorithm;
  if (sigAlg.endsWith("String_Node_Str")) {
    sigAlg="String_Node_Str";
  }
  KeyPairGenerator keyGen=KeyPairGenerator.getInstance(sigAlg);
  keyGen.initialize(signatureKeyLength,prng);
  KeyPair pair=keyGen.generateKeyPair();
  privateKey=pair.getPrivate();
  publicKey=pair.getPublic();
}
Program: 31340
Project: 31340
Buggy source:
/** 
 * Returns the array of matching parameter values from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The parameter name
 * @return An array of matching "scrubbed" parameter values.
 */
public String[] getParameterValues(String name){
  String[] values=getHttpServletRequest().getParameterValues(name);
  List<String> newValues=new ArrayList<String>();
  if (values != null) {
    for (    String value : values) {
      try {
        String cleanValue=ESAPI.validator().getValidInput("String_Node_Str" + value,value,"String_Node_Str",2000,true);
        newValues.add(cleanValue);
      }
 catch (      ValidationException e) {
        logger.warning(Logger.SECURITY_FAILURE,"String_Node_Str");
      }
    }
  }
  return newValues.toArray(new String[newValues.size()]);
}

Fixed version (ground truth):
/** 
 * Returns the array of matching parameter values from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The parameter name
 * @return An array of matching "scrubbed" parameter values or<code>null</code> if the parameter does not exist.
 */
public String[] getParameterValues(String name){
  String[] values=getHttpServletRequest().getParameterValues(name);
  List<String> newValues;
  if (values == null)   return null;
  newValues=new ArrayList<String>();
  for (  String value : values) {
    try {
      String cleanValue=ESAPI.validator().getValidInput("String_Node_Str" + value,value,"String_Node_Str",2000,true);
      newValues.add(cleanValue);
    }
 catch (    ValidationException e) {
      logger.warning(Logger.SECURITY_FAILURE,"String_Node_Str");
    }
  }
  return newValues.toArray(new String[newValues.size()]);
}
Program: 31341
Project: 31341
Buggy source:
/** 
 * {@inheritDoc}Returns the decoded version of the character starting at index, or null if no decoding is possible.  This implementation does not support \\### octal encoding. Formats all are legal both upper/lower case: \\x - special characters \\HHHH
 */
public Character decodeCharacter(PushbackString input){
  input.mark();
  Character first=input.next();
  if (first == null) {
    input.reset();
    return null;
  }
  if (first != '\\') {
    input.reset();
    return null;
  }
  Character second=input.next();
  if (second == null) {
    input.reset();
    return null;
  }
  if (PushbackString.isHexDigit(second)) {
    StringBuilder sb=new StringBuilder();
    sb.append(second);
    for (int i=0; i < 5; i++) {
      Character c=input.next();
      if (c == null || c == 0x20)       break;
      if (PushbackString.isHexDigit(c)) {
        sb.append(c);
      }
 else {
        input.pushback(c);
        break;
      }
    }
    try {
      int i=Integer.parseInt(sb.toString(),16);
      if (Character.isValidCodePoint(i))       return (char)i;
    }
 catch (    NumberFormatException e) {
    }
  }
  return second;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Returns the decoded version of the character starting at index, or null if no decoding is possible.
 */
public Character decodeCharacter(PushbackString input){
  input.mark();
  Character first=input.next();
  if (first == null || first != '\\') {
    input.reset();
    return null;
  }
  Character second=input.next();
  if (second == null) {
    input.reset();
    return null;
  }
switch (second) {
case '\r':
    if (input.peek('\n'))     input.next();
case '\n':
case '\f':
case '\u0000':
  return decodeCharacter(input);
}
if (!PushbackString.isHexDigit(second)) {
return second;
}
StringBuilder sb=new StringBuilder();
sb.append(second);
for (int i=0; i < 5; i++) {
Character c=input.next();
if (c == null || Character.isWhitespace(c)) break;
if (PushbackString.isHexDigit(c)) sb.append(c);
 else {
  input.pushback(c);
  break;
}
}
try {
int i=Integer.parseInt(sb.toString(),16);
if (Character.isValidCodePoint(i)) return (char)i;
return REPLACEMENT;
}
 catch (NumberFormatException e) {
throw new IllegalStateException("String_Node_Str",e);
}
}
Program: 31343
Project: 31343
Buggy source:
/** 
 * Utility method to get a resource as an InputStream. The search looks for an "esapi-resources" directory in the setResourceDirectory() location, then the System.getProperty( "org.owasp.esapi.resources" ) location, then the System.getProperty( "user.home" ) location, and then the classpath.
 * @param filename
 * @return	An {@code InputStream} associated with the specified file name as a resourcestream.
 * @throws IOException	If the file cannot be found or opened for reading.
 */
public InputStream getResourceStream(String filename) throws IOException {
  if (filename == null) {
    System.out.println("String_Node_Str");
    return null;
  }
  try {
    File f=getResourceFile(filename);
    if (f != null && f.exists()) {
      return new FileInputStream(f);
    }
  }
 catch (  Exception e) {
  }
  ClassLoader loader=getClass().getClassLoader();
  System.out.println("String_Node_Str" + loader);
  String filePathToLoad="String_Node_Str" + filename;
  System.out.println("String_Node_Str" + filePathToLoad);
  URL resourceURL=loader.getResource(filePathToLoad);
  System.out.println("String_Node_Str" + resourceURL);
  String resource=resourceURL.getFile();
  System.out.println("String_Node_Str" + resource);
  FileInputStream in=null;
  try {
    URI uri=new URI(resource);
    in=new FileInputStream(uri.getPath());
  }
 catch (  Exception e) {
  }
  if (in != null) {
    logSpecial("String_Node_Str",null);
    return in;
  }
 else {
    logSpecial("String_Node_Str",null);
    logSpecial("String_Node_Str",null);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Utility method to get a resource as an InputStream. The search looks for an "esapi-resources" directory in the setResourceDirectory() location, then the System.getProperty( "org.owasp.esapi.resources" ) location, then the System.getProperty( "user.home" ) location, and then the classpath.
 * @param filename
 * @return	An {@code InputStream} associated with the specified file name as a resourcestream.
 * @throws IOException	If the file cannot be found or opened for reading.
 */
public InputStream getResourceStream(String filename) throws IOException {
  if (filename == null) {
    logSpecial("String_Node_Str",null);
    return null;
  }
  try {
    File f=getResourceFile(filename);
    if (f != null && f.exists()) {
      return new FileInputStream(f);
    }
  }
 catch (  Exception e) {
  }
  ClassLoader loader=getClass().getClassLoader();
  logSpecial("String_Node_Str" + loader,null);
  String filePathToLoad="String_Node_Str" + filename;
  logSpecial("String_Node_Str" + filePathToLoad,null);
  URL resourceURL=loader.getResource(filePathToLoad);
  logSpecial("String_Node_Str" + resourceURL,null);
  String resource=resourceURL.getFile();
  logSpecial("String_Node_Str" + resource,null);
  FileInputStream in=null;
  try {
    URI uri=new URI(resource);
    in=new FileInputStream(uri.getPath());
  }
 catch (  Exception e) {
  }
  if (in != null) {
    logSpecial("String_Node_Str",null);
    return in;
  }
 else {
    logSpecial("String_Node_Str",null);
    logSpecial("String_Node_Str",null);
  }
  return null;
}
Program: 31345
Project: 31345
Buggy source:
/** 
 * Returns the parameter map from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @return A {@code Map} containing scrubbed parameter names / value pairs.
 */
public Map getParameterMap(){
  @SuppressWarnings({"String_Node_Str"}) Map<String,String[]> map=getHttpServletRequest().getParameterMap();
  Map<String,String[]> cleanMap=new HashMap<String,String[]>();
  for (  Object o : map.entrySet()) {
    try {
      Map.Entry e=(Map.Entry)o;
      String name=(String)e.getKey();
      String cleanName=ESAPI.validator().getValidInput("String_Node_Str" + name,name,"String_Node_Str",100,false);
      String[] value=(String[])e.getValue();
      String[] cleanValues=new String[value.length];
      for (int j=0; j < value.length; j++) {
        String cleanValue=ESAPI.validator().getValidInput("String_Node_Str" + value[j],value[j],"String_Node_Str",2000,false);
        cleanValues[j]=cleanValue;
      }
      cleanMap.put(cleanName,cleanValues);
    }
 catch (    ValidationException e) {
    }
  }
  return cleanMap;
}

Fixed version (ground truth):
/** 
 * Returns the parameter map from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @return A {@code Map} containing scrubbed parameter names / value pairs.
 */
public Map getParameterMap(){
  @SuppressWarnings({"String_Node_Str"}) Map<String,String[]> map=getHttpServletRequest().getParameterMap();
  Map<String,String[]> cleanMap=new HashMap<String,String[]>();
  for (  Object o : map.entrySet()) {
    try {
      Map.Entry e=(Map.Entry)o;
      String name=(String)e.getKey();
      String cleanName=ESAPI.validator().getValidInput("String_Node_Str" + name,name,"String_Node_Str",100,true);
      String[] value=(String[])e.getValue();
      String[] cleanValues=new String[value.length];
      for (int j=0; j < value.length; j++) {
        String cleanValue=ESAPI.validator().getValidInput("String_Node_Str" + value[j],value[j],"String_Node_Str",2000,true);
        cleanValues[j]=cleanValue;
      }
      cleanMap.put(cleanName,cleanValues);
    }
 catch (    ValidationException e) {
    }
  }
  return cleanMap;
}
Program: 31346
Project: 31346
Buggy source:
/** 
 * Returns the enumeration of parameter names from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @return An {@code Enumeration} of properly "scrubbed" parameter names.
 */
public Enumeration getParameterNames(){
  Vector<String> v=new Vector<String>();
  Enumeration en=getHttpServletRequest().getParameterNames();
  while (en.hasMoreElements()) {
    try {
      String name=(String)en.nextElement();
      String clean=ESAPI.validator().getValidInput("String_Node_Str" + name,name,"String_Node_Str",150,false);
      v.add(clean);
    }
 catch (    ValidationException e) {
    }
  }
  return v.elements();
}

Fixed version (ground truth):
/** 
 * Returns the enumeration of parameter names from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @return An {@code Enumeration} of properly "scrubbed" parameter names.
 */
public Enumeration getParameterNames(){
  Vector<String> v=new Vector<String>();
  Enumeration en=getHttpServletRequest().getParameterNames();
  while (en.hasMoreElements()) {
    try {
      String name=(String)en.nextElement();
      String clean=ESAPI.validator().getValidInput("String_Node_Str" + name,name,"String_Node_Str",150,true);
      v.add(clean);
    }
 catch (    ValidationException e) {
    }
  }
  return v.elements();
}
Program: 31347
Project: 31347
Buggy source:
/** 
 * Returns the named header from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The name of an HTTP request header
 * @return The specified header value is returned.
 */
public String getHeader(String name){
  String value=getHttpServletRequest().getHeader(name);
  String clean="String_Node_Str";
  try {
    clean=ESAPI.validator().getValidInput("String_Node_Str" + value,value,"String_Node_Str",150,false);
  }
 catch (  ValidationException e) {
  }
  return clean;
}

Fixed version (ground truth):
/** 
 * Returns the named header from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The name of an HTTP request header
 * @return The specified header value is returned.
 */
public String getHeader(String name){
  String value=getHttpServletRequest().getHeader(name);
  String clean="String_Node_Str";
  try {
    clean=ESAPI.validator().getValidInput("String_Node_Str" + value,value,"String_Node_Str",150,true);
  }
 catch (  ValidationException e) {
  }
  return clean;
}
Program: 31348
Project: 31348
Buggy source:
/** 
 * Returns the array of Cookies from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @return An array of {@code Cookie}s for this   {@code HttpServletRequest}
 */
public Cookie[] getCookies(){
  Cookie[] cookies=getHttpServletRequest().getCookies();
  if (cookies == null)   return new Cookie[0];
  List<Cookie> newCookies=new ArrayList<Cookie>();
  for (  Cookie c : cookies) {
    try {
      String name=ESAPI.validator().getValidInput("String_Node_Str" + c.getName(),c.getName(),"String_Node_Str",150,false);
      String value=ESAPI.validator().getValidInput("String_Node_Str" + c.getValue(),c.getValue(),"String_Node_Str",1000,false);
      int maxAge=c.getMaxAge();
      String domain=c.getDomain();
      String path=c.getPath();
      Cookie n=new Cookie(name,value);
      n.setMaxAge(maxAge);
      if (domain != null) {
        n.setDomain(ESAPI.validator().getValidInput("String_Node_Str" + domain,domain,"String_Node_Str",200,false));
      }
      if (path != null) {
        n.setPath(ESAPI.validator().getValidInput("String_Node_Str" + path,path,"String_Node_Str",200,false));
      }
      newCookies.add(n);
    }
 catch (    ValidationException e) {
      logger.warning(Logger.SECURITY_FAILURE,"String_Node_Str" + c.getName() + "String_Node_Str"+ c.getValue(),e);
    }
  }
  return newCookies.toArray(new Cookie[newCookies.size()]);
}

Fixed version (ground truth):
/** 
 * Returns the array of Cookies from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @return An array of {@code Cookie}s for this   {@code HttpServletRequest}
 */
public Cookie[] getCookies(){
  Cookie[] cookies=getHttpServletRequest().getCookies();
  if (cookies == null)   return new Cookie[0];
  List<Cookie> newCookies=new ArrayList<Cookie>();
  for (  Cookie c : cookies) {
    try {
      String name=ESAPI.validator().getValidInput("String_Node_Str" + c.getName(),c.getName(),"String_Node_Str",150,true);
      String value=ESAPI.validator().getValidInput("String_Node_Str" + c.getValue(),c.getValue(),"String_Node_Str",1000,true);
      int maxAge=c.getMaxAge();
      String domain=c.getDomain();
      String path=c.getPath();
      Cookie n=new Cookie(name,value);
      n.setMaxAge(maxAge);
      if (domain != null) {
        n.setDomain(ESAPI.validator().getValidInput("String_Node_Str" + domain,domain,"String_Node_Str",200,false));
      }
      if (path != null) {
        n.setPath(ESAPI.validator().getValidInput("String_Node_Str" + path,path,"String_Node_Str",200,false));
      }
      newCookies.add(n);
    }
 catch (    ValidationException e) {
      logger.warning(Logger.SECURITY_FAILURE,"String_Node_Str" + c.getName() + "String_Node_Str"+ c.getValue(),e);
    }
  }
  return newCookies.toArray(new Cookie[newCookies.size()]);
}
Program: 31349
Project: 31349
Buggy source:
/** 
 * Returns the array of matching parameter values from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The parameter name
 * @return An array of matching "scrubbed" parameter values.
 */
public String[] getParameterValues(String name){
  String[] values=getHttpServletRequest().getParameterValues(name);
  List<String> newValues=new ArrayList<String>();
  if (values != null) {
    for (    String value : values) {
      try {
        String cleanValue=ESAPI.validator().getValidInput("String_Node_Str" + value,value,"String_Node_Str",2000,false);
        newValues.add(cleanValue);
      }
 catch (      ValidationException e) {
        logger.warning(Logger.SECURITY_FAILURE,"String_Node_Str");
      }
    }
  }
  return newValues.toArray(new String[newValues.size()]);
}

Fixed version (ground truth):
/** 
 * Returns the array of matching parameter values from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The parameter name
 * @return An array of matching "scrubbed" parameter values.
 */
public String[] getParameterValues(String name){
  String[] values=getHttpServletRequest().getParameterValues(name);
  List<String> newValues=new ArrayList<String>();
  if (values != null) {
    for (    String value : values) {
      try {
        String cleanValue=ESAPI.validator().getValidInput("String_Node_Str" + value,value,"String_Node_Str",2000,true);
        newValues.add(cleanValue);
      }
 catch (      ValidationException e) {
        logger.warning(Logger.SECURITY_FAILURE,"String_Node_Str");
      }
    }
  }
  return newValues.toArray(new String[newValues.size()]);
}
Program: 31350
Project: 31350
Buggy source:
/** 
 * Returns the enumeration of headers from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The name of an HTTP request header.
 * @return An {@code Enumeration} of headers from the request aftercanonicalizing and filtering has been performed.
 */
public Enumeration getHeaders(String name){
  Vector<String> v=new Vector<String>();
  Enumeration en=getHttpServletRequest().getHeaders(name);
  while (en.hasMoreElements()) {
    try {
      String value=(String)en.nextElement();
      String clean=ESAPI.validator().getValidInput("String_Node_Str" + name + "String_Node_Str"+ value,value,"String_Node_Str",150,false);
      v.add(clean);
    }
 catch (    ValidationException e) {
    }
  }
  return v.elements();
}

Fixed version (ground truth):
/** 
 * Returns the enumeration of headers from the HttpServletRequest after canonicalizing and filtering out any dangerous characters.
 * @param name The name of an HTTP request header.
 * @return An {@code Enumeration} of headers from the request aftercanonicalizing and filtering has been performed.
 */
public Enumeration getHeaders(String name){
  Vector<String> v=new Vector<String>();
  Enumeration en=getHttpServletRequest().getHeaders(name);
  while (en.hasMoreElements()) {
    try {
      String value=(String)en.nextElement();
      String clean=ESAPI.validator().getValidInput("String_Node_Str" + name + "String_Node_Str"+ value,value,"String_Node_Str",150,true);
      v.add(clean);
    }
 catch (    ValidationException e) {
    }
  }
  return v.elements();
}