for (final AstNode n : traversal) {
if (!(n instanceof IdentifierExpression)) {
continue;
}
final IdentifierExpression identifier = (IdentifierExpression) n;
final UsageType usage = UsageClassifier.getUsageType(identifier);
if (mode == CorrelationMode.Read) {
if (usage != UsageType.Read && usage != UsageType.ReadWrite) {
continue;
}
}
else if (usage != UsageType.Write && usage != UsageType.ReadWrite) {
continue;
}
IMetadataTypeMember member = identifier.getUserData(Keys.MEMBER_REFERENCE);
if (member != null) {
members.add(member);
continue;
}
final Variable variable = identifier.getUserData(Keys.VARIABLE);
if (variable != null) {
if (variable.isParameter()) {
member = variable.getOriginalParameter();
}