Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add the ability to turn off automatic derivation of Aliases for custom parsers. [SPR-12643] #17244
We (The Shibboleth team), just rolled out a new version based on Spring 4.1.3 and a customer has tripped over an unfortunate side effect of the use of the attribute name=”whatever” as an alias for the bean.
We make extensive use of custom schema parsing and in one such schema we have a specific use for an attribute “name”. It is in the nature of this attribute that the value (which is not used as a bean, but as an on-the-wire string) will have the same value as a different spring bean id.
The net result is that after our custom parser has done its stuff, AbstractBeanDefinitionParser#parse comes along an unconditionally pulls the content of the attribute called “name” and makes an alias.
This alias then tramples on the different bean definition with that id.
Things then rapidly deteriorate at this stage.
We have “fixed” this by overriding the method “registerBeanDefinition” in our parser:
But this is ugly and makes more use of internal knowledge than we’d like.
I can provide example code if you want, or even a proposed patch. Or you might like to see our workaround in situ at
1 votes, 4 watchers