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 2021/12/24 09:35:21 UTC

[camel] branch main updated (d223513 -> c637417)

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

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


    from d223513  CAMEL-17329: drop JDK8
     new 987b9c3  CAMEL-17329: Drop Java 8 and set source/target to Java 11
     new c637417  CAMEL-17329: Drop Java 8 - camel-printer uses sun.awt code changed to reflection

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/component/printer/PrinterPrintTest.java      | 18 +++++++++++++-----
 pom.xml                                                |  5 ++++-
 2 files changed, 17 insertions(+), 6 deletions(-)

[camel] 02/02: CAMEL-17329: Drop Java 8 - camel-printer uses sun.awt code changed to reflection

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c6374172b32f65ffd1170f68936bec7b77ae9156
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 24 10:34:02 2021 +0100

    CAMEL-17329: Drop Java 8 - camel-printer uses sun.awt code changed to reflection
---
 .../camel/component/printer/PrinterPrintTest.java      | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java b/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java
index 56255fb..b4b28e1 100644
--- a/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java
+++ b/components/camel-printer/src/test/java/org/apache/camel/component/printer/PrinterPrintTest.java
@@ -69,7 +69,7 @@ public class PrinterPrintTest extends CamelTestSupport {
     }
 
     @AfterEach
-    public void tearDown() {
+    public void tearDown() throws Exception {
         restoreJavaPrint();
     }
 
@@ -407,9 +407,13 @@ public class PrinterPrintTest extends CamelTestSupport {
 
     protected void setupJavaPrint() throws Exception {
         // save the current print services
-        printServiceLookup = sun.awt.AppContext.getAppContext().get(printServiceLookupServicesClass);
+        Class<?> clazz = context.getClassResolver().resolveClass("sun.awt.AppContext");
+        Object ac = clazz.getMethod("getAppContext").invoke(null);
+        printServiceLookup = clazz.getMethod("get", Object.class).invoke(ac, printServiceLookupServicesClass);
+
         // setup a new empty list of printer services
-        sun.awt.AppContext.getAppContext().put(printServiceLookupServicesClass, null);
+        clazz.getMethod("put", Object.class, Object.class).invoke(ac, printServiceLookupServicesClass, null);
+
         Method method = PrintServiceLookup.class.getDeclaredMethod("initListOfLookupServices");
         method.setAccessible(true);
         method.invoke(null);
@@ -432,9 +436,13 @@ public class PrinterPrintTest extends CamelTestSupport {
         PrintServiceLookup.registerServiceProvider(psLookup);
     }
 
-    protected void restoreJavaPrint() {
+    protected void restoreJavaPrint() throws Exception {
         // restore print services
-        sun.awt.AppContext.getAppContext().put(printServiceLookupServicesClass, printServiceLookup);
+        if (printServiceLookup != null) {
+            Class<?> clazz = context.getClassResolver().resolveClass("sun.awt.AppContext");
+            Object ac = clazz.getMethod("getAppContext").invoke(null);
+            clazz.getMethod("put", Object.class, Object.class).invoke(ac, printServiceLookupServicesClass, printServiceLookup);
+        }
     }
 
 }

[camel] 01/02: CAMEL-17329: Drop Java 8 and set source/target to Java 11

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 987b9c3c3d560aa3ffddba7fdbb0cf884b8fa84e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 24 09:50:42 2021 +0100

    CAMEL-17329: Drop Java 8 and set source/target to Java 11
---
 pom.xml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 46e2b0c..110cc84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,9 +109,12 @@
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
         <site-repo-url>scpexe://people.apache.org/www/camel.apache.org/maven/</site-repo-url>
-        <jdk.version>1.8</jdk.version>
+        <jdk.version>11</jdk.version> <!-- TODO: deprecate use maven.compiler.xxx instead -->
         <compiler.fork>false</compiler.fork>
 
+        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>11</maven.compiler.source>
+
         <!-- reproduceable builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
         <project.build.outputTimestamp>1</project.build.outputTimestamp>