Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 20560 invoked from network); 17 Oct 2007 09:09:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Oct 2007 09:09:10 -0000 Received: (qmail 93751 invoked by uid 500); 17 Oct 2007 09:08:57 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 93740 invoked by uid 99); 17 Oct 2007 09:08:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 02:08:57 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [212.224.30.66] (HELO service-01.spree.de) (212.224.30.66) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 09:09:01 +0000 Received: from [172.16.1.21] (rhein.spree.de [172.16.1.21]) (authenticated bits=0) by service-01.spree.de (8.13.4/8.13.4/Debian-3) with ESMTP id l9H98cwS029613 for ; Wed, 17 Oct 2007 11:08:39 +0200 Message-ID: <4715D116.3080900@spree.de> Date: Wed, 17 Oct 2007 11:08:38 +0200 From: Michael Bouschen Organization: Tech@Spree Engineering User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: jdo-dev@db.apache.org Subject: Re: VOTE: change signatures for Java5; deprecate uncooperative APIs References: <79C3BD90-C070-4BDB-90C5-4ECECF055227@SUN.com> In-Reply-To: <79C3BD90-C070-4BDB-90C5-4ECECF055227@SUN.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Craig, it might be too late now, but here is my +1. Regards Michael > This is from the discussion in > https://issues.apache.org/jira/browse/JDO-538 > > It turns out that there are some uncooperative methods (those that > have a boolean parameter as the second parameter) that don't easily > migrate to Java 5 syntax. > > Please vote: > > +1 add new methods that move the boolean parameter to be first and > change the Object[ ] to Object...; deprecate the uncooperative methods > > -1 keep the uncooperative methods as they are > > This vote will end on Monday. Here's the discussion. > > The compiler only autoboxes if the signature is one of the new > variable-arity signatures. I took a closer look and found these > signatures that can be changed to autobox, simply by changing the > signature from [ ] to ... > > The implementation would need to change the signature of the > implementing class but no other changes would be needed (the type of > the argument inside the method remains e.g. Object[ ]). > > In PersistenceManager, these methods can be redefined to use > variable-arity: > > void deletePersistentAll (Object[] pcs); > T[] detachCopyAll (T[] pcs); > void evictAll (Object[] pcs); > Object[] getObjectsById (Object[] oids, boolean validate); > void makeNontransactionalAll (Object[] pcs); > T[] makePersistentAll (T[] pcs); > void makeTransactionalAll (Object[] pcs); > void makeTransientAll (Object[] pcs); > void makeTransientAll (Object[] pcs, boolean useFetchPlan); > void retrieveAll (Object[] pcs, boolean useFetchPlan); > void retrieveAll (Object[] pcs); > > In Query: > long deletePersistentAll (Object[] parameters); > Object executeWithArray (Object[] parameters); > > One more issue. Variable-arity only works if the variable part is the > last argument. So we either have to reorder the arguments or just not > modify the signature for the methods with extra arguments. So we either: > > 1. Add new signatures, e.g. > void makeTransientAll (boolean useFetchPlan, Object... pcs); > void makeTransientAll (boolean useFetchPlan, Object... pcs); > void retrieveAll (boolean useFetchPlan, Object... pcs); > 2. Don't change the signatures for these methods: > Object[] getObjectsById (Object[] oids, boolean validate); > void makeTransientAll (Object[] pcs, boolean useFetchPlan); > void retrieveAll (Object[] pcs, boolean useFetchPlan); > > > Craig Russell > Architect, Sun Java Enterprise System http://java.sun.com/products/jdo > 408 276-5638 mailto:Craig.Russell@sun.com > P.S. A good JDO? O, Gasp! > -- Tech@Spree Engineering GmbH Tel.: +49/(0)30/235 520-33 Buelowstr. 66 Fax.: +49/(0)30/217 520-12 10783 Berlin mailto:mbo.tech@spree.de Geschaeftsfuehrung: Anna-Kristin Proefrock Sitz Berlin, Amtsgericht Charlottenburg, HRB 564 52