mirror of https://github.com/apache/lucene.git
LUCENE-8503: Call #getDelegate instead of direct member access during unwrap
Filter*Reader instances access the member or the delegate directly instead of calling getDelegate(). In order to track access of the delegate these methods should call #getDelegat()
This commit is contained in:
parent
36eae57163
commit
44dbfaab19
|
@ -37,7 +37,7 @@ public abstract class FilterDirectoryReader extends DirectoryReader {
|
||||||
* an instance of {@link FilterDirectoryReader}. */
|
* an instance of {@link FilterDirectoryReader}. */
|
||||||
public static DirectoryReader unwrap(DirectoryReader reader) {
|
public static DirectoryReader unwrap(DirectoryReader reader) {
|
||||||
while (reader instanceof FilterDirectoryReader) {
|
while (reader instanceof FilterDirectoryReader) {
|
||||||
reader = ((FilterDirectoryReader) reader).in;
|
reader = ((FilterDirectoryReader) reader).getDelegate();
|
||||||
}
|
}
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public abstract class FilterLeafReader extends LeafReader {
|
||||||
* an instance of {@link FilterLeafReader}. */
|
* an instance of {@link FilterLeafReader}. */
|
||||||
public static LeafReader unwrap(LeafReader reader) {
|
public static LeafReader unwrap(LeafReader reader) {
|
||||||
while (reader instanceof FilterLeafReader) {
|
while (reader instanceof FilterLeafReader) {
|
||||||
reader = ((FilterLeafReader) reader).in;
|
reader = ((FilterLeafReader) reader).getDelegate();
|
||||||
}
|
}
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue