Details
-
Bug
-
Resolution: Duplicate
-
High
-
None
-
6.2, 6.3
-
6.02
-
Description
During some tests for a Plugin in V1, I need to disable one of my plugin v1, and surprise I was not able to do it, since JIRA Plugin Manager raises the error "org.picocontainer.PicoCompositionException: Duplicate Keys not allowed. Duplicate for 'xxxx'".
I have finally made some tests wigth older versions ... It appears that I was not able to disable plugin V1 since JIRA 6.2.
I made some search in source code and found this ....
Before 6.2, the method *ComponentModuleDescriptor.unregisterComponents() *was :
public void unregisterComponents(final MutablePicoContainer container) { // Check that we have classloaded the interface if required. if (interfaceClazzName != null && interfaceClazz == null) { throw new PluginException("Cannot unregister component '" + interfaceClazzName + "' in plugin '" + getKey() + "' because we haven't loaded the class. This means that this plugin has not been successfully enabled."); } if (container.getComponentAdapter(interfaceClazz) != null) { container.unregisterComponent(interfaceClazz); } // TODO: Should this be in an else clause? It is probably harmless, but also pointless. container.unregisterComponent(getModuleClass()); }
Since 6.2, the method ComponentModuleDescriptor.unregisterComponents() is now :
public void unregisterComponents(final MutablePicoContainer container) { // Check that we have classloaded the interface if required. if (interfaceClazzName != null && interfaceClazz == null) { throw new PluginException("Cannot unregister component '" + interfaceClazzName + "' in plugin '" + getKey() + "' because we haven't loaded the class. This means that this plugin has not been successfully enabled."); } if (container.getComponentAdapter(interfaceClazz) != null) { container.removeComponent(interfaceClazz); } // TODO: Should this be in an else clause? It is probably harmless, but also pointless. container.addComponent(getModuleClass()); }
I did not invest more about the cause of this change (probably due to some change the Container), but it is strange that the last lien :
container.unregisterComponent(getModuleClass());
is replaced by
container.addComponent(getModuleClass());
It seems to be a wrong Copy/Paste !
Regards
Vincent
Attachments
Issue Links
- duplicates
-
JRASERVER-40539 Not able to disabled a plugin V1
- Closed