Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
parent
808b74ff34
commit
3d9f34696b
|
@ -265,6 +265,12 @@ public class Configurations extends AbstractList<Configuration> implements Dumpa
|
|||
.map(c -> c.getClass().getName())
|
||||
.toArray(String[]::new));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(Configuration configuration)
|
||||
{
|
||||
return addConfiguration(configuration);
|
||||
}
|
||||
|
||||
public void add(Configuration... configurations)
|
||||
{
|
||||
|
@ -428,7 +434,7 @@ public class Configurations extends AbstractList<Configuration> implements Dumpa
|
|||
return getConfigurations().iterator();
|
||||
}
|
||||
|
||||
private void addConfiguration(Configuration configuration)
|
||||
private boolean addConfiguration(Configuration configuration)
|
||||
{
|
||||
String name = configuration.getClass().getName();
|
||||
// Is this configuration known?
|
||||
|
@ -462,14 +468,14 @@ public class Configurations extends AbstractList<Configuration> implements Dumpa
|
|||
if (r != null)
|
||||
{
|
||||
if (r.getName().equals(configuration.getClass().getName()))
|
||||
return; //skip the addition, a replacement is already present
|
||||
return false; //skip the addition, a replacement is already present
|
||||
}
|
||||
|
||||
if (c.getClass().getName().equals(configuration.getClass().getName()))
|
||||
return; //don't add same one twice
|
||||
return false; //don't add same one twice
|
||||
}
|
||||
|
||||
_configurations.add(configuration);
|
||||
return _configurations.add(configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue