void (@NotNull OrderRootType type, @NotNull ModuleRootModel rootModel, @NotNull Collection<String> result, boolean includeProduction, boolean includeTests, @NotNull List<? extends OrderEnumerationHandler> customHandlers) { if (type.equals(OrderRootType.SOURCES)) { if (includeProduction) { Collections.addAll(result, rootModel.getSourceRootUrls(includeTests)); } else { for (ContentEntry entry : rootModel.getContentEntries()) { for (SourceFolder folder : entry.getSourceFolders(JavaModuleSourceRootTypes.TESTS)) { result.add(folder.getUrl()); } } } } else if (type.equals(OrderRootType.CLASSES)) { boolean hasTests = false; boolean hasProduction = false; for (ContentEntry contentEntry : rootModel.getContentEntries()) { for (SourceFolder sourceFolder : contentEntry.getSourceFolders()) { if (sourceFolder.isTestSource()) { hasTests = true; } else { hasProduction = true; } } } includeTests &= hasTests; includeProduction &= hasProduction; final CompilerModuleExtension extension = rootModel.getModuleExtension(CompilerModuleExtension.class); if (extension != null) { if (myWithoutSelfModuleOutput && myOrderEnumerator.isRootModuleModel(rootModel)) { if (includeTests && includeProduction) { Collections.addAll(result, extension.getOutputRootUrls(false)); } } else { if (includeProduction) { Collections.addAll(result, extension.getOutputRootUrls(includeTests)); } else if (includeTests) { ContainerUtil.addIfNotNull(result, extension.getCompilerOutputUrlForTests()); } } } } OrderEnumeratorBase.addCustomRootsUrlsForModule(type, rootModel, result, includeProduction, includeTests, customHandlers); }