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

Improve ICollector usage #918

Open
1 task done
paulirwin opened this issue Feb 24, 2024 · 0 comments
Open
1 task done

Improve ICollector usage #918

paulirwin opened this issue Feb 24, 2024 · 0 comments
Labels
design is:enhancement New feature or request is:task A chore to be done pri:normal up-for-grabs This issue is open to be worked on by anyone

Comments

@paulirwin
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Task description

Context: #914 (comment)

From @NightOwl888:

Due to covariance issues with Lucene.Net.Grouping, we changed Collector from an abstract class to an interface. However, we also have a static Collector class that is only used to put constants that are not possible to put on an interface in .NET. We should probably change that static class back to an abstract class that implements ICollector and leave ICollector on all of the methods throughout the codebase. This makes it easier for users who are copying code from Java to implement a collector.

However, we need an analyzer to ensure that none of our internal code actually accepts Collector as an argument.

Do note that we could potentially get rid of the ICollector interface altogether if the GroupingSearch class were divided into 3 separate classes instead of having main Search methods that deal with object closing types. I would really like to get rid of the non-generic IDictionary and ICollection usages in Lucene.Net.Grouping and Lucene.Net.Queries and replace them with generics prior to the release. J2N doesn't fully support non-generic collection interfaces, so it is best not to use them at all.

@rclabo did some analysis in this area and added some tests (as demos), so he would be a big help to accomplish this.

@paulirwin paulirwin added the is:task A chore to be done label Feb 24, 2024
@NightOwl888 NightOwl888 added up-for-grabs This issue is open to be worked on by anyone design is:enhancement New feature or request pri:normal labels Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design is:enhancement New feature or request is:task A chore to be done pri:normal up-for-grabs This issue is open to be worked on by anyone
Projects
None yet
Development

No branches or pull requests

2 participants