karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-4693) shell:new issue with class wildcards
Date Mon, 05 Sep 2016 03:21:20 GMT

    [ https://issues.apache.org/jira/browse/KARAF-4693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15463965#comment-15463965
] 

ASF subversion and git services commented on KARAF-4693:
--------------------------------------------------------

Commit ea0149950fb405bf7f518f4638b4708ec35f6dd6 in karaf's branch refs/heads/master from [~paolo.antinori]
[ https://git-wip-us.apache.org/repos/asf?p=karaf.git;h=ea01499 ]

KARAF-4693 - shell:new, support for wildcards in generics


> shell:new issue with class wildcards
> ------------------------------------
>
>                 Key: KARAF-4693
>                 URL: https://issues.apache.org/jira/browse/KARAF-4693
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-shell
>    Affects Versions: 4.0.6
>            Reporter: Paolo Antinori
>            Assignee: Freeman Fang
>
> Karaf shell fails if you run this command:
> {code:none}a=shell:new java.util.ArrayList 2
> 2016-09-02 11:15:51,525 | ERROR | nsole user karaf | ShellUtil                      
 | 43 - org.apache.karaf.shell.core - 4.0.6 | Exception caught while executing command
> java.lang.IllegalStateException
> 	at org.apache.karaf.shell.support.converter.GenericType.parametersOf(GenericType.java:161)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.karaf.shell.support.converter.GenericType.[init](GenericType.java:53)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.karaf.shell.support.converter.GenericType.parametersOf(GenericType.java:154)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.karaf.shell.support.converter.GenericType.[init](GenericType.java:53)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.karaf.shell.commands.impl.NewAction.findMatchingConstructors(NewAction.java:167)[41:org.apache.karaf.shell.commands:4.0.6]
> 	at org.apache.karaf.shell.commands.impl.NewAction.execute(NewAction.java:89)[41:org.apache.karaf.shell.commands:4.0.6]
> 	at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[43:org.apache.karaf.shell.core:4.0.6]
> 	at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:274)[43:org.apache.karaf.shell.core:4.0.6]
> 	at java.lang.Thread.run(Thread.java:745)[:1.8.0_102]
> {code}
> The reason for that is not really that it can't handle generics but it the logic that
probe for the best matching constructor, that at some point, in this class:
> https://github.com/apache/karaf/blob/68bef0ced72a3fe192cfe496b3fff654b49b2377/shell/core/src/main/java/org/apache/karaf/shell/support/converter/GenericType.java#L161-L161
> sees {{type}} set to {{"? extends E"}} that is not able to handle, thus throwing the
blocking exception.
> It's enough to replace that exception with an empty return, to bypass the failing iteration
and have the command to succeed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message