Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 863701876B for ; Wed, 9 Dec 2015 19:31:11 +0000 (UTC) Received: (qmail 29363 invoked by uid 500); 9 Dec 2015 19:31:11 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 29336 invoked by uid 500); 9 Dec 2015 19:31:11 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 29284 invoked by uid 99); 9 Dec 2015 19:31:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2015 19:31:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2FEA82C1F79 for ; Wed, 9 Dec 2015 19:31:11 +0000 (UTC) Date: Wed, 9 Dec 2015 19:31:11 +0000 (UTC) From: "Stuart McCulloch (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (KARAF-4184) ArgumentCompleter has incorrect check for enum type MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 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 https://github.com/apache/karaf/blob/karaf-4.0.3/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ArgumentCompleter.java#L180 {code} if (type.isAssignableFrom(Enum.class)) { {code} should really be: {code} if (type.isEnum()) { {code} 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: {code} if (Enum.class.isAssignableFrom(type)) { {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)