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

refactoring to ImportControlCheck #3498

Closed
romani opened this Issue Oct 4, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@romani
Member

romani commented Oct 4, 2016

1)2)
that points were removed as not reasonable to implement.

inPkg = full.getText();

rename inPkg --> package

currentLeaf

rename to currentPkgControl

            final FullIdent imp;
            if (ast.getType() == TokenTypes.IMPORT) {
                imp = FullIdent.createFullIdentBelow(ast);
            }
            else {
                // know it is a static import
                imp = FullIdent.createFullIdent(ast
                        .getFirstChild().getNextSibling());
}

make it as function that return String, nobody need FullIdent class out of this scope.

final DetailAST nameAST = ast.getLastChild().getPreviousSibling();
final FullIdent full = FullIdent.createFullIdent(nameAST);

make a function from this with clear name of what is it doing.

currentLeaf.checkAccess(imp.getText(),inPkg);

order of argument should be different(by pattern WHERE-->WHAT), should be currentPkgControl.checkAccess(package, currentImport);


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@romani romani added the approved label Oct 4, 2016

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Oct 4, 2016

Member

@romani

such validation should be done in setter

If setter is never called, when property is not defined, validation error will never be printed.
If you want to print validation errors of missing, required properties, it should probably be done in init.

Member

rnveach commented Oct 4, 2016

@romani

such validation should be done in setter

If setter is never called, when property is not defined, validation error will never be printed.
If you want to print validation errors of missing, required properties, it should probably be done in init.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Oct 5, 2016

Member

it should probably be done in init.

may be. But All Checks do some default behavior if nothing is set - nothing is done.

Member

romani commented Oct 5, 2016

it should probably be done in init.

may be. But All Checks do some default behavior if nothing is set - nothing is done.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Nov 25, 2016

Member

point 1) and 2) were removed as not reasonable.

Member

romani commented Nov 25, 2016

point 1) and 2) were removed as not reasonable.

kazachka added a commit to kazachka/checkstyle that referenced this issue Nov 26, 2016

kazachka added a commit to kazachka/checkstyle that referenced this issue Nov 26, 2016

kazachka added a commit to kazachka/checkstyle that referenced this issue Nov 26, 2016

kazachka added a commit to kazachka/checkstyle that referenced this issue Nov 27, 2016

kazachka added a commit to kazachka/checkstyle that referenced this issue Nov 28, 2016

@romani romani added this to the 7.4 milestone Nov 28, 2016

rnveach added a commit that referenced this issue Nov 28, 2016

@romani romani closed this Nov 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment