Code review comment: This is not new code, copied from the old Dev UI, just move from a POST handler to the Processor. Happy to change this, but maybe in a follow up PR ?

Code under review:
private List<String> sourcePackagesForRoot(Path langPath) {
        if (!Files.exists(langPath)) {
            return Collections.emptyList();
        }
        File[] rootFiles = langPath.toFile().listFiles();
        List<Path> rootPackages = new ArrayList<>(1);
        if (rootFiles != null) {
            for (File rootFile : rootFiles) {
                if (rootFile.isDirectory()) {
                    rootPackages.add(rootFile.toPath());
                }
            }
        }
        if (rootPackages.isEmpty()) {
            return List.of("");
        }
        List<String> result = new ArrayList<>(rootPackages.size());
        for (Path rootPackage : rootPackages) {
            List<String> paths = new ArrayList<>();
            SimpleFileVisitor<Path> simpleFileVisitor = new DetectPackageFileVisitor(paths);
            try {
                Files.walkFileTree(rootPackage, simpleFileVisitor);
                if (paths.isEmpty()) {
                    continue;
                }
                String commonPath = commonPath(paths);
                String rootPackageStr = commonPath.replace(langPath.toAbsolutePath().toString(), "")
                        .replace(File.separator, ".");
                if (rootPackageStr.startsWith(".")) {
                    rootPackageStr = rootPackageStr.substring(1);
                }
                if (rootPackageStr.endsWith(".")) {
                    rootPackageStr = rootPackageStr.substring(0, rootPackageStr.length() - 1);
                }
                result.add(rootPackageStr);
            } catch (IOException e) {
                log.debug("Unable to determine the sources directories", e);
                
            }
        }
        return result;
    }

Line commented on: return result;

Revised code:
private List<String> sourcePackagesForRoot(Path langPath) {
        if (!Files.exists(langPath)) {
            return Collections.emptyList();
        }
        File[] rootFiles = langPath.toFile().listFiles();
        List<Path> rootPackages = new ArrayList<>(1);
        if (rootFiles != null) {
            for (File rootFile : rootFiles) {
                if (rootFile.isDirectory()) {
                    rootPackages.add(rootFile.toPath());
                }
            }
        }
        if (rootPackages.isEmpty()) {
            return List.of("");
        }
        List<String> result = new ArrayList<>(rootPackages.size());
        for (Path rootPackage : rootPackages) {
            List<String> paths = new ArrayList<>();
            SimpleFileVisitor<Path> simpleFileVisitor = new DetectPackageFileVisitor(paths);
            try {
                Files.walkFileTree(rootPackage, simpleFileVisitor);
                if (paths.isEmpty()) {
                    continue;
                }
                String commonPath = commonPath(paths);
                String rootPackageStr = commonPath.replace(langPath.toAbsolutePath().toString(), "")
                        .replace(File.separator, ".");
                if (rootPackageStr.startsWith(".")) {
                    rootPackageStr = rootPackageStr.substring(1);
                }
                if (rootPackageStr.endsWith(".")) {
                    rootPackageStr = rootPackageStr.substring(0, rootPackageStr.length() - 1);
                }
                result.add(rootPackageStr);
            } catch (IOException e) {
                log.debug("Unable to determine the sources directories", e);
                
            }
        }
        return result;
    }