mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
Switch order of literals to prevent NullPointerException
This commit is contained in:
parent
73a340cbe2
commit
c2d8692ecb
@ -182,7 +182,7 @@ public class TempFileCleanupServiceTest {
|
|||||||
return FileTime.fromMillis(System.currentTimeMillis() - 5000000);
|
return FileTime.fromMillis(System.currentTimeMillis() - 5000000);
|
||||||
}
|
}
|
||||||
// For empty.tmp file, return a timestamp older than 5 minutes (for empty file test)
|
// For empty.tmp file, return a timestamp older than 5 minutes (for empty file test)
|
||||||
else if (fileName.equals("empty.tmp")) {
|
else if ("empty.tmp".equals(fileName)) {
|
||||||
return FileTime.fromMillis(System.currentTimeMillis() - 6 * 60 * 1000);
|
return FileTime.fromMillis(System.currentTimeMillis() - 6 * 60 * 1000);
|
||||||
}
|
}
|
||||||
// For all other files, return a recent timestamp
|
// For all other files, return a recent timestamp
|
||||||
@ -198,7 +198,7 @@ public class TempFileCleanupServiceTest {
|
|||||||
String fileName = path.getFileName().toString();
|
String fileName = path.getFileName().toString();
|
||||||
|
|
||||||
// Return 0 bytes for the empty file
|
// Return 0 bytes for the empty file
|
||||||
if (fileName.equals("empty.tmp")) {
|
if ("empty.tmp".equals(fileName)) {
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
// Return normal size for all other files
|
// Return normal size for all other files
|
||||||
@ -327,7 +327,7 @@ public class TempFileCleanupServiceTest {
|
|||||||
Path path = invocation.getArgument(0);
|
Path path = invocation.getArgument(0);
|
||||||
String fileName = path.getFileName().toString();
|
String fileName = path.getFileName().toString();
|
||||||
|
|
||||||
if (fileName.equals("empty.tmp")) {
|
if ("empty.tmp".equals(fileName)) {
|
||||||
// More than 5 minutes old
|
// More than 5 minutes old
|
||||||
return FileTime.fromMillis(System.currentTimeMillis() - 6 * 60 * 1000);
|
return FileTime.fromMillis(System.currentTimeMillis() - 6 * 60 * 1000);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user