Return-Path: Delivered-To: apmail-tapestry-commits-archive@minotaur.apache.org Received: (qmail 37028 invoked from network); 6 Jan 2010 18:28:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Jan 2010 18:28:25 -0000 Received: (qmail 81816 invoked by uid 500); 6 Jan 2010 18:28:24 -0000 Delivered-To: apmail-tapestry-commits-archive@tapestry.apache.org Received: (qmail 81744 invoked by uid 500); 6 Jan 2010 18:28:24 -0000 Mailing-List: contact commits-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tapestry.apache.org Delivered-To: mailing list commits@tapestry.apache.org Received: (qmail 81733 invoked by uid 99); 6 Jan 2010 18:28:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jan 2010 18:28:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jan 2010 18:28:15 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AA562234C052 for ; Wed, 6 Jan 2010 10:27:54 -0800 (PST) Message-ID: <1157725871.73251262802474696.JavaMail.jira@brutus.apache.org> Date: Wed, 6 Jan 2010 18:27:54 +0000 (UTC) From: "Howard M. Lewis Ship (JIRA)" To: commits@tapestry.apache.org Subject: [jira] Closed: (TAP5-927) Cannot use Scala for Tapestry IOC Modules In-Reply-To: <516677101.1258031799563.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/TAP5-927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship closed TAP5-927. ------------------------------------- Resolution: Fixed Fix Version/s: 5.2.0 Any method who names starts with '$' is now ignored. > Cannot use Scala for Tapestry IOC Modules > ----------------------------------------- > > Key: TAP5-927 > URL: https://issues.apache.org/jira/browse/TAP5-927 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-ioc > Affects Versions: 5.1.0.5 > Reporter: Philip Lopez > Assignee: Howard M. Lewis Ship > Priority: Minor > Fix For: 5.2.0 > > > Scala (as of 2.7.7) adds a public method $tag() to classes. It's not particularly pretty (and $tag() is apparently deprecated) but it's there. (See http://programming-scala.labs.oreilly.com/ch14.html#CommandLineToolDecompilers) > The (new, in 5.1.0.x) checks in org.apache.tapestry5.ioc.internal.DefaultModuleDefImp mean that a module implemented in Scala throws an exception on load: > java.lang.RuntimeException: Module class contains unrecognized public methods: public static final int .$tag() throws java.rmi.RemoteException. > It would be nice to have a way to work around this so that Scala could be used with Tapestry IOC 5.1.0.x (including Modules). One generic approach may be to have an @IgnoredPublicMethods annotation applicable to Module classes that took an array of Strings that named methods that should also be removed from the "methods" set before checking whether there are superfluous public methods. Of course, there's always the hard-code exception too (ugly but a lot less "investment" for this pesky incompatibility). > As an example, the following article describes Scala and Tapestry: http://fanf42.blogspot.com/2009/02/tapestry-5-scala-view-article-in-html.html. If you checkout the git project and update the Tapestry release version to 5.1.0.5, you'll see it fail, where in 5.0.x it worked. > The relevant code is: > 109 // Want to verify that every public method is meaningful to Tapestry IoC. Remaining methods might > 110 // have typos, i.e., "createFoo" that should be "buildFoo". > 111 > 112 Set methods = CollectionFactory.newSet(moduleClass.getMethods()); > 113 > 114 methods.removeAll(OBJECT_METHODS); > 115 > 116 boolean modulePreventsServiceDecoration = moduleClass.getAnnotation(PreventServiceDecoration.class) != null; > 117 > 118 grind(methods, modulePreventsServiceDecoration); > 119 bind(methods, modulePreventsServiceDecoration); > 120 > 121 if (methods.isEmpty()) return; > 122 > 123 throw new RuntimeException(String.format("Module class %s contains unrecognized public methods: %s.", > 124 moduleClass.getName(), > 125 InternalUtils.joinSorted(methods))); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.