You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/02/01 13:28:24 UTC

[GitHub] [commons-lang] garydgregory commented on a change in pull request #703: LANG-1641: GmtTimeZone now implements #equals(Object) using it's time…

garydgregory commented on a change in pull request #703:
URL: https://github.com/apache/commons-lang/pull/703#discussion_r567823371



##########
File path: src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
##########
@@ -67,39 +69,43 @@ public void setRawOffset(final int offsetMillis) {
 
     @Override
     public int getRawOffset() {
-        return offset;
+        return m_delegate.getRawOffset();
     }
 
     @Override
     public String getID() {
-        return zoneId;
+        return m_delegate.getID();
     }
 
     @Override
     public boolean useDaylightTime() {
-        return false;
+        return m_delegate.useDaylightTime();
     }
 
     @Override
     public boolean inDaylightTime(final Date date) {
-        return false;
+        return m_delegate.inDaylightTime(date);
     }
 
     @Override
     public String toString() {
-        return "[GmtTimeZone id=\"" + zoneId + "\",offset=" + offset + ']';
+        return "[GmtTimeZone id=\"" + getID() + "\",offset=" + getRawOffset() + ']';
     }
 
     @Override
-    public int hashCode() {
-        return offset;
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {

Review comment:
       Either this class should be final or this check should allow subclasses.
   WDYT?

##########
File path: src/main/java/org/apache/commons/lang3/time/GmtTimeZone.java
##########
@@ -33,8 +35,7 @@
     // Serializable!
     static final long serialVersionUID = 1L;
 
-    private final int offset;
-    private final String zoneId;
+    private final SimpleTimeZone m_delegate;
 

Review comment:
       No weird prefix on names please.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org