Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x

This commit is contained in:
Jan Bartel 2022-02-22 10:56:10 +01:00
commit 28aaa44a22
1 changed files with 10 additions and 4 deletions

View File

@ -266,6 +266,12 @@ public class Configurations extends AbstractList<Configuration> implements Dumpa
.toArray(String[]::new));
}
@Override
public boolean add(Configuration configuration)
{
return addConfiguration(configuration);
}
public void add(Configuration... configurations)
{
for (Configuration 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