Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
I keep coming across badly written ObjectFactory classes which assume that the first parameter is a Reference and therefore always cast to this without doing an instance of check first. These are badly behaved and crummy, but it seems quite pervasive in the world of JNDI, which might have something to do with the lack of understanding people have of JNDI given it is poorly documented.
So far I've managed to get the poorly written ObjectFactories fixed, but this is such a common pattern I've raised a spec bug in the OSGi alliance to provide a way to "opt-out" of the phase that causes most problems. I'm raising this to prototype a fix.
I'm proposing (well about to commit) a fix that means an ObjectFactory with a property called aries.object.factory.requires.refernece set to Boolean.TRUE will not be called if the first parameter is not a Reference.