db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject GRANT/REVOKE - unneeded complexity in PrivilegeNode??
Date Fri, 01 Sep 2006 21:33:49 GMT

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.


Mime
View raw message