Program: 172637
Project: 172637
Buggy source:
@Override public void handle(RoutingContext context){
  if (adminManager.isAdmin(context)) {
    DataBase database=DataBase.getInstance();
    SafeResultSet resultSet;
    SafeResultSet extensionStateResultSet;
    AES256 aes=UserManager.getAES();
    File file=getFile();
    try {
      wb=new XSSFWorkbook(new FileInputStream(file));
      XSSFSheet sheet=wb.getSheetAt(0);
      for (      Row row : sheet) {
        for (        Cell cell : row) {
switch (cell.getCellType()) {
case Cell.CELL_TYPE_NUMERIC:
            StringBuilder sb=new StringBuilder(Double.toString(cell.getNumericCellValue()));
          String studentNumber=aes.encrypt(sb.toString().substring(0,4));
        int classId=0;
      resultSet=database.executeQuery("String_Node_Str",studentNumber,"String_Node_Str");
    if (resultSet.next()) {
      String uid=resultSet.getString("String_Node_Str");
      extensionStateResultSet=database.executeQuery("String_Node_Str",uid,"String_Node_Str");
      if (extensionStateResultSet.next()) {
        classId=extensionStateResultSet.getInt("String_Node_Str");
      }
    }
  XSSFRow studentRow=sheet.getRow(cell.getRowIndex());
XSSFCell extensionStateCell=studentRow.getCell(cell.getColumnIndex() + 2);
extensionStateCell.setCellValue(CLASS_NAMES[classId]);
break;
}
}
}
FileOutputStream xlsToSave=new FileOutputStream(FILE_DIR + "String_Node_Str");
wb.write(xlsToSave);
xlsToSave.close();
String fileName=new String("String_Node_Str".getBytes("String_Node_Str"),"String_Node_Str");
context.response().putHeader(HttpHeaders.CONTENT_DISPOSITION,"String_Node_Str" + fileName).sendFile(FILE_DIR + "String_Node_Str");
context.response().close();
}
 catch (IOException|SQLException e) {
context.response().setStatusCode(500).end();
context.response().close();
}
}
 else {
context.response().setStatusCode(400).end();
context.response().end("String_Node_Str");
context.response().close();
}
}

Fixed version (ground truth):
@Override public void handle(RoutingContext context){
  if (AdminManager.isAdmin(context)) {
    DataBase database=DataBase.getInstance();
    SafeResultSet resultSet;
    SafeResultSet extensionStateResultSet;
    File file=getFile();
    try {
      wb=new XSSFWorkbook(new FileInputStream(file));
      XSSFSheet sheet=wb.getSheetAt(0);
      for (      Row row : sheet) {
        for (        Cell cell : row) {
switch (cell.getCellType()) {
case Cell.CELL_TYPE_NUMERIC:
            StringBuilder sb=new StringBuilder(Double.toString(cell.getNumericCellValue()));
          String studentNumber=AES256.encrypt(sb.toString().substring(0,4));
        int classId=0;
      resultSet=database.executeQuery("String_Node_Str",studentNumber,"String_Node_Str");
    if (resultSet.next()) {
      String uid=resultSet.getString("String_Node_Str");
      extensionStateResultSet=database.executeQuery("String_Node_Str",uid,"String_Node_Str");
      if (extensionStateResultSet.next()) {
        classId=extensionStateResultSet.getInt("String_Node_Str");
      }
    }
  XSSFRow studentRow=sheet.getRow(cell.getRowIndex());
XSSFCell extensionStateCell=studentRow.getCell(cell.getColumnIndex() + 2);
extensionStateCell.setCellValue(CLASS_NAMES[classId]);
break;
}
}
}
FileOutputStream xlsToSave=new FileOutputStream(FILE_DIR + "String_Node_Str");
wb.write(xlsToSave);
xlsToSave.close();
String fileName=new String("String_Node_Str".getBytes("String_Node_Str"),"String_Node_Str");
context.response().putHeader(HttpHeaders.CONTENT_DISPOSITION,"String_Node_Str" + fileName).sendFile(FILE_DIR + "String_Node_Str");
context.response().close();
}
 catch (IOException|SQLException e) {
context.response().setStatusCode(500).end();
context.response().close();
}
}
 else {
context.response().setStatusCode(400).end();
context.response().end("String_Node_Str");
context.response().close();
}
}