This is an automated email from the ASF dual-hosted git repository.
nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
The following commit(s) were added to refs/heads/master by this push:
new 8213e9310 SWEEP: Removed call to ToString() for StringBuilder.Append()
methods, so strongly typed StringBuilder overloads can be used on target
frameworks that support it. Fixes #668.
8213e9310 is described below
commit 8213e9310f19dda22566bf2d23338771a7ac8471
Author: Shad Storhaug <[email protected]>
AuthorDate: Thu Oct 20 02:51:57 2022 +0700
SWEEP: Removed call to ToString() for StringBuilder.Append() methods, so
strongly typed StringBuilder overloads can be used on target frameworks that
support it. Fixes #668.
---
.../Analysis/Compound/Hyphenation/PatternParser.cs | 2 +-
src/Lucene.Net.Tests/Analysis/TestToken.cs | 4 ++--
.../Analysis/TokenAttributes/TestCharTermAttributeImpl.cs | 4 ++--
src/Lucene.Net.Tests/Search/TestCustomSearcherSort.cs | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git
a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
index db92089ab..7d9c5adaa 100644
---
a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
+++
b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs
@@ -270,7 +270,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation
token.Length = 0;
return word;
}
- token.Append(chars.ToString());
+ token.Append(chars); // LUCENENET: CA1830: Prefer strongly-typed
Append and Insert method overloads on StringBuilder
return null;
}
diff --git a/src/Lucene.Net.Tests/Analysis/TestToken.cs
b/src/Lucene.Net.Tests/Analysis/TestToken.cs
index 28d65dc58..136cc0871 100644
--- a/src/Lucene.Net.Tests/Analysis/TestToken.cs
+++ b/src/Lucene.Net.Tests/Analysis/TestToken.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Analysis.TokenAttributes;
+using Lucene.Net.Analysis.TokenAttributes;
using NUnit.Framework;
using System.Collections.Generic;
using System.IO;
@@ -99,7 +99,7 @@ namespace Lucene.Net.Analysis
t.CopyBuffer(content, 0, content.Length);
Assert.AreEqual(buf.Length, t.Length);
Assert.AreEqual(buf.ToString(), t.ToString());
- buf.Append(buf.ToString());
+ buf.Append(buf); // LUCENENET: CA1830: Prefer strongly-typed
Append and Insert method overloads on StringBuilder
}
Assert.AreEqual(1048576, t.Length);
diff --git
a/src/Lucene.Net.Tests/Analysis/TokenAttributes/TestCharTermAttributeImpl.cs
b/src/Lucene.Net.Tests/Analysis/TokenAttributes/TestCharTermAttributeImpl.cs
index 3ec9cdd07..b7d214937 100644
--- a/src/Lucene.Net.Tests/Analysis/TokenAttributes/TestCharTermAttributeImpl.cs
+++ b/src/Lucene.Net.Tests/Analysis/TokenAttributes/TestCharTermAttributeImpl.cs
@@ -1,4 +1,4 @@
-using J2N.Text;
+using J2N.Text;
using NUnit.Framework;
using System;
using System.Collections.Generic;
@@ -57,7 +57,7 @@ namespace Lucene.Net.Analysis.TokenAttributes
t.CopyBuffer(content, 0, content.Length);
Assert.AreEqual(buf.Length, t.Length);
Assert.AreEqual(buf.ToString(), t.ToString());
- buf.Append(buf.ToString());
+ buf.Append(buf); // LUCENENET: CA1830: Prefer strongly-typed
Append and Insert method overloads on StringBuilder
}
Assert.AreEqual(1048576, t.Length);
diff --git a/src/Lucene.Net.Tests/Search/TestCustomSearcherSort.cs
b/src/Lucene.Net.Tests/Search/TestCustomSearcherSort.cs
index 77d782053..95d72f5c4 100644
--- a/src/Lucene.Net.Tests/Search/TestCustomSearcherSort.cs
+++ b/src/Lucene.Net.Tests/Search/TestCustomSearcherSort.cs
@@ -181,7 +181,7 @@ namespace Lucene.Net.Search
message.Append("Duplicate key for hit index = ");
message.Append(docnum);
message.Append(", previous index = ");
- message.Append(value.ToString());
+ message.Append(value); // LUCENENET: CA1830: Prefer
strongly-typed Append and Insert method overloads on StringBuilder
message.Append(", Lucene ID = ");
message.Append(luceneId);
Log(message.ToString());