Skip to content

Commit 5c1cd5a

Browse files
committed
Suppress CA2202
1 parent 5ac4ecf commit 5c1cd5a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Rubberduck.Parsing/ComReflection/XmlComProjectSerializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics.CodeAnalysis;
23
using System.IO;
34
using System.Runtime.Serialization;
45
using System.Xml;
@@ -46,6 +47,7 @@ public bool SerializedVersionExists(ReferenceInfo reference)
4647
return File.Exists(testFile);
4748
}
4849

50+
[SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")] //This is fine. XmlWriter disposes the FileStream, but calling twice is a NOP.
4951
public void SerializeProject(ComProject project)
5052
{
5153
var filepath = Path.Combine(Target, FileName(project));

Rubberduck.SettingsProvider/XmlPersistanceService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics.CodeAnalysis;
23
using System.IO;
34
using System.Linq;
45
using System.Text;
@@ -76,6 +77,7 @@ private static T FailedLoadReturnValue()
7677
return (T)Convert.ChangeType(null, typeof(T));
7778
}
7879

80+
[SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")] //This is fine. StreamWriter disposes the MemoryStream, but calling twice is a NOP.
7981
public void Save(T toSerialize)
8082
{
8183
var doc = GetConfigurationDoc(FilePath);

0 commit comments

Comments
 (0)