You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "paulirwin (via GitHub)" <gi...@apache.org> on 2024/12/06 05:39:46 UTC
[PR] SWEEP: Make anonymous class members default to private instead of internal, #715 [lucenenet]
paulirwin opened a new pull request, #1061:
URL: https://github.com/apache/lucenenet/pull/1061
- [X] You've read the [Contributor Guide](https://github.com/apache/lucenenet/blob/main/CONTRIBUTING.md) and [Code of Conduct](https://www.apache.org/foundation/policies/conduct.html).
- [ ] You've included unit or integration tests for your change, where applicable.
- [ ] You've included inline docs for your change, where applicable.
- [X] There's an open issue for the PR that you are making. If you'd like to propose a change, please [open an issue](https://github.com/apache/lucenenet/issues/new/choose) to discuss the change or find an existing issue.
Make anonymous class members default to private instead of internal
Fixes #715
## Description
See #715 for info and rationale. This makes "AnonymousClass" implementation members private instead of internal where possible (and readonly, where possible). This also takes the opportunity to remove redundant constructors and unused "outerInstance" fields where applicable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SWEEP: Make anonymous class members default to private instead of internal, #715 [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin commented on code in PR #1061:
URL: https://github.com/apache/lucenenet/pull/1061#discussion_r1884219980
##########
src/Lucene.Net/Search/NumericRangeQuery.cs:
##########
@@ -430,7 +430,7 @@ public Int64RangeBuilderAnonymousClass(NumericRangeTermsEnum outerInstance)
this.outerInstance = outerInstance;
}
- public override sealed void AddRange(BytesRef minPrefixCoded, BytesRef maxPrefixCoded)
+ public override void AddRange(BytesRef minPrefixCoded, BytesRef maxPrefixCoded)
Review Comment:
This was removed because it's redundant because the class is marked `sealed`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SWEEP: Make anonymous class members default to private instead of internal, #715 [lucenenet]
Posted by "NightOwl888 (via GitHub)" <gi...@apache.org>.
NightOwl888 commented on code in PR #1061:
URL: https://github.com/apache/lucenenet/pull/1061#discussion_r1883322501
##########
src/Lucene.Net/Search/NumericRangeQuery.cs:
##########
@@ -446,7 +446,7 @@ public Int32RangeBuilderAnonymousClass(NumericRangeTermsEnum outerInstance)
this.outerInstance = outerInstance;
}
- public override sealed void AddRange(BytesRef minPrefixCoded, BytesRef maxPrefixCoded)
+ public override void AddRange(BytesRef minPrefixCoded, BytesRef maxPrefixCoded)
Review Comment:
`sealed` is how this is declared upstream. I realize it makes no difference (it isn't possible to inherit an anonymous class), but let's keep the declaration in sync.
https://github.com/apache/lucene/blob/releases/lucene-solr/4.8.0/lucene/core/src/java/org/apache/lucene/search/NumericRangeQuery.java#L472
##########
src/Lucene.Net/Search/NumericRangeQuery.cs:
##########
@@ -430,7 +430,7 @@ public Int64RangeBuilderAnonymousClass(NumericRangeTermsEnum outerInstance)
this.outerInstance = outerInstance;
}
- public override sealed void AddRange(BytesRef minPrefixCoded, BytesRef maxPrefixCoded)
+ public override void AddRange(BytesRef minPrefixCoded, BytesRef maxPrefixCoded)
Review Comment:
`sealed` is how this is declared upstream. I realize it makes no difference (it isn't possible to inherit an anonymous class), but let's keep the declaration in sync.
https://github.com/apache/lucene/blob/releases/lucene-solr/4.8.0/lucene/core/src/java/org/apache/lucene/search/NumericRangeQuery.java#L432
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SWEEP: Make anonymous class members default to private instead of internal, #715 [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin merged PR #1061:
URL: https://github.com/apache/lucenenet/pull/1061
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org