Skip to content

Commit

Permalink
Let setter only accept TreeString instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Apr 6, 2023
1 parent 4c76a89 commit 8b5348d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/edu/hm/hafner/coverage/FileNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ public String getRelativePath() {
* @param relativePath
* the relative path
*/
public void setRelativePath(final String relativePath) {
this.relativePath = TreeString.valueOf(relativePath);
public void setRelativePath(final TreeString relativePath) {
this.relativePath = relativePath;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/edu/hm/hafner/coverage/FileNodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void shouldGetFilePath() {
assertThat(folder.getAll(Metric.FILE)).containsExactly(file);
assertThat(file.getAll(Metric.FILE)).containsExactly(file);

file.setRelativePath(otherPath);
file.setRelativePath(TreeString.valueOf(otherPath));
assertThat(file.getRelativePath()).isEqualTo(otherPath);

assertThat(file.matches(Metric.FILE, fileName)).isTrue();
Expand Down

0 comments on commit 8b5348d

Please sign in to comment.