Skip to content

Commit

Permalink
Use correct find class in ExtentTraverser (#2649)
Browse files Browse the repository at this point in the history
use correct find class in ExtentTraverser
  • Loading branch information
SirYwell authored Mar 24, 2024
1 parent c10f58a commit 2dee197
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ public ExtentTraverser<T> last() {
return last;
}

@SuppressWarnings("unchecked")
@Nullable
public <U> U findAndGet(Class<U> clazz) {
ExtentTraverser<Extent> traverser = find(clazz);
return (traverser != null) ? (U) traverser.get() : null;
public <U extends Extent> U findAndGet(Class<U> clazz) {
ExtentTraverser<U> traverser = find(clazz);
return (traverser != null) ? traverser.get() : null;
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 2dee197

Please sign in to comment.