Code review comment: Added ProjectServiceInfoHolder for this. Please check

Code under review:
public ProjectServiceInfo(Project project) {
        Package currentPackage = project.currentPackage();

        Iterable<Module> modules = currentPackage.modules();
        Map<String, List<ServiceInfo>> serviceMap = new HashMap<>();
        Map<String, List<ListenerInfo>> listenerMap = new HashMap<>();
        for (Module module : modules) {
            Collection<DocumentId> documentIds = module.documentIds();
            for (DocumentId doc : documentIds) {
                Document document = module.document(doc);
                String name = document.name();
                Node node = document.syntaxTree().rootNode();

                C2CVisitor visitor = new C2CVisitor();
                node.accept(visitor);
                serviceMap.put(name, visitor.getServices());
                listenerMap.put(name, visitor.getListeners());
            }
        }

        
        for (Map.Entry<String, List<ServiceInfo>> entry : serviceMap.entrySet()) {
            String fileName = entry.getKey();
            List<ServiceInfo> value = entry.getValue();
            for (ServiceInfo serviceInfo : value) {
                ListenerInfo listener = serviceInfo.getListener();
                if (listener.getPort() == 0) {
                    String name = listener.getName();
                    List<ListenerInfo> listenerInfos = listenerMap.get(fileName);
                    for (ListenerInfo listenerInfo : listenerInfos) {
                        if (name.equals(listenerInfo.getName())) {
                            listener.setPort(listenerInfo.getPort());
                        }
                    }
                }
            }
        }
        this.serviceMap = serviceMap;
        this.listenerMap = listenerMap;
    }

Line commented on: Iterable<Module> modules = currentPackage.modules();

Revised code:
public ProjectServiceInfo(Project project) {
        Package currentPackage = project.currentPackage();

        Iterable<Module> modules = currentPackage.modules();
        Map<String, List<ServiceInfo>> serviceMap = new HashMap<>();
        Map<String, List<ListenerInfo>> listenerMap = new HashMap<>();
        for (Module module : modules) {
            Collection<DocumentId> documentIds = module.documentIds();
            for (DocumentId doc : documentIds) {
                Document document = module.document(doc);
                String name = document.name();
                Node node = document.syntaxTree().rootNode();

                C2CVisitor visitor = new C2CVisitor();
                node.accept(visitor);
                serviceMap.put(name, visitor.getServices());
                listenerMap.put(name, visitor.getListeners());
            }
        }

        
        for (Map.Entry<String, List<ServiceInfo>> entry : serviceMap.entrySet()) {
            String fileName = entry.getKey();
            List<ServiceInfo> value = entry.getValue();
            for (ServiceInfo serviceInfo : value) {
                ListenerInfo listener = serviceInfo.getListener();
                if (listener.getPort() == 0) {
                    String name = listener.getName();
                    List<ListenerInfo> listenerInfos = listenerMap.get(fileName);
                    for (ListenerInfo listenerInfo : listenerInfos) {
                        if (name.equals(listenerInfo.getName())) {
                            listener.setPort(listenerInfo.getPort());
                        }
                    }
                }
            }
        }
        this.serviceMap = serviceMap;
        this.listenerMap = listenerMap;
    }