Stefan Bischof created FELIX-6238:
-------------------------------------

             Summary: Convert to Interface without methods without Exception
                 Key: FELIX-6238
                 URL: https://issues.apache.org/jira/browse/FELIX-6238
             Project: Felix
          Issue Type: Bug
          Components: Converter
            Reporter: Stefan Bischof


 

Converter should Convert to an Interface without methods without Exception

Example
{code:java}
public interface I
{
}{code}
 
{code:java}
 I i = Converters.standardConverter()
                 .convert(Map.of("a", "b"))
                 .to(I.class);{code}

throws Exception:
{code:java}
org.osgi.util.converter.ConversionException: Cannot convert a to interface 
org.apache.felix.atomos.substrate.core.I
 at 
[email protected]/org.osgi.util.converter.ConvertingImpl.to(ConvertingImpl.java:212)
 at 
[email protected]/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:176)
 at 
[email protected]/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:139)
 at 
[email protected]/org.osgi.util.converter.ConvertingImpl.convertMapEntryToSingleValue(ConvertingImpl.java:260)
 at 
[email protected]/org.osgi.util.converter.ConvertingImpl.to(ConvertingImpl.java:197)
 at 
[email protected]/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:176)
 at 
[email protected]/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:139)
 
{code}
 



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

Reply via email to