Source:
public Map<String, String> getMapping(@NotNull IProject project) { Map<String, String> optionsMap = new HashMap<>(); Module module = project.adaptTo(IntelliJProjectImpl.class).getModule(); String moduleTypeName = module.getModuleTypeName(); optionsMap.put(MODULE_TYPE_KEY, moduleTypeName); ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); Sdk sdk = moduleRootManager.getSdk(); String sdkName; if (sdk != null) { sdkName = sdk.getName(); } else { sdkName = ""; } optionsMap.put(SDK_KEY, sdkName); ContentEntry[] contentEntries = moduleRootManager.getContentEntries(); if (contentEntries.length != 1) { throw new IllegalStateException( "Encountered shared module with multiple content roots - " + module); } ContentEntry contentEntry = contentEntries[0]; VirtualFile contentRoot = contentEntry.getFile(); if (contentRoot == null) { throw new IllegalStateException( "Content root for shared module does not have a valid local representation - " + module); } String contentRootPath = contentRoot.getPath(); String sourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaSourceRootType.SOURCE)); optionsMap.put(SOURCE_ROOTS_KEY, sourceRoots); String testSourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaSourceRootType.TEST_SOURCE)); optionsMap.put(TEST_SOURCE_ROOTS_KEY, testSourceRoots); String resourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaResourceRootType.RESOURCE)); optionsMap.put(RESOURCE_ROOTS_KEY, resourceRoots); String testResourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaResourceRootType.TEST_RESOURCE)); optionsMap.put(TEST_RESOURCE_ROOTS_KEY, testResourceRoots); return optionsMap; }

Target:
public Map<String, String> getMapping(@NotNull IProject project) { Map<String, String> optionsMap = new HashMap<>(); Module module = project.adaptTo(IntelliJProjectImpl.class).getModule(); String moduleTypeName = module.getModuleTypeName(); optionsMap.put(MODULE_TYPE_KEY, moduleTypeName); ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); Sdk sdk = moduleRootManager.getSdk(); String sdkName; if (sdk != null) { sdkName = sdk.getName(); } else { sdkName = ""; } optionsMap.put(SDK_KEY, sdkName); ContentEntry[] contentEntries = moduleRootManager.getContentEntries(); if (contentEntries.length != 1) { log.error( "Encountered shared module \"" + module + "\" with multiple content roots. Can not provide source configuration."); return optionsMap; } ContentEntry contentEntry = contentEntries[0]; VirtualFile contentRoot = contentEntry.getFile(); if (contentRoot == null) { log.error( "Encountered content root without a valid local representation for shared module \"" + module + "\". Can not provide source configuration."); return optionsMap; } String contentRootPath = contentRoot.getPath(); String sourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaSourceRootType.SOURCE)); optionsMap.put(SOURCE_ROOTS_KEY, sourceRoots); String testSourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaSourceRootType.TEST_SOURCE)); optionsMap.put(TEST_SOURCE_ROOTS_KEY, testSourceRoots); String resourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaResourceRootType.RESOURCE)); optionsMap.put(RESOURCE_ROOTS_KEY, resourceRoots); String testResourceRoots = flatten(contentRootPath, contentEntry.getSourceFolders(JavaResourceRootType.TEST_RESOURCE)); optionsMap.put(TEST_RESOURCE_ROOTS_KEY, testResourceRoots); return optionsMap; }