xiaoyao1991 commented on a change in pull request #3142: Validate resource 
constraint (RAM and CPU) in RoundRobinPacking
URL: https://github.com/apache/incubator-heron/pull/3142#discussion_r245390400
 
 

 ##########
 File path: heron/common/src/java/org/apache/heron/common/basics/ByteAmount.java
 ##########
 @@ -221,42 +202,37 @@ public ByteAmount max(ByteAmount other) {
     }
   }
 
-  @Override
-  public int compareTo(ByteAmount other) {
-    return Long.compare(asBytes(), other.asBytes());
-  }
-
   @Override
   public boolean equals(Object other) {
     if (this == other) {
       return true;
     }
-    if (other == null || getClass() != other.getClass()) {
+    if (!(other instanceof ByteAmount)) {
 
 Review comment:
   Looks like `instanceof` automatically does null check, so it's redundant

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to