[jira] [Commented] (FELIX-6239) Converter should be able to invoke default methods in Interfaces

2020-04-14 Thread A. J. David Bosschaert (Jira)


[ 
https://issues.apache.org/jira/browse/FELIX-6239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17083189#comment-17083189
 ] 

A. J. David Bosschaert commented on FELIX-6239:
---

The PR is merged. [~bisch...@jena.de] is there anything else to do or can we 
resolve this issue?

> Converter should be able to invoke default methods in Interfaces
> 
>
> Key: FELIX-6239
> URL: https://issues.apache.org/jira/browse/FELIX-6239
> Project: Felix
>  Issue Type: New Feature
>  Components: Converter
>Reporter: Stefan Bischof
>Priority: Minor
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Would be nice if Converter could invoke default methods in Interfaces.
> https://github.com/apache/felix-dev/blob/f4304bdea3fb9280ccc0b75dc97275125bc5cbfb/converter/converter/src/main/java/org/osgi/util/converter/ConvertingImpl.java#L807-L820
> I didn't found a proper way to invoke default methods <= and > Java 8.
> Test: 
> {code:java}
>  interface InterfaceWithDefault
>  {
>default String s()
>{
>  return "s";
> }
>  }
> @Test()
> public void testInterfaceWithDefault() throws Exception
> {
>InterfaceWithDefault i = Converters.standardConverter().convert(new 
> HashMap()).to(InterfaceWithDefault.class);
>assertEquals("s", i.s());
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FELIX-6239) Converter should be able to invoke default methods in Interfaces

2020-03-18 Thread A. J. David Bosschaert (Jira)


[ 
https://issues.apache.org/jira/browse/FELIX-6239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17061879#comment-17061879
 ] 

A. J. David Bosschaert commented on FELIX-6239:
---

[~bisch...@jena.de] wrote:

bq. I didn't found a proper way to invoke default methods <= and > Java 8.

Well they are only there after Java 8, so before Java 8 we don't need to do 
anything.
I guess this can be done via Java 8 reflection somehow...

> Converter should be able to invoke default methods in Interfaces
> 
>
> Key: FELIX-6239
> URL: https://issues.apache.org/jira/browse/FELIX-6239
> Project: Felix
>  Issue Type: New Feature
>  Components: Converter
>Reporter: Stefan Bischof
>Priority: Minor
>
> Would be nice if Converter could invoke default methods in Interfaces.
> https://github.com/apache/felix-dev/blob/f4304bdea3fb9280ccc0b75dc97275125bc5cbfb/converter/converter/src/main/java/org/osgi/util/converter/ConvertingImpl.java#L807-L820
> I didn't found a proper way to invoke default methods <= and > Java 8.
> Test: 
> {code:java}
>  interface InterfaceWithDefault
>  {
>default String s()
>{
>  return "s";
> }
>  }
> @Test()
> public void testInterfaceWithDefault() throws Exception
> {
>InterfaceWithDefault i = Converters.standardConverter().convert(new 
> HashMap()).to(InterfaceWithDefault.class);
>assertEquals("s", i.s());
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)