| 323 | } |
| 324 | |
| 325 | public <S extends Decl.Named> S getDeclaration(Identifier name, Type signature, Class<S> kind) { |
| 326 | List<S> matches = super.getSyntacticItems(kind); |
| 327 | for (int i = 0; i != matches.size(); ++i) { |
| 328 | S match = matches.get(i); |
| 329 | if (match.getName().equals(name)) { |
| 330 | if (signature != null && signature.equals(match.getType())) { |
| 331 | return match; |
| 332 | } else if (signature == null) { |
| 333 | return match; |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | throw new IllegalArgumentException("unknown declarataion (" + name + "," + signature + ")"); |
| 338 | } |
| 339 | |
| 340 | @Override |
| 341 | public <T extends Syntactic.Item> void replace(T from, T to) { |