package io.sniffy.nio.compat;

public class SniffyCompatSelectorProviderModule {

    private static int getVersion() {
        String version = System.getProperty("java.version");
        if (version.startsWith("1.")) {
            version = version.substring(2, 3);
        } else {
            int dot = version.indexOf(".");
            if (dot != -1) {
                version = version.substring(0, dot);
            }
        }
        return Integer.parseInt(version);
    }

    public static void initialize() {

        if (getVersion() >= 9) return; // TODO: change to 8

        try {
            SniffySelectorProviderBootstrap.initialize();
            SniffySelectorProvider.install();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

@@ -607,97 +607,221 @@
     
-SniffySelectorProviderBootstrap.initialize();%0A            SniffySelectorProvider.install(
+Class.forName(%22io.sniffy.nio.compat.SniffySelectorProviderBootstrap%22).getMethod(%22initialize%22).invoke(null);%0A            Class.forName(%22io.sniffy.nio.compat.SniffySelectorProvider%22).getMethod(%22install%22).invoke(null
 );%0A 

Introduce modularity