8000 [StyleCleanUp] Addressing SA warnings Part 2 by harshit7962 · Pull Request #10123 · dotnet/wpf · GitHub
[go: up one dir, main page]

Skip to content

[StyleCleanUp] Addressing SA warnings Part 2 #10123

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

Merged
merged 10 commits into from
Dec 30, 2024
Merged
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
21 changes: 0 additions & 21 deletions src/Microsoft.DotNet.Wpf/src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -311,30 +311,9 @@ dotnet_diagnostic.SA1121.severity = suggestion
# SA1129: Do not use default value type constructor
dotnet_diagnostic.SA1129.severity = suggestion

# SA1206: Keyword ordering
dotnet_diagnostic.SA1206.severity = suggestion

# SA1400: Member should declare an access modifier
dotnet_diagnostic.SA1400.severity = suggestion

# SA1500: Braces for multi-line statements should not share line
dotnet_diagnostic.SA1500.severity = suggestion

# SA1505: An opening brace should not be followed by a blank line
dotnet_diagnostic.SA1505.severity = suggestion

# SA1507: Code should not contain multiple blank lines in a row
dotnet_diagnostic.SA1507.severity = suggestion

# SA1508: A closing brace should not be preceded by a blank line
dotnet_diagnostic.SA1508.severity = suggestion

# SA1513: Closing brace should be followed by blank line
dotnet_diagnostic.SA1513.severity = suggestion

# SA1518: Code should not contain blank lines at the end of the file
dotnet_diagnostic.SA1518.severity = suggestion

# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
dotnet_diagnostic.SYSLIB1045.severity = suggestion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ internal static Assembly GetLoadedAssembly(AssemblyName assemblyName)
return assemblies[i];
}
}

return null;
}

Expand All @@ -171,6 +172,7 @@ static AssemblyName GetAssemblyName(Assembly assembly)
return result;
}
}

//
// We use AssemblyName ctor here because GetName demands FileIOPermission
// and does load more than just the required information.
Expand All @@ -185,6 +187,7 @@ static AssemblyName GetAssemblyName(Assembly assembly)
GCNotificationToken.RegisterCallback(_cleanupCollectedAssemblies, null);
_isGCCallbackPending = true;
}

return result;
}
}
Expand All @@ -203,6 +206,7 @@ static void CleanupCollectedAssemblies(object state) // dummy parameter required
{
continue;
}

if (weakRef.IsAlive)
{
// There is a weak ref that is still alive, register another GC callback for next time
Expand All @@ -215,16 +219,19 @@ static void CleanupCollectedAssemblies(object state) // dummy parameter required
{
keysToRemove = new List<object>();
}

keysToRemove.Add(key);
}
}

if (keysToRemove is not null)
{
foreach (object key in keysToRemove)
{
_assemblies.Remove(key);
}
}

if (foundLiveDynamicAssemblies)
{
GCNotificationToken.RegisterCallback(_cleanupCollectedAssemblies, null);
Expand Down Expand Up @@ -311,6 +318,7 @@ public override bool Equals(object o)
return (target1 == target2);
}
}

return base.Equals(o);
}

Expand All @@ -320,6 +328,7 @@ public override bool Equals(object o)
{
return object.ReferenceEquals(right, null);
}

return left.Equals(right);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ public XamlContextStack(XamlContextStack<T> source, bool copy)
{
_currentFrame = newFrame;
}

if (lastFrameInNewStack is not null)
{
lastFrameInNewStack.Previous = newFrame;
}

lastFrameInNewStack = newFrame;
iteratorFrame = (T)iteratorFrame.Previous;
}
Expand Down Expand Up @@ -88,6 +90,7 @@ public T GetFrame(int depth)
{
iteratorFrame = (T)iteratorFrame.Previous;
}

return iteratorFrame;
}

Expand All @@ -106,6 +109,7 @@ public void PushScope()
_recycledFrame = (T)_recycledFrame.Previous;
_currentFrame.Previous = lastFrame;
}

_depth++;
Debug.Assert(CurrentFrame.Depth == Depth);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class SpecialBracketCharacters : ISupportInitialize
{
private string _startChars;
private string _endChars;
private readonly static ISet<char> _restrictedCharSet = new SortedSet<char>((new char[] { '=', ',', '\'', '"', '{', '}', '\\' }));
private static readonly ISet<char> _restrictedCharSet = new SortedSet<char>((new char[] { '=', ',', '\'', '"', '{', '}', '\\' }));
private bool _initializing;
private StringBuilder _startCharactersStringBuilder;
private StringBuilder _endCharactersStringBuilder;
Expand Down
Loading
0