You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Daniel John Debrunner <dj...@apache.org> on 2006/09/01 23:33:49 UTC

GRANT/REVOKE - unneeded complexity in PrivilegeNode??

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.