public static boolean containsProposal ( final Collection < ICompletionProposal > proposals , String newProposal ) { for ( ICompletionProposal prop : proposals ) { String displayString = prop . getDisplayString ( ) ; String [ ] existings = displayString . split ( " " ) ; if ( existings . length == 0 ) { continue ; } String [ ] newProposals = newProposal . split ( " " ) ; if ( newProposals . length == 0 ) { continue ; } if ( existings [ 0 ] . equals ( newProposals [ 0 ] ) ) { return true ; } } return false ; }
Attempt to compare proposals of different types based on the tokenized display string