nus-yam/ex-repair huggingface dataset:
Program: 9027
Project: 9027
Buggy source:
private void setProgressInternal(int progress){
  if (this.mProgress != progress) {
    this.mProgress=progress;
    if (!mFromUser) {
      int newPercent=(this.mProgress / this.mMaxProgress) * mMaxProgress;
      int newAngle=(newPercent / mMaxProgress) * TOTAL_DEGREES_INT;
      this.setAngle(newAngle);
      mProgressPercent=newPercent;
    }
    mListener.onProgressChanged(this,mProgress,mFromUser);
    mFromUser=false;
  }
}

Fixed version (ground truth):
private void setProgressInternal(int progress){
  if (this.mProgress != progress) {
    this.mProgress=progress;
    if (!mFromUser) {
      int newPercent=(this.mProgress / this.mMaxProgress) * mMaxProgress;
      int newAngle=(newPercent / mMaxProgress) * TOTAL_DEGREES_INT;
      this.setAngle(newAngle);
      mProgressPercent=newPercent;
    }
    if (mIsProgressSetViaApi) {
      mAngle=mProgress * 360.0f / mMaxProgress;
    }
    mListener.onProgressChanged(this,mProgress,mFromUser);
    mFromUser=false;
  }
}
Program: 9028
Project: 9028
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_main,container,false);
  final ClockView minDepartTime=(ClockView)rootView.findViewById(R.id.min_depart_time_clock_view);
  DateTime minTime=new DateTime(2014,4,25,7,0);
  DateTime maxTime=new DateTime(2014,4,26,4,0);
  minDepartTime.setBounds(minTime,maxTime,false);
  final ClockView maxDepartTime=(ClockView)rootView.findViewById(R.id.max_depart_time_clock_view);
  maxDepartTime.setBounds(minTime,maxTime,true);
  minDepartTime.setClockTimeUpdateListener(new ClockView.ClockTimeUpdateListener(){
    @Override public void onClockTimeUpdate(    ClockView clockView,    DateTime currentTime){
      Log.e("String_Node_Str",String.valueOf(currentTime));
    }
  }
);
  TimerTask timerTask=new TimerTask(){
    @Override public void run(){
      Handler handler=new Handler(Looper.getMainLooper());
      handler.post(new Runnable(){
        @Override public void run(){
          minDepartTime.setNewCurrentTime(new DateTime(2014,4,25,10,0));
        }
      }
);
    }
  }
;
  Timer timer=new Timer();
  timer.schedule(timerTask,5000);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.fragment_main,container,false);
  final ClockView minDepartTime=(ClockView)rootView.findViewById(R.id.min_depart_time_clock_view);
  DateTime minTime=new DateTime(2014,4,25,7,0);
  DateTime maxTime=new DateTime(2014,4,26,4,0);
  minDepartTime.setBounds(minTime,maxTime,false);
  minDepartTime.setNewCurrentTime(new DateTime(2014,4,25,10,0));
  final ClockView maxDepartTime=(ClockView)rootView.findViewById(R.id.max_depart_time_clock_view);
  maxDepartTime.setBounds(minTime,maxTime,true);
  minDepartTime.setClockTimeUpdateListener(new ClockView.ClockTimeUpdateListener(){
    @Override public void onClockTimeUpdate(    ClockView clockView,    DateTime currentTime){
      Log.e("String_Node_Str",String.valueOf(currentTime));
    }
  }
);
  TimerTask timerTask=new TimerTask(){
    @Override public void run(){
      Handler handler=new Handler(Looper.getMainLooper());
      handler.post(new Runnable(){
        @Override public void run(){
          minDepartTime.setNewCurrentTime(new DateTime(2014,4,25,12,0));
        }
      }
);
    }
  }
;
  Timer timer=new Timer();
  timer.schedule(timerTask,5000);
  return rootView;
}
Program: 9029
Project: 9029
Buggy source:
@Override public void run(){
  minDepartTime.setNewCurrentTime(new DateTime(2014,4,25,10,0));
}

Fixed version (ground truth):
@Override public void run(){
  minDepartTime.setNewCurrentTime(new DateTime(2014,4,25,12,0));
}
Program: 9031
Project: 9031
Buggy source:
/** 
 * Create status file
 */
public void createStatusFile(){
  statusFileJsonMap.put(SOURCE_NAME_STATUS_FILE,sourceName);
  statusFileJsonMap.put(URL_STATUS_FILE,connectionURL);
  statusFileJsonMap.put(COLUMNS_TO_SELECT_STATUS_FILE,columnsToSelect);
  statusFileJsonMap.put(TABLE_STATUS_FILE,table);
  statusFileJsonMap.put(LAST_INDEX_STATUS_FILE,currentIndex);
  try {
    Writer fileWriter=new FileWriter(file,false);
    JSONValue.writeJSONString(statusFileJsonMap,fileWriter);
    fileWriter.close();
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Create status file
 */
public void createStatusFile(){
  statusFileJsonMap.put(SOURCE_NAME_STATUS_FILE,sourceName);
  statusFileJsonMap.put(URL_STATUS_FILE,connectionURL);
  statusFileJsonMap.put(LAST_INDEX_STATUS_FILE,currentIndex);
  if (isCustomQuerySet()) {
    statusFileJsonMap.put(QUERY_STATUS_FILE,customQuery);
  }
 else {
    statusFileJsonMap.put(COLUMNS_TO_SELECT_STATUS_FILE,columnsToSelect);
    statusFileJsonMap.put(TABLE_STATUS_FILE,table);
  }
  try {
    Writer fileWriter=new FileWriter(file,false);
    JSONValue.writeJSONString(statusFileJsonMap,fileWriter);
    fileWriter.close();
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
}
Program: 9032
Project: 9032
Buggy source:
/** 
 * Builds an SQLSourceHelper containing the configuration parameters and usefull utils for SQL Source
 * @param context Flume source context, contains the properties from configuration file
 */
public SQLSourceHelper(Context context,String sourceName){
  this.context=context;
  statusFilePath=context.getString("String_Node_Str",DEFAULT_STATUS_DIRECTORY);
  statusFileName=context.getString("String_Node_Str");
  table=context.getString("String_Node_Str");
  columnsToSelect=context.getString("String_Node_Str","String_Node_Str");
  runQueryDelay=context.getInteger("String_Node_Str",DEFAULT_QUERY_DELAY);
  directory=new File(statusFilePath);
  customQuery=context.getString("String_Node_Str");
  batchSize=context.getInteger("String_Node_Str",DEFAULT_BATCH_SIZE);
  maxRows=context.getInteger("String_Node_Str",DEFAULT_MAX_ROWS);
  connectionURL=context.getString("String_Node_Str");
  this.sourceName=sourceName;
  startFrom=context.getString("String_Node_Str",DEFAULT_INCREMENTAL_VALUE);
  statusFileJsonMap=new LinkedHashMap<String,String>();
  checkMandatoryProperties();
  if (!(isStatusDirectoryCreated())) {
    createDirectory();
  }
  file=new File(statusFilePath + "String_Node_Str" + statusFileName);
  if (!isStatusFileCreated()) {
    currentIndex=startFrom;
    createStatusFile();
  }
 else   currentIndex=getStatusFileIndex(startFrom);
  query=buildQuery();
}

Fixed version (ground truth):
/** 
 * Builds an SQLSourceHelper containing the configuration parameters and usefull utils for SQL Source
 * @param context Flume source context, contains the properties from configuration file
 */
public SQLSourceHelper(Context context,String sourceName){
  this.context=context;
  statusFilePath=context.getString("String_Node_Str",DEFAULT_STATUS_DIRECTORY);
  statusFileName=context.getString("String_Node_Str");
  table=context.getString("String_Node_Str");
  columnsToSelect=context.getString("String_Node_Str","String_Node_Str");
  runQueryDelay=context.getInteger("String_Node_Str",DEFAULT_QUERY_DELAY);
  directory=new File(statusFilePath);
  customQuery=context.getString("String_Node_Str");
  batchSize=context.getInteger("String_Node_Str",DEFAULT_BATCH_SIZE);
  maxRows=context.getInteger("String_Node_Str",DEFAULT_MAX_ROWS);
  connectionURL=context.getString("String_Node_Str");
  readOnlySession=context.getBoolean("String_Node_Str",false);
  this.sourceName=sourceName;
  startFrom=context.getString("String_Node_Str",DEFAULT_INCREMENTAL_VALUE);
  statusFileJsonMap=new LinkedHashMap<String,String>();
  checkMandatoryProperties();
  if (!(isStatusDirectoryCreated())) {
    createDirectory();
  }
  file=new File(statusFilePath + "String_Node_Str" + statusFileName);
  if (!isStatusFileCreated()) {
    currentIndex=startFrom;
    createStatusFile();
  }
 else   currentIndex=getStatusFileIndex(startFrom);
  query=buildQuery();
}
Program: 9033
Project: 9033
Buggy source:
/** 
 * Process a batch of events performing SQL Queries
 */
@Override public Status process() throws EventDeliveryException {
  try {
    sqlSourceCounter.startProcess();
    List<List<Object>> result=hibernateHelper.executeQuery();
    if (!result.isEmpty()) {
      csvWriter.writeAll(sqlSourceHelper.getAllRows(result));
      csvWriter.flush();
      sqlSourceCounter.incrementEventCount(result.size());
      sqlSourceHelper.updateStatusFile();
    }
    sqlSourceCounter.endProcess(result.size());
    if (result.size() < sqlSourceHelper.getMaxRows()) {
      Thread.sleep(sqlSourceHelper.getRunQueryDelay());
    }
    return Status.READY;
  }
 catch (  IOException|InterruptedException e) {
    LOG.error("String_Node_Str",e);
    return Status.BACKOFF;
  }
}

Fixed version (ground truth):
/** 
 * Process a batch of events performing SQL Queries
 */
@Override public Status process() throws EventDeliveryException {
  try {
    sqlSourceCounter.startProcess();
    List<List<Object>> result=hibernateHelper.executeQuery();
    if (!result.isEmpty()) {
      csvWriter.writeAll(sqlSourceHelper.getAllRows(result));
      csvWriter.flush();
      sqlSourceCounter.incrementEventCount(result.size());
      sqlSourceHelper.updateStatusFile();
    }
    sqlSourceCounter.endProcess(result.size());
    if (result.size() < sqlSourceHelper.getMaxRows()) {
      hibernateHelper.resetConnectionAndSleep();
    }
    return Status.READY;
  }
 catch (  IOException|InterruptedException e) {
    LOG.error("String_Node_Str",e);
    return Status.BACKOFF;
  }
}
Program: 9034
Project: 9034
Buggy source:
/** 
 * Connect to database using hibernate
 */
public void establishSession(){
  LOG.info("String_Node_Str");
  serviceRegistry=new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();
  factory=config.buildSessionFactory(serviceRegistry);
  session=factory.openSession();
}

Fixed version (ground truth):
/** 
 * Connect to database using hibernate
 */
public void establishSession(){
  LOG.info("String_Node_Str");
  serviceRegistry=new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();
  factory=config.buildSessionFactory(serviceRegistry);
  session=factory.openSession();
  session.setCacheMode(CacheMode.IGNORE);
  session.setDefaultReadOnly(sqlSourceHelper.isReadOnlySession());
}
Program: 9035
Project: 9035
Buggy source:
/** 
 * Execute the selection query in the database
 * @return The query result. Each Object is a cell content. <p>The cell contents use database types (date,int,string...),  keep in mind in case of future conversions/castings.
 */
@SuppressWarnings("String_Node_Str") public List<List<Object>> executeQuery(){
  List<List<Object>> rowsList;
  if (sqlSourceHelper.isCustomQuerySet()) {
    if (sqlSourceHelper.getMaxRows() == 0) {
      rowsList=session.createSQLQuery(sqlSourceHelper.buildQuery()).setResultTransformer(Transformers.TO_LIST).list();
    }
 else {
      rowsList=session.createSQLQuery(sqlSourceHelper.buildQuery()).setMaxResults(sqlSourceHelper.getMaxRows()).setResultTransformer(Transformers.TO_LIST).list();
    }
    if (!rowsList.isEmpty())     sqlSourceHelper.setCurrentIndex(rowsList.get(rowsList.size() - 1).get(0).toString());
  }
 else {
    if (sqlSourceHelper.getMaxRows() == 0) {
      rowsList=session.createSQLQuery(sqlSourceHelper.getQuery()).setFirstResult(Integer.parseInt(sqlSourceHelper.getCurrentIndex())).setResultTransformer(Transformers.TO_LIST).list();
    }
 else {
      rowsList=session.createSQLQuery(sqlSourceHelper.getQuery()).setFirstResult(Integer.parseInt(sqlSourceHelper.getCurrentIndex())).setMaxResults(sqlSourceHelper.getMaxRows()).setResultTransformer(Transformers.TO_LIST).list();
    }
    sqlSourceHelper.setCurrentIndex(Integer.toString((Integer.parseInt(sqlSourceHelper.getCurrentIndex()) + rowsList.size())));
  }
  return rowsList;
}

Fixed version (ground truth):
/** 
 * Execute the selection query in the database
 * @return The query result. Each Object is a cell content. <p>The cell contents use database types (date,int,string...),  keep in mind in case of future conversions/castings.
 * @throws InterruptedException 
 */
@SuppressWarnings("String_Node_Str") public List<List<Object>> executeQuery() throws InterruptedException {
  List<List<Object>> rowsList=new ArrayList<List<Object>>();
  Query query;
  if (!session.isConnected()) {
    resetConnection();
  }
  if (sqlSourceHelper.isCustomQuerySet()) {
    query=session.createSQLQuery(sqlSourceHelper.buildQuery());
    if (sqlSourceHelper.getMaxRows() != 0) {
      query=query.setMaxResults(sqlSourceHelper.getMaxRows());
    }
  }
 else {
    query=session.createSQLQuery(sqlSourceHelper.getQuery()).setFirstResult(Integer.parseInt(sqlSourceHelper.getCurrentIndex()));
    if (sqlSourceHelper.getMaxRows() != 0) {
      query=query.setMaxResults(sqlSourceHelper.getMaxRows());
    }
  }
  try {
    rowsList=query.setResultTransformer(Transformers.TO_LIST).list();
  }
 catch (  Exception e) {
    resetConnection();
  }
  if (!rowsList.isEmpty()) {
    if (sqlSourceHelper.isCustomQuerySet()) {
      sqlSourceHelper.setCurrentIndex(rowsList.get(rowsList.size() - 1).get(0).toString());
    }
 else {
      sqlSourceHelper.setCurrentIndex(Integer.toString((Integer.parseInt(sqlSourceHelper.getCurrentIndex()) + rowsList.size())));
    }
  }
  return rowsList;
}
Program: 9036
Project: 9036
Buggy source:
public void endProcess(int events){
  long runningTime=System.currentTimeMillis() - getStartTime();
  long processTime=System.currentTimeMillis() - startProcessTime;
  long throughput=0L;
  if (events > 0 && processTime > 0)   throughput=1000 * events / processTime;
  if (getMaxThroughput() < throughput)   set(MAX_THROUGHPUT,throughput);
  set(AVERAGE_THROUGHPUT,getEventCount() / (runningTime / 1000));
  set(CURRENT_THROUGHPUT,throughput);
}

Fixed version (ground truth):
public void endProcess(int events){
  long runningTime=TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - getStartTime());
  long processTime=TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - startProcessTime);
  long throughput=0L;
  if (events > 0 && processTime > 0)   throughput=events / processTime;
  if (getMaxThroughput() < throughput)   set(MAX_THROUGHPUT,throughput);
  if (runningTime > 0 && getEventCount() > 0)   set(AVERAGE_THROUGHPUT,(getEventCount() / runningTime));
  set(CURRENT_THROUGHPUT,throughput);
}
Program: 9037
Project: 9037
Buggy source:
public List<String[]> getAllRows(List<List<Object>> queryResult){
  List<String[]> allRows=new ArrayList<String[]>(queryResult.size());
  if (queryResult == null || queryResult.isEmpty())   return allRows;
  String[] row=null;
  for (int i=0; i < queryResult.size(); i++) {
    List<Object> rawRow=queryResult.get(i);
    row=new String[rawRow.size()];
    for (int j=0; j < rawRow.size(); j++) {
      row[j]=rawRow.get(j).toString();
    }
    allRows.add(row);
  }
  return allRows;
}

Fixed version (ground truth):
public List<String[]> getAllRows(List<List<Object>> queryResult){
  List<String[]> allRows=new ArrayList<String[]>();
  if (queryResult == null || queryResult.isEmpty())   return allRows;
  String[] row=null;
  for (int i=0; i < queryResult.size(); i++) {
    List<Object> rawRow=queryResult.get(i);
    row=new String[rawRow.size()];
    for (int j=0; j < rawRow.size(); j++) {
      row[j]=rawRow.get(j).toString();
    }
    allRows.add(row);
  }
  return allRows;
}
Program: 9038
Project: 9038
Buggy source:
@Test public void chekGetAllRowsWithNullParam(){
  SQLSourceHelper sqlSourceHelper=new SQLSourceHelper(context);
  assertEquals(null,sqlSourceHelper.getAllRows(null));
}

Fixed version (ground truth):
@Test public void chekGetAllRowsWithNullParam(){
  SQLSourceHelper sqlSourceHelper=new SQLSourceHelper(context);
  assertEquals(new ArrayList<String>(),sqlSourceHelper.getAllRows(null));
}
Program: 9039
Project: 9039
Buggy source:
/** 
 * Converter from a List of Object List to a List of String arrays <p> Useful for csvWriter
 * @param queryResult Query Result from hibernate executeQuery method
 * @return A list of String arrays, ready for csvWriter.writeall method
 */
public List<String[]> getAllRows(List<List<Object>> queryResult){
  List<String[]> allRows=new ArrayList<String[]>();
  if (queryResult == null || queryResult.isEmpty())   return allRows;
  String[] row=null;
  for (int i=0; i < queryResult.size(); i++) {
    List<Object> rawRow=queryResult.get(i);
    row=new String[rawRow.size()];
    for (int j=0; j < rawRow.size(); j++) {
      row[j]=rawRow.get(j).toString();
    }
    allRows.add(row);
  }
  return allRows;
}

Fixed version (ground truth):
/** 
 * Converter from a List of Object List to a List of String arrays <p> Useful for csvWriter
 * @param queryResult Query Result from hibernate executeQuery method
 * @return A list of String arrays, ready for csvWriter.writeall method
 */
public List<String[]> getAllRows(List<List<Object>> queryResult){
  List<String[]> allRows=new ArrayList<String[]>();
  if (queryResult == null || queryResult.isEmpty())   return allRows;
  String[] row=null;
  for (int i=0; i < queryResult.size(); i++) {
    List<Object> rawRow=queryResult.get(i);
    row=new String[rawRow.size()];
    for (int j=0; j < rawRow.size(); j++) {
      if (rawRow.get(j) != null)       row[j]=rawRow.get(j).toString();
 else       row[j]="String_Node_Str";
    }
    allRows.add(row);
  }
  return allRows;
}
Program: 9040
Project: 9040
Buggy source:
/** 
 * Runs the query and returns a Vector of Vectors as a result
 * @param mQuery
 * @return Vector<Vector<String>>
 * @throws SQLException
 */
public Vector<Vector<String>> runQuery(String mQuery) throws SQLException {
  Vector<Vector<String>> mResults=new Vector<Vector<String>>();
  Statement mStatement=(Statement)this.mConnection.createStatement();
  ResultSet mResultSet=mStatement.executeQuery(mQuery);
  mMetaData=mResultSet.getMetaData();
  int mNumColumns=mMetaData.getColumnCount();
  setColumns(mNumColumns,mMetaData);
  while (mResultSet.next()) {
    Vector<String> mRow=new Vector<String>();
    for (int i=1; i <= mNumColumns; i++) {
      mRow.add(mResultSet.getString(i));
    }
    mResults.add(mRow);
  }
  return mResults;
}

Fixed version (ground truth):
/** 
 * Runs the query and returns a Vector of Vectors as a result
 * @param mQuery
 * @return Vector<Vector<String>>
 * @throws SQLException
 */
public ResultSet runQuery(String mQuery) throws SQLException {
  Statement mStatement=(Statement)this.mConnection.createStatement();
  ResultSet mResultSet=mStatement.executeQuery(mQuery);
  mMetaData=mResultSet.getMetaData();
  int mNumColumns=mMetaData.getColumnCount();
  setColumns(mNumColumns,mMetaData);
  return mResultSet;
}
Program: 9042
Project: 9042
Buggy source:
/** 
 * Gets the image's pixels via BufferedImage.getRGB(..). Slow, but the fast method doesn't work for all color models.
 * @param sourceImage the source image
 * @param quality 1 is the highest quality settings. 10 is the default. There is a trade-off between quality and speed. The bigger the number, the faster the palette generation but the greater the likelihood that colors will be missed.
 * @param ignoreWhite if <code>true</code>, white pixels are ignored
 * @return an array of pixels (each an RGB int array)
 */
private static int[][] getPixelsSlow(BufferedImage sourceImage,int quality,boolean ignoreWhite){
  int width=sourceImage.getWidth();
  int height=sourceImage.getHeight();
  int pixelCount=width * height;
  int numRegardedPixels=(pixelCount + quality - 1) / quality;
  int numUsedPixels=0;
  int[][] res=new int[numRegardedPixels][];
  int r, g, b;
  for (int i=0; i < pixelCount; i+=quality) {
    int row=i / width;
    int col=i % width;
    int rgb=sourceImage.getRGB(col,row);
    r=(rgb >> 16) & 0xFF;
    g=(rgb >> 8) & 0xFF;
    b=(rgb) & 0xFF;
    if (!(ignoreWhite && r > 250 && r > 250 && r > 250)) {
      res[numUsedPixels]=new int[]{r,g,b};
      numUsedPixels++;
    }
  }
  return Arrays.copyOfRange(res,0,numUsedPixels);
}

Fixed version (ground truth):
/** 
 * Gets the image's pixels via BufferedImage.getRGB(..). Slow, but the fast method doesn't work for all color models.
 * @param sourceImage the source image
 * @param quality 1 is the highest quality settings. 10 is the default. There is a trade-off between quality and speed. The bigger the number, the faster the palette generation but the greater the likelihood that colors will be missed.
 * @param ignoreWhite if <code>true</code>, white pixels are ignored
 * @return an array of pixels (each an RGB int array)
 */
private static int[][] getPixelsSlow(BufferedImage sourceImage,int quality,boolean ignoreWhite){
  int width=sourceImage.getWidth();
  int height=sourceImage.getHeight();
  int pixelCount=width * height;
  int numRegardedPixels=(pixelCount + quality - 1) / quality;
  int numUsedPixels=0;
  int[][] res=new int[numRegardedPixels][];
  int r, g, b;
  for (int i=0; i < pixelCount; i+=quality) {
    int row=i / width;
    int col=i % width;
    int rgb=sourceImage.getRGB(col,row);
    r=(rgb >> 16) & 0xFF;
    g=(rgb >> 8) & 0xFF;
    b=(rgb) & 0xFF;
    if (!(ignoreWhite && r > 250 && g > 250 && b > 250)) {
      res[numUsedPixels]=new int[]{r,g,b};
      numUsedPixels++;
    }
  }
  return Arrays.copyOfRange(res,0,numUsedPixels);
}
Program: 9043
Project: 9043
Buggy source:
@Override public int compare(VBox a,VBox b){
  int aCount=a.count(false);
  int bCount=b.count(false);
  int aVolume=a.volume(false);
  int bVolume=b.volume(false);
  if (aCount == bCount) {
    return aVolume - bVolume;
  }
  return aCount * aVolume - bCount * bVolume;
}

Fixed version (ground truth):
@Override public int compare(VBox a,VBox b){
  int aCount=a.count(false);
  int bCount=b.count(false);
  int aVolume=a.volume(false);
  int bVolume=b.volume(false);
  if (aCount == bCount) {
    return aVolume - bVolume;
  }
  return Long.compare((long)aCount * aVolume,(long)bCount * bVolume);
}
Program: 9044
Project: 9044
Buggy source:
@DataProvider(name="String_Node_Str") public Object[][] getRelativeCases(){
  return new Object[][]{{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",false}};
}

Fixed version (ground truth):
@DataProvider(name="String_Node_Str") public Object[][] getRelativeCases(){
  return new Object[][]{{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str",true},{"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",true},{"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",false}};
}
Program: 9046
Project: 9046
Buggy source:
public static void changePassword(Context serverContext,String realm,String username,String oldPassword,String newPassword) throws ResourceException {
  try {
    SSOToken token=serverContext.asContext(SSOTokenContext.class).getCallerSSOToken();
    AMIdentity userIdentity=new AMIdentity(token,username,IdType.USER,realm,null);
    userIdentity.changePassword(oldPassword,newPassword);
  }
 catch (  SSOException ssoe) {
    debug.warning("String_Node_Str" + "String_Node_Str" + username,ssoe);
    throw new PermanentException(401,"String_Node_Str",ssoe);
  }
catch (  IdRepoException ire) {
    if (IdRepoBundle.ACCESS_DENIED.equals(ire.getErrorCode())) {
      throw new ForbiddenException("String_Node_Str");
    }
 else {
      debug.warning("String_Node_Str" + "String_Node_Str" + username,ire);
      throw new InternalServerErrorException("String_Node_Str",ire);
    }
  }
}

Fixed version (ground truth):
public static void changePassword(Context serverContext,String realm,String username,String oldPassword,String newPassword) throws ResourceException {
  try {
    SSOToken token=serverContext.asContext(SSOTokenContext.class).getCallerSSOToken();
    AMIdentity userIdentity=new AMIdentity(token,username,IdType.USER,realm,null);
    userIdentity.changePassword(oldPassword,newPassword);
  }
 catch (  SSOException ssoe) {
    debug.warning("String_Node_Str" + "String_Node_Str" + username,ssoe);
    throw new PermanentException(401,"String_Node_Str",ssoe);
  }
catch (  IdRepoException ire) {
    if (IdRepoBundle.ACCESS_DENIED.equals(ire.getErrorCode())) {
      throw new ForbiddenException("String_Node_Str");
    }
 else     if (LDAPConstants.LDAP_INVALID_CREDENTIALS.equals(ire.getLDAPErrorCode())) {
      throw ResourceException.newResourceException(401,"String_Node_Str");
    }
 else {
      debug.warning("String_Node_Str" + "String_Node_Str" + username,ire);
      throw new InternalServerErrorException("String_Node_Str",ire);
    }
  }
}
Program: 9048
Project: 9048
Buggy source:
/** 
 * Validates attributes for create or modify operation. 
 * @param attrMap attributes map to be validated.
 * @param idOp operaton which is ethier <code>IdOperation.CREATE</code> or<code>IdOperation.EDIT</code>
 * @throws IdRepoException If attributes can't be validated or there arerepository related error conditions.
 */
public void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException ;

Fixed version (ground truth):
/** 
 * Validates attributes for create or modify operation. 
 * @param attrMap attributes map to be validated.
 * @param idOp operation which is either <code>IdOperation.CREATE</code> or<code>IdOperation.EDIT</code>
 * @throws IdRepoException If attributes can't be validated or there arerepository related error conditions.
 */
void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException ;
Program: 9049
Project: 9049
Buggy source:
/** 
 * Initialization paramters as configred for a given plugin.
 * @param configParams configuration parameters
 */
public void initialize(Map<String,Set<String>> configParams);

Fixed version (ground truth):
/** 
 * Initialization parameters as configured for a given plugin.
 * @param configParams configuration parameters
 */
void initialize(Map<String,Set<String>> configParams);
Program: 9050
Project: 9050
Buggy source:
/** 
 * Validates attributes for create or modify operation. 
 * @param attrMap attributes map to be validated.
 * @param idOp operaton which is ethier <code>IdOperation.CREATE</code> or<code>IdOperation.EDIT</code>
 * @throws IdRepoException If attributes can't be validated or there arerepository related error conditions.
 */
public void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException {
  if (minPasswordLength == 0) {
    return;
  }
  attrMap=new CaseInsensitiveHashMap(attrMap);
  if (!attrMap.containsKey(ATTR_USER_PASSWORD)) {
    if (idOp.equals(IdOperation.CREATE)) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
  }
 else {
    Set<String> values=attrMap.get(ATTR_USER_PASSWORD);
    if ((values == null) || (values.isEmpty())) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
 else {
      String password=values.iterator().next();
      if (password.length() < minPasswordLength) {
        Object[] args={"String_Node_Str" + minPasswordLength};
        throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void validateAttributes(Map<String,Set<String>> attrMap,IdOperation idOp) throws IdRepoException {
  if (minPasswordLength == 0) {
    return;
  }
  attrMap=new CaseInsensitiveHashMap(attrMap);
  if (!attrMap.containsKey(ATTR_USER_PASSWORD)) {
    if (idOp.equals(IdOperation.CREATE)) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
  }
 else {
    Set<String> values=attrMap.get(ATTR_USER_PASSWORD);
    if ((values == null) || (values.isEmpty())) {
      Object[] args={"String_Node_Str" + minPasswordLength};
      throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
    }
 else {
      String password=values.iterator().next();
      if (password.length() < minPasswordLength) {
        Object[] args={"String_Node_Str" + minPasswordLength};
        throw new IdRepoException(IdRepoBundle.BUNDLE_NAME,"String_Node_Str",args);
      }
    }
  }
}
Program: 9051
Project: 9051
Buggy source:
/** 
 * Initialization paramters as configred for a given plugin.
 * @param configParams configuration parameters
 */
public void initialize(Map<String,Set<String>> configParams){
  if ((configParams == null) || configParams.isEmpty()) {
    return;
  }
  for (  String name : configParams.keySet()) {
    if (name.equals(PROP_MIN_PASSWORD_LENGTH)) {
      Set<String> values=configParams.get(name);
      if ((values != null) && (!values.isEmpty())) {
        String value=values.iterator().next();
        try {
          minPasswordLength=Integer.parseInt(value);
          if (minPasswordLength < 0) {
            minPasswordLength=0;
          }
        }
 catch (        NumberFormatException nfe) {
          if (debug.warningEnabled()) {
            debug.warning("String_Node_Str" + "String_Node_Str",nfe);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void initialize(Map<String,Set<String>> configParams){
  if ((configParams == null) || configParams.isEmpty()) {
    return;
  }
  for (  String name : configParams.keySet()) {
    if (name.equals(PROP_MIN_PASSWORD_LENGTH)) {
      Set<String> values=configParams.get(name);
      if ((values != null) && (!values.isEmpty())) {
        String value=values.iterator().next();
        try {
          minPasswordLength=Integer.parseInt(value);
          if (minPasswordLength < 0) {
            minPasswordLength=0;
          }
        }
 catch (        NumberFormatException nfe) {
          if (debug.warningEnabled()) {
            debug.warning("String_Node_Str" + "String_Node_Str",nfe);
          }
        }
      }
    }
  }
}
Program: 9053
Project: 9053
Buggy source:
private Privilege parsePrivilege(String providedName,JsonValue jsonValue) throws EntitlementException {
  try {
    JsonPolicy policy=MAPPER.readValue(jsonValue.toString(),JsonPolicy.class);
    Privilege privilege=policy.asPrivilege();
    if (isBlank(privilege.getName())) {
      privilege.setName(providedName);
    }
    if (isBlank(privilege.getName())) {
      throw new EntitlementException(EntitlementException.MISSING_PRIVILEGE_NAME);
    }
    if (privilege.getCondition() != null) {
      privilege.getCondition().validate();
    }
    return privilege;
  }
 catch (  UnrecognizedPropertyException ex) {
    throw new EntitlementException(EntitlementException.INVALID_VALUE,new Object[]{ex.getUnrecognizedPropertyName()});
  }
catch (  JsonMappingException ex) {
    throw new EntitlementException(EntitlementException.INVALID_JSON,ex,ex.getCause().getMessage());
  }
catch (  IOException e) {
    throw new EntitlementException(EntitlementException.UNABLE_TO_CREATE_POLICY,e);
  }
}

Fixed version (ground truth):
private Privilege parsePrivilege(String providedName,JsonValue jsonValue) throws EntitlementException {
  try {
    JsonPolicy policy=MAPPER.readValue(jsonValue.toString(),JsonPolicy.class);
    Privilege privilege=policy.asPrivilege();
    if (isBlank(privilege.getName())) {
      privilege.setName(providedName);
    }
    if (isBlank(privilege.getName())) {
      throw new EntitlementException(EntitlementException.MISSING_PRIVILEGE_NAME);
    }
    if (privilege.getCondition() != null) {
      privilege.getCondition().validate();
    }
    return privilege;
  }
 catch (  UnrecognizedPropertyException ex) {
    throw new EntitlementException(EntitlementException.INVALID_VALUE,new Object[]{ex.getUnrecognizedPropertyName()});
  }
catch (  JsonMappingException ex) {
    throw new EntitlementException(EntitlementException.INVALID_JSON,ex,ex.getMessage());
  }
catch (  IOException e) {
    throw new EntitlementException(EntitlementException.UNABLE_TO_CREATE_POLICY,e);
  }
}
Program: 9055
Project: 9055
Buggy source:
/** 
 * "Inspired" by the OAuth2 module. We use this cookie to remind us exactly where we are when returning from a remote server as we currently cannot trust the RedirectCallback's authentication framework equiv.
 */
private void setCookiesForRedirects(final HttpServletRequest request,final HttpServletResponse response){
  final Set<String> domains=AuthClientUtils.getCookieDomains();
  final StringBuilder originalUrl=new StringBuilder();
  final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
  final String requestedQuery=request.getQueryString();
  if (xuiState.isXUIEnabled()) {
    originalUrl.append(request.getContextPath());
  }
 else {
    originalUrl.append(request.getRequestURI());
  }
  if (StringUtils.isNotEmpty(realm)) {
    originalUrl.append("String_Node_Str").append(URLEncDec.encode(realm));
  }
  if (requestedQuery != null) {
    originalUrl.append(originalUrl.indexOf("String_Node_Str") == -1 ? '?' : '&');
    originalUrl.append(requestedQuery);
  }
  for (  String domain : domains) {
    CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(Constants.AM_LOCATION_COOKIE,originalUrl.toString(),"String_Node_Str",domain));
  }
}

Fixed version (ground truth):
/** 
 * "Inspired" by the OAuth2 module. We use this cookie to remind us exactly where we are when returning from a remote server as we currently cannot trust the RedirectCallback's authentication framework equiv.
 */
private void setCookiesForRedirects(final HttpServletRequest request,final HttpServletResponse response){
  final Set<String> domains=AuthClientUtils.getCookieDomains();
  final StringBuilder originalUrl=new StringBuilder();
  final String requestedQuery=request.getQueryString();
  final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
  if (xuiState.isXUIEnabled()) {
    originalUrl.append(request.getContextPath());
  }
 else {
    originalUrl.append(request.getRequestURI());
  }
  if (StringUtils.isNotEmpty(realm)) {
    originalUrl.append("String_Node_Str").append(URLEncDec.encode(realm));
  }
  if (requestedQuery != null) {
    originalUrl.append(originalUrl.indexOf("String_Node_Str") == -1 ? '?' : '&');
    originalUrl.append(requestedQuery);
  }
  for (  String domain : domains) {
    CookieUtils.addCookieToResponse(response,CookieUtils.newCookie(Constants.AM_LOCATION_COOKIE,originalUrl.toString(),"String_Node_Str",domain));
  }
}
Program: 9056
Project: 9056
Buggy source:
/** 
 * Adds information necessary for the session to be federated completely (if attributes are being drawn in, and to configure ready for SLO).
 */
private void setSessionProperties(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setUserSessionProperty(SAML2Constants.SINGLE_LOGOUT,String.valueOf(singleLogoutEnabled));
  if (singleLogoutEnabled) {
    setUserSessionProperty(SAML2Constants.RELAY_STATE,sloRelayState);
  }
  setUserSessionProperty(SAML2Constants.SESSION_INDEX,sessionIndex);
  setUserSessionProperty(SAML2Constants.IDPENTITYID,entityName);
  setUserSessionProperty(SAML2Constants.SPENTITYID,SPSSOFederate.getSPEntityId(metaAlias));
  setUserSessionProperty(SAML2Constants.METAALIAS,metaAlias);
  setUserSessionProperty(SAML2Constants.REQ_BINDING,reqBinding);
  setUserSessionProperty(SAML2Constants.NAMEID,nameId.toXMLString(true,true));
  setUserSessionProperty(Constants.IS_TRANSIENT,Boolean.toString(isTransient));
  setUserSessionProperty(Constants.REQUEST_ID,respInfo.getResponse().getInResponseTo());
  setAttributeProperties(assertion,userName);
}

Fixed version (ground truth):
/** 
 * Adds information necessary for the session to be federated completely (if attributes are being drawn in, and to configure ready for SLO).
 */
private void setSessionProperties(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setUserSessionProperty(SAML2Constants.SINGLE_LOGOUT,String.valueOf(singleLogoutEnabled));
  if (singleLogoutEnabled) {
    setUserSessionProperty(SAML2Constants.RELAY_STATE,sloRelayState);
  }
  setUserSessionProperty(SAML2Constants.SESSION_INDEX,sessionIndex);
  setUserSessionProperty(SAML2Constants.IDPENTITYID,entityName);
  setUserSessionProperty(SAML2Constants.SPENTITYID,SPSSOFederate.getSPEntityId(metaAlias));
  setUserSessionProperty(SAML2Constants.METAALIAS,metaAlias);
  setUserSessionProperty(SAML2Constants.REQ_BINDING,reqBinding);
  setUserSessionProperty(SAML2Constants.NAMEID,nameId.toXMLString(true,true));
  setUserSessionProperty(Constants.IS_TRANSIENT,Boolean.toString(isTransient));
  setUserSessionProperty(Constants.REQUEST_ID,respInfo.getResponse().getInResponseTo());
  setUserSessionProperty(SAML2Constants.BINDING,binding);
  setUserSessionProperty(Constants.CACHE_KEY,storageKey);
}
Program: 9058
Project: 9058
Buggy source:
/** 
 * Sets the auth module's logged-in username via storeUsernamePasswd, triggers call to add information necessary for SLO (if configured) and returns success.
 */
private int success(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setSessionProperties(assertion,nameId,userName);
  DEBUG.message("String_Node_Str",getPrincipal().getName());
  storeUsernamePasswd(DNUtils.DNtoName(getPrincipal().getName()),null);
  return ISAuthConstants.LOGIN_SUCCEED;
}

Fixed version (ground truth):
/** 
 * Sets the auth module's logged-in username via storeUsernamePasswd, triggers call to add information necessary for SLO (if configured) and returns success.
 */
private int success(Assertion assertion,NameID nameId,String userName) throws AuthLoginException, SAML2Exception {
  setSessionProperties(assertion,nameId,userName);
  setSessionAttributes(assertion,userName);
  DEBUG.message("String_Node_Str",getPrincipal().getName());
  storeUsernamePasswd(DNUtils.DNtoName(getPrincipal().getName()),null);
  return ISAuthConstants.LOGIN_SUCCEED;
}
Program: 9061
Project: 9061
Buggy source:
@Override public void onLogout(HttpServletRequest request,HttpServletResponse response,SSOToken ssoToken) throws AuthenticationException {
  try {
    final String ssOutEnabled=ssoToken.getProperty(SAML2Constants.SINGLE_LOGOUT);
    if (Boolean.parseBoolean(ssOutEnabled)) {
      request.setAttribute(AMPostAuthProcessInterface.POST_PROCESS_LOGOUT_URL,ssoToken.getProperty(SLO_SESSION_LOCATION) + ssoToken.getProperty(SLO_SESSION_REFERENCE));
      ssoToken.setProperty(AMPostAuthProcessInterface.POST_PROCESS_LOGOUT_URL,ssoToken.getProperty(SLO_SESSION_LOCATION) + ESAPI.encoder().encodeForURL(ssoToken.getProperty(SLO_SESSION_REFERENCE)));
    }
  }
 catch (  EncodingException|SSOException e) {
    DEBUG.warning("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onLogout(HttpServletRequest request,HttpServletResponse response,SSOToken ssoToken) throws AuthenticationException {
  try {
    final String ssOutEnabled=ssoToken.getProperty(SAML2Constants.SINGLE_LOGOUT);
    if (Boolean.parseBoolean(ssOutEnabled)) {
      final XUIState xuiState=InjectorHolder.getInstance(XUIState.class);
      final StringBuilder logoutLocation=new StringBuilder();
      logoutLocation.append(ssoToken.getProperty(SLO_SESSION_LOCATION));
      if (xuiState.isXUIEnabled()) {
        logoutLocation.append(ESAPI.encoder().encodeForURL(ssoToken.getProperty(SLO_SESSION_REFERENCE)));
      }
 else {
        logoutLocation.append(ssoToken.getProperty(SLO_SESSION_REFERENCE));
      }
      request.setAttribute(AMPostAuthProcessInterface.POST_PROCESS_LOGOUT_URL,logoutLocation.toString());
    }
  }
 catch (  EncodingException|SSOException e) {
    DEBUG.warning("String_Node_Str",e);
  }
}
Program: 9062
Project: 9062
Buggy source:
private void configureIdpInitSLO(SSOToken session,String sessionIndex,String metaAlias,NameIDInfo info,boolean isTransient,String requestID) throws SessionException, SAML2Exception, SSOException {
  SessionProvider sessionProvider=SessionManager.getProvider();
  SPACSUtils.saveInfoInMemory(sessionProvider,session,sessionIndex,metaAlias,info,IDPProxyUtil.isIDPProxyEnabled(requestID),isTransient);
}

Fixed version (ground truth):
private void configureIdpInitSLO(SessionProvider sessionProvider,SSOToken session,String sessionIndex,String metaAlias,NameIDInfo info,boolean isTransient,String requestID) throws SessionException, SAML2Exception, SSOException {
  SPACSUtils.saveInfoInMemory(sessionProvider,session,sessionIndex,metaAlias,info,IDPProxyUtil.isIDPProxyEnabled(requestID),isTransient);
}
Program: 9063
Project: 9063
Buggy source:
/** 
 * Clears the session of all the temp data we passed to set up SLO.
 */
private void clearSession(SSOToken ssoToken) throws SSOException {
  ssoToken.setProperty(SAML2Constants.RELAY_STATE,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SESSION_INDEX,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.IDPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.METAALIAS,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.REQ_BINDING,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.NAMEID,"String_Node_Str");
  ssoToken.setProperty(Constants.IS_TRANSIENT,"String_Node_Str");
  ssoToken.setProperty(Constants.REQUEST_ID,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Clears the session of all the temp data we passed to set up SLO.
 */
private void clearSession(SSOToken ssoToken) throws SSOException {
  ssoToken.setProperty(SAML2Constants.RELAY_STATE,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SESSION_INDEX,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.IDPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.SPENTITYID,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.METAALIAS,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.REQ_BINDING,"String_Node_Str");
  ssoToken.setProperty(SAML2Constants.NAMEID,"String_Node_Str");
  ssoToken.setProperty(Constants.IS_TRANSIENT,"String_Node_Str");
  ssoToken.setProperty(Constants.REQUEST_ID,"String_Node_Str");
  ssoToken.setProperty(Constants.CACHE_KEY,"String_Node_Str");
}
Program: 9065
Project: 9065
Buggy source:
/** 
 * Generates the redirect from SAML2 auth module to IDP as GET.
 */
private void configureGetRedirectCallback(final String redirectUrl,RedirectCallback redirectCallback) throws AuthLoginException {
  final RedirectCallback rcNew=new RedirectCallback(redirectUrl,null,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  Map<String,String> redirectData=rcNew.getRedirectData();
  if (null == redirectData) {
    redirectData=new HashMap<>();
  }
  rcNew.setRedirectData(redirectData);
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}

Fixed version (ground truth):
/** 
 * Generates the redirect from SAML2 auth module to IDP as GET.
 */
private void configureGetRedirectCallback(final String redirectUrl,RedirectCallback redirectCallback) throws AuthLoginException {
  final RedirectCallback rcNew=new RedirectCallback(redirectUrl,null,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  Map<String,String> redirectData=rcNew.getRedirectData();
  rcNew.setRedirectData(redirectData);
  rcNew.setTrackingCookie(true);
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}
Program: 9066
Project: 9066
Buggy source:
/** 
 * Generates the redirect from SAML2 auth module to IDP as POST.
 */
private void configurePostRedirectCallback(final String postMsg,final String ssoURL,final RedirectCallback redirectCallback) throws AuthLoginException {
  final Map<String,String> postData=new HashMap<>();
  postData.put(SAML2Constants.SAML_REQUEST,postMsg);
  final RedirectCallback rcNew=new RedirectCallback(ssoURL,postData,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}

Fixed version (ground truth):
/** 
 * Generates the redirect from SAML2 auth module to IDP as POST.
 */
private void configurePostRedirectCallback(final String postMsg,final String ssoURL,final RedirectCallback redirectCallback) throws AuthLoginException {
  final Map<String,String> postData=new HashMap<>();
  postData.put(SAML2Constants.SAML_REQUEST,postMsg);
  final RedirectCallback rcNew=new RedirectCallback(ssoURL,postData,"String_Node_Str",redirectCallback.getStatusParameter(),redirectCallback.getRedirectBackUrlCookieName());
  rcNew.setTrackingCookie(true);
  replaceCallback(REDIRECT,REDIRECT_CALLBACK,rcNew);
}
Program: 9067
Project: 9067
Buggy source:
/** 
 * Converts the   {@code RedirectCallback} into a JSON representation.{@inheritDoc}
 */
public JsonValue convertToJson(RedirectCallback callback,int index) throws RestAuthException {
  JsonValue callbacksJson=json(array(createOutputField("String_Node_Str",callback.getRedirectUrl()),createOutputField("String_Node_Str",callback.getMethod())));
  JsonValue jsonValue=json(object(field("String_Node_Str",CALLBACK_NAME),field("String_Node_Str",callbacksJson.getObject())));
  if (callback.getRedirectData() != null) {
    callbacksJson.add(createOutputField("String_Node_Str",callback.getRedirectData()));
  }
  return jsonValue;
}

Fixed version (ground truth):
/** 
 * Converts the   {@code RedirectCallback} into a JSON representation.{@inheritDoc}
 */
public JsonValue convertToJson(RedirectCallback callback,int index) throws RestAuthException {
  JsonValue callbacksJson=json(array(createOutputField("String_Node_Str",callback.getRedirectUrl()),createOutputField("String_Node_Str",callback.getMethod()),createOutputField("String_Node_Str",callback.getTrackingCookie())));
  JsonValue jsonValue=json(object(field("String_Node_Str",CALLBACK_NAME),field("String_Node_Str",callbacksJson.getObject())));
  if (callback.getRedirectData() != null) {
    callbacksJson.add(createOutputField("String_Node_Str",callback.getRedirectData()));
  }
  return jsonValue;
}