Skip to content

[release/10.0-preview4] Fix some static analysis errors #115020

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ private static void WriteHeader(StringBuilder writer, int errorsCount, int pathC
// The composition produced a single composition error. The root cause is provided below.
writer.AppendFormat(
CultureInfo.CurrentCulture,
SR.CompositionException_SingleErrorWithSinglePath,
pathCount);
SR.CompositionException_SingleErrorWithSinglePath);
}

writer.Append(' ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override CompositeActivator RewriteActivator(

foreach (var m in importsSatisfiedMethods)
{
if (!(m.IsPublic || m.IsAssembly) | m.IsStatic || m.ReturnType != typeof(void) ||
if (!(m.IsPublic || m.IsAssembly) || m.IsStatic || m.ReturnType != typeof(void) ||
m.IsGenericMethodDefinition || m.GetParameters().Length != 0)
{
string message = SR.Format(SR.OnImportsSatisfiedFeature_AttributeError, partType, m.Name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ internal unsafe IntPtr GetReplicationInfoHelper(IntPtr dsHandle, int type, int s
}
catch (COMException e)
{
if (e.ErrorCode == unchecked((int)0x80072020) | // dir_error on server side
if (e.ErrorCode == unchecked((int)0x80072020) || // dir_error on server side
e.ErrorCode == unchecked((int)0x80072030)) // object not exists
throw new ArgumentException(SR.DSNoObject, "objectPath");
else if (e.ErrorCode == unchecked((int)0x80005000) | // bad path name
else if (e.ErrorCode == unchecked((int)0x80005000) || // bad path name
e.ErrorCode == unchecked((int)0x80072032)) // ERROR_DS_INVALID_DN_SYNTAX
throw new ArgumentException(SR.DSInvalidPath, "objectPath");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public override ValueTask<T> ReadAsync(CancellationToken cancellationToken)
// cancellation callback could end up running arbitrary code, including code that called back into the reader or
// writer and tried to take the same lock held by the thread running UnregisterCancellation... deadlock. As such,
// we only allow synchronous continuations here if both a) the caller requested it and the token isn't cancelable.
var reader = new AsyncOperation<T>(parent._runContinuationsAsynchronously | cancellationToken.CanBeCanceled, cancellationToken);
var reader = new AsyncOperation<T>(parent._runContinuationsAsynchronously || cancellationToken.CanBeCanceled, cancellationToken);
parent._blockedReaders.EnqueueTail(reader);
return reader.ValueTaskOfT;
}
Expand Down Expand Up @@ -232,7 +232,7 @@ public override ValueTask<bool> WaitToReadAsync(CancellationToken cancellationTo
// cancellation callback could end up running arbitrary code, including code that called back into the reader or
// writer and tried to take the same lock held by the thread running UnregisterCancellation... deadlock. As such,
// we only allow synchronous continuations here if both a) the caller requested it and the token isn't cancelable.
var waiter = new AsyncOperation<bool>(parent._runContinuationsAsynchronously | cancellationToken.CanBeCanceled, cancellationToken);
var waiter = new AsyncOperation<bool>(parent._runContinuationsAsynchronously || cancellationToken.CanBeCanceled, cancellationToken);
ChannelUtilities.QueueWaiter(ref _parent._waitingReadersTail, waiter);
return waiter.ValueTaskOfT;
}
Expand Down
Loading