FtcXtensible/src/main/java/org/ftccommunity/ftcxtensible/AnnotationFtcRegister.java
private LinkedList<Class> buildClassList() {
        DexFile df;
        Context applicationContext = getApplicationContext();

        // Try to load the Dex-File
        try {
            df = new DexFile(applicationContext.getPackageCodePath());
        } catch (IOException e) {
            Log.wtf(TAG, e);
            throw new NullPointerException();
        }


        // Migrate the enum to OpMode LinkedList
        LinkedList<String> classes = new LinkedList<>(Collections.list(df.entries()));

        // Create the container for the objects to add
        LinkedList<Class> classesToProcess = new LinkedList<>();
        for (String klazz : classes) {
            if (shouldAdd(klazz)) {
                try {
                    classesToProcess.add(Class.forName(klazz, false, applicationContext.getClassLoader()));
                } catch (ClassNotFoundException | NoClassDefFoundError e) {
                    Log.e(TAG, "Cannot add class to process list: " + klazz + "Reason: " + e.toString());

                    // Add code to prevent loading the next class
                    if (klazz.contains("$")) {
                        klazz = klazz.substring(0, klazz.indexOf("$") - 1);
                    }
                    noCheckList.add(klazz);
                }
            }
        }

        return classesToProcess;
    }
/**
     * Uses a context generated by {@link #getApplicationContext()} to get a list of the class
     * packages within in this application
     *
     * @return a list of classes present and that can be used
     */
Uses a context generated by  #getApplicationContext() to get a list of the class
packages within in this application

@return a list of classes present and that can be used
Uses a context generated by #getApplicationContext () to get a list of the class packages within in this application @return a list of classes present and that can be used
private LinkedList<Class> buildClassList() {
        DexFile df;
        Context applicationContext = getApplicationContext();
        try {
            df = new DexFile(applicationContext.getPackageCodePath());
        } catch (IOException e) {
            Log.wtf(TAG, e);
            throw new NullPointerException();
        }
        LinkedList<String> classes = new LinkedList<>(Collections.list(df.entries()));
        LinkedList<Class> classesToProcess = new LinkedList<>();
        for (String klazz : classes) {
            if (shouldAdd(klazz)) {
                try {
                    classesToProcess.add(Class.forName(klazz, false, applicationContext.getClassLoader()));
                } catch (ClassNotFoundException | NoClassDefFoundError e) {
                    Log.e(TAG, "Cannot add class to process list: " + klazz + "Reason: " + e.toString());
                    if (klazz.contains("$")) {
                        klazz = klazz.substring(0, klazz.indexOf("$") - 1);
                    }
                    noCheckList.add(klazz);
                }
            }
        }
        return classesToProcess;
    }
private LinkedList < Class > buildClassList ( ) { DexFile df ; Context applicationContext = getApplicationContext ( ) ; try { df = new DexFile ( applicationContext . getPackageCodePath ( ) ) ; } catch ( IOException e ) { Log . wtf ( TAG , e ) ; throw new NullPointerException ( ) ; } LinkedList < String > classes = new LinkedList < > ( Collections . list ( df . entries ( ) ) ) ; LinkedList < Class > classesToProcess = new LinkedList < > ( ) ; for ( String klazz : classes ) { if ( shouldAdd ( klazz ) ) { try { classesToProcess . add ( Class . forName ( klazz , false , applicationContext . getClassLoader ( ) ) ) ; } catch ( ClassNotFoundException | NoClassDefFoundError e ) { Log . e ( TAG , "Cannot add class to process list: " + klazz + "Reason: " + e . toString ( ) ) ; if ( klazz . contains ( "$" ) ) { klazz = klazz . substring ( 0 , klazz . indexOf ( "$" ) - 1 ) ; } noCheckList . add ( klazz ) ; } } } return classesToProcess ; }
Uses a context generated by {@link #getApplicationContext()} to get a list of the class
 packages within in this application
Uses a context generated by { @link #getApplicationContext () } to get a list of the class packages within in this application
// Try to load the Dex-File // Migrate the enum to OpMode LinkedList // Create the container for the objects to add // Add code to prevent loading the next class