Skip to content
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

Task: Refactor SetOnce<T> to .NETify #1069

Closed
1 task done
NightOwl888 opened this issue Dec 19, 2024 · 0 comments · Fixed by #1071
Closed
1 task done

Task: Refactor SetOnce<T> to .NETify #1069

NightOwl888 opened this issue Dec 19, 2024 · 0 comments · Fixed by #1071
Assignees
Labels
design good-first-issue Good for newcomers is:task A chore to be done notes:breaking-change Has changes that will break backward compatibility pri:normal up-for-grabs This issue is open to be worked on by anyone

Comments

@NightOwl888
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Task description

SetOnce<T> has Get() and Set() methods without any overloads. This class can be improved by changing Get() and Set() methods to a Value property to match Nullable<T> in .NET.

Get() and Set() should be deprecated and moved to the Support/ObsoleteAPI (for removal in the rc1). This can be done by making SetOnce<T> into a partial class, which allows us to simply delete the whole class to remove the obsolete members.

NOTE: In Java, there was no restriction on which types could be used in SetOnce<T>, but all custom types in Java are reference types. Adapting this class to support value types doesn't seem worth the trouble. Users that need to have this functionality with numeric types can either use reference types from J2N.Numerics or make their own SetOnceInt32 type.

@NightOwl888 NightOwl888 added up-for-grabs This issue is open to be worked on by anyone design good-first-issue Good for newcomers pri:normal is:task A chore to be done notes:breaking-change Has changes that will break backward compatibility labels Dec 19, 2024
@NightOwl888 NightOwl888 added this to the 4.8.0-beta00018 milestone Dec 19, 2024
@paulirwin paulirwin self-assigned this Dec 21, 2024
paulirwin added a commit to paulirwin/lucene.net that referenced this issue Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design good-first-issue Good for newcomers is:task A chore to be done notes:breaking-change Has changes that will break backward compatibility pri:normal up-for-grabs This issue is open to be worked on by anyone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants