Fixes some warnings

This commit is contained in:
2024-03-15 02:09:46 +01:00
parent 6c614b2f17
commit 692d9e79d2
8 changed files with 13 additions and 21 deletions

View File

@ -110,7 +110,7 @@ public final class FFMpegHelper {
StringBuilder output = new StringBuilder();
while (process.isAlive()) {
String read = readProcess(processReader, spacer);
if (!read.equals("")) {
if (!read.isEmpty()) {
if (write) {
OutputUtil.println(read);
} else {
@ -339,7 +339,7 @@ public final class FFMpegHelper {
private static String readProcess(BufferedReader reader, String spacer) throws IOException {
String line;
StringBuilder text = new StringBuilder();
while (reader.ready() && (line = reader.readLine()) != null && !line.equals("") && !line.equals("\n")) {
while (reader.ready() && (line = reader.readLine()) != null && !line.isEmpty() && !line.equals("\n")) {
text.append(line).append(spacer);
}
return text.toString().trim();

View File

@ -32,7 +32,7 @@ public final class OutputUtil {
* @throws IOException <p>If a write is not possible.</p>
*/
public static void println(String input) throws IOException {
if (!input.equals("")) {
if (!input.isEmpty()) {
writer.write(input);
}
println();

View File

@ -193,7 +193,7 @@ public final class Parser {
* @return <p>True if the string builder is non empty.</p>
*/
private static boolean isNotEmpty(StringBuilder builder) {
return !builder.toString().trim().equals("");
return !builder.toString().trim().isEmpty();
}
}