Skip to content

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lslonina
Copy link

@lslonina lslonina commented Jun 6, 2025

  • Refactor creation to avoid redundant canonicalization calls
  • Introduced internal factory methods for clearer construction paths

Overview


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

mpkorstanje

This comment was marked as duplicate.

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Jun 6, 2025

I'm not sure why my review got posted twice. I've hidden one, but now they're both hidden. 😕

@ALUMINIS650
Copy link

how to add?

@lslonina
Copy link
Author

lslonina commented Jun 6, 2025

@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.

@lslonina lslonina marked this pull request as draft June 6, 2025 10:46
*/
@API(status = EXPERIMENTAL, since = "6.0")
public FileSource withPosition(FilePosition filePosition) {
Preconditions.notNull(filePosition, "position must not be null");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Preconditions.notNull(filePosition, "position must not be null");
Preconditions.notNull(filePosition, "filePosition must not be null");

@lslonina lslonina force-pushed the file_source_reuse branch from 130f158 to bf8423e Compare June 10, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High overhead in FileSource due to repeated canonical path resolution during test discovery
5 participants