Remove empty lines; correct space on closing square brackets, negative signs, and generic brackets (#8508)

This commit is contained in:
Dongbo Wang
2018-12-21 12:23:04 +05:00
committed by Ilya
parent e999e1dba5
commit 2bfbcd4f07
20 changed files with 38 additions and 56 deletions
@@ -1389,7 +1389,6 @@ namespace Microsoft.PowerShell.Commands
current.Remove(0, current.Length);
}
}
else if (ch == '"')
{
if (seenBeginQuote)
@@ -901,7 +901,6 @@ namespace Microsoft.PowerShell
break;
}
}
else if (MatchSwitch(switchKey, "settingsfile", "settings"))
{
// Parse setting file arg and write error
@@ -62,7 +62,7 @@ namespace Microsoft.PowerShell
/// <summary>
/// Send the telemetry
/// </summary>
private static void SendTelemetry(string eventName, Dictionary<string,string>payload)
private static void SendTelemetry(string eventName, Dictionary<string,string> payload)
{
try
{
@@ -800,7 +800,6 @@ namespace Microsoft.PowerShell.Commands
WriteError(er);
}
}
else
{
foreach (string p in Path)
@@ -3180,7 +3180,7 @@ namespace Microsoft.PowerShell.Commands
// if it exists and does not contain a comma
// a comma, indicates it is not a DNS name
if(cert.Subject.StartsWith(distinguishedNamePrefix, System.StringComparison.InvariantCultureIgnoreCase) &&
cert.Subject.IndexOf(",",System.StringComparison.InvariantCulture)==-1)
cert.Subject.IndexOf(",",System.StringComparison.InvariantCulture) == -1)
{
name = cert.Subject.Substring(distinguishedNamePrefix.Length);
try
@@ -334,7 +334,6 @@ namespace Microsoft.WSMan.Management
_sr = new StreamReader(_fs);
strOut = _sr.ReadToEnd();
}
catch (ArgumentNullException e)
{
ErrorRecord er = new ErrorRecord(e, "ArgumentNullException", ErrorCategory.InvalidArgument, null);
@@ -1078,7 +1077,6 @@ namespace Microsoft.WSMan.Management
}
}
}
catch (IOException e)
{
@@ -7,7 +7,7 @@ using COM = System.Runtime.InteropServices.ComTypes;
namespace System.Management.Automation
{
/// <summary>
/// Summary description for IDispatch.
/// The IDispatch interface.
/// </summary>
[Guid("00020400-0000-0000-c000-000000000046")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
@@ -623,9 +623,9 @@ namespace System.Management.Automation.ComInterop
var attributes = new[] {
new CustomAttributeBuilder(typeof(UnverifiableCodeAttribute).GetConstructor(Type.EmptyTypes), Utils.EmptyArray<object>()),
//PermissionSet(SecurityAction.Demand, Unrestricted = true)
new CustomAttributeBuilder(typeof(PermissionSetAttribute).GetConstructor(new Type[]{typeof(SecurityAction)}),
new object[]{SecurityAction.Demand},
new PropertyInfo[]{typeof(PermissionSetAttribute).GetProperty("Unrestricted")},
new CustomAttributeBuilder(typeof(PermissionSetAttribute).GetConstructor(new Type[] { typeof(SecurityAction) }),
new object[] { SecurityAction.Demand },
new PropertyInfo[] { typeof(PermissionSetAttribute).GetProperty("Unrestricted") },
new object[] {true})
};
@@ -996,8 +996,8 @@ namespace System.Management.Automation
if (LanguagePrimitives.IsNumeric(LanguagePrimitives.GetTypeCode(objType)))
{
ConversionData data = GetConversionData(objType, typeof(bool)) ??
CacheConversion(objType, typeof(bool), CreateNumericToBoolConverter(objType), ConversionRank.Language);
IConversionData data = GetConversionData(objType, typeof(bool)) ??
CacheConversion(objType, typeof(bool), CreateNumericToBoolConverter(objType), ConversionRank.Language);
return (bool)data.Invoke(obj, typeof(bool), false, null, null, null);
}
@@ -4212,7 +4212,7 @@ namespace System.Management.Automation
internal delegate object PSNullConverter(object nullOrAutomationNull);
internal interface ConversionData
internal interface IConversionData
{
object Converter { get; }
ConversionRank Rank { get; }
@@ -4226,7 +4226,7 @@ namespace System.Management.Automation
}
[System.Diagnostics.DebuggerDisplay("{_converter.Method.Name}")]
internal class ConversionData<T> : ConversionData
internal class ConversionData<T> : IConversionData
{
private readonly PSConverter<T> _converter;
@@ -4249,12 +4249,12 @@ namespace System.Management.Automation
}
}
private static Dictionary<ConversionTypePair, ConversionData> s_converterCache = new Dictionary<ConversionTypePair, ConversionData>(256);
private static Dictionary<ConversionTypePair, IConversionData> s_converterCache = new Dictionary<ConversionTypePair, IConversionData>(256);
private static ConversionData CacheConversion<T>(Type fromType, Type toType, PSConverter<T> converter, ConversionRank rank)
private static IConversionData CacheConversion<T>(Type fromType, Type toType, PSConverter<T> converter, ConversionRank rank)
{
ConversionTypePair pair = new ConversionTypePair(fromType, toType);
ConversionData data = null;
IConversionData data = null;
lock (s_converterCache)
{
if (!s_converterCache.TryGetValue(pair, out data))
@@ -4271,11 +4271,11 @@ namespace System.Management.Automation
return data;
}
private static ConversionData GetConversionData(Type fromType, Type toType)
private static IConversionData GetConversionData(Type fromType, Type toType)
{
lock (s_converterCache)
{
ConversionData result = null;
IConversionData result = null;
s_converterCache.TryGetValue(new ConversionTypePair(fromType, toType), out result);
return result;
}
@@ -4608,7 +4608,7 @@ namespace System.Management.Automation
return availableProperties.ToString();
}
internal static ConversionData FigureConversion(object valueToConvert, Type resultType, out bool debase)
internal static IConversionData FigureConversion(object valueToConvert, Type resultType, out bool debase)
{
PSObject valueAsPsObj;
Type originalType;
@@ -4625,7 +4625,7 @@ namespace System.Management.Automation
debase = false;
ConversionData data = FigureConversion(originalType, resultType);
IConversionData data = FigureConversion(originalType, resultType);
if (data.Rank != ConversionRank.None)
{
return data;
@@ -4764,7 +4764,7 @@ namespace System.Management.Automation
throw new PSInvalidCastException("ConversionSupportedOnlyToCoreTypes", null, ExtendedTypeSystem.InvalidCastExceptionNonCoreType, resultType.ToString());
}
private static ConversionData FigureLanguageConversion(Type fromType, Type toType,
private static IConversionData FigureLanguageConversion(Type fromType, Type toType,
out PSConverter<object> valueDependentConversion,
out ConversionRank valueDependentRank)
{
@@ -4774,7 +4774,7 @@ namespace System.Management.Automation
Type underlyingType = Nullable.GetUnderlyingType(toType);
if (underlyingType != null)
{
ConversionData nullableConversion = FigureConversion(fromType, underlyingType);
IConversionData nullableConversion = FigureConversion(fromType, underlyingType);
if (nullableConversion.Rank != ConversionRank.None)
{
return CacheConversion<object>(fromType, toType, LanguagePrimitives.ConvertToNullable, nullableConversion.Rank);
@@ -4834,7 +4834,7 @@ namespace System.Management.Automation
return CacheConversion<object>(fromType, toType, LanguagePrimitives.ConvertEnumerableToArray, ConversionRank.Language);
}
ConversionData data = FigureConversion(fromType, toElementType);
IConversionData data = FigureConversion(fromType, toElementType);
if (data.Rank != ConversionRank.None)
{
valueDependentRank = data.Rank & ConversionRank.ValueDependent;
@@ -5441,9 +5441,9 @@ namespace System.Management.Automation
}
internal class InternalPSObject : PSObject { }
internal static ConversionData FigureConversion(Type fromType, Type toType)
internal static IConversionData FigureConversion(Type fromType, Type toType)
{
ConversionData data = GetConversionData(fromType, toType);
IConversionData data = GetConversionData(fromType, toType);
if (data != null)
{
return data;
@@ -5512,7 +5512,7 @@ namespace System.Management.Automation
PSConverter<object> valueDependentConversion = null;
ConversionRank valueDependentRank = ConversionRank.None;
ConversionData conversionData = FigureLanguageConversion(fromType, toType, out valueDependentConversion, out valueDependentRank);
IConversionData conversionData = FigureLanguageConversion(fromType, toType, out valueDependentConversion, out valueDependentRank);
if (conversionData != null)
{
return conversionData;
@@ -5632,9 +5632,9 @@ namespace System.Management.Automation
}
internal class Null { };
private static ConversionData FigureConversionFromNull(Type toType)
private static IConversionData FigureConversionFromNull(Type toType)
{
ConversionData data = GetConversionData(typeof(Null), toType);
IConversionData data = GetConversionData(typeof(Null), toType);
if (data != null)
{
return data;
@@ -716,8 +716,8 @@ namespace System.Management.Automation
}
}
if ((dashIndex != - 1 && String.IsNullOrEmpty(preLabel)) ||
(plusIndex != - 1 && String.IsNullOrEmpty(buildLabel)) ||
if ((dashIndex != -1 && String.IsNullOrEmpty(preLabel)) ||
(plusIndex != -1 && String.IsNullOrEmpty(buildLabel)) ||
String.IsNullOrEmpty(versionSansLabel))
{
// We have dash and no preReleaseLabel or
@@ -4643,7 +4643,6 @@ namespace System.Management.Automation
if (providerPaths.Count > 0)
providerPath = providerPaths[0];
}
catch (DriveNotFoundException)
{
// This exception is expected for remote sessions where drives exist in a remote session but not
@@ -1505,7 +1505,6 @@ namespace System.Management.Automation
}
}
}
catch (ArgumentException)
{
throwNotSupported = true;
@@ -63,7 +63,7 @@ namespace System.Management.Automation.Interpreter
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public InstructionList.DebugView.InstructionView[]/*!*/ A0
public InstructionList.DebugView.InstructionView[] A0
{
get
{
@@ -109,7 +109,7 @@ namespace System.Management.Automation.Interpreter
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public InstructionView[]/*!*/ A0
public InstructionView[] A0
{
get
{
@@ -368,7 +368,7 @@ namespace System.Management.Automation.Language
internal static readonly FieldInfo PSObject_isDeserialized =
typeof(PSObject).GetField(nameof(PSObject.isDeserialized), instanceFlags);
internal static readonly MethodInfo PSObject_ToStringParser =
typeof(PSObject).GetMethod(nameof(PSObject.ToStringParser), staticFlags, null, new[]{typeof(ExecutionContext), typeof(object)}, null);
typeof(PSObject).GetMethod(nameof(PSObject.ToStringParser), staticFlags, null, new[] { typeof(ExecutionContext), typeof(object) }, null);
internal static readonly PropertyInfo PSReference_Value =
typeof(PSReference).GetProperty(nameof(PSReference.Value));
@@ -852,7 +852,7 @@ namespace Microsoft.PowerShell.Commands
{
Uri uri = new System.Uri("ssh://" + hostname);
host = ResolveComputerName(uri.Host);
ValidateComputerName(new string[]{host});
ValidateComputerName(new string[] { host });
if (uri.UserInfo != String.Empty)
{
userName = uri.UserInfo;
@@ -277,7 +277,6 @@ namespace System.Management.Automation.Remoting
{
serverTransportMgr = new WSManPluginServerTransportManager(BaseTransportManager.DefaultFragmentSize, new PSRemotingCryptoHelperServer());
}
else
{
serverTransportMgr = new WSManPluginServerTransportManager(BaseTransportManager.DefaultFragmentSize, null);
@@ -3820,7 +3820,7 @@ namespace System.Management.Automation.Language
return null;
}
internal static Expression InvokeConverter(LanguagePrimitives.ConversionData conversion,
internal static Expression InvokeConverter(LanguagePrimitives.IConversionData conversion,
Expression value,
Type resultType,
bool debase,
@@ -7455,9 +7455,7 @@ namespace System.Management.Automation.Language
private static readonly
Dictionary<Tuple<CallInfo, PSMethodInvocationConstraints, bool>, PSCreateInstanceBinder>
s_binderCache =
new Dictionary
<Tuple<CallInfo, PSMethodInvocationConstraints, bool>, PSCreateInstanceBinder>(
new KeyComparer());
new Dictionary<Tuple<CallInfo, PSMethodInvocationConstraints, bool>, PSCreateInstanceBinder>(new KeyComparer());
public static PSCreateInstanceBinder Get(CallInfo callInfo, PSMethodInvocationConstraints constraints, bool publicTypeOnly = false)
{
@@ -7632,9 +7630,7 @@ namespace System.Management.Automation.Language
private static readonly
Dictionary<Tuple<CallInfo, PSMethodInvocationConstraints>, PSInvokeBaseCtorBinder>
s_binderCache =
new Dictionary
<Tuple<CallInfo, PSMethodInvocationConstraints>, PSInvokeBaseCtorBinder>(
new KeyComparer());
new Dictionary<Tuple<CallInfo, PSMethodInvocationConstraints>, PSInvokeBaseCtorBinder>(new KeyComparer());
public static PSInvokeBaseCtorBinder Get(CallInfo callInfo, PSMethodInvocationConstraints constraints)
{
@@ -3373,7 +3373,6 @@ namespace Microsoft.PowerShell.Commands
{
CopyItemFromRemoteSession(path, destinationPath, recurse, Force, fromSession);
}
else
{
// Copy-Item to session
@@ -3385,9 +3384,7 @@ namespace Microsoft.PowerShell.Commands
CopyItemLocalOrToSession(path, destinationPath, recurse, Force, ps);
}
}
// Copy-Item local
else
else // Copy-Item local
{
CopyItemLocalOrToSession(path, destinationPath, recurse, Force, null);
}
@@ -1713,25 +1713,22 @@ namespace System.Management.Automation
bool result = false;
// Is it the global scope?
if (String.Compare(
driveName,
StringLiterals.Global,
StringComparison.OrdinalIgnoreCase) == 0)
{
// It's the global scope.
s_tracer.WriteLine("match found: {0}", StringLiterals.Global);
result = true;
scope = _sessionState.Internal.GlobalScope;
}
// Is it the local scope?
else if (String.Compare(
driveName,
StringLiterals.Local,
StringComparison.OrdinalIgnoreCase) == 0)
{
// It's the local scope.
s_tracer.WriteLine("match found: {0}", driveName);
result = true;
scope = _sessionState.Internal.CurrentScope;
@@ -19,7 +19,7 @@ namespace mvc.Controllers
{
public class ResumeController : Controller
{
private static Byte[] FileBytes = new Byte[]{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
private static Byte[] FileBytes = new Byte[] { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 };
public async void Index()
{