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

Template matcher improvements #996

Merged
merged 4 commits into from
Nov 21, 2016

Conversation

pvojtechovsky
Copy link
Collaborator

I am learning how TemplateMatcher works. I suggest some little code improvements.

There is a bug fix too, int this PR, in isParameterSource method, which returned before true, in some cases, even when ref.getDeclaration() was null. It might be OK in this method, but it would fail immediately on NullPointerException in Parameters.getParameterName() on f.getDeclaration().getAnnotation(...)' so I think the change in the isParameterSource` expression is correct.

I replaced Launcher.LOGGER.error(...) by throwing of exception. I guess that spoon should visibly fail if client wants to use a template, but something bad happens. The writing to log is not enough in such case. But here I am not sure, so if you do not agree, then I gladly rollback this change.

@monperrus monperrus merged commit 62a20a4 into INRIA:master Nov 21, 2016
@pvojtechovsky pvojtechovsky deleted the templateMatcherImprovements branch November 22, 2016 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants