diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Assets.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Assets.cs index b1b6645c73e..4a6b401038e 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Assets.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Assets.cs @@ -189,13 +189,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching /// (together with used package information) required for compilation. /// /// True if parsing succeeds, otherwise false. - public bool TryParse(string json, string? jsonPath = null) + public bool TryParse(string json, string jsonPath) { try { var obj = JObject.Parse(json); - AddPackageDependencies(obj, jsonPath ?? json); - AddFrameworkDependencies(obj, jsonPath ?? json); + AddPackageDependencies(obj, jsonPath); + AddFrameworkDependencies(obj, jsonPath); return true; } catch (Exception e) diff --git a/csharp/extractor/Semmle.Extraction.Tests/Assets.cs b/csharp/extractor/Semmle.Extraction.Tests/Assets.cs index ea04597f96b..f2478f0614d 100644 --- a/csharp/extractor/Semmle.Extraction.Tests/Assets.cs +++ b/csharp/extractor/Semmle.Extraction.Tests/Assets.cs @@ -16,7 +16,7 @@ namespace Semmle.Extraction.Tests var json = assetsJson1; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.True(success); @@ -46,7 +46,7 @@ namespace Semmle.Extraction.Tests var json = "garbage data"; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.False(success); @@ -61,7 +61,7 @@ namespace Semmle.Extraction.Tests var json = assetsNet70; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.True(success); @@ -91,7 +91,7 @@ namespace Semmle.Extraction.Tests var json = assetsNet48; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.True(success); @@ -117,7 +117,7 @@ namespace Semmle.Extraction.Tests var json = assetsNetstandard21; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.True(success); @@ -144,7 +144,7 @@ namespace Semmle.Extraction.Tests var json = assetsNetstandard16; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.True(success); @@ -175,7 +175,7 @@ namespace Semmle.Extraction.Tests var json = assetsNetcoreapp20; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.True(success); @@ -202,7 +202,7 @@ namespace Semmle.Extraction.Tests var json = assetsNetcoreapp31; // Execute - var success = assets.TryParse(json); + var success = assets.TryParse(json, ""); // Verify Assert.True(success);