Skip to content

Commit 0ea0a4d

Browse files
authored
Merge pull request scala/scala#10335 from SethTisue/restarr-jdk20
2 parents d53bdec + f18bb4d commit 0ea0a4d

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

library/src/scala/io/Source.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ object Source {
132132
/** same as fromURL(new URL(s))
133133
*/
134134
def fromURL(s: String)(implicit codec: Codec): BufferedSource =
135-
fromURL(new URL(s))(codec)
135+
fromURL(new URI(s).toURL)(codec)
136136

137137
/** same as fromInputStream(url.openStream())(Codec(enc))
138138
*/

library/src/scala/util/Using.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ object Using {
226226
}
227227

228228
private def preferentiallySuppress(primary: Throwable, secondary: Throwable): Throwable = {
229+
@annotation.nowarn("cat=deprecation") // avoid warning on mention of ThreadDeath
229230
def score(t: Throwable): Int = t match {
230231
case _: VirtualMachineError => 4
231232
case _: LinkageError => 3

library/src/scala/util/control/NonFatal.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ object NonFatal {
3636
/**
3737
* Returns true if the provided `Throwable` is to be considered non-fatal, or false if it is to be considered fatal
3838
*/
39+
@annotation.nowarn("cat=deprecation") // avoid warning on mention of ThreadDeath
3940
def apply(t: Throwable): Boolean = t match {
4041
// VirtualMachineError includes OutOfMemoryError and other fatal errors
4142
case _: VirtualMachineError | _: ThreadDeath | _: InterruptedException | _: LinkageError | _: ControlThrowable => false

0 commit comments

Comments
 (0)