On Mon, Dec 13, 2010 at 17:25, Vincent Massol
<vincent(a)massol.net> wrote:
On Dec 13, 2010, at 5:16 PM, tmortagne (SVN) wrote:
Author: tmortagne
Date: 2010-12-13 17:16:56 +0100 (Mon, 13 Dec 2010)
New Revision: 33366
Modified:
platform/core/trunk/xwiki-component/xwiki-component-default/src/main/java/org/xwiki/component/embed/EmbeddableComponentManager.java
platform/core/trunk/xwiki-component/xwiki-component-default/src/test/java/org/xwiki/component/embed/EmbeddableComponentManagerTest.java
Log:
XWIKI-5792: ComponentManager#hasComponent does not work if the component has not already
been lookuped
Modified:
platform/core/trunk/xwiki-component/xwiki-component-default/src/main/java/org/xwiki/component/embed/EmbeddableComponentManager.java
===================================================================
---
platform/core/trunk/xwiki-component/xwiki-component-default/src/main/java/org/xwiki/component/embed/EmbeddableComponentManager.java
2010-12-13 16:03:58 UTC (rev 33365)
+++
platform/core/trunk/xwiki-component/xwiki-component-default/src/main/java/org/xwiki/component/embed/EmbeddableComponentManager.java
2010-12-13 16:16:56 UTC (rev 33366)
@@ -93,7 +93,7 @@
*/
public <T> boolean hasComponent(Class<T> role, String roleHint)
{
- return this.components.containsKey(new RoleHint<T>(role, roleHint));
+ return this.descriptors.containsKey(new RoleHint<T>(role, roleHint));
Isn't this what we used to have and you changed it because you wanted hasComponent to
return true if the component had been instantiated vs the component had been registered,
no?
No I would never do that, I actually remember that I fixed the same
thing already in other places ;)