Hi there,
while testing and later refactoring (issue) Module.getExtensions()
I found that we provide the setter Module.setExtensions()
which is never used in openmrs-core and actually overwrites the logic in Module.getExtensions()
which creates the Extension
classes based on the modules config.xml extension entries like for example in the reporting module
<extension>
<point>org.openmrs.admin.list</point>
<class>org.openmrs.module.web.extension.ManageAdminListExt</class>
</extension>
I feel like this might have been an oversight, or an auto-generated setter. When a module is loaded the ModuleFileParser.parse()
creates a Module
instance and sets the extensionNames
which is a simple map representing the above xml extension elements. When one calls module.getExtensions()
actual instances of the extension classes defined in the config.xml are created and stored.
However, it is possible to override this logic afterwards with module.setExtensions()
. I wonder if this is intentional.
What do you think?