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

False positive: return in finally block #269

Closed
romani opened this issue Nov 6, 2014 · 0 comments
Closed

False positive: return in finally block #269

romani opened this issue Nov 6, 2014 · 0 comments
Assignees

Comments

@romani
Copy link
Member

@romani romani commented Nov 6, 2014

Warning: "Forbid return statement in finally block: Finally block should not contain return statements."

https://github.com/sevntu-checkstyle/sevntu.checkstyle/blob/master/sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/ForbidReturnInFinalBlockCheck.java

    public void test() {
        try {
                         /// some code
        } finally { 
            // remove test data
            csf.doIn(new Callback<Void>() {
                @Override
                public Void execute(ISession session) {
                    session.delete(this);
                    return null;  // WARNING !!!!!!
                }
            }, "");
        }
    }

it is also required to rename Check, as block is "finally" not a "final"

aulianenko pushed a commit to aulianenko/sevntu.checkstyle that referenced this issue Jan 3, 2015
aulianenko pushed a commit to aulianenko/sevntu.checkstyle that referenced this issue Jan 9, 2015
aulianenko pushed a commit to aulianenko/sevntu.checkstyle that referenced this issue Jan 9, 2015
aulianenko pushed a commit to aulianenko/sevntu.checkstyle that referenced this issue Jan 12, 2015
aulianenko pushed a commit to aulianenko/sevntu.checkstyle that referenced this issue Jan 12, 2015
aulianenko pushed a commit to aulianenko/sevntu.checkstyle that referenced this issue Jan 14, 2015
@romani romani closed this in 5f9164c Jan 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.