public String getFilename() { return this.token.getTokenSrcID(); }
public void findMatches() { cpdListener.phaseUpdate(CPDListener.HASH); Map<TokenEntry, Object> markGroups = hash(); cpdListener.phaseUpdate(CPDListener.MATCH); MatchCollector matchCollector = new MatchCollector(this); for (Iterator<Object> i = markGroups.values().iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof List) { @SuppressWarnings("unchecked") List<TokenEntry> l = (List<TokenEntry>) o; Collections.reverse(l); matchCollector.collect(l); } i.remove(); } cpdListener.phaseUpdate(CPDListener.GROUPING); matches = matchCollector.getMatches(); for (Match match : matches) { for (Mark mark : match) { TokenEntry token = mark.getToken(); int lineCount = tokens.getLineCount(token, match); mark.setLineCount(lineCount); SourceCode sourceCode = source.get(token.getTokenSrcID()); mark.setSourceCode(sourceCode); } } cpdListener.phaseUpdate(CPDListener.DONE); }
public String getFilename() { return this.token.getTokenSrcID(); }
public void findMatches() { cpdListener.phaseUpdate(CPDListener.HASH); Map<TokenEntry, Object> markGroups = hash(); cpdListener.phaseUpdate(CPDListener.MATCH); MatchCollector matchCollector = new MatchCollector(this); for (Iterator<Object> i = markGroups.values().iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof List) { @SuppressWarnings("unchecked") List<TokenEntry> l = (List<TokenEntry>) o; Collections.reverse(l); matchCollector.collect(l); } i.remove(); } cpdListener.phaseUpdate(CPDListener.GROUPING); matches = matchCollector.getMatches(); for (Match match : matches) { for (Mark mark : match) { TokenEntry token = mark.getToken(); int lineCount = tokens.getLineCount(token, match); mark.setLineCount(lineCount); SourceCode sourceCode = source.get(token.getTokenSrcID()); mark.setSourceCode(sourceCode); } } cpdListener.phaseUpdate(CPDListener.DONE); }
String filename = tokenEntry.getTokenSrcID(); File file = new File( filename ); PmdFileInfo fileInfo = fileMap.get( file );