-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add withPosition() factory method to FileSource #4629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I'm not sure why my review got posted twice. I've hidden one, but now they're both hidden. 😕 |
This comment was marked as outdated.
This comment was marked as outdated.
@mpkorstanje Thanks for the feedback — the code can definitely be simplified, especially with the instance method approach. Let’s see how the discussion on this topic evolves; I’ll keep this marked as a draft for now. |
...t-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSource.java
Outdated
Show resolved
Hide resolved
*/ | ||
@API(status = EXPERIMENTAL, since = "6.0") | ||
public FileSource withPosition(FilePosition filePosition) { | ||
Preconditions.notNull(filePosition, "position must not be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preconditions.notNull(filePosition, "position must not be null"); | |
Preconditions.notNull(filePosition, "filePosition must not be null"); |
130f158
to
bf8423e
Compare
@lslonina the issue has moved off team discussion. Do you have time available to patch up your PR or would you prefer to hand it over? |
Thanks for picking this up. I’ve added |
@API(status = EXPERIMENTAL, since = "6.0") | ||
public FileSource withPosition(FilePosition filePosition) { | ||
Preconditions.notNull(filePosition, "filePosition must not be null"); | ||
return new FileSource(this.file, filePosition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the changes to the constructors and factory methods above and introduce a copy constructor as proposed in #4630 (comment) instead.
return new FileSource(this.file, filePosition); | |
return new FileSource(this, filePosition); |
Good question! Please keep using |
@lslonina Are you going to finish this PR or is @mpkorstanje taking over? |
5ac5aa4
to
c3d041d
Compare
Overview
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@API
annotations