You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/01/11 08:28:28 UTC

[camel] branch master updated: Fixed CS and polished

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 989074d  Fixed CS and polished
989074d is described below

commit 989074d412990f9503dd68b29323e692f2d9e834
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Jan 11 09:28:02 2020 +0100

    Fixed CS and polished
---
 .../camel/component/exec/ExecResultConverter.java  | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java b/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java
index 7a2b5ca..b126130 100644
--- a/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java
+++ b/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecResultConverter.java
@@ -53,7 +53,7 @@ public final class ExecResultConverter {
 
     @Converter
     public static byte[] convertToByteArray(ExecResult result, Exchange exchange) throws FileNotFoundException, IOException {
-    	try (InputStream stream = toInputStream(result)) {
+        try (InputStream stream = toInputStream(result)) {
             return IOUtils.toByteArray(stream);
         }
     }
@@ -77,15 +77,15 @@ public final class ExecResultConverter {
 
     /**
      * Converts <code>ExecResult</code> to the type <code>T</code>.
-     * 
-     * @param <T> The type to convert to
-     * @param type Class instance of the type to which to convert
+     *
+     * @param <T>      The type to convert to
+     * @param type     Class instance of the type to which to convert
      * @param exchange a Camel exchange. If exchange is <code>null</code>, no
-     *            conversion will be made
-     * @param result the exec result
+     *                 conversion will be made
+     * @param result   the exec result
      * @return the converted {@link ExecResult}
      * @throws FileNotFoundException if there is a file in the execResult, and
-     *             the file can not be found
+     *                               the file can not be found
      */
     @SuppressWarnings("unchecked")
     private static <T> T convertTo(Class<T> type, Exchange exchange, ExecResult result) throws FileNotFoundException {
@@ -107,15 +107,15 @@ public final class ExecResultConverter {
      * the exec result. <br>
      * If the output stream is of type <code>ByteArrayInputStream</code>, its
      * <code>reset()</code> method is called.
-     * 
+     *
      * @param execResult ExecResult object to convert to InputStream.
      * @return InputStream object with the <i>output</i> of the executable.
-     *         Returns <code>null</code> if both {@link ExecResult#getStdout()}
-     *         and {@link ExecResult#getStderr()} are <code>null</code> , or if
-     *         the <code>execResult</code> is <code>null</code>.
+     * Returns <code>null</code> if both {@link ExecResult#getStdout()}
+     * and {@link ExecResult#getStderr()} are <code>null</code> , or if
+     * the <code>execResult</code> is <code>null</code>.
      * @throws FileNotFoundException if the {@link ExecCommand#getOutFile()} can
-     *             not be opened. In this case the out file must have had a not
-     *             <code>null</code> value
+     *                               not be opened. In this case the out file must have had a not
+     *                               <code>null</code> value
      */
     private static InputStream toInputStream(ExecResult execResult) throws FileNotFoundException {
         if (execResult == null) {
@@ -132,7 +132,7 @@ public final class ExecResultConverter {
                 LOG.warn("ExecResult has no stdout, will fallback to use stderr.");
                 result = execResult.getStderr();
             } else {
-                result = execResult.getStdout() != null ? execResult.getStdout() : null;
+                result = execResult.getStdout();
             }
         }
         // reset the stream if it was already read.