Use correct find class in ExtentTraverser (#2649)

use correct find class in ExtentTraverser
This commit is contained in:
Hannes Greule 2024-03-24 18:02:16 +01:00 committed by GitHub
parent c10f58ac95
commit 2dee197f2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,11 +51,10 @@ public class ExtentTraverser<T extends Extent> {
return last; return last;
} }
@SuppressWarnings("unchecked")
@Nullable @Nullable
public <U> U findAndGet(Class<U> clazz) { public <U extends Extent> U findAndGet(Class<U> clazz) {
ExtentTraverser<Extent> traverser = find(clazz); ExtentTraverser<U> traverser = find(clazz);
return (traverser != null) ? (U) traverser.get() : null; return (traverser != null) ? traverser.get() : null;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")