You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/08/24 15:15:05 UTC
[commons-exec] 05/07: No need to nest, format
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-exec.git
commit ad68e0e72767469873b94eae3a9edc3389559c14
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 24 11:12:05 2022 -0400
No need to nest, format
---
.../org/apache/commons/exec/DefaultExecutorTest.java | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java b/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
index 5d0402f..b1d581d 100644
--- a/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
+++ b/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
@@ -561,12 +561,11 @@ public class DefaultExecutorTest {
final String result = baos.toString().trim();
assertTrue(result, result.indexOf("Finished reading from stdin") > 0);
assertFalse("exitValue=" + exitValue, exec.isFailure(exitValue));
- } else if (OS.isFamilyWindows()) {
- System.err
- .println("The code samples to do that in windows look like a joke ... :-( .., no way I'm doing that");
- System.err.println("The test 'testExecuteWithRedirectedStreams' does not support the following OS : "
- + System.getProperty("os.name"));
} else {
+ if (OS.isFamilyWindows()) {
+ System.err
+ .println("The code samples to do that in windows look like a joke ... :-( .., no way I'm doing that");
+ }
System.err.println("The test 'testExecuteWithRedirectedStreams' does not support the following OS : "
+ System.getProperty("os.name"));
}
@@ -759,11 +758,8 @@ public class DefaultExecutorTest {
final StringBuilder contents = new StringBuilder();
final BufferedReader reader = new BufferedReader(new FileReader(file));
- while ((text = reader.readLine()) != null)
- {
- contents.append(text)
- .append(System.getProperty(
- "line.separator"));
+ while ((text = reader.readLine()) != null) {
+ contents.append(text).append(System.getProperty("line.separator"));
}
reader.close();
return contents.toString();