Skip to content

Commit

Permalink
rename switch per API review
Browse files Browse the repository at this point in the history
  • Loading branch information
krwq committed Jul 17, 2023
1 parent 0dc5170 commit 5c49b26
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<linker>
<assembly fullname="System.Private.Xml">
<type fullname="System.Xml.LocalAppContextSwitches">
<method signature="System.Boolean get_AllowResolvingUrlsByDefault()" body="stub" value="false"
feature="System.Xml.AllowResolvingUrlsByDefault" featurevalue="false" />
<method signature="System.Boolean get_IsNetworkingEnabledByDefault()" body="stub" value="false"
feature="System.Xml.XmlResolver.IsNetworkingEnabledByDefault" featurevalue="false" />
</type>
</assembly>
</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ internal static class LocalAppContextSwitches
? value : false;


public static bool AllowResolvingUrlsByDefault { get; } =
public static bool IsNetworkingEnabledByDefault { get; } =
AppContext.TryGetSwitch(
switchName: "System.Xml.AllowResolvingUrlsByDefault",
switchName: "System.Xml.XmlResolver.IsNetworkingEnabledByDefault",
isEnabled: out bool value)
? value : true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ private XmlReader AddConformanceWrapper(XmlReader baseReader)

internal static XmlResolver GetDefaultPermissiveResolver()
{
return LocalAppContextSwitches.AllowResolvingUrlsByDefault ? new XmlUrlResolver() : XmlResolver.FileSystemResolver;
return LocalAppContextSwitches.IsNetworkingEnabledByDefault ? new XmlUrlResolver() : XmlResolver.FileSystemResolver;
}

[DoesNotReturn]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
ExtraTrimmerArgs="--enable-opt sealer" />
<TestConsoleAppSourceFiles Include="XmlSerializer.Serialize.cs" />
<TestConsoleAppSourceFiles Include="XslCompiledTransformTests.cs" />
<TestConsoleAppSourceFiles Include="XmlUrlResolverDefaults.DisallowResolvingUrlsByDefault.cs">
<DisabledFeatureSwitches>System.Xml.AllowResolvingUrlsByDefault</DisabledFeatureSwitches>
<TestConsoleAppSourceFiles Include="XmlUrlResolverDefaults.Disabled.IsNetworkingEnabledByDefault.cs">
<DisabledFeatureSwitches>System.Xml.XmlResolver.IsNetworkingEnabledByDefault</DisabledFeatureSwitches>
</TestConsoleAppSourceFiles>
<TestConsoleAppSourceFiles Include="XmlUrlResolverDefaults.AllowResolvingUrlsByDefault.cs">
<EnabledFeatureSwitches>System.Xml.AllowResolvingUrlsByDefault</EnabledFeatureSwitches>
<TestConsoleAppSourceFiles Include="XmlUrlResolverDefaults.IsNetworkingEnabledByDefault.cs">
<EnabledFeatureSwitches>System.Xml.XmlResolver.IsNetworkingEnabledByDefault</EnabledFeatureSwitches>
</TestConsoleAppSourceFiles>
</ItemGroup>

Expand Down

0 comments on commit 5c49b26

Please sign in to comment.