lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: precommit failure
Date Wed, 15 Aug 2018 23:20:53 GMT
Hi,

> To be sure we're talking about the same thing, your preferred
> initialization looks like this?
> 
> static final Map<TEST_TYPE, String> solrClassMap =
> Collections.unmodifiableMap(Stream.of(
>     new SimpleEntry<>(TEST_TYPE.TINT, "solr.TrieIntField"),
> 
>     new SimpleEntry<>(TEST_TYPE.BOOL, "solr.BoolField"))
>     .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
> 
> BTW, why do you consider inline lambdas horrible? Not disagreeing,
> just wondering whether it's a functional problem or what to add to my
> knowledge store.

Yes, that looks better...

> And I assumed that this _was_ unmodifiable given it starts with
> "Collections.unmodifiableMap".

Sorry was on mobile phone and did not see the unmodifiableMap.

We should maybe add a "TODO" at those constructs to upgrade them to the much better and elegant
Map.of() once we switch master to Java 9/10/11.

Uwe



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message