src/jdk.jdi/share/classes/com/sun/tools/jdi/LocationImpl.java
changeset 48803 6738bf669314
parent 47216 71c04702a3d5
equal deleted inserted replaced
48802:cc7ae802c537 48803:6738bf669314
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    77          * TO DO: better hash code?
    77          * TO DO: better hash code?
    78          */
    78          */
    79         return method().hashCode() + (int)codeIndex();
    79         return method().hashCode() + (int)codeIndex();
    80     }
    80     }
    81 
    81 
    82     public int compareTo(Location object) {
    82     public int compareTo(Location other) {
    83         LocationImpl other = (LocationImpl)object;
       
    84         int rc = method().compareTo(other.method());
    83         int rc = method().compareTo(other.method());
    85         if (rc == 0) {
    84         if (rc == 0) {
    86             long diff = codeIndex() - other.codeIndex();
    85             long diff = codeIndex() - other.codeIndex();
    87             if (diff < 0)
    86             if (diff < 0)
    88                 return -1;
    87                 return -1;