protected void processStatement(ASTNode node, PatternLocator locator) {
if (node instanceof FieldDeclaration) {
locator.match((FieldDeclaration) node, getNodeSet());
} else if (node instanceof ConstantDeclaration) {
ConstantDeclaration constDecl = (ConstantDeclaration) node;
ConstantReference constantName = constDecl.getConstantName();
FieldDeclaration decl = new FieldDeclarationLocation(constantName
.getName(), constantName.sourceStart(), constantName
.sourceEnd(), constDecl.sourceStart(), constDecl
.sourceEnd());
decl.setModifiers(Modifiers.AccConstant);
locator.match(decl, getNodeSet());
} else if (node instanceof FieldAccess) {
Expression field = ((FieldAccess) node).getField();
if (field instanceof SimpleReference) {
SimpleReference ref = (SimpleReference) field;
SimpleReferenceLocation refLoc = new SimpleReferenceLocation(
ref.sourceStart(), ref.sourceEnd(), '$' + ref.getName());
locator.match(refLoc, getNodeSet());
}
} else if (node instanceof StaticFieldAccess) {
Expression field = ((StaticFieldAccess) node).getField();
if (field instanceof SimpleReference) {
SimpleReference ref = (SimpleReference) field;
SimpleReferenceLocation refLoc = new SimpleReferenceLocation(
ref.sourceStart(), ref.sourceEnd(), '$' + ref.getName());
locator.match(refLoc, getNodeSet());
}
} else if (node instanceof StaticConstantAccess) {
ConstantReference constantRef = ((StaticConstantAccess) node)
.getConstant();
locator.match(constantRef, getNodeSet());
}
/*
* else if (node instanceof ConstantReference) {