Skip to content

Commit

Permalink
Use String#isEmpty()
Browse files Browse the repository at this point in the history
(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)
  • Loading branch information
garydgregory committed Jun 2, 2023
1 parent ab9f06f commit 8310bf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/apache/commons/imaging/Imaging.java
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,12 @@ public static ImageFormat guessFormat(final ByteSource byteSource) throws IOExce
.of(imageFormat.getExtensions())
.anyMatch(extension -> {
final String fileName = byteSource.getFileName();
if (fileName == null || fileName.trim().length() == 0) {
if (fileName == null || fileName.trim().isEmpty()) {
return false;
}
final String fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
return extension != null
&& extension.trim().length() > 0
&& !extension.trim().isEmpty()
&& fileExtension.equalsIgnoreCase(extension);
}))
.findFirst()
Expand Down

0 comments on commit 8310bf6

Please sign in to comment.