diff --git a/DDTool/DDTool/Generators/GenMessageFactories.cs b/DDTool/DDTool/Generators/GenMessageFactories.cs index 45f00206b..cc59b8e05 100644 --- a/DDTool/DDTool/Generators/GenMessageFactories.cs +++ b/DDTool/DDTool/Generators/GenMessageFactories.cs @@ -62,7 +62,7 @@ private static string Generate(DataDictionary dd) { " };", " }", "", - " public Group Create(string beginString, string msgType, int correspondingFieldId)", + " public Group? Create(string beginString, string msgType, int correspondingFieldId)", " {" }); diff --git a/Messages/FIX40/MessageFactory.cs b/Messages/FIX40/MessageFactory.cs index 33974180a..1b1f100fb 100644 --- a/Messages/FIX40/MessageFactory.cs +++ b/Messages/FIX40/MessageFactory.cs @@ -52,7 +52,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX40.News.MsgType.Equals(msgType)) { diff --git a/Messages/FIX40/QuickFix.FIX40.csproj b/Messages/FIX40/QuickFix.FIX40.csproj index 2ff27cee1..82415947c 100644 --- a/Messages/FIX40/QuickFix.FIX40.csproj +++ b/Messages/FIX40/QuickFix.FIX40.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIX41/MessageFactory.cs b/Messages/FIX41/MessageFactory.cs index fa10cf51a..3ad79eaad 100644 --- a/Messages/FIX41/MessageFactory.cs +++ b/Messages/FIX41/MessageFactory.cs @@ -53,7 +53,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX41.IndicationofInterest.MsgType.Equals(msgType)) { diff --git a/Messages/FIX41/QuickFix.FIX41.csproj b/Messages/FIX41/QuickFix.FIX41.csproj index 54864055f..983ef5804 100644 --- a/Messages/FIX41/QuickFix.FIX41.csproj +++ b/Messages/FIX41/QuickFix.FIX41.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIX42/MessageFactory.cs b/Messages/FIX42/MessageFactory.cs index 0fa23bc04..aac8c011f 100644 --- a/Messages/FIX42/MessageFactory.cs +++ b/Messages/FIX42/MessageFactory.cs @@ -71,7 +71,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX42.Logon.MsgType.Equals(msgType)) { diff --git a/Messages/FIX42/QuickFix.FIX42.csproj b/Messages/FIX42/QuickFix.FIX42.csproj index cd225723d..8050a6527 100644 --- a/Messages/FIX42/QuickFix.FIX42.csproj +++ b/Messages/FIX42/QuickFix.FIX42.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIX43/MessageFactory.cs b/Messages/FIX43/MessageFactory.cs index 6422c4852..c2b356d8d 100644 --- a/Messages/FIX43/MessageFactory.cs +++ b/Messages/FIX43/MessageFactory.cs @@ -93,7 +93,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX43.Logon.MsgType.Equals(msgType)) { diff --git a/Messages/FIX43/QuickFix.FIX43.csproj b/Messages/FIX43/QuickFix.FIX43.csproj index 70a4707f1..a18dd8f16 100644 --- a/Messages/FIX43/QuickFix.FIX43.csproj +++ b/Messages/FIX43/QuickFix.FIX43.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIX44/MessageFactory.cs b/Messages/FIX44/MessageFactory.cs index 9d957c8e4..f7bcfaf88 100644 --- a/Messages/FIX44/MessageFactory.cs +++ b/Messages/FIX44/MessageFactory.cs @@ -118,7 +118,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX44.Logon.MsgType.Equals(msgType)) { diff --git a/Messages/FIX44/QuickFix.FIX44.csproj b/Messages/FIX44/QuickFix.FIX44.csproj index 1942848a1..f1dfb0faa 100644 --- a/Messages/FIX44/QuickFix.FIX44.csproj +++ b/Messages/FIX44/QuickFix.FIX44.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIX50/MessageFactory.cs b/Messages/FIX50/MessageFactory.cs index a179a9b02..49d497ef5 100644 --- a/Messages/FIX50/MessageFactory.cs +++ b/Messages/FIX50/MessageFactory.cs @@ -118,7 +118,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX50.IOI.MsgType.Equals(msgType)) { diff --git a/Messages/FIX50/QuickFix.FIX50.csproj b/Messages/FIX50/QuickFix.FIX50.csproj index 4e9fe2bbd..f7ac52280 100644 --- a/Messages/FIX50/QuickFix.FIX50.csproj +++ b/Messages/FIX50/QuickFix.FIX50.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIX50SP1/MessageFactory.cs b/Messages/FIX50SP1/MessageFactory.cs index 63b5ed9e7..8f11ec1e5 100644 --- a/Messages/FIX50SP1/MessageFactory.cs +++ b/Messages/FIX50SP1/MessageFactory.cs @@ -130,7 +130,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX50SP1.IOI.MsgType.Equals(msgType)) { diff --git a/Messages/FIX50SP1/QuickFix.FIX50SP1.csproj b/Messages/FIX50SP1/QuickFix.FIX50SP1.csproj index fd9c8ecd9..765a4c22e 100644 --- a/Messages/FIX50SP1/QuickFix.FIX50SP1.csproj +++ b/Messages/FIX50SP1/QuickFix.FIX50SP1.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIX50SP2/MessageFactory.cs b/Messages/FIX50SP2/MessageFactory.cs index 18ed1ec04..f7350eeac 100644 --- a/Messages/FIX50SP2/MessageFactory.cs +++ b/Messages/FIX50SP2/MessageFactory.cs @@ -135,7 +135,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIX50SP2.IOI.MsgType.Equals(msgType)) { diff --git a/Messages/FIX50SP2/QuickFix.FIX50SP2.csproj b/Messages/FIX50SP2/QuickFix.FIX50SP2.csproj index dd893616c..6083a44ca 100644 --- a/Messages/FIX50SP2/QuickFix.FIX50SP2.csproj +++ b/Messages/FIX50SP2/QuickFix.FIX50SP2.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/Messages/FIXT11/MessageFactory.cs b/Messages/FIXT11/MessageFactory.cs index 0d56585a0..66881cff9 100644 --- a/Messages/FIXT11/MessageFactory.cs +++ b/Messages/FIXT11/MessageFactory.cs @@ -33,7 +33,7 @@ public QuickFix.Message Create(string beginString, string msgType) }; } - public Group Create(string beginString, string msgType, int correspondingFieldId) + public Group? Create(string beginString, string msgType, int correspondingFieldId) { if (QuickFix.FIXT11.Logon.MsgType.Equals(msgType)) { diff --git a/Messages/FIXT11/QuickFix.FIXT11.csproj b/Messages/FIXT11/QuickFix.FIXT11.csproj index 61c9b7db4..f2ecc263f 100644 --- a/Messages/FIXT11/QuickFix.FIXT11.csproj +++ b/Messages/FIXT11/QuickFix.FIXT11.csproj @@ -21,6 +21,7 @@ snupkg README.md qfn-icon.png + enable diff --git a/QuickFIXn/DefaultMessageFactory.cs b/QuickFIXn/DefaultMessageFactory.cs index 58dbc073b..6d0688ac6 100644 --- a/QuickFIXn/DefaultMessageFactory.cs +++ b/QuickFIXn/DefaultMessageFactory.cs @@ -80,7 +80,7 @@ public Message Create(string beginString, QuickFix.Fields.ApplVerID applVerId, s return message; } - public Group Create(string beginString, string msgType, int groupCounterTag) + public Group? Create(string beginString, string msgType, int groupCounterTag) { string key = beginString; if(beginString.Equals(FixValues.BeginString.FIXT11)) diff --git a/QuickFIXn/IMessageFactory.cs b/QuickFIXn/IMessageFactory.cs index 80f91a776..949041fca 100644 --- a/QuickFIXn/IMessageFactory.cs +++ b/QuickFIXn/IMessageFactory.cs @@ -39,7 +39,7 @@ public interface IMessageFactory /// the FIX version (e.g. "FIX.4.2") /// message type of the enclosing message (e.g. "D" for a NewOrderSingle /// the tag of the group's counter field - /// group, or null if the group can't be created - Group Create(string beginString, string msgType, int groupCounterTag); + /// A group, or null if the group can't be created + Group? Create(string beginString, string msgType, int groupCounterTag); } } diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5acdee982..e8273cb06 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -52,6 +52,7 @@ What's New * #914 - Optimize MessageCracker.IsHandlerMethod (vasily-balansea) * #742 - Improvements to HTTP web proxy (IanLeeClaxton) * #277 - change FileStore.SetSeqNum() to dispose StreamWriter (hlibman) +* #nnn - mark IMessageFactory.Create's Group return value as nullable (gbirchmeier) ### v1.12.0 diff --git a/UnitTests/DefaultMessageFactoryTests.cs b/UnitTests/DefaultMessageFactoryTests.cs index f1fdbc4f2..a69b2a15d 100644 --- a/UnitTests/DefaultMessageFactoryTests.cs +++ b/UnitTests/DefaultMessageFactoryTests.cs @@ -15,13 +15,13 @@ public void GroupCreateTest_Fix50() { DefaultMessageFactory dmf = new DefaultMessageFactory(QuickFix.FixValues.ApplVerID.FIX50); - Group g44 = dmf.Create("FIX.4.4", "B", 33); + Group? g44 = dmf.Create("FIX.4.4", "B", 33); Assert.That(g44, Is.InstanceOf()); - Group g50 = dmf.Create("FIXT.1.1", "B", 33); + Group? g50 = dmf.Create("FIXT.1.1", "B", 33); Assert.That(g50, Is.InstanceOf()); - Group g50sp2 = dmf.Create("FIXT.1.1", "CD", QuickFix.Fields.Tags.NoAsgnReqs); + Group? g50sp2 = dmf.Create("FIXT.1.1", "CD", QuickFix.Fields.Tags.NoAsgnReqs); Assert.That(g50sp2, Is.Null); } @@ -30,10 +30,10 @@ public void GroupCreateTest_DefaultFix50Sp2() { DefaultMessageFactory dmf = new DefaultMessageFactory(); - Group g44 = dmf.Create("FIX.4.4", "B", 33); + Group? g44 = dmf.Create("FIX.4.4", "B", 33); Assert.That(g44, Is.InstanceOf()); - Group g50sp2 = dmf.Create("FIXT.1.1", "CD", QuickFix.Fields.Tags.NoAsgnReqs); + Group? g50sp2 = dmf.Create("FIXT.1.1", "CD", QuickFix.Fields.Tags.NoAsgnReqs); Assert.That(g50sp2, Is.InstanceOf()); } }