static int compareMarkers ( IMarker m1 , IMarker m2 ) { if ( m1 == null || m2 == null || ! m1 . exists ( ) || ! m2 . exists ( ) ) { return 0 ; } int rank1 = MarkerUtil . findBugRankForMarker ( m1 ) ; int rank2 = MarkerUtil . findBugRankForMarker ( m2 ) ; int result = rank1 - rank2 ; if ( result != 0 ) { return result ; } int prio1 = MarkerUtil . findConfidenceForMarker ( m1 ) . ordinal ( ) ; int prio2 = MarkerUtil . findConfidenceForMarker ( m2 ) . ordinal ( ) ; result = prio1 - prio2 ; if ( result != 0 ) { return result ; } String a1 = m1 . getAttribute ( IMarker . MESSAGE , "" ) ; String a2 = m2 . getAttribute ( IMarker . MESSAGE , "" ) ; return a1 . compareToIgnoreCase ( a2 ) ; }
Sorts markers on rank then priority and then on name if requested