src/main/java/ch/uzh/ifi/seal/ase/cscc/index/KaVeRecommender.java
private static void removeDuplicates(List<ScoredIndexDocument> sortedRefinedCandidates) {
        Set<String> uniqueMethodNames = new HashSet<>();
        for (int i = 0; i < sortedRefinedCandidates.size(); i++) {
            String methodName = sortedRefinedCandidates.get(i).getMethodCall();
            if (uniqueMethodNames.contains(methodName)) {
                sortedRefinedCandidates.remove(i);
                i--;
            } else {
                uniqueMethodNames.add(methodName);
            }
        }
    }
/**
     * Removes documents with same method call name while leaving the order of the list unchanged.
     */
Removes documents with same method call name while leaving the order of the list unchanged.
Removes documents with same method call name while leaving the order of the list unchanged .
private static void removeDuplicates(List<ScoredIndexDocument> sortedRefinedCandidates) {
        Set<String> uniqueMethodNames = new HashSet<>();
        for (int i = 0; i < sortedRefinedCandidates.size(); i++) {
            String methodName = sortedRefinedCandidates.get(i).getMethodCall();
            if (uniqueMethodNames.contains(methodName)) {
                sortedRefinedCandidates.remove(i);
                i--;
            } else {
                uniqueMethodNames.add(methodName);
            }
        }
    }
private static void removeDuplicates ( List < ScoredIndexDocument > sortedRefinedCandidates ) { Set < String > uniqueMethodNames = new HashSet < > ( ) ; for ( int i = 0 ; i < sortedRefinedCandidates . size ( ) ; i ++ ) { String methodName = sortedRefinedCandidates . get ( i ) . getMethodCall ( ) ; if ( uniqueMethodNames . contains ( methodName ) ) { sortedRefinedCandidates . remove ( i ) ; i -- ; } else { uniqueMethodNames . add ( methodName ) ; } } }
Removes documents with same method call name while leaving the order of the list unchanged.
Removes documents with same method call name while leaving the order of the list unchanged .