Skip to content

Commit

Permalink
ILLink annotation related to ISerializable and IBindingListView in Sy…
Browse files Browse the repository at this point in the history
…stem.Data.Common (#55394)
  • Loading branch information
krwq authored Jul 10, 2021
1 parent 69d6739 commit 413f0de
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public partial interface IBindingList : System.Collections.ICollection, System.C
}
public partial interface IBindingListView : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.IBindingList
{
string? Filter { get; set; }
string? Filter { get; [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Members of types used in the filter expression might be trimmed.")] set; }
System.ComponentModel.ListSortDescriptionCollection SortDescriptions { get; }
bool SupportsAdvancedSorting { get; }
bool SupportsFiltering { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface IBindingListView : IBindingList
{
void ApplySort(ListSortDescriptionCollection sorts);

string? Filter { get; set; }
string? Filter { get; [RequiresUnreferencedCode("Members of types used in the filter expression might be trimmed.")] set; }

ListSortDescriptionCollection SortDescriptions { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Data.Common/ref/System.Data.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ public DataView(System.Data.DataTable table, string? RowFilter, string? Sort, Sy
bool System.ComponentModel.IBindingList.SupportsChangeNotification { get { throw null; } }
bool System.ComponentModel.IBindingList.SupportsSearching { get { throw null; } }
bool System.ComponentModel.IBindingList.SupportsSorting { get { throw null; } }
string? System.ComponentModel.IBindingListView.Filter { get { throw null; } set { } }
string? System.ComponentModel.IBindingListView.Filter { get { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Members of types used in the filter expression might be trimmed.")] set { } }
System.ComponentModel.ListSortDescriptionCollection System.ComponentModel.IBindingListView.SortDescriptions { get { throw null; } }
bool System.ComponentModel.IBindingListView.SupportsAdvancedSorting { get { throw null; } }
bool System.ComponentModel.IBindingListView.SupportsFiltering { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<linker>
<assembly fullname="System.Data.Common, PublicKeyToken=b03f5f7f11d50a3a">
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2026</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Data.DataSet.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2026</argument>
Expand All @@ -25,12 +19,6 @@
<property name="Scope">member</property>
<property name="Target">M:System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.WriteXml(System.Xml.XmlWriter)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2026</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Data.DataTable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2026</argument>
Expand All @@ -49,11 +37,5 @@
<property name="Scope">member</property>
<property name="Target">M:System.Data.DataTable.WriteXmlCore(System.Xml.XmlWriter)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2026</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Data.DataView.System.ComponentModel.IBindingListView.set_Filter(System.String)</property>
</attribute>
</assembly>
</linker>
2 changes: 2 additions & 0 deletions src/libraries/System.Data.Common/src/System/Data/DataSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ protected DataSet(SerializationInfo info, StreamingContext context, bool Constru
DeserializeDataSet(info, context, remotingFormat, schemaSerializationMode);
}

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "Binary serialization is unsafe in general and is planned to be obsoleted. We do not want to mark interface or ctors of this class as unsafe as that would show many unnecessary warnings elsewhere.")]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
SerializationFormat remotingFormat = RemotingFormat;
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Data.Common/src/System/Data/DataTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ protected DataTable(SerializationInfo info, StreamingContext context) : this()
DeserializeDataTable(info, context, isSingleTable, remotingFormat);
}

[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "Binary serialization is unsafe in general and is planned to be obsoleted. We do not want to mark interface or ctors of this class as unsafe as that would show many unnecessary warnings elsewhere.")]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
SerializationFormat remotingFormat = RemotingFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ void IBindingListView.RemoveFilter()
string? IBindingListView.Filter
{
get { return RowFilter; }
[RequiresUnreferencedCode(Select.RequiresUnreferencedCodeMessage)]
set { RowFilter = value; }
}

Expand Down

0 comments on commit 413f0de

Please sign in to comment.