Skip to content

Commit e69cedb

Browse files
committed
Push down null invariant check and Javadoc.
1 parent ef2c5e3 commit e69cedb

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/main/java/org/apache/commons/io/FileCleaningTracker.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ private static final class Tracker extends PhantomReference<Object> {
106106
* @param marker the marker object used to track the file, not null.
107107
* @param queue the queue on to which the tracker will be pushed, not null.
108108
*/
109-
Tracker(final String path, final FileDeleteStrategy deleteStrategy, final Object marker,
110-
final ReferenceQueue<? super Object> queue) {
109+
Tracker(final String path, final FileDeleteStrategy deleteStrategy, final Object marker, final ReferenceQueue<? super Object> queue) {
111110
super(marker, queue);
112-
this.path = path;
111+
this.path = Objects.requireNonNull(path, "path");
113112
this.deleteStrategy = deleteStrategy == null ? FileDeleteStrategy.NORMAL : deleteStrategy;
114113
}
115114

@@ -171,6 +170,7 @@ public FileCleaningTracker() {
171170
* @param path the full path to the file to be tracked, not null.
172171
* @param marker the marker object used to track the file, not null.
173172
* @param deleteStrategy the strategy to delete the file, null means normal.
173+
* @throws NullPointerException Thrown if the path is null.
174174
*/
175175
private synchronized void addTracker(final String path, final Object marker, final FileDeleteStrategy
176176
deleteStrategy) {
@@ -316,10 +316,9 @@ public void track(final String path, final Object marker) {
316316
* @param path the full path to the file to be tracked, not null.
317317
* @param marker the marker object used to track the file, not null.
318318
* @param deleteStrategy the strategy to delete the file, null means normal.
319-
* @throws NullPointerException if the path is null.
319+
* @throws NullPointerException Thrown if the path is null.
320320
*/
321321
public void track(final String path, final Object marker, final FileDeleteStrategy deleteStrategy) {
322-
Objects.requireNonNull(path, "path");
323322
addTracker(path, marker, deleteStrategy);
324323
}
325324

0 commit comments

Comments
 (0)