Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #7613 Override Configurations.add(Configuration) #7631

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ public Configurations(Configurations classlist)
.map(c -> c.getClass().getName())
.toArray(String[]::new));
}

@Override
public boolean add(Configuration configuration)
{
return addConfiguration(configuration);
}

public void add(Configuration... configurations)
{
Expand Down Expand Up @@ -428,7 +434,7 @@ public Iterator<Configuration> iterator()
return getConfigurations().iterator();
}

private void addConfiguration(Configuration configuration)
private boolean addConfiguration(Configuration configuration)
{
String name = configuration.getClass().getName();
// Is this configuration known?
Expand Down Expand Up @@ -462,14 +468,14 @@ private void addConfiguration(Configuration configuration)
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
Expand Down