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 2015/02/23 07:57:47 UTC
camel git commit: CAMEL-8241: Work around bug in commons-exec to get
camel-exec to work on unix with java 8.
Repository: camel
Updated Branches:
refs/heads/camel-2.14.x 4125e9d86 -> 4314959d5
CAMEL-8241: Work around bug in commons-exec to get camel-exec to work on unix with java 8.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4314959d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4314959d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4314959d
Branch: refs/heads/camel-2.14.x
Commit: 4314959d5fb60b5709d8bbebf42dd93b8858c387
Parents: 4125e9d
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Feb 23 07:58:40 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Feb 23 07:58:40 2015 +0100
----------------------------------------------------------------------
.../org/apache/camel/component/exec/ExecDefaultExecutor.java | 2 +-
.../org/apache/camel/component/exec/ExecJava8IssueTest.java | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/4314959d/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecDefaultExecutor.java
----------------------------------------------------------------------
diff --git a/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecDefaultExecutor.java b/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecDefaultExecutor.java
index 14df04e..753af19 100644
--- a/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecDefaultExecutor.java
+++ b/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecDefaultExecutor.java
@@ -31,7 +31,7 @@ public class ExecDefaultExecutor extends DefaultExecutor {
}
@Override
- protected Process launch(CommandLine command, Map<String, String> env, File dir) throws IOException {
+ protected Process launch(CommandLine command, Map env, File dir) throws IOException {
process = super.launch(command, env, dir);
return process;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/4314959d/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJava8IssueTest.java
----------------------------------------------------------------------
diff --git a/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJava8IssueTest.java b/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJava8IssueTest.java
index 5fa78d4..c9cdb24 100644
--- a/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJava8IssueTest.java
+++ b/components/camel-exec/src/test/java/org/apache/camel/component/exec/ExecJava8IssueTest.java
@@ -103,10 +103,14 @@ public class ExecJava8IssueTest extends Assert {
* Creates a script which will append " world" to a file
*/
private void writeScript(File script) throws IOException {
- try (FileWriter fw = new FileWriter(script);
- PrintWriter pw = new PrintWriter(fw)) {
+ FileWriter fw = new FileWriter(script);
+ try {
+ PrintWriter pw = new PrintWriter(fw);
String s = "echo \" world\" >> $1";
pw.print(s);
+ } finally {
+ fw.flush();
+ fw.close();
}
}