Skip to content

Conversation

@DmitryLukyanov
Copy link
Contributor

@DmitryLukyanov DmitryLukyanov requested a review from jyemin February 5, 2021 18:59
@jyemin jyemin requested a review from JamesKovacs February 5, 2021 19:03
@DmitryLukyanov DmitryLukyanov requested a review from jyemin February 5, 2021 19:14
{
throw new FormatException($"Invalid $uuid hyphens format: '{uuidTokenStringValue}'.");
}

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 you can replace lines 2093-2112 with:

var guid = Guid.Parse(uuidToken.StringValue);
var binaryData = new BsonBinaryData(guid, GuidRepresentation.Standard);

Guid.Parse already does all the validations we need.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, done

@DmitryLukyanov
Copy link
Contributor Author

@DmitryLukyanov DmitryLukyanov requested a review from rstam February 5, 2021 19:23
@jyemin jyemin removed the request for review from JamesKovacs February 5, 2021 19:43
@jyemin
Copy link
Contributor

jyemin commented Feb 5, 2021

Removed James since Robert picked it up.

Copy link
Contributor

@rstam rstam left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JamesKovacs JamesKovacs left a comment

Choose a reason for hiding this comment

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

Changes look good. Verified that:

  • BsonBinarySubType is still set correctly.
  • Same exception type (FormatException) is thrown as before.
  • Tests run successfully.

One minor change required. You have an extraneous using statement.

using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@JamesKovacs JamesKovacs left a comment

Choose a reason for hiding this comment

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

LGTM

@DmitryLukyanov DmitryLukyanov merged commit 2c0e72b into mongodb:master Feb 18, 2021
@DmitryLukyanov DmitryLukyanov deleted the csharp3355 branch February 18, 2021 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants