You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by GitBox <gi...@apache.org> on 2020/03/18 18:17:47 UTC
[GitHub] [felix-dev] stbischof opened a new pull request #10: [converter]
handle default methods - FELIX-6239
stbischof opened a new pull request #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10
https://issues.apache.org/jira/browse/FELIX-6239
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] stbischof commented on a change in pull request #10:
[converter] handle default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
stbischof commented on a change in pull request #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10#discussion_r398522828
##########
File path: converter/converter/src/main/java/org/osgi/util/converter/ConvertingImpl.java
##########
@@ -810,6 +813,32 @@ public Object invoke(Object proxy, Method method, Object[] args)
if (cls.isAnnotation()) {
val = method.getDefaultValue();
}
+ else if (method.isDefault())
+ {
+ double javaVersion = Double.parseDouble(
+ System.getProperty("java.class.version"));
+ double java8 = 52.0;
+ if (javaVersion > java8)
Review comment:
Yes. I didn't found one way that works in 8 and 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] bosschaert merged pull request #10: [converter] handle
default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
bosschaert merged pull request #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] bosschaert commented on a change in pull request #10:
[converter] handle default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
bosschaert commented on a change in pull request #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10#discussion_r397712849
##########
File path: converter/converter/src/main/java/org/osgi/util/converter/ConvertingImpl.java
##########
@@ -810,6 +813,32 @@ public Object invoke(Object proxy, Method method, Object[] args)
if (cls.isAnnotation()) {
val = method.getDefaultValue();
}
+ else if (method.isDefault())
+ {
+ double javaVersion = Double.parseDouble(
+ System.getProperty("java.class.version"));
+ double java8 = 52.0;
+ if (javaVersion > java8)
Review comment:
So invoking default methods is different for Java 8 and 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] stbischof commented on issue #10: [converter] handle
default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
stbischof commented on issue #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10#issuecomment-604400975
Each way works only with one. 8 oder 9+.
The most information i found about this topic are there.
https://stackoverflow.com/questions/22614746/how-do-i-invoke-java-8-default-methods-reflectively/23990827
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] bosschaert commented on issue #10: [converter] handle
default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
bosschaert commented on issue #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10#issuecomment-604405005
Thanks @stbischof I've merged your change.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] bosschaert commented on issue #10: [converter] handle
default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
bosschaert commented on issue #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10#issuecomment-603736594
The PR looks good to me, I just find it surprising that there seems to be special code for just Java 8... Can the Java 8 code not use the MethodHandles approach?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] stbischof edited a comment on issue #10: [converter]
handle default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
stbischof edited a comment on issue #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10#issuecomment-604400975
Each way works only with one. 8 oder 9+.
The most information i found about this topic are there.
https://stackoverflow.com/questions/22614746/how-do-i-invoke-java-8-default-methods-reflectively/23990827
Would be happy to find a better way that works.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [felix-dev] bosschaert commented on issue #10: [converter] handle
default methods - FELIX-6239
Posted by GitBox <gi...@apache.org>.
bosschaert commented on issue #10: [converter] handle default methods - FELIX-6239
URL: https://github.com/apache/felix-dev/pull/10#issuecomment-614627240
@stbischof is there more work needed or can https://issues.apache.org/jira/browse/FELIX-6239 be marked as resolved?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services