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

Validate against trying to override non-overrideable method #143

Open
rcodesmith opened this issue Aug 2, 2014 · 0 comments
Open

Validate against trying to override non-overrideable method #143

rcodesmith opened this issue Aug 2, 2014 · 0 comments
Labels

Comments

@rcodesmith
Copy link
Member

If you try to override a method that is not overrideable (e.g. because the return type wasn't declared and is inferred) and call the next object in the override dispatch chain, Sculptor doesn't give a useful error.

What happens is when the 'next' method is called, it ends up calling the base implementation of the method in the dispatch object, and it'll frequently fail with an NPE because the dispatch object hasn't had any objects injected into it. I got an error like the following, along with a stack trace pointing to the base class method implementation where it tries to use an injected object:

[ERROR] Error running action 'org.sculptor.generator.template.RootTmpl.root': null

We should add a validation that guards against attempts to override methods that are not overrideable in Sculptor (e.g. because the return type is inferred).

@rcodesmith rcodesmith added the bug label Aug 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant