huan233usc commented on code in PR #16765:
URL: https://github.com/apache/iceberg/pull/16765#discussion_r3475769263


##########
api/src/main/java/org/apache/iceberg/types/Types.java:
##########
@@ -584,12 +585,12 @@ public static GeometryType of(String crs) {
     private final String crs;
 
     private GeometryType() {
-      crs = null;
+      crs = DEFAULT_CRS;
     }
 
     private GeometryType(String crs) {
       Preconditions.checkArgument(crs == null || !crs.isEmpty(), "Invalid CRS: 
(empty string)");
-      this.crs = DEFAULT_CRS.equalsIgnoreCase(crs) ? null : crs;
+      this.crs = crs != null ? crs : DEFAULT_CRS;

Review Comment:
   Good call — done in 6ec2544e7. Both `GeometryType` and `GeographyType` now 
canonicalize the default CRS (omitted or any casing) in the constructor, so 
`crs()` is a plain field getter and `equals`/`hashCode`/`toString` 
compare/format the stored field directly. The getter indirection and the 
explanatory comments are gone, and `TestTypes` (incl. the `ogc:crs84` -> 
`OGC:CRS84` cases) still passes since the observable behavior is identical.



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