You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/10/26 03:51:40 UTC

[GitHub] [skywalking] wu-sheng opened a new pull request #8005: Support JDK 16 and 17.

wu-sheng opened a new pull request #8005:
URL: https://github.com/apache/skywalking/pull/8005


   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/CHANGES.md).
   
   Since JDK16, JDK requires `--add-opens java.base/java.lang=ALL-UNNAMED` to work. In this change, I add a version sensitive mechanism to adopt different Javassist API to avoid this break.
   Meanwhile, OAL engine doesn't support OALDefine to override the package name. All classes are generated in default packages only.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8005: Support JDK 16 and 17.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8005:
URL: https://github.com/apache/skywalking/pull/8005#discussion_r736136169



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/MeterSystem.java
##########
@@ -230,7 +234,11 @@ public MeterSystem(final ModuleManager manager) {
 
         Class targetClass;
         try {
-            targetClass = metricsClass.toClass(MeterSystem.class.getClassLoader(), null);
+            if (JVMEnvUtil.version() < 9) {

Review comment:
       Let me check how Apache commons do.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8005: Support JDK 16 and 17.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8005:
URL: https://github.com/apache/skywalking/pull/8005#discussion_r736194732



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/MeterSystem.java
##########
@@ -230,7 +234,11 @@ public MeterSystem(final ModuleManager manager) {
 
         Class targetClass;
         try {
-            targetClass = metricsClass.toClass(MeterSystem.class.getClassLoader(), null);
+            if (JVMEnvUtil.version() < 9) {

Review comment:
       Fixed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #8005: Support JDK 16 and 17.

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #8005:
URL: https://github.com/apache/skywalking/pull/8005#discussion_r736130036



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/MeterSystem.java
##########
@@ -230,7 +234,11 @@ public MeterSystem(final ModuleManager manager) {
 
         Class targetClass;
         try {
-            targetClass = metricsClass.toClass(MeterSystem.class.getClassLoader(), null);
+            if (JVMEnvUtil.version() < 9) {

Review comment:
       Consider using `org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng merged pull request #8005: Support JDK 16 and 17.

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #8005:
URL: https://github.com/apache/skywalking/pull/8005


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8005: Support JDK 16 and 17.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8005:
URL: https://github.com/apache/skywalking/pull/8005#discussion_r736131100



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/MeterSystem.java
##########
@@ -230,7 +234,11 @@ public MeterSystem(final ModuleManager manager) {
 
         Class targetClass;
         try {
-            targetClass = metricsClass.toClass(MeterSystem.class.getClassLoader(), null);
+            if (JVMEnvUtil.version() < 9) {

Review comment:
       I am not sure only JVM9 matters. This was JDK 16+, but after testing, new style works for jdk9+, so I changed to this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #8005: Support JDK 16 and 17.

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #8005:
URL: https://github.com/apache/skywalking/pull/8005#discussion_r736131597



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/MeterSystem.java
##########
@@ -230,7 +234,11 @@ public MeterSystem(final ModuleManager manager) {
 
         Class targetClass;
         try {
-            targetClass = metricsClass.toClass(MeterSystem.class.getClassLoader(), null);
+            if (JVMEnvUtil.version() < 9) {

Review comment:
       I mean to use an existing API instead of writing an untested util class




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org