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


##########
solr/core/src/java/org/apache/solr/response/transform/GeoTransformerFactory.java:
##########
@@ -199,7 +199,7 @@ public String getName() {
 
     @Override
     public Collection<String> getRawFields() {
-      return updater.isJSON ? Collections.singleton(updater.display) : 
Collections.emptySet();
+      return updater.isJSON ? Collections.singleton(updater.display) : 
Set.of();

Review Comment:
   ah, `Collections.singleton` is another to to place, e.g. with `Set.of(...)`



##########
solr/core/src/test/org/apache/solr/util/ModuleUtilsTest.java:
##########
@@ -52,7 +51,7 @@ public void testGetModuleLibPath() {
   }
 
   public void testResolveFromSyspropOrEnv() {
-    assertEquals(Collections.emptySet(), 
ModuleUtils.resolveFromSyspropOrEnv());
+    assertEquals(Set.of(), ModuleUtils.resolveFromSyspropOrEnv());

Review Comment:
   weird assertions in this method... ought to assert `isEmpty`



##########
solr/core/src/test/org/apache/solr/cloud/overseer/TestClusterStateMutator.java:
##########
@@ -40,8 +41,7 @@ public static void beforeClass() {
 
   public void testCreateCollection() {
     ClusterState clusterState =
-        new ClusterState(
-            Collections.<String>emptySet(), Collections.<String, 
DocCollection>emptyMap());
+        new ClusterState(Set.of(), Collections.<String, 
DocCollection>emptyMap());

Review Comment:
   and later replace `Collections.emptyMap` with `Map.of`



##########
solr/core/src/test/org/apache/solr/util/ModuleUtilsTest.java:
##########
@@ -66,8 +65,7 @@ public void testResolveModules() {
     assertEquals(
         Set.of("foo", "bar", "baz", "mod1"),
         Set.copyOf(ModuleUtils.resolveModulesFromStringOrSyspropOrEnv("foo 
,bar, baz,mod1")));
-    assertEquals(
-        Collections.emptySet(), 
Set.copyOf(ModuleUtils.resolveModulesFromStringOrSyspropOrEnv("")));
+    assertEquals(Set.of(), 
Set.copyOf(ModuleUtils.resolveModulesFromStringOrSyspropOrEnv("")));

Review Comment:
   weird; copying i and then compare with Set.of.  Wow... like just check 
isEmpty



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