Avoid "Illegal Capacity" error, if number of hiddenActions > actions

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7956 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-01-09 14:30:46 +00:00
parent 99544b86fa
commit aafc95b78f

View File

@@ -293,8 +293,7 @@ public class ActionsConfigElement extends ConfigElementAdapter
public Iterator<String> iterator()
{
// create a list of the visible actions and return it's iterator
ArrayList<String> visibleActions = new ArrayList<String>(
this.actions.size() - this.hiddenActions.size());
ArrayList<String> visibleActions = new ArrayList<String>(this.actions.size());
for (String actionId : this.actions)
{
if (this.hiddenActions.contains(actionId) == false)
@@ -303,6 +302,8 @@ public class ActionsConfigElement extends ConfigElementAdapter
}
}
visibleActions.trimToSize();
return visibleActions.iterator();
}