I'm looking over this code right now, from ModuleImpl:

    public Set<ContributionDef2>
getContributorDefsForService(ServiceDef serviceDef)
    {
        Set<ContributionDef2> result = CollectionFactory.newSet();

        for (ContributionDef next : moduleDef.getContributionDefs())
        {
            ContributionDef2 def = InternalUtils.toContributionDef2(next);

            if (serviceDef.getServiceId().equals(def.getServiceId()))
            {
                result.add(def);
            }
            else
            {
                Set<Class> markers = CollectionFactory.newSet(def.getMarkers());

                if (markers.contains(Local.class))
                {
                    if
(moduleDef.getServiceDef(serviceDef.getServiceId()) == null)
                        continue;

                    markers.remove(Local.class);
                }

                if (serviceDef.getMarkers().equals(markers)    // Why equals() ?
                        && serviceDef.getServiceInterface() ==
def.getServiceInterface())
                {
                    result.add(def);
                }
            }
        }

        return result;
    }


I think that's an error, comparing the services markers to the
contribution methods markers using equals().  I believe that should be
containsAll().  As in, the contribution method's annotations are a
super-set of the service's marker annotations.


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to