private boolean subModuleExists ( File dir ) { if ( isSlotDirectory ( dir ) ) { return true ; } else { File [ ] children = dir . listFiles ( File :: isDirectory ) ; for ( File child : children ) { if ( subModuleExists ( child ) ) { return true ; } } } return false ; }
depth - first search for any module - just to check that the suggestion has any chance of delivering correct result