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

Try to detect when missing a call to returnValue #67

Open
metacosm opened this issue Dec 18, 2020 · 3 comments · May be fixed by #69
Open

Try to detect when missing a call to returnValue #67

metacosm opened this issue Dec 18, 2020 · 3 comments · May be fixed by #69

Comments

@metacosm
Copy link

This is a source of errors, in particular when creating constructors, as one needs to remember to call returnValue(null).

@dufoli
Copy link
Contributor

dufoli commented Dec 19, 2020

I have start to implement it but it is more complexe than it looks like

Missing part:

  • functionnal creator

  • if method contain branch with if false/ true and each part returnValue.
    So maybe best is to implement a visitor of methods to check return instead of a global simple check.
    same things for while, for... indeed any statement

  • thinking to warning instead of exception but the closest for that seems to be ErrorReporter but it seems not implemented.

@dufoli
Copy link
Contributor

dufoli commented Dec 20, 2020

Ok, I have try to implement my own MethodVisitor to detect

class MethodCheckerVisitor extends MethodVisitor

but the issue is that bytecodeImpl will close the classCreator... so it trigger other visitors.
hope it is fine.

@dufoli
Copy link
Contributor

dufoli commented Dec 20, 2020

it is #69

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 a pull request may close this issue.

2 participants