Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
3.0 kB
5
Indexable
Never
	private void stRepOne(List<Map<String, Object>> duData, XSSFCellStyle h11, int startRow, String iOUName,
			ResourceBundle rb, XSSFSheet hssfSheet, CellStyle style, Set<String> keys2) {
		for (int l = 0; l < duData.size(); l++) {

			hssfSheet.createRow(startRow + l);
			int j = 0;

			for (String key1 : keys2) {

				XSSFCell cell = hssfSheet.getRow(startRow + l).createCell(j);
				splDuOne(duData, h11, style, l, j, key1, cell);
				cell.setCellStyle(h11);
				j++;
				duPlSecLast(duData, startRow, rb, hssfSheet, style, l, j);

			}
			splDuLast(duData, startRow, iOUName, rb, hssfSheet, l);

		}
	}

	private void duPlSecLast(List<Map<String, Object>> duData, int startRow, ResourceBundle rb, XSSFSheet hssfSheet,
			CellStyle style, int l, int j) {
		if (j == 19) {
			newSplThree(duData, startRow, rb, style, hssfSheet, l, j);
		}
	}

	private void splDuLast(List<Map<String, Object>> duData, int startRow, String iOUName, ResourceBundle rb,
			XSSFSheet hssfSheet, int l) {
		if (l == 0 && null != iOUName) {// for calculation sheet
			XSSFCell cell1 = hssfSheet.getRow(startRow).createCell(27);
			cell1.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell1.setCellFormula(rb.getString("BCN").replaceAll("1000", "" + (duData.size() + startingRowNo)));
			XSSFCell cell2 = hssfSheet.getRow(startRow).createCell(28);
			cell2.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell2.setCellFormula(rb.getString("BCD").replaceAll("1000", "" + (duData.size() + startingRowNo)));
			XSSFCell cell3 = hssfSheet.getRow(startRow).createCell(29);
			cell3.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell3.setCellFormula(rb.getString("ADN").replaceAll("1000", "" + (duData.size() + startingRowNo)));
			XSSFCell cell4 = hssfSheet.getRow(startRow).createCell(30);
			cell4.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell4.setCellFormula(rb.getString("ADD").replaceAll("1000", "" + (duData.size() + startingRowNo)));
			XSSFCell cell5 = hssfSheet.getRow(startRow).createCell(31);
			cell5.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell5.setCellFormula(rb.getString("EXN").replaceAll("1000", "" + (duData.size() + startingRowNo)));
			XSSFCell cell6 = hssfSheet.getRow(startRow).createCell(32);
			cell6.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell6.setCellFormula(rb.getString("EXD").replaceAll("1000", "" + (duData.size() + startingRowNo)));
			XSSFCell cell7 = hssfSheet.getRow(startRow).createCell(33);
			cell7.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell7.setCellFormula(rb.getString("OCN").replaceAll("1000", "" + (duData.size() + startingRowNo)));
			XSSFCell cell8 = hssfSheet.getRow(startRow).createCell(34);
			cell8.setCellType(XSSFCell.CELL_TYPE_FORMULA);
			cell8.setCellFormula(rb.getString("OCD").replaceAll("1000", "" + (duData.size() + startingRowNo)));
		}

In the above code I'm getting SAST error that Dead Code: Expression is Always false for "if (l == 0 && null != iOUName)" can you modify the above code and give me solution
Leave a Comment