diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java index be231909921..d29a5493062 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDirectoryReaderReopen.java @@ -626,7 +626,7 @@ public class TestDirectoryReaderReopen extends LuceneTestCase { MockDirectoryWrapper dir = newMockDirectory(); if (dir instanceof MockDirectoryWrapper) { // ensure we produce enough of our exceptions - ((MockDirectoryWrapper)dir).setEnableVirusScanner(false); + dir.setEnableVirusScanner(false); } IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));