8349383: (fs) FileTreeWalker.next() superfluous null check of visit() return value

Reviewed-by: djelinski
This commit is contained in:
Brian Burkhalter 2025-02-05 21:40:47 +00:00
parent 379c3f9966
commit b499c827a5

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -319,8 +319,6 @@ class FileTreeWalker implements Closeable {
return null; // stack is empty, we are done return null; // stack is empty, we are done
// continue iteration of the directory at the top of the stack // continue iteration of the directory at the top of the stack
Event ev;
do {
Path entry = null; Path entry = null;
IOException ioe = null; IOException ioe = null;
@ -353,12 +351,8 @@ class FileTreeWalker implements Closeable {
} }
// visit the entry // visit the entry
ev = visit(entry, return visit(entry,
true); // canUseCached true); // canUseCached
} while (ev == null);
return ev;
} }
/** /**