Buggy code:
public boolean isDev ( ) { } public boolean isProd ( ) { } } public static boolean initialized = false ; public static boolean started = false ; private static boolean shutdownHookEnabled = false ; public static String id ; public static Play . Mode mode ; public static File applicationPath = null ; public static File tmpDir = null ; public static boolean readOnlyTmp = false ; public static File frameworkPath = null ; public static ApplicationClasses classes ; public static ApplicationClassloader classloader ; public static List < VirtualFile > roots = new ArrayList < VirtualFile > ( 16 ) ; public static List < VirtualFile > javaPath ; public static List < VirtualFile > templatesPath ; public static VirtualFile routes ; public static Map < String , VirtualFile > modulesRoutes ; public static VirtualFile conf ; public static Properties configuration ; public static long startedAt ; public static List < String > langs = new ArrayList < String > ( 16 ) ; public static String secretKey ; public static PluginCollection pluginCollection = new PluginCollection ( ) ; @ Deprecated public static List < PlayPlugin > plugins = Play . pluginCollection . getEnabledPlugins ( ) ; public static Map < String , VirtualFile > modules = new HashMap < String , VirtualFile > ( 16 ) ; public static String version = null ; public static String ctxPath = "" ; static boolean firstStart = true ; public static boolean usePrecompiled = false ; public static boolean forceProd = false ; public static boolean lazyLoadTemplates = false ; public static String defaultWebEncoding = "utf-8" ; public static void init ( File root , String id ) { } public static void guessFrameworkPath ( ) { } public static void readConfiguration ( ) { } public static synchronized void start ( ) { } public static synchronized void stop ( ) { } static boolean preCompile ( ) { } public static synchronized void detectChanges ( ) { } @ SuppressWarnings ( "unchecked" ) public static < T > T plugin ( Class < T > clazz ) { } public static void initStaticStuff ( ) { } public static void loadModules ( ) { if ( ( System . getenv ( "MODULES" ) ) != null ) { if ( ( ( System . getenv ( "MODULES" ) ) != null ) && ( ( System . getenv ( "MODULES" ) . trim ( ) . length ( ) ) > 0 ) ) { for ( String m : System . getenv ( "MODULES" ) . split ( ( System . getProperty ( "os.name" ) . startsWith ( "Windows" ) ? ";" : ":" ) ) ) { File modulePath = new File ( m ) ; if ( ( ! ( modulePath . exists ( ) ) ) || ( ! ( modulePath . isDirectory ( ) ) ) ) { Logger . error ( "Module<seq2seq4repair_space>%s<seq2seq4repair_space>will<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>loaded<seq2seq4repair_space>because<seq2seq4repair_space>%s<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" , modulePath . getName ( ) , modulePath . getAbsolutePath ( ) ) ; } else { final String modulePathName = modulePath . getName ( ) ; final String moduleName = ( modulePathName . contains ( "-" ) ) ? modulePathName . substring ( 0 , modulePathName . lastIndexOf ( "-" ) ) : modulePathName ; Play . addModule ( moduleName , modulePath ) ; } } } } for ( Object key : Play . configuration . keySet ( ) ) { String pName = key . toString ( ) ; if ( pName . startsWith ( "module." ) ) { Logger . warn ( "Declaring<seq2seq4repair_space>modules<seq2seq4repair_space>in<seq2seq4repair_space>application.conf<seq2seq4repair_space>is<seq2seq4repair_space>deprecated.<seq2seq4repair_space>Use<seq2seq4repair_space>dependencies.yml<seq2seq4repair_space>instead<seq2seq4repair_space>(%s)" , pName ) ; String moduleName = pName . substring ( 7 ) ; File modulePath = new File ( Play . configuration . getProperty ( pName ) ) ; if ( ! ( modulePath . isAbsolute ( ) ) ) { modulePath = new File ( Play . applicationPath , Play . configuration . getProperty ( pName ) ) ; } if ( ( ! ( modulePath . exists ( ) ) ) || ( ! ( modulePath . isDirectory ( ) ) ) ) { Logger . error ( "Module<seq2seq4repair_space>%s<seq2seq4repair_space>will<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>loaded<seq2seq4repair_space>because<seq2seq4repair_space>%s<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" , moduleName , modulePath . getAbsolutePath ( ) ) ; } else { Play . addModule ( moduleName , modulePath ) ; } } } File localModules = Play . getFile ( "modules" ) ; if ( ( localModules . exists ( ) ) && ( localModules . isDirectory ( ) ) ) { for ( File module : localModules . listFiles ( ) ) { String moduleName = module . getName ( ) ; if ( moduleName . contains ( "-" ) ) { <START_BUG> moduleName = moduleName . substring ( 0 , moduleName . indexOf ( "-" ) ) ; <END_BUG> } if ( module . isDirectory ( ) ) { Play . addModule ( moduleName , module ) ; } else { File modulePath = new File ( IO . readContentAsString ( module ) . trim ( ) ) ; if ( ( ! ( modulePath . exists ( ) ) ) || ( ! ( modulePath . isDirectory ( ) ) ) ) { Logger . error ( "Module<seq2seq4repair_space>%s<seq2seq4repair_space>will<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>loaded<seq2seq4repair_space>because<seq2seq4repair_space>%s<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" , moduleName , modulePath . getAbsolutePath ( ) ) ; } else { Play . addModule ( moduleName , modulePath ) ; } } } } if ( Play . runingInTestMode ( ) ) { Play . addModule ( "_testrunner" , new File ( Play . frameworkPath , "modules//testrunner" ) ) ; } if ( ( Play . mode ) == ( Play . Mode . DEV ) ) { Play . addModule ( "_docviewer" , new File ( Play . frameworkPath , "modules//docviewer" ) ) ; } } public static void addModule ( String name , File path ) { } public static VirtualFile getVirtualFile ( String path ) { } public static File getFile ( String path ) { } public static boolean runingInTestMode ( ) { } }

Fix:
moduleName = moduleName . substring ( 0 , moduleName . lastIndexOf ( "-" ) ) ;