[Checkers] Framework Change Request
mahmood at MIT.EDU
Wed Apr 23 13:44:46 EDT 2008
> Here's what I opted for instead --
> it's very low impact (in terms of patch size) but also probably less
> effective (in terms of performance boost) than what you've proposed:
> - add a cache to AnnotatedTypeFactory that maps Trees to TreePaths
I don't think that such cache is necessary beneficial. fromExpression
and getAnnotatedType is called on expression trees almost only once,
and on class, method, and field trees multiple times but they would be
calculated only once (due to caching).
I believe that we only need to know the current tree path only.
> I really like your idea better from a design standpoint, though it
> might be a pain to use in some places -- we're not always calling
> getAnnotatedType() in a place where the path is readily available
> (TypeFromTree?), and sometimes even in visitors we call it on a child
> of the current path (e.g., node.getExpression() in visitMemberSelect),
> in which case the path needs to be extended.
Agreed. I just realized that changing the interface would complicate
the client code. It is quite annoying to construct TreePaths all the
More information about the checkers