[camel] branch master updated (6519cd1 -> 0da5786)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch master updated (6519cd1 -> 0da5786)

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

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


    from 6519cd1  Jenkinsfile jdk14 build: changed the JDK name following INFRA new approach
     new 0edf16c  Fixed CS
     new 0da5786  CAMEL-15697: camel-joor - Camel expression langauge using jOOR runtime java compiled.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/language/joor/JoorCompilationException.java    |  4 ++--
 .../org/apache/camel/language/joor/JoorExpression.java   |  8 ++++----
 .../language/joor/JoorExpressionEvaluationException.java | 16 ++++++++++++++++
 .../org/apache/camel/language/joor/JoorLanguageTest.java |  2 ++
 4 files changed, 24 insertions(+), 6 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[camel] 01/02: Fixed CS

davsclaus-2
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

commit 0edf16c669ab13e2fc785556775153c7dd7c5b85
Author: Claus Ibsen <[hidden email]>
AuthorDate: Sat Oct 17 17:36:58 2020 +0200

    Fixed CS
---
 .../camel/language/joor/JoorCompilationException.java    |  4 ++--
 .../org/apache/camel/language/joor/JoorExpression.java   |  8 ++++----
 .../language/joor/JoorExpressionEvaluationException.java | 16 ++++++++++++++++
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorCompilationException.java b/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorCompilationException.java
index c0184c6..348c728 100644
--- a/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorCompilationException.java
+++ b/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorCompilationException.java
@@ -18,8 +18,8 @@ package org.apache.camel.language.joor;
 
 public class JoorCompilationException extends RuntimeException {
 
-    private String className;
-    private String code;
+    private final String className;
+    private final String code;
 
     public JoorCompilationException(String className, String code, Throwable cause) {
         super("jOOR compilation error for class: " + className + " with code:\n" + code, cause);
diff --git a/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpression.java b/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpression.java
index c024c23..62dcaf9 100644
--- a/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpression.java
+++ b/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpression.java
@@ -32,7 +32,7 @@ public class JoorExpression extends ExpressionAdapter {
 
     private static final AtomicInteger COUNTER = new AtomicInteger();
     private static final Logger LOG = LoggerFactory.getLogger(JoorExpression.class);
-    private static Boolean JAVA8;
+    private static Boolean java8;
 
     private final String text;
     private String className;
@@ -105,9 +105,9 @@ public class JoorExpression extends ExpressionAdapter {
     public void init(CamelContext context) {
         super.init(context);
 
-        if (JAVA8 == null) {
-            JAVA8 = getJavaMajorVersion() == 8;
-            if (JAVA8) {
+        if (java8 == null) {
+            java8 = getJavaMajorVersion() == 8;
+            if (java8) {
                 throw new UnsupportedOperationException("Java 8 is not supported. Use Java 11 or higher");
             }
         }
diff --git a/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpressionEvaluationException.java b/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpressionEvaluationException.java
index 93ecf59..806e550 100644
--- a/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpressionEvaluationException.java
+++ b/components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorExpressionEvaluationException.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.language.joor;
 
 import org.apache.camel.Exchange;

Reply | Threaded
Open this post in threaded view
|

[camel] 02/02: CAMEL-15697: camel-joor - Camel expression langauge using jOOR runtime java compiled.

davsclaus-2
In reply to this post by davsclaus-2
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

commit 0da5786dd54ce6a196e5059e27e577a3f86f46c3
Author: Claus Ibsen <[hidden email]>
AuthorDate: Sat Oct 17 17:38:12 2020 +0200

    CAMEL-15697: camel-joor - Camel expression langauge using jOOR runtime java compiled.
---
 .../src/test/java/org/apache/camel/language/joor/JoorLanguageTest.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/camel-joor/src/test/java/org/apache/camel/language/joor/JoorLanguageTest.java b/components/camel-joor/src/test/java/org/apache/camel/language/joor/JoorLanguageTest.java
index 56e43d5..de582c4 100644
--- a/components/camel-joor/src/test/java/org/apache/camel/language/joor/JoorLanguageTest.java
+++ b/components/camel-joor/src/test/java/org/apache/camel/language/joor/JoorLanguageTest.java
@@ -81,6 +81,8 @@ public class JoorLanguageTest extends LanguageTestSupport {
         exchange.getIn().setHeader("user", "Donald");
         assertExpression("Object user = message.getHeader('user'); return user != null ? 'User: ' + user : 'No user exists';",
                 "User: Donald");
+        assertExpression("var user = message.getHeader('user'); return user != null ? 'User: ' + user : 'No user exists';",
+                "User: Donald");
         exchange.getIn().removeHeader("user");
         assertExpression("Object user = message.getHeader('user'); return user != null ? 'User: ' + user : 'No user exists';",
                 "No user exists");