Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log only errors for parameter matching #846

Merged
merged 2 commits into from
Apr 30, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -743,19 +743,20 @@ private int matchArguments(List<Token> tokens, List<Token> arguments) {
break;
}
} while (true);

} catch (MismatchException me) {
LOG.debug("Mismatch: expected ','got: '" + rest.get(0).getValue() + "'");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this then be error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically this message is:

Mismatch: expected ',' got: ')'

This is the reason for the exception but not an error. Anything different than ',' or ')' is an error. This message could be an error if the ')' case is not reported.

}
try {
rest = match(rest, ")");
} catch (MismatchException me) {
LOG.error("MismatchException : '{}' rest: '{}'", me.getMessage(), rest);
return 0;
}

return tokens.size() - rest.size();
}

private List<Token> match(List<Token> tokens, String str) throws MismatchException {
if (!tokens.get(0).getValue().equals(str)) {
LOG.error("Mismatch: expected '" + str + "' got: '" + tokens.get(0).getValue() + "'");
throw new MismatchException("Mismatch: expected '" + str + "' got: '"
+ tokens.get(0).getValue() + "'");
}
Expand Down