|
From: Rod J. <rod...@in...> - 2004-05-25 07:31:41
|
> >- Constants that define a full object. We have a number of those, for example ClassFilters.TRUE and AdvisedSupport.EMPTY_TARGET_SOURCE. I've tried for quite a while, but I haven't been able to figure out a way to define such constants such that they will be garbage collected. Juergen Good detective work! As you say, I don't think there's any real issue now, especially when you consider other libraries. Surely the amount of leakage in hot deployment scenarios with the constants is going to be tiny... And Hibernate, CGLIB et al will account for way more issues. Is it correct to assume that problem scenarios in development are now unlikely? Maintaining canonical instances is good style IMHO. However, if you do have a list of those you detected, please send it to me. (I expect they're mainly in my code.) Some of them could be changed fairly easily: for example, a null pointcut could have the same effect as Pointcut.TRUE. I'd like to take a look when I have time (2-3 weeks) and see if it's appropriate to change some or all of them. HOWEVER, such a change would be effectively a public API change in some cases. I don't imagine too many people use the canonical pointcut and ClassFilter instances (because it's not really necessary in those cases), but they _are_ public. EMPTY_TARGET_SOURCE doesn't really have such a problem. That can be changed easily, and I've thought of doing it once or twice. It can just be promoted to a package-level class, and a new instance could be created for each AdvisedSupport, as the class itself is trivial. Rgds Rod |