Skip to content

Commit 8310bf6

Browse files
committed
Use String#isEmpty()
(build passes for me locally on Windows 10 and Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux (within Windows WSL)
1 parent ab9f06f commit 8310bf6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/apache/commons/imaging/Imaging.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,12 +760,12 @@ public static ImageFormat guessFormat(final ByteSource byteSource) throws IOExce
760760
.of(imageFormat.getExtensions())
761761
.anyMatch(extension -> {
762762
final String fileName = byteSource.getFileName();
763-
if (fileName == null || fileName.trim().length() == 0) {
763+
if (fileName == null || fileName.trim().isEmpty()) {
764764
return false;
765765
}
766766
final String fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
767767
return extension != null
768-
&& extension.trim().length() > 0
768+
&& !extension.trim().isEmpty()
769769
&& fileExtension.equalsIgnoreCase(extension);
770770
}))
771771
.findFirst()

0 commit comments

Comments
 (0)