Permalink
Browse files

replace newLinkedHashSet by an ImmutableSet.copyOf when returning com…

…ponents

as recommended by the documentation, these Sets are not supposed to be mutable anyway
  • Loading branch information...
xhanin committed Oct 10, 2014
1 parent da0a80d commit 7a82e6e5e9534e6c29888b0034bc555ad492c811
Showing with 2 additions and 2 deletions.
  1. +2 −2 restx-factory/src/main/java/restx/factory/Factory.java
@@ -448,7 +448,7 @@ public boolean isMandatory() {
return doFind();
}
public final Set<T> findAsComponents() {
return Sets.newLinkedHashSet(
return ImmutableSet.copyOf(
Iterables.transform(find(), NamedComponent.<T>toComponent()));
}
public abstract Set<Name<T>> findNames();
@@ -719,7 +719,7 @@ private Factory(boolean usedServiceLoader, Multimap<String, FactoryMachine> mach
// define a Machine to provide a default provider for MetricRegistry
// this won't be used if a MetricsRegistry is provided through a higher priority machine
.put("MetricRegistryMachine", new SingleNameFactoryMachine<>(10000,
new NoDepsMachineEngine<MetricRegistry>(METRICS_NAME, BoundlessComponentBox.FACTORY) {
new NoDepsMachineEngine<MetricRegistry>(METRICS_NAME, 10000, BoundlessComponentBox.FACTORY) {
@Override
protected MetricRegistry doNewComponent(SatisfiedBOM satisfiedBOM) {
return new DummyMetricRegistry();

0 comments on commit 7a82e6e

Please sign in to comment.