Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 78627 invoked from network); 12 Jan 2007 04:40:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jan 2007 04:40:35 -0000 Received: (qmail 67491 invoked by uid 500); 12 Jan 2007 04:40:39 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 67453 invoked by uid 500); 12 Jan 2007 04:40:39 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 67444 invoked by uid 99); 12 Jan 2007 04:40:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2007 20:40:39 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of alexey.v.varlamov@gmail.com designates 64.233.184.231 as permitted sender) Received: from [64.233.184.231] (HELO wr-out-0506.google.com) (64.233.184.231) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2007 20:40:30 -0800 Received: by wr-out-0506.google.com with SMTP id i31so486692wra for ; Thu, 11 Jan 2007 20:40:09 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=mLYE1Vp1Eavd17mnFnm19vnWWn3dFu4cd7jD8DUGqYIyoVicMTvxD+cVOCSTQyX14v2PD7EkQ8hgBG5yGZKG5Fg5sdgympBr1PkPyTjYd3eMTlJLi7L08Ic8D6XQ845Ue8jC3XdYm7dCni0QHUSWCES8hUBUytpQi75oIsqq8Ec= Received: by 10.65.251.2 with SMTP id d2mr201816qbs.1168576808885; Thu, 11 Jan 2007 20:40:08 -0800 (PST) Received: by 10.65.121.17 with HTTP; Thu, 11 Jan 2007 20:40:08 -0800 (PST) Message-ID: Date: Fri, 12 Jan 2007 10:40:08 +0600 From: "Alexey Varlamov" To: dev@harmony.apache.org Subject: Re: [vmi] Reflection support for generics In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4590F338.2050601@gmail.com> <4592525E.9020509@gmail.com> <16ACCAB9-8CA8-4354-B3F9-4A4AAF096671@pobox.com> X-Virus-Checked: Checked by ClamAV on apache.org 2007/1/12, Yang Paulex : > inline. > > 2007/1/11, Alexey Varlamov : > > > > Hello Paulex, > > > > Actually I thought about reversed order of steps, i.e. clean up impl > > first then move it. > > The point is that current impl is spaghetti-like, entangled with > > internals of kernel classes. The very 1st step I suggest to get rid of > > all o.a.h.l.reflect.** import clauses in j.l.Class except the Parser > > itself (currently there are 16(!) imported classes). After that we'll > > have more neat API and will better understand really needed > > dependencies. Please ask if you need any assistance, I'm happy to take > > part. > > > Sounds reasonable, so I'll look into the implementation now, and I'll raise > my thoughts here after then. OK, thank you. Good luck ;) [snip] > > The 2) looks reasonable, except I do not think one ever needs > > getSignature(AccessibleObject). Signatures of members are only needed > > as input parameters to the parser. > > And probably even getSignature(Class) is not needed, parser could do > > just with public reflection API - though I did not try to verify this > > speculation. So if the latter is true, we also have other option: > > > I did think the signature can be got by public API, but I didn't find it:(. That's right, the signature is specific to class file format and is not exposed anywhere. My speculation was it could be possible to go with recursive callbacks to public API instead of VMI extension, but it seems tricky to verify without going deeper into implementation details. So I'm OK with the 2) as it enables more impl freedom. > About the getSignature(AccessibleObject), it's needed by ConstructorData, > etc, but not by the reflection parser classes. I see, and my suggestion to sort out the parser first is still valid :) > > 3) Don't change VMI, export an API from classlib like this: > > Type o.a.h.l.reflect.GenericsParser.getType(String sig, Class owner); > > TypeVariable[] o.a.h.l.reflect.GenericsParser.getTypeParameters(String > > sig, Class owner); > > ... > > > I agree this is the objective:). > > As for sharing other classes like Class.GACache, > > Constructor.ConstructorData, it may also be reasonable but would > > certainly require further VMI extension. Let's do it step by step and > > manage the parser first. > > > So far I only found one more external dependency related to generics, i.e., > the VMGenericsAndAnnotations.getSignature(long), but as inner classes, maybe > they had some coupling with their wrapper classes. The inner classes also handle annotations and other reflection data so have other dependencies as well, though indeed not related to generics. But don't be confused by finding generics-related code in those classes, such code should belong to the parser actually - this is just an example of spaghetti-ness which I talked above. [snip] -- Alexey