Skip to content

Commit 851b2e3

Browse files
author
Brian Burkhalter
committed
6245663: (spec) File.renameTo(File) changes the file-system object, not the File instance
Reviewed-by: rriggs, naoto, alanb
1 parent c4f17a3 commit 851b2e3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/java.base/share/classes/java/io/File.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1994, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1376,7 +1376,9 @@ public boolean mkdirs() {
13761376
* file from one filesystem to another, it might not be atomic, and it
13771377
* might not succeed if a file with the destination abstract pathname
13781378
* already exists. The return value should always be checked to make sure
1379-
* that the rename operation was successful.
1379+
* that the rename operation was successful. As instances of {@code File}
1380+
* are immutable, this File object is not changed to name the destination
1381+
* file or directory.
13801382
*
13811383
* <p> Note that the {@link java.nio.file.Files} class defines the {@link
13821384
* java.nio.file.Files#move move} method to move or rename a file in a

0 commit comments

Comments
 (0)