未验证 提交 6c4051a4 编写于 作者: D dotnet-maestro[bot] 提交者: GitHub

[release/5.0] Update dependencies from dotnet/arcade (#3635)

[release/5.0] Update dependencies from dotnet/arcade


 - Replace null comparisons on non-nullable types that now cause compilation errors, due to the .NET SDK update.

 - PR feedback

 - PR feedback

 - Merge pull request #3649 from dotnet/nonnullablechecks

Replace null comparisons on non-nullable types that now cause compilation errors, due to the .NET SDK update.
上级 8ac8fc32
......@@ -103,25 +103,25 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20506.7">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20510.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
<Sha>6813f5aa511a7a4498fa217a54219b5704a01f83</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.20506.7">
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.20510.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
<Sha>6813f5aa511a7a4498fa217a54219b5704a01f83</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20506.7">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="5.0.0-beta.20510.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
<Sha>6813f5aa511a7a4498fa217a54219b5704a01f83</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.20506.7">
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.20510.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
<Sha>6813f5aa511a7a4498fa217a54219b5704a01f83</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.20506.7">
<Dependency Name="Microsoft.DotNet.GenAPI" Version="5.0.0-beta.20510.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ee39cd1573dbb8011f343e1037af51d4fc00a747</Sha>
<Sha>6813f5aa511a7a4498fa217a54219b5704a01f83</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
......@@ -42,9 +42,9 @@
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/arcade -->
<PropertyGroup>
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20506.7</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>5.0.0-beta.20506.7</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20506.7</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20510.1</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>5.0.0-beta.20510.1</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20510.1</MicrosoftDotNetGenAPIVersion>
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/corefxlab -->
<PropertyGroup>
......
{
"tools": {
"dotnet": "5.0.100-rc.1.20452.10",
"dotnet": "5.0.100-rc.2.20479.15",
"runtimes": {
"dotnet": [
"2.1.7",
......@@ -12,11 +12,11 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20506.7",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20506.7"
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20510.1",
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20510.1"
},
"sdk": {
"version": "5.0.100-rc.1.20452.10"
"version": "5.0.100-rc.2.20479.15"
},
"native-tools": {
"strawberry-perl": "5.28.1.1-1",
......
......@@ -160,9 +160,6 @@ internal override Rect GetBoundsInternal(Pen pen, Matrix matrix, double toleranc
{
Rect rect;
Debug.Assert(worldMatrix != null);
Debug.Assert(geometryMatrix != null);
if ( (pen == null || pen.DoesNotContainGaps) &&
worldMatrix.IsIdentity && geometryMatrix.IsIdentity)
{
......
......@@ -71,7 +71,7 @@ private static long ComputeEstimatedSize(IntPtr bitmapObject)
{
long estimatedSize = 0;
if (bitmapObject != null && bitmapObject != IntPtr.Zero)
if (bitmapObject != IntPtr.Zero)
{
IntPtr wicBitmap;
......
......@@ -85,15 +85,6 @@ BitmapPalette palette
// Sanitize inputs
//
if (pixelFormat == null)
{
// Backwards Compat:
//
// The original code would null-ref, but we choose to raise a
// better exception.
throw new ArgumentNullException("pixelFormat");
}
if (pixelFormat.Palettized && palette == null)
{
throw new InvalidOperationException(SR.Get(SRID.Image_IndexedPixelFormatRequiresPalette));
......
......@@ -107,9 +107,6 @@ internal override Rect GetBoundsInternal(Pen pen, Matrix worldMatrix, double tol
internal static Rect GetBoundsHelper(Pen pen, Matrix worldMatrix, Point pt1, Point pt2,
Matrix geometryMatrix, double tolerance, ToleranceType type)
{
Debug.Assert(worldMatrix != null);
Debug.Assert(geometryMatrix != null);
if (pen == null && worldMatrix.IsIdentity && geometryMatrix.IsIdentity)
{
return new Rect(pt1, pt2);
......
......@@ -190,9 +190,6 @@ internal override Rect GetBoundsInternal(Pen pen, Matrix worldMatrix, double tol
{
Rect boundingRect;
Debug.Assert(worldMatrix != null);
Debug.Assert(geometryMatrix != null);
if (rect.IsEmpty)
{
boundingRect = Rect.Empty;
......
......@@ -43,15 +43,13 @@ public bool TryTransform(Point3D inPoint, out Point result)
result = new Point();
// project the point
if (_projectionTransform != null)
{ Point3D projectedPoint = _projectionTransform.Transform(inPoint);
if (_transformBetween2D != null)
{
result = _transformBetween2D.Transform(new Point(projectedPoint.X, projectedPoint.Y));
success = true;
}
}
Point3D projectedPoint = _projectionTransform.Transform(inPoint);
if (_transformBetween2D != null)
{
result = _transformBetween2D.Transform(new Point(projectedPoint.X, projectedPoint.Y));
success = true;
}
return success;
}
......
......@@ -215,8 +215,9 @@ internal static IntPtr MarshalPropVariant(Object obj)
// allocate an unmanaged PROPVARIANT to return
pNative = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(PROPVARIANT)));
// Per MSDN, AllocCoTaskMem never returns null. One can't be too careful, though.
Invariant.Assert(pNative != null);
// Per MSDN, AllocCoTaskMem never returns null: check for IntPtr.Zero instead.
Invariant.Assert(pNative != IntPtr.Zero);
// marshal the managed PROPVARIANT into the unmanaged block and return it
Marshal.StructureToPtr(v, pNative, false);
......
......@@ -628,7 +628,7 @@ IntPtr unmanagedBuffer
}
catch (Exception)
{
if (unmanagedBuffer != null)
if (unmanagedBuffer != IntPtr.Zero)
{
FreeUnmanagedPrintDlgExStruct(unmanagedBuffer);
unmanagedBuffer = IntPtr.Zero;
......
......@@ -157,7 +157,7 @@ internal void ValidateVisual()
int dvrTopSpace;
PTS.FSPAP fspap;
if(CellParagraph.StructuralCache.DtrList != null && breakRecordIn != null)
if(CellParagraph.StructuralCache.DtrList != null && breakRecordIn != IntPtr.Zero)
{
CellParagraph.InvalidateStructure(TextContainerHelper.GetCPFromElement(CellParagraph.StructuralCache.TextContainer, CellParagraph.Element, ElementEdge.BeforeStart));
}
......
......@@ -127,7 +127,7 @@ public void Dispose()
marshaler?.Dispose();
}
}
if (_array != null)
if (_array != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(_array);
}
......@@ -445,7 +445,7 @@ public void Dispose()
Marshaler<T>.DisposeMarshaler(marshaler);
}
}
if (_array != null)
if (_array != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(_array);
}
......@@ -627,7 +627,7 @@ public void Dispose()
DisposeMarshaler(marshaler);
}
}
if (_array != null)
if (_array != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(_array);
}
......
......@@ -30,10 +30,6 @@ public sealed class DateTimeAutomationPeer : AutomationPeer, IGridItemProvider,
internal DateTimeAutomationPeer(DateTime date, Calendar owningCalendar, CalendarMode buttonMode)
: base()
{
if (date == null)
{
throw new ArgumentNullException("date");
}
if (owningCalendar == null)
{
throw new ArgumentNullException("owningCalendar");
......
......@@ -1380,23 +1380,20 @@ private void ProcessEndKey(bool shift)
{
case CalendarMode.Month:
{
if (this.DisplayDate != null)
{
DateTime? selectedDate = new DateTime(this.DisplayDateInternal.Year, this.DisplayDateInternal.Month, 1);
if (DateTimeHelper.CompareYearMonth(DateTime.MaxValue, selectedDate.Value) > 0)
{
// since DisplayDate is not equal to DateTime.MaxValue we are sure selectedDate is not null
selectedDate = DateTimeHelper.AddMonths(selectedDate.Value, 1).Value;
selectedDate = DateTimeHelper.AddDays(selectedDate.Value, -1).Value;
}
else
{
selectedDate = DateTime.MaxValue;
}
DateTime? selectedDate = new DateTime(this.DisplayDateInternal.Year, this.DisplayDateInternal.Month, 1);
ProcessSelection(shift, selectedDate);
if (DateTimeHelper.CompareYearMonth(DateTime.MaxValue, selectedDate.Value) > 0)
{
// since DisplayDate is not equal to DateTime.MaxValue we are sure selectedDate is not null
selectedDate = DateTimeHelper.AddMonths(selectedDate.Value, 1).Value;
selectedDate = DateTimeHelper.AddDays(selectedDate.Value, -1).Value;
}
else
{
selectedDate = DateTime.MaxValue;
}
ProcessSelection(shift, selectedDate);
break;
}
......
......@@ -349,9 +349,6 @@ private bool IsValidThread()
/// <returns></returns>
private CalendarDateRange GetContainingDateRange(DateTime date)
{
if (date == null)
return null;
for (int i = 0; i < Count; i++)
{
if (DateTimeHelper.InRange(date, this[i]))
......
......@@ -278,7 +278,7 @@ internal void NotifyPropertyChanged(DependencyObject d, string propertyName, Dep
{
column.RefreshCellContent(this, propertyName);
}
else if (e != null && e.Property != null)
else if (e.Property != null)
{
column.RefreshCellContent(this, e.Property.Name);
}
......
......@@ -681,7 +681,6 @@ private void Cell_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
CalendarKeyboardHelper.GetMetaKeyState(out ctrl, out shift);
DateTime selectedDate = (DateTime)b.DataContext;
Debug.Assert(selectedDate != null);
switch (this.Owner.SelectionMode)
{
......@@ -1303,7 +1302,6 @@ private void SetYearModeMonthButtons()
if (this.Owner != null)
{
Debug.Assert(this.Owner.DisplayDateInternal != null);
childButton.HasSelectedDays = (DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateInternal) == 0);
if (DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateStartInternal) < 0 || DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateEndInternal) > 0)
......
......@@ -278,7 +278,7 @@ protected override void SetItem(int index, DateTime item)
}
else
{
if (item != null && DateTime.Compare(this[index], item) != 0 && Calendar.IsValidDateSelection(this._owner, item))
if (DateTime.Compare(this[index], item) != 0 && Calendar.IsValidDateSelection(this._owner, item))
{
removedItems.Add(this[index]);
base.SetItem(index, item);
......
......@@ -220,8 +220,6 @@ internal override void OnPropertyInvalidation(DependencyObject d, DependencyProp
{
if (d == null)
throw new ArgumentNullException("d");
if (args == null)
throw new ArgumentNullException("args");
DependencyProperty dp = args.Property;
if (dp == null)
......
......@@ -4589,7 +4589,8 @@ protected sealed override void ArrangeCore(Rect finalRect)
// First, get clipped, transformed, unrounded size.
if (useLayoutRounding)
{
if (ltd != null && ltd.TransformedUnroundedDS != null)
// 'transformUnroundedDS' is a non-nullable value type and can never be null.
if (ltd != null)
{
transformedUnroundedDS = ltd.TransformedUnroundedDS;
transformedUnroundedDS.Width = Math.Max(0, transformedUnroundedDS.Width - marginWidth);
......
......@@ -2797,7 +2797,7 @@ public static MONITORINFO GetMonitorInfo(IntPtr hMonitor)
public static IntPtr GetStockObject(StockObject fnObject)
{
IntPtr retPtr = _GetStockObject(fnObject);
if (retPtr == null)
if (retPtr == IntPtr.Zero)
{
HRESULT.ThrowLastError();
}
......
......@@ -408,7 +408,7 @@ private static Storyboard GenerateDynamicTransitionAnimations(FrameworkElement r
if (transition != null)
{
if (transition.GeneratedDuration != null)
if (transition.GeneratedDuration != DurationZero)
{
dynamic.Duration = transition.GeneratedDuration;
}
......
......@@ -6148,7 +6148,7 @@ private static object CoerceRenderTransform(DependencyObject d, object value)
Transform renderTransformValue = (Transform)value;
if ((value == null) ||
(renderTransformValue != null && renderTransformValue.Value != null && renderTransformValue.Value.IsIdentity == true))
(renderTransformValue != null && renderTransformValue.Value.IsIdentity == true))
{
// setting this value is allowed.
}
......
......@@ -553,7 +553,8 @@ private bool UnhookWindowProc(bool force)
//AvDebug.Assert(_gcHandle.IsAllocated, "External GC handle has not been allocated.");
if(null != _gcHandle)
// GCHandle is a non-nullable type. Check GCHandle.IsAllocated before calling Free().
if(_gcHandle.IsAllocated)
_gcHandle.Free();
return true;
......
......@@ -180,8 +180,8 @@ internal class IssuanceLicense : IDisposable
}
}
// set metafata as required
if (contentId != null)
// set metadata as required
if (contentId != Guid.Empty)
{
hr = SafeNativeMethods.DRMSetMetaData(
_issuanceLicenseHandle,
......
......@@ -238,7 +238,7 @@ private object CloseInternal(Object fadeOutArg)
// In the case where the developer has specified AutoClose=True and then calls
// Close(non_zero_timespan) before the auto close operation is dispatched we begin
// the fadeout immidiately and ignore the later call to close.
if (_dt != null || _hwnd == null)
if (_dt != null || _hwnd == IntPtr.Zero)
{
return BooleanBoxes.TrueBox;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册