Skip to content

Commit

Permalink
SLLS-109 Fix duplicate publication of hotspots with semantically equi…
Browse files Browse the repository at this point in the history
…valent file URIs
  • Loading branch information
jblievremont committed Jan 30, 2023
1 parent 0283c59 commit ae9f8bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ public Optional<URI> serverPathToFileUri(String serverPath) {
.filter(e -> e.getValue().isPresent())
.map(e -> tryResolveLocalFile(serverPath, e.getKey(), e.getValue().get()))
.flatMap(Optional::stream)
.map(File::toURI)
.map(File::toPath)
.map(Path::toUri)
.findFirst();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ void should_return_optional_on_valid_path() {
var uri = underTest.serverPathToFileUri(serverPath);

assertThat(uri).isNotEmpty();
assertThat(uri.get().toString()).contains("src/test/resources/sample-folder/Test.java");
assertThat(uri.get().toString())
.startsWith("file:///")
.contains("src/test/resources/sample-folder/Test.java");
}

@Test
Expand Down

0 comments on commit ae9f8bf

Please sign in to comment.