Program: 172638
Project: 172638
Buggy source:
@Override public void handle(RoutingContext context){
  if (adminManager.isAdmin(context)) {
    DataBase database=DataBase.getInstance();
    SafeResultSet resultSet;
    SafeResultSet stayStateResultSet;
    SafeResultSet stayDefaultResultSet;
    AES256 aes=UserManager.getAES();
    int year=Integer.parseInt(context.request().getParam("String_Node_Str"));
    int month=Integer.parseInt(context.request().getParam("String_Node_Str"));
    int week=Integer.parseInt(context.request().getParam("String_Node_Str"));
    String targetWeek=StringFormatter.format("String_Node_Str",year,month,week).getValue();
    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));
        resultSet=database.executeQuery("String_Node_Str",studentNumber,"String_Node_Str");
      if (resultSet.next()) {
        String uid=resultSet.getString("String_Node_Str");
        stayStateResultSet=database.executeQuery("String_Node_Str",uid,"String_Node_Str");
        if (stayStateResultSet.next()) {
          setCellValues(stayStateResultSet,database,sheet,cell,uid);
        }
 else {
          stayDefaultResultSet=database.executeQuery("String_Node_Str",uid,"String_Node_Str");
          if (stayDefaultResultSet.next()) {
            setCellValues(stayDefaultResultSet,database,sheet,cell,uid);
          }
        }
      }
    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) {
e.printStackTrace();
context.response().setStatusCode(500).end();
context.response().close();
}
}
 else {
context.response().setStatusCode(400);
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 stayStateResultSet;
    SafeResultSet stayDefaultResultSet;
    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));
        resultSet=database.executeQuery("String_Node_Str",studentNumber,"String_Node_Str");
      if (resultSet.next()) {
        String uid=resultSet.getString("String_Node_Str");
        stayStateResultSet=database.executeQuery("String_Node_Str",uid,"String_Node_Str");
        if (stayStateResultSet.next()) {
          setCellValues(stayStateResultSet,database,sheet,cell,uid);
        }
 else {
          stayDefaultResultSet=database.executeQuery("String_Node_Str",uid,"String_Node_Str");
          if (stayDefaultResultSet.next()) {
            setCellValues(stayDefaultResultSet,database,sheet,cell,uid);
          }
        }
      }
    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) {
e.printStackTrace();
context.response().setStatusCode(500).end();
context.response().close();
}
}
 else {
context.response().setStatusCode(400);
context.response().end("String_Node_Str");
context.response().close();
}
}