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

Comments

Projects
None yet
2 participants
@romani
Member

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"

Andrew0701 pushed a commit to Andrew0701/sevntu.checkstyle that referenced this issue Jan 3, 2015

Andrew0701 pushed a commit to Andrew0701/sevntu.checkstyle that referenced this issue Jan 9, 2015

Andrew0701 pushed a commit to Andrew0701/sevntu.checkstyle that referenced this issue Jan 9, 2015

Andrew0701 pushed a commit to Andrew0701/sevntu.checkstyle that referenced this issue Jan 12, 2015

Andrew0701 pushed a commit to Andrew0701/sevntu.checkstyle that referenced this issue Jan 12, 2015

Andrew0701 pushed a commit to Andrew0701/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