Skip to content

Commit 358cb7d

Browse files
authored
Increase deprecation level for Path.source/sink (#457)
These functions were deprecated with warning for a while. Their removal was postponed from release to release, and it's time to at least increase the deprecation level to error.
1 parent 0329603 commit 358cb7d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/common/src/files/Paths.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,16 @@ public fun Path(base: Path, vararg parts: String): Path {
100100
/**
101101
* Returns [RawSource] for the given file or throws if path is not a file or does not exist
102102
*
103-
* Use of this method is deprecated with warning since kotlinx-io 0.3.0. The method will be removed in 0.7.0.
103+
* Use of this method is deprecated with warning since kotlinx-io 0.3.0, with error since 0.8.0,
104+
* and it will be removed in the future.
104105
*/
105106
@Deprecated(
106107
message = "Use FileSystem.source instead",
107108
replaceWith = ReplaceWith(
108109
expression = "SystemFileSystem.source(this).buffered()",
109110
imports = arrayOf("kotlinx.io.files.FileSystem")
110111
),
111-
level = DeprecationLevel.WARNING
112+
level = DeprecationLevel.ERROR
112113
)
113114
@JvmName("sourceDeprecated")
114115
public fun Path.source(): Source = SystemFileSystem.source(this).buffered()
@@ -117,15 +118,16 @@ public fun Path.source(): Source = SystemFileSystem.source(this).buffered()
117118
* Returns [RawSink] for the given path, creates file if it doesn't exist, throws if it's a directory,
118119
* overwrites contents.
119120
*
120-
* Use of this method is deprecated with warning since kotlinx-io 0.3.0. The method will be removed in 0.7.0.
121+
* Use of this method is deprecated with warning since kotlinx-io 0.3.0, with error since 0.8.0,
122+
* and it will be removed in the future.
121123
*/
122124
@Deprecated(
123125
message = "Use FileSystem.sink instead",
124126
replaceWith = ReplaceWith(
125127
expression = "SystemFileSystem.sink(this).buffered()",
126128
imports = arrayOf("kotlinx.io.files.FileSystem")
127129
),
128-
level = DeprecationLevel.WARNING
130+
level = DeprecationLevel.ERROR
129131
)
130132
@JvmName("sinkDeprecated")
131133
public fun Path.sink(): Sink = SystemFileSystem.sink(this).buffered()

0 commit comments

Comments
 (0)