Removed asserts from 3 classes #1305
This commit is contained in:
parent
b8ca9f9765
commit
35fc8622d0
|
|
@ -364,7 +364,6 @@ public final class ModifiedControlVariableCheck extends Check {
|
|||
* @return set of variables initialized in for loop
|
||||
*/
|
||||
private static Set<String> getForInitVariables(DetailAST ast) {
|
||||
assert ast.getType() == TokenTypes.LITERAL_FOR;
|
||||
final Set<String> initializedVariables = new HashSet<>();
|
||||
final DetailAST forInitAST = ast.findFirstToken(TokenTypes.FOR_INIT);
|
||||
|
||||
|
|
|
|||
|
|
@ -87,12 +87,10 @@ final class ImportControlLoader extends AbstractLoader {
|
|||
stack.push(new PkgControl(pkg));
|
||||
}
|
||||
else if ("subpackage".equals(qName)) {
|
||||
assert !stack.isEmpty();
|
||||
final String name = safeGet(atts, "name");
|
||||
stack.push(new PkgControl(stack.peek(), name));
|
||||
}
|
||||
else if ("allow".equals(qName) || "disallow".equals(qName)) {
|
||||
assert !stack.isEmpty();
|
||||
// Need to handle either "pkg" or "class" attribute.
|
||||
// May have "exact-match" for "pkg"
|
||||
// May have "local-only"
|
||||
|
|
@ -122,7 +120,6 @@ final class ImportControlLoader extends AbstractLoader {
|
|||
public void endElement(final String namespaceURI, final String localName,
|
||||
final String qName) {
|
||||
if ("subpackage".equals(qName)) {
|
||||
assert stack.size() > 1;
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
|
|
@ -175,7 +172,6 @@ final class ImportControlLoader extends AbstractLoader {
|
|||
* @return the root {@link PkgControl} object loaded.
|
||||
*/
|
||||
private PkgControl getRoot() {
|
||||
assert stack.size() == 1;
|
||||
return stack.peek();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ class PkgControl {
|
|||
* @param pkgName the name of the package.
|
||||
*/
|
||||
PkgControl(final String pkgName) {
|
||||
assert pkgName != null;
|
||||
parent = null;
|
||||
fullPackage = pkgName;
|
||||
}
|
||||
|
|
@ -57,8 +56,6 @@ class PkgControl {
|
|||
* @param subPkg the sub package name.
|
||||
*/
|
||||
PkgControl(final PkgControl parent, final String subPkg) {
|
||||
assert parent != null;
|
||||
assert subPkg != null;
|
||||
this.parent = parent;
|
||||
fullPackage = parent.getFullPackage() + "." + subPkg;
|
||||
parent.children.add(this);
|
||||
|
|
|
|||
Loading…
Reference in New Issue