File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
compiler/src/dotty/tools/dotc/config Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ package dotty.tools
22package dotc
33package config
44
5- import java .security .AccessControlException
6-
75/** For placing a wrapper function around property functions.
86 * Motivated by places like google app engine throwing exceptions
97 * on property lookups.
@@ -29,6 +27,14 @@ trait WrappedProperties extends PropertiesTrait {
2927
3028object WrappedProperties {
3129 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+ }
3339 }
3440}
You can’t perform that action at this time.
0 commit comments