diff options
author | Ulf Adams <ulfjack@google.com> | 2016-06-17 12:57:20 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-06-20 09:34:05 +0000 |
commit | 48f2470b3cc60c11e46a95872a409341c4224096 (patch) | |
tree | dcfd618cda74a3d078b7b4b16e47058e1777455b /src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java | |
parent | d9ecddbc3d6de3e9ea21386bca3f932ac90780fa (diff) |
Clean up the test runner code a bit.
Small steps towards #1150.
--
MOS_MIGRATED_REVID=125158135
Diffstat (limited to 'src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java')
-rw-r--r-- | src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java index a25d3a3746..9f76bd89bb 100644 --- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java +++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4/JUnit4Config.java @@ -15,7 +15,6 @@ package com.google.testing.junit.runner.junit4; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Preconditions; @@ -74,16 +73,11 @@ class JUnit4Config { */ public Optional<Path> getXmlOutputPath() { if (!xmlOutputPath.isPresent()) { - Optional<String> envXmlOutputPath = - Optional.fromNullable(System.getenv(XML_OUTPUT_FILE_ENV_VAR)); - return envXmlOutputPath.transform(new Function<String, Path>() { - @Override - public Path apply(String path) { - return FileSystems.getDefault().getPath(path); - } - }); + String envXmlOutputPath = System.getenv(XML_OUTPUT_FILE_ENV_VAR); + return envXmlOutputPath == null + ? Optional.<Path>absent() + : Optional.of(FileSystems.getDefault().getPath(envXmlOutputPath)); } - return xmlOutputPath; } |