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 9DEF2FDDF for ; Mon, 15 Dec 2014 05:26:13 +0000 (UTC) Received: (qmail 2524 invoked by uid 500); 15 Dec 2014 05:26:13 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 2479 invoked by uid 500); 15 Dec 2014 05:26:13 -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 2467 invoked by uid 99); 15 Dec 2014 05:26:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2014 05:26:13 +0000 Date: Mon, 15 Dec 2014 05:26:13 +0000 (UTC) From: =?utf-8?Q?Jean-Baptiste_Onofr=C3=A9_=28JIRA=29?= To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (KARAF-2508) make osgi:find-class a more useful command MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-2508?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Onofr=C3=A9 updated KARAF-2508: ---------------------------------------- Fix Version/s: (was: 2.4.1) 2.4.2 > make osgi:find-class a more useful command > ------------------------------------------ > > Key: KARAF-2508 > URL: https://issues.apache.org/jira/browse/KARAF-2508 > Project: Karaf > Issue Type: Improvement > Components: karaf-shell > Affects Versions: 2.3.3 > Reporter: Amichai Rothman > Assignee: Jean-Baptiste Onofr=C3=A9 > Priority: Minor > Fix For: 4.0.0, 3.0.3, 2.4.2 > > > I recently had to track down which bundle contains a certain class, and f= ound the find-class command wanting. A few simple improvements would make i= t much more useful: > 1. Add an --exact/-e option which doesn't automatically add asterisks at = both ends of the string. In my case I was looking for the javax.jms.Connect= ion class, and since the search is only on the last part of the name, this = returned all classes in all packages which have the word Connection in thei= r name, which added up to hundreds of results. with --exact I could look fo= r what I want exactly, or choose to add asterisks at one or both ends expli= citly in the search string if I wanted to. > 2. Add a --local/-l option which adds BundleWiring.LISTRESOURCES_LOCAL to= the listResources method call bitmask. With the current implementation, it= returns both bundles containing the given class name and classes that impo= rt it from other bundles, which is useful in some cases. But with the --loc= al option it could show only the bundles that actually contain the class (w= hether exported or not, unlike the exports command), which is far more usef= ul in tracking down some classloading issues. > 3. Add the bundle ID (at least) on the beginning of every printed line. T= his makes it amenable to grepping (without it a grep loses all bundle infor= mation, which is the whole point of using this command). > 4. As a somewhat more complex alternative to #3, it would be nice if you = could specify a fully qualified class name and not only the last part of th= e name. The command can split the search string around periods, pass the la= st part to listResources, then internally grep/match the full name. That wo= uld make it truly flexible in finding classes. Asterisks would have to be t= reated accordingly. > I think adding these options (#1-#3 are trivial implementations), or at l= east some of them, would make the command extremely useful when performing = classloading diagnosis. -- This message was sent by Atlassian JIRA (v6.3.4#6332)