tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Lewis Ship <hls...@gmail.com>
Subject Service contributions via markers
Date Tue, 06 Jul 2010 22:20:16 GMT
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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message