uschindler commented on a change in pull request #1779:
URL: https://github.com/apache/lucene-solr/pull/1779#discussion_r475820891
##########
File path:
lucene/core/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java
##########
@@ -36,6 +37,26 @@
*/
public class TestDocumentsWriterDeleteQueue extends LuceneTestCase {
+
+ public void testAdvanceReferencesOriginal() {
+ WeakAndNext weakAndNext = new WeakAndNext();
+ DocumentsWriterDeleteQueue next = weakAndNext.next;
+ assertNotNull(next);
+ System.gc();
Review comment:
I would also use a ReferenceQueue to do the check. The weak.get() has a
bad taste to me.
I did not check that System.gc() tries to cleanup weak refs, but if it does
and we can rely on this, I am fine.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]