|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| package net.sourceforge.pmd.symboltable; |
|
5 |
| |
|
6 |
| import net.sourceforge.pmd.util.UnaryFunction; |
|
7 |
| |
|
8 |
| import java.util.HashMap; |
|
9 |
| import java.util.Map; |
|
10 |
| |
|
11 |
| public class VariableUsageFinderFunction implements UnaryFunction { |
|
12 |
| |
|
13 |
| private Map results = new HashMap(); |
|
14 |
| private Map decls; |
|
15 |
| |
|
16 |
516
| public VariableUsageFinderFunction(Map decls) {
|
|
17 |
516
| this.decls = decls;
|
|
18 |
| } |
|
19 |
| |
|
20 |
439
| public void applyTo(Object o) {
|
|
21 |
439
| results.put(o, decls.get(o));
|
|
22 |
| } |
|
23 |
| |
|
24 |
516
| public Map getUsed() {
|
|
25 |
516
| return results;
|
|
26 |
| } |
|
27 |
| } |