package ceylon.test.engine.internal;

import org.jboss.modules.Module;
import org.jboss.modules.ModuleLoadException;
import ceylon.modules.jboss.runtime.CeylonModuleLoader;

class Workaround {

    static void loadModule(String modName, String modVersion) {
        try {
            CeylonModuleLoader cml = (CeylonModuleLoader) Module.getCallerModuleLoader();
            cml.loadModuleSynchronous(modName, modVersion);
        } catch (ModuleLoadException e) {
            throw new RuntimeException(e);
        }
    }

}
@@ -355,16 +355,52 @@
 ader();%0A
+            if( cml != null ) %7B%0A    
         
@@ -451,16 +451,30 @@
 rsion);%0A
+            %7D%0A
         

fix NPE due --flat-classpath option #6214