List<ConfigurationImpl> resultList = new ArrayList<ConfigurationImpl>();
for (Iterator<ConfigurationImpl> it = configurations.values().iterator(); it.hasNext();) {
</BUG>
ConfigurationImpl config = it.next();
String otherFactoryPid = config.getFactoryPid();
<BUG>if (otherFactoryPid != null && otherFactoryPid.equals(factoryPid))

resultList.add(config);
}</BUG>
return resultList.toArray(new ConfigurationImpl[resultList.size()]);

List<ConfigurationImpl> resultList = new ArrayList<ConfigurationImpl>();
synchronized (this) {
resultList.addAll(configurations.values());
}
for (Iterator<ConfigurationImpl> it = resultList.iterator(); it.hasNext();) {
ConfigurationImpl config = it.next();
String otherFactoryPid = config.getFactoryPid();
if (otherFactoryPid == null || !otherFactoryPid.equals(factoryPid))
it.remove();
