karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stuart McCulloch (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-4184) ArgumentCompleter has incorrect check for enum type
Date Wed, 09 Dec 2015 19:31:11 GMT
Stuart McCulloch created KARAF-4184:

             Summary: ArgumentCompleter has incorrect check for enum type
                 Key: KARAF-4184
                 URL: https://issues.apache.org/jira/browse/KARAF-4184
             Project: Karaf
          Issue Type: Bug
          Components: karaf-shell
    Affects Versions: 4.0.3
            Reporter: Stuart McCulloch

if (type.isAssignableFrom(Enum.class)) {
should really be:
if (type.isEnum()) {
because otherwise the only time that branch will be taken is when 'type' is exactly Enum.class
or a superclass, as per the spec of isAssignableFrom. It won't be taken when the field is
a concrete enum class with actual values.

If you want to stick with "isAssignableFrom" then the Enum check should be:
if (Enum.class.isAssignableFrom(type)) {

This message was sent by Atlassian JIRA

View raw message