Fixes some warnings
This commit is contained in:
parent
6c614b2f17
commit
692d9e79d2
2
pom.xml
2
pom.xml
@ -101,7 +101,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<version>4.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -156,7 +156,7 @@ class Main {
|
||||
int videoStreamIndex = -1;
|
||||
|
||||
try {
|
||||
if (input.size() > 0) {
|
||||
if (!input.isEmpty()) {
|
||||
audioStreamIndex = Integer.parseInt(input.get(0));
|
||||
}
|
||||
if (input.size() > 1) {
|
||||
@ -191,7 +191,7 @@ class Main {
|
||||
int forcedSubtitleIndex = -1;
|
||||
String subtitleNameFilter = "";
|
||||
|
||||
if (input.size() > 0) {
|
||||
if (!input.isEmpty()) {
|
||||
audioLanguage = ListUtil.getListFromCommaSeparatedString(input.get(0));
|
||||
}
|
||||
if (input.size() > 1) {
|
||||
@ -247,7 +247,7 @@ class Main {
|
||||
private static String getChoice(String prompt) throws IOException {
|
||||
OutputUtil.println(prompt);
|
||||
String choice = "";
|
||||
while (choice.equals("")) {
|
||||
while (choice.isEmpty()) {
|
||||
OutputUtil.println("Your input: ");
|
||||
choice = READER.nextLine();
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public abstract class AbstractConverter implements Converter {
|
||||
audioFormats = FileUtil.readFileLines("audio_formats.txt");
|
||||
videoFormats = FileUtil.readFileLines("video_formats.txt");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("Unable to read audio and/or video formats from internal files.");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
@ -159,7 +159,7 @@ public abstract class AbstractConverter implements Converter {
|
||||
AudioStream audioStream = null;
|
||||
if (audioStreams.size() > n) {
|
||||
audioStream = audioStreams.get(n);
|
||||
} else if (audioStreams.size() > 0) {
|
||||
} else if (!audioStreams.isEmpty()) {
|
||||
audioStream = audioStreams.get(0);
|
||||
}
|
||||
return audioStream;
|
||||
@ -180,7 +180,7 @@ public abstract class AbstractConverter implements Converter {
|
||||
SubtitleStream subtitleStream = null;
|
||||
if (subtitleStreams.size() > n) {
|
||||
subtitleStream = subtitleStreams.get(n);
|
||||
} else if (subtitleStreams.size() > 0) {
|
||||
} else if (!subtitleStreams.isEmpty()) {
|
||||
subtitleStream = subtitleStreams.get(0);
|
||||
}
|
||||
return subtitleStream;
|
||||
@ -201,7 +201,7 @@ public abstract class AbstractConverter implements Converter {
|
||||
VideoStream videoStream = null;
|
||||
if (videoStreams.size() > n) {
|
||||
videoStream = videoStreams.get(n);
|
||||
} else if (videoStreams.size() > 0) {
|
||||
} else if (!videoStreams.isEmpty()) {
|
||||
videoStream = videoStreams.get(0);
|
||||
}
|
||||
return videoStream;
|
||||
|
@ -61,7 +61,7 @@ public class ConverterArgument {
|
||||
* @return <p>True if the argument is valid. False otherwise.</p>
|
||||
*/
|
||||
public boolean testArgumentValue(String value) {
|
||||
if (value.length() == 0) {
|
||||
if (value.isEmpty()) {
|
||||
return !valueRequired;
|
||||
}
|
||||
if (valueRequired && value.startsWith("-")) {
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,6 @@
|
||||
package net.knarcraft.ffmpegconverter.converter;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class AnimeConverterTest {
|
||||
|
||||
@ -14,9 +11,4 @@ public class AnimeConverterTest {
|
||||
false, -1, -1, "");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void weirdTest() {
|
||||
assertEquals(0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user