File tree 1 file changed +9
-3
lines changed
compiler/src/dotty/tools/dotc/config
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ package dotty.tools
2
2
package dotc
3
3
package config
4
4
5
- import java .security .AccessControlException
6
-
7
5
/** For placing a wrapper function around property functions.
8
6
* Motivated by places like google app engine throwing exceptions
9
7
* on property lookups.
@@ -29,6 +27,14 @@ trait WrappedProperties extends PropertiesTrait {
29
27
30
28
object WrappedProperties {
31
29
object AccessControl extends WrappedProperties {
32
- def wrap [T ](body : => T ): Option [T ] = try Some (body) catch { case _ : AccessControlException => None }
30
+ def wrap [T ](body : => T ): Option [T ] =
31
+ try Some (body)
32
+ catch {
33
+ // the actual exception we are concerned with is AccessControlException,
34
+ // but that's deprecated on JDK 17, so catching its superclass is a convenient
35
+ // way to avoid a deprecation warning
36
+ case _ : SecurityException =>
37
+ None
38
+ }
33
39
}
34
40
}
You can’t perform that action at this time.
0 commit comments