julianhyde commented on code in PR #3984:
URL: https://github.com/apache/calcite/pull/3984#discussion_r1806920445


##########
core/src/main/java/org/apache/calcite/sql/validate/MustFilterRequirements.java:
##########
@@ -37,9 +35,9 @@ public class MustFilterRequirements {
 
   ImmutableBitSet mustFilterFields;
   ImmutableBitSet mustFilterBypassFields;
-  protected Set<SqlQualified> remnantMustFilterFields;
+  protected ImmutableSet<SqlQualified> remnantMustFilterFields;
   public MustFilterRequirements(ImmutableBitSet mustFilterFields,
-      ImmutableBitSet mustFilterBypassFields, Set<SqlQualified> 
remnantMustFilterFields) {
+      ImmutableBitSet mustFilterBypassFields, ImmutableSet<SqlQualified> 
remnantMustFilterFields) {

Review Comment:
   Parameters and fields should be declared as Set not ImmutableSet
   
   (I don't like the rule, but it minimizes binary compatibility problems for 
people who have shaded Guava.)
   
   You will often see the following pattern in constructors:
   ```
     this.remnantMustFilterFields = 
ImmutableSet.copyOf(remnantMustFilterFields);
   ```
   which ensures immutability and non-null.



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

Reply via email to