Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public FeedbackItem(string header, List<string>? actions, FeedbackDisplayLayout
/// <param name="layout">The layout for displaying the actions.</param>
public FeedbackItem(string header, List<string>? actions, string? footer, FeedbackDisplayLayout layout)
{
Requires.NotNullOrEmpty(header, nameof(header));
ArgumentException.ThrowIfNullOrEmpty(header);

Header = header;
RecommendedActions = actions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static Action<ICommandPredictor> GetCallBack(PredictionClient client, uint sessi
/// <param name="suggestionText">The accepted suggestion text.</param>
public static void OnSuggestionAccepted(PredictionClient client, Guid predictorId, uint session, string suggestionText)
{
Requires.NotNullOrEmpty(suggestionText, nameof(suggestionText));
ArgumentException.ThrowIfNullOrEmpty(suggestionText);

var predictors = SubsystemManager.GetSubsystems<ICommandPredictor>();
if (predictors.Count == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public PredictionContext(Ast inputAst, Token[] inputTokens)
/// <returns>A <see cref="PredictionContext"/> object.</returns>
public static PredictionContext Create(string input)
{
Requires.NotNullOrEmpty(input, nameof(input));
ArgumentException.ThrowIfNullOrEmpty(input);

Ast ast = Parser.ParseInput(input, out Token[] tokens, out _);
return new PredictionContext(ast, tokens);
Expand Down Expand Up @@ -239,7 +239,7 @@ public PredictiveSuggestion(string suggestion)
/// <param name="toolTip">The tooltip of the suggestion.</param>
public PredictiveSuggestion(string suggestion, string? toolTip)
{
Requires.NotNullOrEmpty(suggestion, nameof(suggestion));
ArgumentException.ThrowIfNullOrEmpty(suggestion);

SuggestionText = suggestion;
ToolTip = toolTip;
Expand Down
8 changes: 0 additions & 8 deletions src/System.Management.Automation/engine/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1733,14 +1733,6 @@ internal ReadOnlyBag(HashSet<T> hashset)
/// </summary>
internal static class Requires
{
internal static void NotNullOrEmpty(string value, string paramName)
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentNullException(paramName);
}
}

internal static void NotNullOrEmpty(ICollection value, string paramName)
{
if (value is null || value.Count == 0)
Expand Down