From dde958721c68c2c178f9ace5231dcf238ecc3e9d Mon Sep 17 00:00:00 2001 From: elachlan <2433737+elachlan@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:53:00 +1000 Subject: [PATCH] SA1408 Conditional expressions should declare precedence --- eng/Common.globalconfig | 2 +- src/Build/BackEnd/BuildManager/BuildManager.cs | 2 +- .../BackEnd/Components/ProjectCache/ProjectCacheService.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Common.globalconfig b/eng/Common.globalconfig index ba417e063f2..561275f6135 100644 --- a/eng/Common.globalconfig +++ b/eng/Common.globalconfig @@ -956,7 +956,7 @@ dotnet_diagnostic.SA1405.severity = suggestion dotnet_diagnostic.SA1407.severity = suggestion # Conditional expressions should declare precedence -dotnet_diagnostic.SA1408.severity = suggestion +dotnet_diagnostic.SA1408.severity = warning dotnet_diagnostic.SA1410.severity = none diff --git a/src/Build/BackEnd/BuildManager/BuildManager.cs b/src/Build/BackEnd/BuildManager/BuildManager.cs index e2b4a71dc6f..8a14da34757 100644 --- a/src/Build/BackEnd/BuildManager/BuildManager.cs +++ b/src/Build/BackEnd/BuildManager/BuildManager.cs @@ -909,7 +909,7 @@ public void EndBuild() { // Override the build success if the user specified /warnaserror and any errors were logged outside of a build submission. if (exceptionsThrownInEndBuild || - _overallBuildSuccess && loggingService.HasBuildSubmissionLoggedErrors(BuildEventContext.InvalidSubmissionId)) + (_overallBuildSuccess && loggingService.HasBuildSubmissionLoggedErrors(BuildEventContext.InvalidSubmissionId))) { _overallBuildSuccess = false; } diff --git a/src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs b/src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs index 2a11a10f59b..3db0eeb4a3a 100644 --- a/src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs +++ b/src/Build/BackEnd/Components/ProjectCache/ProjectCacheService.cs @@ -282,7 +282,7 @@ public void PostCacheRequest(CacheRequest cacheRequest) ErrorUtilities.VerifyThrowInternalError( LateInitializationForVSWorkaroundCompleted is null || - _projectCacheDescriptor.VsWorkaround && LateInitializationForVSWorkaroundCompleted.Task.IsCompleted, + (_projectCacheDescriptor.VsWorkaround && LateInitializationForVSWorkaroundCompleted.Task.IsCompleted), "Completion source should be null when this is not the VS workaround"); BuildRequestData buildRequest = new BuildRequestData( @@ -314,7 +314,7 @@ static bool IsDesignTimeBuild(ProjectInstance project) var buildingProject = project.GlobalPropertiesDictionary[DesignTimeProperties.BuildingProject]?.EvaluatedValue; return MSBuildStringIsTrue(designTimeBuild) || - buildingProject != null && !MSBuildStringIsTrue(buildingProject); + (buildingProject != null && !MSBuildStringIsTrue(buildingProject)); } void EvaluateProjectIfNecessary(CacheRequest request)