void () { File root1 = new File(myRoot, "root1"); File root2 = new File(myRoot, "root2"); JpsModule module = addModule(); addContentRoot(module, root1); addContentRoot(module, root2); assertSame(FileFilters.EVERYTHING, createIndex().getModuleFileFilterHonorExclusionPatterns(module)); module.addExcludePattern(JpsPathUtil.pathToUrl(root1.getAbsolutePath()), "*.txt"); module.addExcludePattern(JpsPathUtil.pathToUrl(root2.getAbsolutePath()), "out"); assertExcluded(new File(root1, "a.txt")); assertExcluded(new File(root1, "dir/a.txt")); assertNotExcluded(new File(root1, "A.java")); assertNotExcluded(new File(root2, "a.txt")); assertExcluded(new File(root2, "out")); assertExcluded(new File(root2, "out/A.java")); assertExcluded(new File(root2, "dir/out/A.java")); FileFilter moduleFilter = createIndex().getModuleFileFilterHonorExclusionPatterns(module); assertTrue(moduleFilter.accept(new File(root1, "A.java"))); assertTrue(moduleFilter.accept(new File(root2, "a.txt"))); assertFalse(moduleFilter.accept(new File(root1, "a.txt"))); assertFalse(moduleFilter.accept(new File(root1, "dir/a.txt"))); }