renatoh commented on code in PR #2197:
URL: https://github.com/apache/solr/pull/2197#discussion_r1465491829
##########
solr/core/src/java/org/apache/solr/handler/component/SearchComponent.java:
##########
@@ -114,18 +112,17 @@ public void initializeMetrics(SolrMetricsContext
parentContext, String scope) {
public static final Map<String, Class<? extends SearchComponent>>
standard_components;
static {
- HashMap<String, Class<? extends SearchComponent>> map = new HashMap<>();
- map.put(HighlightComponent.COMPONENT_NAME, HighlightComponent.class);
- map.put(QueryComponent.COMPONENT_NAME, QueryComponent.class);
- map.put(FacetComponent.COMPONENT_NAME, FacetComponent.class);
- map.put(FacetModule.COMPONENT_NAME, FacetModule.class);
- map.put(MoreLikeThisComponent.COMPONENT_NAME, MoreLikeThisComponent.class);
- map.put(StatsComponent.COMPONENT_NAME, StatsComponent.class);
- map.put(DebugComponent.COMPONENT_NAME, DebugComponent.class);
- map.put(RealTimeGetComponent.COMPONENT_NAME, RealTimeGetComponent.class);
- map.put(ExpandComponent.COMPONENT_NAME, ExpandComponent.class);
- map.put(TermsComponent.COMPONENT_NAME, TermsComponent.class);
-
- standard_components = Collections.unmodifiableMap(map);
+ standard_components =
Review Comment:
good point, I removed the static-block and directly initialize the Map.
I did a quick search, it looks like many static-blocks could be removed by
making use of the colleciton-factory methods
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]