You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "slow-J (via GitHub)" <gi...@apache.org> on 2024/06/14 15:42:31 UTC

[PR] Minor cleanup in some Facet tests [lucene]

slow-J opened a new pull request, #13489:
URL: https://github.com/apache/lucene/pull/13489

   Fixing some IDE "warnings", such as removing some dead code + fixing a link + adding use of try-with-resources.
   
   Did not fix `'search(org.apache.lucene.search.Query, org.apache.lucene.search.Collector)' is deprecated`, since it will be fixed as part of Issue: 12892.
   
   While I am already touching these, let me know if anyone has strong opinions and I can also fix the `Statement lambda can be replaced with expression lambda` or `Redundant array creation for calling varargs method` "warnings".
   


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand commented on code in PR #13489:
URL: https://github.com/apache/lucene/pull/13489#discussion_r1640748830


##########
lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetValueSource.java:
##########
@@ -694,7 +694,7 @@ private void checkResults(
                 "dim" + i,
                 new String[0],
                 aggregatedValue,
-                labelValues.toArray(new LabelAndValue[labelValues.size()]),
+                labelValues.toArray(new LabelAndValue[0]),

Review Comment:
   Hmm why this change?  Doesn't it mean we allocate both empty array and correctly sized array with this change, but before we were only allocating the one (correctly sized) array?



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13489:
URL: https://github.com/apache/lucene/pull/13489#issuecomment-2209661435

   This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand commented on PR #13489:
URL: https://github.com/apache/lucene/pull/13489#issuecomment-2169122348

   > While I am already touching these, let me know if anyone has strong opinions and I can also fix the `Statement lambda can be replaced with expression lambda` or `Redundant array creation for calling varargs method` "warnings".
   
   +1 to fix these too!


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on code in PR #13489:
URL: https://github.com/apache/lucene/pull/13489#discussion_r1640936281


##########
lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetValueSource.java:
##########
@@ -694,7 +694,7 @@ private void checkResults(
                 "dim" + i,
                 new String[0],
                 aggregatedValue,
-                labelValues.toArray(new LabelAndValue[labelValues.size()]),
+                labelValues.toArray(new LabelAndValue[0]),

Review Comment:
   We use the `labelValues.toArray(new LabelAndValue[0])` version in other tests as well as source code. I read a little online and this blog post is recommending the `labelValues.toArray(new LabelAndValue[0])` version due to optimizations in the JVM and JIT, making it more performant than the previous version: https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_new_reflective_array



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #13489:
URL: https://github.com/apache/lucene/pull/13489#issuecomment-2169232440

   > > While I am already touching these, let me know if anyone has strong opinions and I can also fix the `Statement lambda can be replaced with expression lambda` or `Redundant array creation for calling varargs method` "warnings".
   > 
   > +1 to fix these too!
   
   Thanks for the review Mike! I'll do these changes while I am at it.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "stefanvodita (via GitHub)" <gi...@apache.org>.
stefanvodita merged PR #13489:
URL: https://github.com/apache/lucene/pull/13489


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "stefanvodita (via GitHub)" <gi...@apache.org>.
stefanvodita commented on PR #13489:
URL: https://github.com/apache/lucene/pull/13489#issuecomment-2221008091

   I went ahead and merged since this PR had been pending for a few weeks. Thank you @slow-J for your contribution and @mikemccand for reviewing!


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "slow-J (via GitHub)" <gi...@apache.org>.
slow-J commented on PR #13489:
URL: https://github.com/apache/lucene/pull/13489#issuecomment-2180605011

   Hi @mikemccand can we merge or are we waiting for more reviewers.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Minor cleanup in some Facet tests [lucene]

Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand commented on PR #13489:
URL: https://github.com/apache/lucene/pull/13489#issuecomment-2225379585

   Thank you @slow-J and @stefanvodita!


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org