Github user cestella commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/321#discussion_r85125448
  
    --- Diff: 
metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/PcapPacketComparator.java
 ---
    @@ -25,15 +25,13 @@
     
     public class PcapPacketComparator implements Comparator<PcapPacket> {
     
    -   /** The Constant LOG. */
    -   private static final Logger LOG = Logger.getLogger(PcapMerger.class);
    -   
    -   public int compare(PcapPacket p1, PcapPacket p2) {
    +  /** The Constant LOG. */
    +  private static final Logger LOG = Logger.getLogger(PcapMerger.class);
     
    -           Long p1time = new Long(p1.getPacketHeader().getTsSec()) * 
1000000L + new Long(p1.getPacketHeader().getTsUsec());
    -           Long p2time = new Long(p2.getPacketHeader().getTsSec()) * 
1000000L + new Long(p2.getPacketHeader().getTsUsec());
    -           Long delta = p1time - p2time;
    -           LOG.debug("p1time: " + p1time.toString() + " p2time: " + 
p2time.toString() + " delta: " + delta.toString());
    -           return delta.intValue();
    -   }
    +  public int compare(PcapPacket p1, PcapPacket p2) {
    +    long p1time = p1.getPacketHeader().getTsSec() * 1000000L + 
p1.getPacketHeader().getTsUsec();
    +    long p2time = p2.getPacketHeader().getTsSec() * 1000000L + 
p2.getPacketHeader().getTsUsec();
    +    LOG.debug("p1time: " + p1time + " p2time: " + p2time);
    +    return Long.compare(p1time, p2time);
    --- End diff --
    
    Should that be `compare` or `compareUnsigned`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to