private static List < DependencyError > checkAlwaysForbiddenSection ( final Dependencies dependencies , final ClassInfo classInfo ) { final List < DependencyError > errors = new ArrayList < DependencyError > ( ) ; final Iterator < String > importedPackages = classInfo . getImports ( ) . iterator ( ) ; while ( importedPackages . hasNext ( ) ) { final String importedPackage = importedPackages . next ( ) ; final NotDependsOn ndo = Utils . findForbiddenByName ( dependencies . getAlwaysForbidden ( ) , importedPackage ) ; if ( ndo != null ) { errors . add ( new DependencyError ( classInfo . getName ( ) , importedPackage , ndo . getComment ( ) ) ) ; } } return errors ; }
Checks if any of the imports is listed in the alwaysForbidden section .