@Test public void should_match_suffix() { InputFile inputFile = new TestInputFileBuilder("module1", "src/main/java/org/sonar/test/File.java").build(); FileLocator locator = new FileLocator(Collections.singleton(inputFile)); assertThat(locator.getInputFile("org/sonar/test/File.java")).isEqualTo(inputFile); }
@CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); }
FileLocator { @CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); } }
FileLocator { @CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); } FileLocator(Iterable<InputFile> inputFiles); }
FileLocator { @CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); } FileLocator(Iterable<InputFile> inputFiles);  }
FileLocator { @CheckForNull InputFile getInputFile(String filePath) { String sanitizedPath = PathUtils.sanitize(filePath); if (sanitizedPath == null) { return null; } String[] pathElements = sanitizedPath.split("/"); return tree.getFileWithSuffix(pathElements); } FileLocator(Iterable<InputFile> inputFiles);   }