Skip to content

Commit 3bdd14c

Browse files
EcljpseB0Tjukzi
authored andcommitted
rename IFile.createOrReplace to IFile.write
1 parent 4bc9111 commit 3bdd14c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public default void create(byte[] content, int createFlags, IProgressMonitor mon
435435
* @throws CoreException if this method fails or is canceled.
436436
* @since 3.21
437437
*/
438-
public default void createOrReplace(byte[] content, boolean force, boolean derived, boolean keepHistory,
438+
public default void write(byte[] content, boolean force, boolean derived, boolean keepHistory,
439439
IProgressMonitor monitor) throws CoreException {
440440
Objects.requireNonNull(content);
441441
create(content, (force ? IResource.FORCE : 0) | (derived ? IResource.DERIVED : 0)

resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/IFileTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ public void testCreateBytes() throws CoreException {
484484
}
485485

486486
@Test
487-
public void testCreateOrUpdateDerived() throws CoreException {
487+
public void testWrite() throws CoreException {
488488
/* set local history policies */
489489
IWorkspaceDescription description = getWorkspace().getDescription();
490490
description.setMaxFileStates(4);
@@ -502,14 +502,14 @@ public void testCreateOrUpdateDerived() throws CoreException {
502502
}
503503
assertEquals(!deleteBefore, derived.exists());
504504
FussyProgressMonitor monitor = new FussyProgressMonitor();
505-
derived.createOrReplace(("updateOrCreate" + i).getBytes(), false, setDerived, keepHistory, monitor);
505+
derived.write(("updateOrCreate" + i).getBytes(), false, setDerived, keepHistory, monitor);
506506
monitor.assertUsedUp();
507507
assertEquals(setDerived, derived.isDerived());
508508
assertFalse(derived.isTeamPrivateMember());
509509
assertTrue(derived.exists());
510510

511511
IFileState[] history1 = derived.getHistory(null);
512-
derived.createOrReplace(("update" + i).getBytes(), false, false, keepHistory, null);
512+
derived.write(("update" + i).getBytes(), false, false, keepHistory, null);
513513
IFileState[] history2 = derived.getHistory(null);
514514
assertEquals(keepHistory ? 1 : 0, history2.length - history1.length);
515515
}

team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void commit(IProgressMonitor pm) throws CoreException {
7474
IResource resource = getResource();
7575
if (resource instanceof IFile file) {
7676
byte[] bytes = getContent();
77-
file.createOrReplace(bytes, false, false, true, pm);
77+
file.write(bytes, false, false, true, pm);
7878
fDirty = false;
7979
}
8080
}

team/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceTypedElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void commit(IProgressMonitor monitor) throws CoreException {
9494
if (resource instanceof IFile file) {
9595
byte[] content = getContent();
9696
try {
97-
file.createOrReplace(content, false, false, true, monitor);
97+
file.write(content, false, false, true, monitor);
9898
fDirty = false;
9999
} finally {
100100
fireContentChanged();

0 commit comments

Comments
 (0)