David, I regret making my suggestion in the first place. I really think we need ephemerons, but for the sake of discussion:
- Your patch adds 2 new classes. My suggestion adds one method (maybe 2 for convenience). - Your approach enables explicit clearing, but I thought the whole point of adding this extension was to avoid explicit clearing. If you're going to explicitly clear, why do you need this functionality at all? If we want to support circular dependencies between class loaders, we should pursue ephemerons because your solution requires explicit clearing whereas ephemerons would not. - Say for example that I need a static map from Class to List<Method> (some filtered list of methods in Class). Your patch requires one WeakHashMap per Class. My suggestion requires only one map total and one lightweight data structure per ClassLoader. - Your patch forces users to use your data structure. My suggestion enables users to use whatever data structure they like. Your patch introduces a point of contention between completely orthogonal libraries. Mine introduces almost none (assuming you implement the internal data structure in a non-locking fashion). Bob