Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 51308 invoked from network); 1 Sep 2006 21:34:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Sep 2006 21:34:19 -0000 Received: (qmail 78047 invoked by uid 500); 1 Sep 2006 21:34:18 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 78010 invoked by uid 500); 1 Sep 2006 21:34:18 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 78001 invoked by uid 99); 1 Sep 2006 21:34:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2006 14:34:18 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [68.142.198.204] (HELO smtp105.sbc.mail.mud.yahoo.com) (68.142.198.204) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 01 Sep 2006 14:34:17 -0700 Received: (qmail 55971 invoked from network); 1 Sep 2006 21:33:56 -0000 Received: from unknown (HELO ?127.0.0.1?) (ddebrunner@sbcglobal.net@75.24.104.226 with plain) by smtp105.sbc.mail.mud.yahoo.com with SMTP; 1 Sep 2006 21:33:55 -0000 Message-ID: <44F8A73D.2090105@apache.org> Date: Fri, 01 Sep 2006 14:33:49 -0700 From: Daniel John Debrunner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en, de MIME-Version: 1.0 To: derby-dev Subject: GRANT/REVOKE - unneeded complexity in PrivilegeNode?? X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N In reviewing the patch for DERBY-1686 I cam across this code. class PrivilegeNode method bind( HashMap dependencies, List grantees ) if( dependencyProvider != null) { if( dependencies.get( dependencyProvider) == null) { getCompilerContext().createDependency( dependencyProvider); dependencies.put( dependencyProvider, dependencyProvider); } } The dependencyProvider is driven from the objectOfPrivilege of which there is one in PrivilegeNode. So the questions are: 1) Since bind() is called once for PrivilegeNode how can there ever be anything in the HashMap? 2) Since the dependency manager happily copes with object being dependent on the same item multiple times, why does this code even exist? If there's no good reason for it then I'll clean it up. Dan.