@Override public int compareTo(Object _o) { AggregatedVuln other = null; if(_o instanceof AggregatedVuln) other = (AggregatedVuln)_o; else throw new IllegalArgumentException(); final int filename_comparison = this.filename==null || other.filename==null ? 0 : this.filename.compareTo(other.filename); final int bugid_comparison = this.bug.compareTo(other.getBug()); if(filename_comparison!=0) return filename_comparison; else return bugid_comparison; } }