Change By: Emmanuel Bernard (04/Jun/13 3:18 PM)
Description: The following pseudo code scenario is expected to work but fails

{code}
//create some facet requests
//enable the facet requests

//select by facet1
Facet facet1 = facetManager.getFacets( facetGroupName1 ).get( 0 );
facetManager.getFacetGroup( facetGroupName1 ).selectFacets( facet1 );

Facet facet2 = facetManager.getFacets( facetGroupName2 ).get( 0 );
//select by facet2 that reduces facet1 count
facetManager.getFacetGroup( facetGroupName2 ).selectFacets( facet2 );

List<Facet> recomputedFacets = facetManager.getFacets( facetGroupName1 );
Facet almostFacet1 = facetManager.getFacets( facetGroupName1 ).get(0);
// Following test fails
assertTrue( facetManager.getFacetGroup( facetGroupName1 ).contains( almostFacet1 ) ); 
{code}

This is due to the fact that facet objects are different (between selected ones and recomputed ones) and that equals takes the count into account.

There are two possible fixes:
- 1.  replace selectedFacet with recomputed ones
- 2.  not take count as part of Facet's equality

I think 1. would be impractical especially since Facet reference can float around. So removing count from the equality seems best. However I don't fully understand why Facet.count was part of it in the first place
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira