Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullable: System.Xml, part 6 (XSLT minus XSLT.Runtime) #40368

Merged
merged 5 commits into from
Aug 15, 2020
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 @@ -42,7 +42,7 @@ public override object Evaluate(XPathNodeIterator nodeIterator) =>
FT.FuncNot => Not(nodeIterator),
FT.FuncTrue => true,
FT.FuncFalse => false,
FT.FuncLang => Lang(nodeIterator),
FT.FuncLang => Lang(nodeIterator!),
_ => false,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ internal sealed class XPathComparerHelper : IComparer
private readonly CultureInfo _cinfo;
private readonly XmlDataType _dataType;

public XPathComparerHelper(XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType)
public XPathComparerHelper(XmlSortOrder order, XmlCaseOrder caseOrder, string? lang, XmlDataType dataType)
{
if (lang == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ public ContextQuery()
{
this.count = 0;
}

protected ContextQuery(ContextQuery other) : base(other)
{
this.contextNode = other.contextNode; // Don't need to clone here
}

public override void Reset()
{
count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public override object Evaluate(XPathNodeIterator nodeIterator)
try
{
Debug.Assert(_function != null);
object? retVal = ProcessResult(_function.Invoke(xsltContext, argVals, nodeIterator.Current));
object? retVal = ProcessResult(_function.Invoke(xsltContext, argVals, nodeIterator.Current!));

// ProcessResult may return null when the input value is XmlNode and here doesn't seem to be the case.
Debug.Assert(retVal != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private double Number(XPathNodeIterator nodeIterator)
{
if (_arg == null)
{
Debug.Assert(nodeIterator.Current != null);
Debug.Assert(nodeIterator!.Current != null);
return XmlConvert.ToXPathDouble(nodeIterator.Current.Value);
}
object argVal = _arg.Evaluate(nodeIterator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private double StringLength(XPathNodeIterator nodeIterator)
{
return _argList[0].Evaluate(nodeIterator).ToString()!.Length;
}
Debug.Assert(nodeIterator.Current != null);
Debug.Assert(nodeIterator!.Current != null);
return nodeIterator.Current.Value.Length;
}

Expand All @@ -225,7 +225,7 @@ private string Normalize(XPathNodeIterator nodeIterator)
}
else
{
Debug.Assert(nodeIterator.Current != null);
Debug.Assert(nodeIterator!.Current != null);
value = nodeIterator.Current.Value;
}
int modifyPos = -1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#nullable enable
namespace System.Xml.Xsl
{
internal interface ISourceLineInfo
{
string Uri { get; }
string? Uri { get; }
bool IsNoSource { get; }
Location Start { get; }
Location End { get; }
Expand Down
Loading