You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stefan Bischof (Jira)" <ji...@apache.org> on 2020/03/09 19:32:00 UTC

[jira] [Created] (FELIX-6238) Convert to Interface without methods without Exception

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 org.osgi.util.converter@1.0.1/org.osgi.util.converter.ConvertingImpl.to(ConvertingImpl.java:212)
 at org.osgi.util.converter@1.0.1/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:176)
 at org.osgi.util.converter@1.0.1/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:139)
 at org.osgi.util.converter@1.0.1/org.osgi.util.converter.ConvertingImpl.convertMapEntryToSingleValue(ConvertingImpl.java:260)
 at org.osgi.util.converter@1.0.1/org.osgi.util.converter.ConvertingImpl.to(ConvertingImpl.java:197)
 at org.osgi.util.converter@1.0.1/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:176)
 at org.osgi.util.converter@1.0.1/org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:139)
 
{code}
 



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