dsmiley commented on code in PR #2932:
URL: https://github.com/apache/solr/pull/2932#discussion_r1907905116


##########
solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java:
##########
@@ -67,4 +70,8 @@ public SimpleOrderedMap<T> clone() {
     newList.addAll(nvPairs);
     return new SimpleOrderedMap<>(newList);
   }
+  
+  public static SimpleOrderedMap<Object> emptySimpleOrderedMap() {

Review Comment:
   Needs a javadoc.  And that name is quite redundant given the type where 
we're declaring this.
   WDYT of naming this simply `of` thus mimicking the end effect of `List.of()` 
or `Set.of()` or `Map.of()`?



##########
solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java:
##########
@@ -34,6 +35,8 @@
  * serialized. It aims to minimize overhead and to be efficient at adding new 
elements.
  */
 public class SimpleOrderedMap<T> extends NamedList<T> {
+ 
+  private static final SimpleOrderedMap<Object> emptySimpleOrderedMap = new 
SimpleOrderedMap<>(Collections.emptyList());

Review Comment:
   Also nowadays we just do `List.of()` which is equivalent, shorter, and 
doesn't import another class.



##########
solr/solrj/src/java/org/apache/solr/common/util/SimpleOrderedMap.java:
##########
@@ -34,6 +35,8 @@
  * serialized. It aims to minimize overhead and to be efficient at adding new 
elements.
  */
 public class SimpleOrderedMap<T> extends NamedList<T> {
+ 
+  private static final SimpleOrderedMap<Object> emptySimpleOrderedMap = new 
SimpleOrderedMap<>(Collections.emptyList());

Review Comment:
   call it EMPTY ?



-- 
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]

Reply via email to