Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/System.Management.Automation/CoreCLR/CorePsPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ public enum StatMask
}

/// <summary>The Common Stat class.</summary>
public class CommonStat
public sealed class CommonStat
{
/// <summary>The inode of the filesystem item.</summary>
public long Inode;
Expand Down Expand Up @@ -629,7 +629,7 @@ public string GetModeString()

if ((Mode & 0xFFF) == 420)
{
return OwnerReadWriteGroupReadOtherRead;
return OwnerReadWriteGroupReadOtherRead;
}

if (ItemType == ItemType.Directory & (Mode & 0xFFF) == 493)
Expand Down
4 changes: 2 additions & 2 deletions src/System.Management.Automation/DscSupport/CimDSCParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public override object Transform(EngineIntrinsics engineIntrinsics, object input
/// All CIM operations are represented as methods of this class.
/// </para>
/// </summary>
internal class CimDSCParser
internal sealed class CimDSCParser
{
private readonly CimMofDeserializer _deserializer;
private readonly CimMofDeserializer.OnClassNeeded _onClassNeeded;
Expand Down Expand Up @@ -481,7 +481,7 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal
/// </summary>
[SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes",
Justification = "Needed Internal use only")]
internal class DscClassCacheEntry
internal sealed class DscClassCacheEntry
{
/// <summary>
/// Store the RunAs Credentials that this DSC resource will use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal enum FormattingContextState { none, document, group }
/// <summary>
/// Core inner implementation for format/xxx commands.
/// </summary>
internal class InnerFormatShapeCommand : InnerFormatShapeCommandBase
internal sealed class InnerFormatShapeCommand : InnerFormatShapeCommandBase
{
/// <summary>
/// Constructor to glue to the CRO.
Expand Down Expand Up @@ -365,7 +365,7 @@ private bool ProcessOutOfBand(PSObject so, bool isProcessingError)
return false;
}

protected void WriteInternalErrorMessage(string message)
private void WriteInternalErrorMessage(string message)
{
FormatEntryData fed = new FormatEntryData();
fed.outOfBand = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ internal enum ClassInfoDisplay { none, fullName, shortName }
/// <summary>
/// Specialized class for the "expression" property.
/// </summary>
internal class ExpressionEntryDefinition : HashtableEntryDefinition
internal sealed class ExpressionEntryDefinition : HashtableEntryDefinition
{
internal ExpressionEntryDefinition() : this(false)
{
Expand Down Expand Up @@ -250,7 +250,7 @@ private void ProcessGlobbingCharactersError(bool originalParameterWasHashTable,
private readonly bool _noGlobbing;
}

internal class AlignmentEntryDefinition : HashtableEntryDefinition
internal sealed class AlignmentEntryDefinition : HashtableEntryDefinition
{
internal AlignmentEntryDefinition() : base(FormatParameterDefinitionKeys.AlignmentEntryKey,
new Type[] { typeof(string) })
Expand Down Expand Up @@ -314,7 +314,7 @@ private void ProcessIllegalValue(string s, TerminatingErrorContext invocationCon
private const string RightAlign = "right";
}

internal class WidthEntryDefinition : HashtableEntryDefinition
internal sealed class WidthEntryDefinition : HashtableEntryDefinition
{
internal WidthEntryDefinition() : base(FormatParameterDefinitionKeys.WidthEntryKey,
new Type[] { typeof(int) })
Expand Down Expand Up @@ -349,14 +349,14 @@ private void VerifyRange(int width, TerminatingErrorContext invocationContext)
}
}

internal class LabelEntryDefinition : HashtableEntryDefinition
internal sealed class LabelEntryDefinition : HashtableEntryDefinition
{
internal LabelEntryDefinition() : base(FormatParameterDefinitionKeys.LabelEntryKey, new string[] { NameEntryDefinition.NameEntryKey }, new Type[] { typeof(string) }, false)
{
}
}

internal class FormatStringDefinition : HashtableEntryDefinition
internal sealed class FormatStringDefinition : HashtableEntryDefinition
{
internal FormatStringDefinition() : base(FormatParameterDefinitionKeys.FormatStringEntryKey,
new Type[] { typeof(string) })
Expand Down Expand Up @@ -390,7 +390,7 @@ internal override object Verify(object val,
}
}

internal class BooleanEntryDefinition : HashtableEntryDefinition
internal sealed class BooleanEntryDefinition : HashtableEntryDefinition
{
internal BooleanEntryDefinition(string entryKey) : base(entryKey, null)
{
Expand Down Expand Up @@ -433,7 +433,7 @@ internal static class FormatParameterDefinitionKeys
internal const string DepthEntryKey = "depth";
}

internal class FormatGroupByParameterDefinition : CommandParameterDefinition
internal sealed class FormatGroupByParameterDefinition : CommandParameterDefinition
{
protected override void SetEntries()
{
Expand All @@ -452,7 +452,7 @@ protected override void SetEntries()
}
}

internal class FormatTableParameterDefinition : FormatParameterDefinitionBase
internal sealed class FormatTableParameterDefinition : FormatParameterDefinitionBase
{
protected override void SetEntries()
{
Expand All @@ -463,7 +463,7 @@ protected override void SetEntries()
}
}

internal class FormatListParameterDefinition : FormatParameterDefinitionBase
internal sealed class FormatListParameterDefinition : FormatParameterDefinitionBase
{
protected override void SetEntries()
{
Expand All @@ -472,12 +472,12 @@ protected override void SetEntries()
}
}

internal class FormatWideParameterDefinition : FormatParameterDefinitionBase
internal sealed class FormatWideParameterDefinition : FormatParameterDefinitionBase
{
// no additional entries
}

internal class FormatObjectParameterDefinition : CommandParameterDefinition
internal sealed class FormatObjectParameterDefinition : CommandParameterDefinition
{
protected override void SetEntries()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
/// it manages the formatting protocol and it writes to a generic
/// screen host.
/// </summary>
internal class OutCommandInner : ImplementationCommandBase
internal sealed class OutCommandInner : ImplementationCommandBase
{
#region tracer
[TraceSource("format_out_OutCommandInner", "OutCommandInner")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal class TooManyErrorsException : TypeInfoDataBaseLoaderException
/// <summary>
/// Entry logged by the loader and made available to external consumers.
/// </summary>
internal class XmlLoaderLoggerEntry
internal sealed class XmlLoaderLoggerEntry
{
internal enum EntryType { Error, Trace }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
///
/// IMPORTANT: The code using this class will have to provide ALL the callbacks.
/// </summary>
internal class FormatMessagesContextManager
internal sealed class FormatMessagesContextManager
{
// callbacks declarations
internal delegate OutputContext FormatContextCreationCallback(OutputContext parentContext, FormatInfoData formatData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ protected bool RepeatHeader

private bool _repeatHeader = false;

protected class DataBaseInfo
protected sealed class DataBaseInfo
{
internal TypeInfoDataBase db = null;
internal ViewDefinition view = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private bool EvaluateDisplayCondition(PSObject so, ExpressionToken conditionToke
private readonly int _enumerationLimit;
}

internal class TraversalInfo
internal sealed class TraversalInfo
{
internal TraversalInfo(int level, int maxDepth)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ internal virtual DisplayCells DisplayCells
/// and embedded newline processing
/// It needs to be provided with two callbacks for line processing.
/// </summary>
internal class WriteLineHelper
internal sealed class WriteLineHelper
{
#region callbacks

Expand Down Expand Up @@ -534,7 +534,7 @@ internal TextWriterLineOutput(TextWriter writer, int columns, bool suppressNewli
/// TextWriter to generate data for the Monad pipeline in a streaming fashion:
/// the provided callback will be called each time a line is written.
/// </summary>
internal class StreamingTextWriter : TextWriter
internal sealed class StreamingTextWriter : TextWriter
{
#region tracer
[TraceSource("StreamingTextWriter", "StreamingTextWriter")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
/// Class to write object properties in list form by using
/// the host screen interfaces.
/// </summary>
internal class ListWriter
internal sealed class ListWriter
{
/// <summary>
/// Labels already padded with blanks, separator characters, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Microsoft.PowerShell.Commands.Internal.Format
{
internal class TableWriter
internal sealed class TableWriter
{
/// <summary>
/// Information about each column boundaries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
/// using the metadata information provided by an instance of CommandParameterDefinition
/// it's basically the hash table with the normalized values.
/// </summary>
internal class MshParameter
internal sealed class MshParameter
{
internal Hashtable hash = null;

Expand All @@ -29,7 +29,7 @@ internal object GetEntry(string key)
}
}

internal class NameEntryDefinition : HashtableEntryDefinition
internal sealed class NameEntryDefinition : HashtableEntryDefinition
{
internal const string NameEntryKey = "name";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
/// <summary>
/// Tear off class.
/// </summary>
internal class DisplayCellsHost : DisplayCells
internal sealed class DisplayCellsHost : DisplayCells
{
internal DisplayCellsHost(PSHostRawUserInterface rawUserInterface)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
///
/// The code below is therefore mainly based on reverse engineering of admin\wmi\wbem\winmgmt\wbecomn\like.cpp
/// </remarks>
internal class WildcardPatternToCimQueryParser : WildcardPatternParser
internal sealed class WildcardPatternToCimQueryParser : WildcardPatternParser
{
private readonly StringBuilder _result = new();
private bool _needClientSideFiltering;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace System.Management.Automation
/// This class aggregates the objects necessary for the Monad
/// engine to run.
/// </summary>
internal class AutomationEngine
internal sealed class AutomationEngine
{
static AutomationEngine()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace System.Management.Automation
/// This is the interface between the CommandProcessor and the various
/// parameter binders required to bind parameters to a cmdlet.
/// </summary>
internal class CmdletParameterBinderController : ParameterBinderController
internal sealed class CmdletParameterBinderController : ParameterBinderController
{
#region tracer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace System.Management.Automation
{
internal class CompletionContext
internal sealed class CompletionContext
{
internal List<Ast> RelatedAsts { get; set; }

Expand Down Expand Up @@ -58,7 +58,7 @@ internal bool GetOption(string option, bool @default)
}
}

internal class CompletionAnalysis
internal sealed class CompletionAnalysis
{
private readonly Ast _ast;
private readonly Token[] _tokens;
Expand Down Expand Up @@ -325,7 +325,8 @@ private static bool CompleteAgainstStatementFlags(Ast scriptAst, Ast lastAst, To
while (last != null)
{
errorStatement = last as ErrorStatementAst;
if (errorStatement != null) { break; }
if (errorStatement != null)
{ break; }

last = last.Parent;
}
Expand Down Expand Up @@ -1774,7 +1775,8 @@ private static List<CompletionResult> GetResultForString(CompletionContext compl
var lastAst = completionContext.RelatedAsts.Last();
var expandableString = lastAst as ExpandableStringExpressionAst;
var constantString = lastAst as StringConstantExpressionAst;
if (constantString == null && expandableString == null) { return null; }
if (constantString == null && expandableString == null)
{ return null; }

string strValue = constantString != null ? constantString.Value : expandableString.Value;

Expand Down Expand Up @@ -2047,7 +2049,8 @@ private static List<CompletionResult> GetResultForIdentifier(CompletionContext c
executionContext: completionContext.ExecutionContext)
: null;

if (fullPath == null) { return result; }
if (fullPath == null)
{ return result; }

// Continue trying the filename/commandname completion for scenarios like this: $aa\d<tab>
completionContext.WordToComplete = fullPath;
Expand Down Expand Up @@ -2455,7 +2458,7 @@ private static List<CompletionResult> CompleteLoopLabel(CompletionContext comple

return result;
}

private static List<CompletionResult> CompleteUsingKeywords(int cursorOffset, Token[] tokens, ref int replacementIndex, ref int replacementLength)
{
var result = new List<CompletionResult>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8668,7 +8668,7 @@ public int Compare(PSObject x, PSObject y)
/// use is for intellisense where you don't want to run arbitrary code, but you do want to know the values
/// of various expressions so you can get the members.
/// </summary>
internal class SafeExprEvaluator : ICustomAstVisitor2
internal sealed class SafeExprEvaluator : ICustomAstVisitor2
{
internal static bool TrySafeEval(ExpressionAst ast, ExecutionContext executionContext, out object value)
{
Expand Down Expand Up @@ -8797,9 +8797,11 @@ public object VisitConfigurationDefinition(ConfigurationDefinitionAst configurat

public object VisitStatementBlock(StatementBlockAst statementBlockAst)
{
if (statementBlockAst.Traps != null) return false;
if (statementBlockAst.Traps != null)
return false;
// REVIEW: we could relax this to allow multiple statements
if (statementBlockAst.Statements.Count > 1) return false;
if (statementBlockAst.Statements.Count > 1)
return false;
var pipeline = statementBlockAst.Statements.FirstOrDefault();
return pipeline != null && (bool)pipeline.Accept(this);
}
Expand Down Expand Up @@ -8904,7 +8906,7 @@ public object VisitParenExpression(ParenExpressionAst parenExpressionAst)
/// <summary>
/// Completes with the property names of the InputObject.
/// </summary>
internal class PropertyNameCompleter : IArgumentCompleter
internal sealed class PropertyNameCompleter : IArgumentCompleter
{
private readonly string _parameterNameOfInput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ internal string CommandName

#endregion "PseudoBindingInfo"

internal class PseudoParameterBinder
internal sealed class PseudoParameterBinder
{
/*
/// <summary>
Expand Down
Loading