Skip to content

Conversation

lslonina
Copy link
Contributor

@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

This comment was marked as outdated.

@ALUMINIS650

This comment was marked as outdated.

@lslonina
Copy link
Contributor 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
@marcphilipp marcphilipp linked an issue Jun 6, 2025 that may be closed by this pull request
@mpkorstanje
Copy link
Contributor

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

@lslonina
Copy link
Contributor Author

Thanks for picking this up. I’ve added @API(status = EXPERIMENTAL, since = "6.0"), but if this is a backport candidate, should we change it to since = "5.13.5" instead?

@marcphilipp
Copy link
Member

Thanks for picking this up. I’ve added @API(status = EXPERIMENTAL, since = "6.0"), but if this is a backport candidate, should we change it to since = "5.13.5" instead?

Good question! Please keep using 6.0. We'll adjust it when backporting.

@marcphilipp

This comment was marked as outdated.

@marcphilipp marcphilipp changed the title Add withPosition() factory method to FileSource Add withPosition(FilePosition) method to FileSource Sep 13, 2025
@marcphilipp marcphilipp self-assigned this Sep 13, 2025
@marcphilipp marcphilipp merged commit 64836f5 into junit-team:main Sep 13, 2025
21 checks passed
@marcphilipp
Copy link
Member

Thanks, @lslonina! 👍

mergify bot added a commit to robfrank/linklift that referenced this pull request Oct 7, 2025
Bumps `junit.version` from 5.13.4 to 6.0.0.
Updates `org.junit.jupiter:junit-jupiter-engine` from 5.13.4 to 6.0.0
Release notes

*Sourced from [org.junit.jupiter:junit-jupiter-engine's releases](https://github.com/junit-team/junit-framework/releases).*

> JUnit 6.0.0 = Platform 6.0.0 + Jupiter 6.0.0 + Vintage 6.0.0
>
> See [Release Notes](https://docs.junit.org/6.0.0/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​2897robo`](https://github.com/2897robo) made their first contribution in [junit-team/junit-framework#4525](https://redirect.github.com/junit-team/junit-framework/pull/4525)
> * [`@​strangelookingnerd`](https://github.com/strangelookingnerd) made their first contribution in [junit-team/junit-framework#4683](https://redirect.github.com/junit-team/junit-framework/pull/4683)
> * [`@​eric6iese`](https://github.com/eric6iese) made their first contribution in [junit-team/junit-framework#4717](https://redirect.github.com/junit-team/junit-framework/pull/4717)
> * [`@​raccoonback`](https://github.com/raccoonback) made their first contribution in [junit-team/junit-framework#4822](https://redirect.github.com/junit-team/junit-framework/pull/4822)
> * [`@​currenjin`](https://github.com/currenjin) made their first contribution in [junit-team/junit-framework#4823](https://redirect.github.com/junit-team/junit-framework/pull/4823)
> * [`@​mehulimukherjee`](https://github.com/mehulimukherjee) made their first contribution in [junit-team/junit-framework#4913](https://redirect.github.com/junit-team/junit-framework/pull/4913)
> * [`@​lslonina`](https://github.com/lslonina) made their first contribution in [junit-team/junit-framework#4629](https://redirect.github.com/junit-team/junit-framework/pull/4629)
>
> **Full Changelog**: <junit-team/junit-framework@r5.14.0...r6.0.0>
>
> JUnit 6.0.0-RC3 = Platform 6.0.0-RC3 + Jupiter 6.0.0-RC3 + Vintage 6.0.0-RC3
>
> See [Release Notes](https://docs.junit.org/6.0.0-RC3/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​mehulimukherjee`](https://github.com/mehulimukherjee) made their first contribution in [junit-team/junit-framework#4913](https://redirect.github.com/junit-team/junit-framework/pull/4913)
> * [`@​lslonina`](https://github.com/lslonina) made their first contribution in [junit-team/junit-framework#4629](https://redirect.github.com/junit-team/junit-framework/pull/4629)
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-RC2...r6.0.0-RC3>
>
> JUnit 6.0.0-RC2 = Platform 6.0.0-RC2 + Jupiter 6.0.0-RC2 + Vintage 6.0.0-RC2
>
> See [Release Notes](https://docs.junit.org/6.0.0-RC2/release-notes/).
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-RC1...r6.0.0-RC2>
>
> JUnit 6.0.0-RC1 = Platform 6.0.0-RC1 + Jupiter 6.0.0-RC1 + Vintage 6.0.0-RC1
>
> See [Release Notes](https://docs.junit.org/6.0.0-RC1/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​raccoonback`](https://github.com/raccoonback) made their first contribution in [junit-team/junit-framework#4822](https://redirect.github.com/junit-team/junit-framework/pull/4822)
> * [`@​currenjin`](https://github.com/currenjin) made their first contribution in [junit-team/junit-framework#4823](https://redirect.github.com/junit-team/junit-framework/pull/4823)
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-M2...r6.0.0-RC1>
>
> JUnit 6.0.0-M2 = Platform 6.0.0-M2 + Jupiter 6.0.0-M2 + Vintage 6.0.0-M2
>
> See [Release Notes](https://docs.junit.org/6.0.0-M2/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​eric6iese`](https://github.com/eric6iese) made their first contribution in [junit-team/junit-framework#4717](https://redirect.github.com/junit-team/junit-framework/pull/4717)
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-M1...r6.0.0-M2>

... (truncated)


Commits

* [`4f79594`](junit-team/junit-framework@4f79594) Release 6.0.0
* [`55af30a`](junit-team/junit-framework@55af30a) Revert "Use `develop/6.x` branch for junit-examples during release build"
* [`df3cfdd`](junit-team/junit-framework@df3cfdd) Release 5.14.0
* [`fcb84a2`](junit-team/junit-framework@fcb84a2) Disable backward compatibility check when offline
* [`c9c8344`](junit-team/junit-framework@c9c8344) Prune 5.14.0 release notes
* [`03d8a72`](junit-team/junit-framework@03d8a72) Update broken link to using API Gaurdian with bndtools
* [`3a0b29b`](junit-team/junit-framework@3a0b29b) Use temporary JUnit 6 logo
* [`6603caa`](junit-team/junit-framework@6603caa) Rename `eclipseClasspath` to `eclipseConventions` to avoid confusion
* [`ab3470b`](junit-team/junit-framework@ab3470b) Make sealed `MediaType` work in Eclipse
* [`a8cd41e`](junit-team/junit-framework@a8cd41e) Remove annotations not visible in Eclipse
* Additional commits viewable in [compare view](junit-team/junit-framework@r5.13.4...r6.0.0)
  
Updates `org.junit.jupiter:junit-jupiter-params` from 5.13.4 to 6.0.0
Release notes

*Sourced from [org.junit.jupiter:junit-jupiter-params's releases](https://github.com/junit-team/junit-framework/releases).*

> JUnit 6.0.0 = Platform 6.0.0 + Jupiter 6.0.0 + Vintage 6.0.0
>
> See [Release Notes](https://docs.junit.org/6.0.0/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​2897robo`](https://github.com/2897robo) made their first contribution in [junit-team/junit-framework#4525](https://redirect.github.com/junit-team/junit-framework/pull/4525)
> * [`@​strangelookingnerd`](https://github.com/strangelookingnerd) made their first contribution in [junit-team/junit-framework#4683](https://redirect.github.com/junit-team/junit-framework/pull/4683)
> * [`@​eric6iese`](https://github.com/eric6iese) made their first contribution in [junit-team/junit-framework#4717](https://redirect.github.com/junit-team/junit-framework/pull/4717)
> * [`@​raccoonback`](https://github.com/raccoonback) made their first contribution in [junit-team/junit-framework#4822](https://redirect.github.com/junit-team/junit-framework/pull/4822)
> * [`@​currenjin`](https://github.com/currenjin) made their first contribution in [junit-team/junit-framework#4823](https://redirect.github.com/junit-team/junit-framework/pull/4823)
> * [`@​mehulimukherjee`](https://github.com/mehulimukherjee) made their first contribution in [junit-team/junit-framework#4913](https://redirect.github.com/junit-team/junit-framework/pull/4913)
> * [`@​lslonina`](https://github.com/lslonina) made their first contribution in [junit-team/junit-framework#4629](https://redirect.github.com/junit-team/junit-framework/pull/4629)
>
> **Full Changelog**: <junit-team/junit-framework@r5.14.0...r6.0.0>
>
> JUnit 6.0.0-RC3 = Platform 6.0.0-RC3 + Jupiter 6.0.0-RC3 + Vintage 6.0.0-RC3
>
> See [Release Notes](https://docs.junit.org/6.0.0-RC3/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​mehulimukherjee`](https://github.com/mehulimukherjee) made their first contribution in [junit-team/junit-framework#4913](https://redirect.github.com/junit-team/junit-framework/pull/4913)
> * [`@​lslonina`](https://github.com/lslonina) made their first contribution in [junit-team/junit-framework#4629](https://redirect.github.com/junit-team/junit-framework/pull/4629)
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-RC2...r6.0.0-RC3>
>
> JUnit 6.0.0-RC2 = Platform 6.0.0-RC2 + Jupiter 6.0.0-RC2 + Vintage 6.0.0-RC2
>
> See [Release Notes](https://docs.junit.org/6.0.0-RC2/release-notes/).
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-RC1...r6.0.0-RC2>
>
> JUnit 6.0.0-RC1 = Platform 6.0.0-RC1 + Jupiter 6.0.0-RC1 + Vintage 6.0.0-RC1
>
> See [Release Notes](https://docs.junit.org/6.0.0-RC1/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​raccoonback`](https://github.com/raccoonback) made their first contribution in [junit-team/junit-framework#4822](https://redirect.github.com/junit-team/junit-framework/pull/4822)
> * [`@​currenjin`](https://github.com/currenjin) made their first contribution in [junit-team/junit-framework#4823](https://redirect.github.com/junit-team/junit-framework/pull/4823)
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-M2...r6.0.0-RC1>
>
> JUnit 6.0.0-M2 = Platform 6.0.0-M2 + Jupiter 6.0.0-M2 + Vintage 6.0.0-M2
>
> See [Release Notes](https://docs.junit.org/6.0.0-M2/release-notes/).
>
> New Contributors
> ----------------
>
> * [`@​eric6iese`](https://github.com/eric6iese) made their first contribution in [junit-team/junit-framework#4717](https://redirect.github.com/junit-team/junit-framework/pull/4717)
>
> **Full Changelog**: <junit-team/junit-framework@r6.0.0-M1...r6.0.0-M2>

... (truncated)


Commits

* [`4f79594`](junit-team/junit-framework@4f79594) Release 6.0.0
* [`55af30a`](junit-team/junit-framework@55af30a) Revert "Use `develop/6.x` branch for junit-examples during release build"
* [`df3cfdd`](junit-team/junit-framework@df3cfdd) Release 5.14.0
* [`fcb84a2`](junit-team/junit-framework@fcb84a2) Disable backward compatibility check when offline
* [`c9c8344`](junit-team/junit-framework@c9c8344) Prune 5.14.0 release notes
* [`03d8a72`](junit-team/junit-framework@03d8a72) Update broken link to using API Gaurdian with bndtools
* [`3a0b29b`](junit-team/junit-framework@3a0b29b) Use temporary JUnit 6 logo
* [`6603caa`](junit-team/junit-framework@6603caa) Rename `eclipseClasspath` to `eclipseConventions` to avoid confusion
* [`ab3470b`](junit-team/junit-framework@ab3470b) Make sealed `MediaType` work in Eclipse
* [`a8cd41e`](junit-team/junit-framework@a8cd41e) Remove annotations not visible in Eclipse
* Additional commits viewable in [compare view](junit-team/junit-framework@r5.13.4...r6.0.0)
  
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce withPosition() "wither" method in FileSource
5 participants