diff --git a/build.gradle b/build.gradle index a23f452006b8e8896a44f0f5662f694674a2ed9a..454342ef1b959a9d60799d177966669406090beb 100644 --- a/build.gradle +++ b/build.gradle @@ -28,4 +28,8 @@ idea { downloadJavadoc = true downloadSources = true } +} + +compileJava { + options.compilerArgs << "-Xlint:all" } \ No newline at end of file diff --git a/src/de/uni_passau/fim/seibt/gitwrapper/process/ProcessExecutor.java b/src/de/uni_passau/fim/seibt/gitwrapper/process/ProcessExecutor.java index 380b919075c1536df6752fefea8a3d8b622b76db..36e2befd41a8c11b8cc49df58e3b499d975564b3 100644 --- a/src/de/uni_passau/fim/seibt/gitwrapper/process/ProcessExecutor.java +++ b/src/de/uni_passau/fim/seibt/gitwrapper/process/ProcessExecutor.java @@ -242,26 +242,4 @@ public class ProcessExecutor { return Optional.empty(); } } - - /** - * Returns a modifiable {@link LinkedList} containing the given elements. - * - * @param ts - * the elements to return in a {@link LinkedList} - * @param <T> - * the type of the elements - * @return a {@link LinkedList} containing the elements - */ - @SafeVarargs - public static <T> LinkedList<T> asList(T... ts) { - LinkedList<T> l = new LinkedList<>(); // we expect things to be inserted in front and back - - if (ts == null) { - return l; - } - - Collections.addAll(l, ts); - - return l; - } } diff --git a/src/de/uni_passau/fim/seibt/gitwrapper/process/ToolNotWorkingException.java b/src/de/uni_passau/fim/seibt/gitwrapper/process/ToolNotWorkingException.java index 1150130f94a01d019467c8070c68300480536639..efd5f2ead9f33d6ef71a2a5c67f9cf5e689729cd 100644 --- a/src/de/uni_passau/fim/seibt/gitwrapper/process/ToolNotWorkingException.java +++ b/src/de/uni_passau/fim/seibt/gitwrapper/process/ToolNotWorkingException.java @@ -5,6 +5,8 @@ package de.uni_passau.fim.seibt.gitwrapper.process; */ public class ToolNotWorkingException extends Exception { + private static final long serialVersionUID = 1L; + public ToolNotWorkingException() {} public ToolNotWorkingException(String message) { diff --git a/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java b/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java index d9bf37606e065f7ed3cf2aaa790cbbfddeb99e1a..5f6304afad87b8a4df665f67027940cdc82ba08c 100644 --- a/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java +++ b/src/de/uni_passau/fim/seibt/gitwrapper/repo/GitWrapper.java @@ -25,7 +25,7 @@ import de.uni_passau.fim.seibt.gitwrapper.process.ProcessExecutor.ExecRes; import de.uni_passau.fim.seibt.gitwrapper.process.ToolNotWorkingException; import de.uni_passau.fim.seibt.gitwrapper.process.ToolWrapper; -import static de.uni_passau.fim.seibt.gitwrapper.process.ProcessExecutor.asList; +import static java.util.Collections.singletonList; /** * A wrapper for executing git commands. @@ -77,7 +77,7 @@ public class GitWrapper extends ToolWrapper { @Override protected boolean isWorking() { Function<ExecRes, Boolean> checkPrefix = execRes -> execRes.getStdOutTrimmed().startsWith(GIT_VERSION_PREFIX); - return exec(new File("."), true, asList(GIT_VERSION_C)).map(checkPrefix).orElse(false); + return exec(new File("."), true, singletonList(GIT_VERSION_C)).map(checkPrefix).orElse(false); } /**