File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,12 @@ import java.security._
4
4
5
5
import scala .language .reflectiveCalls
6
6
7
+ // SecurityManager is deprecated on JDK 17, so we sprinkle `@deprecated` around
8
+
7
9
object Test {
8
10
trait Bar { def bar : Unit }
9
11
12
+ @ deprecated
10
13
object Mgr extends SecurityManager {
11
14
override def checkPermission (perm : Permission ) = perm match {
12
15
case _ : java.lang.RuntimePermission => ()
@@ -24,6 +27,7 @@ object Test {
24
27
def doDestroy ( obj : Destroyable ) : Unit = obj.destroy();
25
28
doDestroy( p );
26
29
}
30
+ @ deprecated
27
31
def t2 () = {
28
32
System .setSecurityManager(Mgr )
29
33
@@ -34,11 +38,11 @@ object Test {
34
38
structural.bar
35
39
}
36
40
37
- def main (args : Array [String ]) {
41
+ def main (args : Array [String ]): Unit = {
38
42
// figuring this will otherwise break on windows
39
43
try t1()
40
44
catch { case _ : java.io.IOException => () }
41
45
42
- t2()
46
+ t2(): @ annotation.nowarn( " cat=deprecation " )
43
47
}
44
48
}
You can’t perform that action at this time.
0 commit comments