In reply to your comments:
The two functions are exactly the same and that is why they have the same name. They do exactly the same thing, but we cannot write them only once (or maybe we there is a workaround in that I'm unaware of yet, feel free to help us).
The reason why we cannot is that Gradle runs in three stages, Initialization, Configuration, and Execution. The initialization stage is different from the other stages and cannot reuse code. So build.gradle is not visible to settings.gradle and vice-versa because they are parsed in different time-lines.
In most projects this does not happen, but because of the complexity and non-standard directory structure in OFBiz, we needed that same bit of code in both the initialization phase (to create the subprojects) and in the other phases for everything else.
I hope this answers your inquiries.