Skip to content

Commit

Permalink
Issue #2985 further changes requested in pr
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Bartel <janb@webtide.com>
  • Loading branch information
janbartel committed Oct 17, 2018
1 parent 1312719 commit b4c75ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,10 @@ private void addConfiguration(Configuration configuration)
if(c.getClass().getName().equals(replaces.getName())
|| c.replaces()!=null && c.replaces().getName().equals(replaces.getName()))
{
i.set(configuration);
return;
i.remove();
break;
}
}

_configurations.add(configuration);
return;
}

//check if any existing configurations replace the one we're adding
Expand All @@ -424,6 +421,7 @@ private void addConfiguration(Configuration configuration)
if (c.getClass().getName().equals(configuration.getClass().getName()))
return; //don't add same one twice
}

_configurations.add(configuration);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void testTransitiveReplacements () throws Exception
ConfigFoo.class.getName()
);

configs.add(ConfigDick.class.getName());
configs.add(ReplacementDick.class.getName());
configs.sort();

assertThat(configs.stream().map(c->c.getClass().getName()).collect(toList()),
Expand All @@ -226,14 +226,14 @@ public void testTransitiveReplacements () throws Exception
ConfigZ.class.getName(),
ConfigTom.class.getName(),
AnotherReplacementDick.class.getName(),
ConfigDick.class.getName(),
ConfigHarry.class.getName(),
ConfigAdditionalHarry.class.getName()
));

assertThat(configs.stream().map(c->c.getClass().getName()).collect(toList()),
not(contains(
ReplacementDick.class.getName()
ReplacementDick.class.getName(),
ConfigDick.class.getName()
)));
}

Expand Down

0 comments on commit b4c75ec

Please sign in to comment.