NightOwl888 commented on code in PR #834:
URL: https://github.com/apache/lucenenet/pull/834#discussion_r1166028477
##########
src/Lucene.Net.Benchmark/Support/Sax/Helpers/AttributesImpl.cs:
##########
@@ -59,8 +60,14 @@ public Attributes()
/// <para/>
/// This constructor is especially useful inside a
/// <see cref="IContentHandler.StartElement(string, string, string,
IAttributes)"/>.
+ ///
+ /// Note, this constructor calls a virtual <see
cref="SetAttributes(IAttributes)"/> to copy the attributes.
+ /// If you are subclassing this class and don't want SetAttributes to
be called, you should
+ /// use the <see cref="Attributes()"/> constructor instead and call
SetAttributes yourself if needed.
Review Comment:
It looks like `AddAttribute()` is another way to work around this. Maybe we
should mention it.
##########
src/Lucene.Net.Benchmark/Support/Sax/Helpers/AttributesImpl.cs:
##########
@@ -59,8 +60,14 @@ public Attributes()
/// <para/>
/// This constructor is especially useful inside a
/// <see cref="IContentHandler.StartElement(string, string, string,
IAttributes)"/>.
+ ///
+ /// Note, this constructor calls a virtual <see
cref="SetAttributes(IAttributes)"/> to copy the attributes.
+ /// If you are subclassing this class and don't want SetAttributes to
be called, you should
+ /// use the <see cref="Attributes()"/> constructor instead and call
SetAttributes yourself if needed.
/// </summary>
/// <param name="atts">The existing <see cref="Attributes"/>
object.</param>
+ [SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary
suppression", Justification = "This is a SonarCloud issue")]
+ [SuppressMessage("CodeQuality", "S1699:Constructors should only call
non-overridable methods", Justification = "Required for continuity with
Lucene's design")]
Review Comment:
Let's change this to
`Justification = "There is an Attributes() constructor overload to work
around the issue"`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]