public void scan() {
        final PackageNamesScanner scanner = new PackageNamesScanner(
                scanPkgs.toArray(new String[scanPkgs.size()]), true);
        while (scanner.hasNext()) {
            String fileName = scanner.next();
            if (!fileName.endsWith(".class")) continue;
            ClassInfo info = new ClassInfo(fileName) {

                InputStream in;

                @Override
                public InputStream getFileStream() {
                    if (in == null) {
                        in = scanner.open();
                    }
                    return in;
                }

                @Override
                public void closeFileStream() {
                    closeQuietly(in);
                }
            };
            String className = info.getCtClass().getName();
            if (!foundClasses.contains(className)) {
                ClassFoundEvent event = new ClassFoundEvent(info);
                SystemEventBus.publish(event);
                info.closeFileStream();

                if (event.accept) {
                    acceptClasses.add(className);
                }
            }
            foundClasses.add(className);
        }
    }
public void scan ( ) { final PackageNamesScanner scanner = new PackageNamesScanner ( scanPkgs . toArray ( new String [ scanPkgs . size ( ) ] ) , true ) ; while ( scanner . hasNext ( ) ) { String fileName = scanner . next ( ) ; if ( ! fileName . endsWith ( ".class" ) ) continue ; ClassInfo info = new ClassInfo ( fileName ) { InputStream in ; @ Override public InputStream getFileStream ( ) { if ( in == null ) { in = scanner . open ( ) ; } return in ; } @ Override public void closeFileStream ( ) { closeQuietly ( in ) ; } } ; String className = info . getCtClass ( ) . getName ( ) ; if ( ! foundClasses . contains ( className ) ) { ClassFoundEvent event = new ClassFoundEvent ( info ) ; SystemEventBus . publish ( event ) ; info . closeFileStream ( ) ; if ( event . accept ) { acceptClasses . add ( className ) ; } } foundClasses . add ( className ) ; } }
<p>scan.</p>