Skip to content

Commit

Permalink
util, test-util: Fix strict warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kohlschuetter committed Dec 12, 2024
1 parent 3dd014c commit 49e7003
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.junit.jupiter.api.extension.ExecutionCondition;
import org.junit.jupiter.api.extension.ExtensionContext;

import com.kohlschutter.annotations.compiletime.SuppressFBWarnings;

/**
* A JUnit {@link ExecutionCondition} for {@link CommandAvailabilityRequirement}.
*
Expand All @@ -40,6 +42,7 @@ public CommandAvailabilityExecutionCondition() {
}

@Override
@SuppressFBWarnings("COMMAND_INJECTION")
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) {
String[] commands = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.kohlschutter.annotations.compiletime.SuppressFBWarnings;
import com.kohlschutter.util.ProcessUtil;
import com.kohlschutter.util.SystemPropertyUtil;

Expand All @@ -45,6 +46,7 @@
*
* @author Christian Kohlschütter
*/
@SuppressFBWarnings({"COMMAND_INJECTION", "PATH_TRAVERSAL_IN"})
public class ForkedVM {
private static final Set<String> HAS_PARAMETER = new HashSet<>(Arrays.asList("--add-opens", "-p",
"-cp", "--module-path", "--upgrade-module-path", "-classpath", "--class-path",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.nio.file.Path;
import java.nio.file.Paths;

import com.kohlschutter.annotations.compiletime.SuppressFBWarnings;

/**
* Some {@link Path}-related helper methods.
*
Expand Down Expand Up @@ -130,6 +132,7 @@ public static Path partialRealpath(Path p) {
* @param url The URL to convert to.
* @return The Path, or {@code null} if not convertible.
*/
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
public static Path toPathIfPossible(URL url) {
if (url == null) {
return null;
Expand Down

0 comments on commit 49e7003

Please sign in to comment.