Ref: add new static analyser rule: bestpractices.xml/UnusedAssignment

This commit is contained in:
Laurent Clouet
2024-06-06 01:05:27 +00:00
parent fd33b6d666
commit 1b3cf096d1
8 changed files with 20 additions and 29 deletions
+4 -4
View File
@@ -112,7 +112,7 @@ public class Utils {
if (password != null) {
zipInputStream.setPassword(password);
}
LocalFileHeader fileHeader = null;
LocalFileHeader fileHeader;
while ((fileHeader = zipInputStream.getNextEntry()) != null) {
String outFilePath = destinationDirectory + File.separator + fileHeader.getFileName();
File outFile = new File(outFilePath);
@@ -130,7 +130,7 @@ public class Utils {
FileOutputStream os = new FileOutputStream(outFile);
int readLen = -1;
int readLen;
byte[] buff = new byte[1024];
//Loop until End of File and write the contents to the output stream
@@ -354,8 +354,8 @@ public class Utils {
* Examples: 4,20GB, 20,00TB, 3,69MB
*/
public static String formatDataConsumption(long bytes) {
float divider = 0;
String suffix = "";
float divider;
String suffix;
if (bytes > 1099511627776f) { // 1TB
divider = 1099511627776f;