Skip to content

Commit 7a82e6e

Browse files
committed
replace newLinkedHashSet by an ImmutableSet.copyOf when returning components
as recommended by the documentation, these Sets are not supposed to be mutable anyway
1 parent da0a80d commit 7a82e6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

restx-factory/src/main/java/restx/factory/Factory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ public final Set<NamedComponent<T>> find() {
448448
return doFind();
449449
}
450450
public final Set<T> findAsComponents() {
451-
return Sets.newLinkedHashSet(
451+
return ImmutableSet.copyOf(
452452
Iterables.transform(find(), NamedComponent.<T>toComponent()));
453453
}
454454
public abstract Set<Name<T>> findNames();
@@ -719,7 +719,7 @@ private Factory(boolean usedServiceLoader, Multimap<String, FactoryMachine> mach
719719
// define a Machine to provide a default provider for MetricRegistry
720720
// this won't be used if a MetricsRegistry is provided through a higher priority machine
721721
.put("MetricRegistryMachine", new SingleNameFactoryMachine<>(10000,
722-
new NoDepsMachineEngine<MetricRegistry>(METRICS_NAME, BoundlessComponentBox.FACTORY) {
722+
new NoDepsMachineEngine<MetricRegistry>(METRICS_NAME, 10000, BoundlessComponentBox.FACTORY) {
723723
@Override
724724
protected MetricRegistry doNewComponent(SatisfiedBOM satisfiedBOM) {
725725
return new DummyMetricRegistry();

0 commit comments

Comments
 (0)