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

CSHARP-4886: Mark API that will be removed in 3.0 as obsolete: MongoDB.Bson #1243

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="$(PackageLicenseFile)" />
<None Include="..\..\packageIcon.png" Pack="true" PackagePath="" />
</ItemGroup>

<PropertyGroup>
<NoWarn>
CS0618 <!--Temporary disable obsolete warnings due the massive volume of warnings-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sign that these changes will be painful for our users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but less painful than just API removal without prior warning. Which is the intention of these obsoletions PRs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have a goal that users who stay on 2.x don't have to deal with these warnings at all.

</NoWarn>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions src/MongoDB.Bson/BsonDefaults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace MongoDB.Bson
/// <summary>
/// A static helper class containing BSON defaults.
/// </summary>
[Obsolete("This class will be removed in later release.")]
public static class BsonDefaults
{
// private static fields
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/BsonBinaryReaderSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public BsonBinaryReaderSettings()
/// <summary>
/// Gets or sets the default settings for a BsonBinaryReader.
/// </summary>
[Obsolete("This property will be removed in later release.")]
public static BsonBinaryReaderSettings Defaults
{
get
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/BsonBinaryWriterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public BsonBinaryWriterSettings()
/// <summary>
/// Gets or sets the default BsonBinaryWriter settings.
/// </summary>
[Obsolete("This property will be removed in later release.")]
public static BsonBinaryWriterSettings Defaults
{
get
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/BsonDocumentReaderSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public BsonDocumentReaderSettings(GuidRepresentation guidRepresentation)
/// <summary>
/// Gets or sets the default settings for a BsonDocumentReader.
/// </summary>
[Obsolete("This property will be removed in later release.")]
public static BsonDocumentReaderSettings Defaults
{
get
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/BsonDocumentWriterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public BsonDocumentWriterSettings(GuidRepresentation guidRepresentation)
/// <summary>
/// Gets or sets the default BsonDocumentWriter settings.
/// </summary>
[Obsolete("This property will be removed in later release.")]
public static BsonDocumentWriterSettings Defaults
{
get
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/BsonTrie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace MongoDB.Bson.IO
/// Represents a mapping from a set of UTF8 encoded strings to a set of elementName/value pairs, implemented as a trie.
/// </summary>
/// <typeparam name="TValue">The type of the BsonTrie values.</typeparam>
[Obsolete("This class will be removed in later release.")]
public class BsonTrie<TValue>
{
// private fields
Expand Down
1 change: 0 additions & 1 deletion src/MongoDB.Bson/IO/BsonWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ protected string Name
get { return _name; }
}

// public static methods
// public methods
/// <summary>
/// Closes the writer.
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/ByteArrayChunk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace MongoDB.Bson.IO
/// <summary>
/// Represents a chunk backed by a byte array.
/// </summary>
[Obsolete("This class will be removed in later release.")]
public class ByteArrayChunk : IBsonChunk
{
#region static
Expand Down
2 changes: 2 additions & 0 deletions src/MongoDB.Bson/IO/ByteBufferFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace MongoDB.Bson.IO
/// <summary>
/// Represents a factory for IBsonBuffers.
/// </summary>
/// ByteBufferFactory
[Obsolete("This class will be removed in later release.")]
public static class ByteBufferFactory
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/ByteBufferSlice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace MongoDB.Bson.IO
/// <summary>
/// Represents a slice of a byte buffer.
/// </summary>
[Obsolete("This class will be removed in later release.")]
public class ByteBufferSlice : IByteBuffer
{
private readonly IByteBuffer _buffer;
Expand Down
2 changes: 2 additions & 0 deletions src/MongoDB.Bson/IO/IStreamEfficientCopyTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
* limitations under the License.
*/

using System;
using System.IO;

namespace MongoDB.Bson.IO
{
/// <summary>
/// Represents the effective CopyTo method.
/// </summary>
[Obsolete("This interface will be removed in later release.")]
public interface IStreamEfficientCopyTo
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/JsonReaderSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public JsonReaderSettings()
/// <summary>
/// Gets or sets the default settings for a JsonReader.
/// </summary>
[Obsolete("This property will be removed in later release.")]
public static JsonReaderSettings Defaults
{
get
Expand Down
1 change: 1 addition & 0 deletions src/MongoDB.Bson/IO/JsonWriterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public JsonWriterSettings()
/// <summary>
/// Gets or sets the default JsonWriterSettings.
/// </summary>
[Obsolete("This property will be removed in later release.")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention is also to remove all the static defaults and settings related to serialization.
We don't have new builders and configuration API defined yet, and for some time they will co-exist, but it's better to start obsoleting them as early as possible.

public static JsonWriterSettings Defaults
{
get
Expand Down
2 changes: 2 additions & 0 deletions src/MongoDB.Bson/IO/TrieNameDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using System.Text;

namespace MongoDB.Bson.IO
Expand All @@ -21,6 +22,7 @@ namespace MongoDB.Bson.IO
/// Represents a Trie-based name decoder that also provides a value.
/// </summary>
/// <typeparam name="TValue">The type of the value.</typeparam>
[Obsolete("This class will be removed in later release.")]
public class TrieNameDecoder<TValue> : INameDecoder
{
// private fields
Expand Down