Skip to content

Commit ff37677

Browse files
authored
Bumped J2N to 2.2.0-alpha-0048 (#1378)
1 parent 2e3cf85 commit ff37677

3 files changed

Lines changed: 3 additions & 17 deletions

File tree

.build/dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<IKVMPackageVersion>8.7.5</IKVMPackageVersion>
3939
<IKVMMavenSdkPackageVersion>1.6.7</IKVMMavenSdkPackageVersion>
4040
<!-- J2N will break binary compatibility in 3.0.0 to fix the APIs of collection types -->
41-
<J2NPackageVersion>[2.2.0-alpha-0042, 3.0.0)</J2NPackageVersion>
41+
<J2NPackageVersion>[2.2.0-alpha-0048, 3.0.0)</J2NPackageVersion>
4242
<LiquidTestReportsMarkdownPackageVersion>1.0.9</LiquidTestReportsMarkdownPackageVersion>
4343
<LuceneNetCodeAnalysisDevPackageVersion>1.0.0-alpha.36</LuceneNetCodeAnalysisDevPackageVersion>
4444
<MicrosoftAspNetCoreHttpAbstractionsPackageVersion>2.3.0</MicrosoftAspNetCoreHttpAbstractionsPackageVersion>

src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ public static void DumpEnumerator(string label, IEnumerator iter, TextWriter str
13211321
{
13221322
while (iter.MoveNext())
13231323
{
1324-
stream.WriteLine(Collections.ToString(iter.Current));
1324+
stream.WriteLine(string.Format(J2N.Text.StringFormatter.InvariantCulture, "{0}", iter.Current));
13251325
}
13261326
}
13271327
stream.WriteLine("*** END " + label + " ***");

src/Lucene.Net/Support/Collections.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,21 +163,7 @@ public static string ToString<TKey, TValue>(IDictionary<TKey, TValue>? dictionar
163163
/// </summary>
164164
public static string? ToString(object? obj)
165165
{
166-
if (obj is null)
167-
{
168-
return "null";
169-
}
170-
171-
Type t = obj.GetType();
172-
if (t.IsGenericType
173-
&& (t.ImplementsGenericInterface(typeof(ICollection<>)))
174-
|| t.ImplementsGenericInterface(typeof(IDictionary<,>)))
175-
{
176-
dynamic genericType = Convert.ChangeType(obj, t);
177-
return ToString(genericType);
178-
}
179-
180-
return Convert.ToString(obj, CultureInfo.InvariantCulture);
166+
return string.Format(J2N.Text.StringFormatter.InvariantCulture, "{0}", obj);
181167
}
182168

183169
public static ReadOnlyList<T> AsReadOnly<T>(IList<T> list)

0 commit comments

Comments
 (0)