Releases: NightOwl888/J2N
Releases · NightOwl888/J2N
v2.1.0
Summary
This release focuses primarily on the following:
- Increasing support for System.Memory types such as
ReadOnlySpan<T>
andSpan<T>
, especially on strings - Normalizing behavior of
Dictionary<TKey, TValue>
,SortedDictionary<TKey, TValue>
andSortedSet<T>
to be equivalent to .NET 8 - Reducing allocations by making use of the stack and/or array pool
- Removing support for old target frameworks
- Adding support for
net8.0
What's Changed
- Oct 2023 build updates by @NightOwl888 in #52
- J2N.Numerics: Extended Span support to net45 and netstandard2.0 by @NightOwl888 in #53
- J2N.Threading.ThreadJob: Don't swallow exceptions when getting/setting Priority by @NightOwl888 in #50
- J2N.Character: Added ReadOnlySpan overloads for working with codepoints by @NightOwl888 in #54
- J2N.Tests.Collections.TestBitSet.JDK8BSMethods: Enabled TestEquals() test, removed unnecessary variable initialization by @NightOwl888 in #55
- J2N.Character: Added overloads of ToChars() and ToString() to reduce allocations by @NightOwl888 in #56
- J2N.Text.StringBuilderExtensions: Added CopyTo(int, Span, int) … by @NightOwl888 in #59
- PERFORMANCE: J2N.Text.StringBuilderExtensions: Optimizations by @NightOwl888 in #63
- PERFORMANCE: J2N.Text.CharArrayExtensions: Optimized CompareToOrdinal() by @NightOwl888 in #67
- PERFORMANCE: J2N.Character: Optimized CodePointAt(), CodePointBefore(), CodePointCount(), and OffsetByCodePoints() by @NightOwl888 in #65
- PERFORMANCE: J2N.Text.StringExtensions: Optimized CompareToOrdinal(), ContentEquals(), and RegionMatches() by @NightOwl888 in #66
- J2N.Text.StringBuilderExtensions::InsertCodePoint(): Fixed xml doc by @NightOwl888 in #71
- PERFORMANCE: J2N.Text.CharSequenceComparer: Optimized Compare(), Equals() and GetHashCode() implementations by @NightOwl888 in #70
- J2N.Text: Added ISpanAppendable interface and AppendableExtensions class by @NightOwl888 in #72
- J2N.Text.StringBuffer: Fixed bugs and added new APIs by @NightOwl888 in #73
- J2N.Text (CharArrayCharSequence + StringBuilderCharSequence + StringCharSequence): Optimized and fixed several bugs in the Equals() and CompareTo() overloads. by @NightOwl888 in #74
- PERFORMANCE: J2N.Text.StringBuilderCharSequence: Optimized and fixed several bugs with the IAppendable implementations by @NightOwl888 in #75
- J2N.Text: Added ValueStringBuilderIndexer for end users - optimizes iteration of StringBuilder via index by @NightOwl888 in #76
- J2N.Text.StringExtensions, J2N.Memory.MemoryExtensions: Added optimized ReverseText() methods by @NightOwl888 in #77
- J2N.Character: Added overloads of CodePointAt() and CodePointBefore() by @NightOwl888 in #78
- PERFORMANCE: Added target for net462 by @NightOwl888 in #79
- PERFORMANCE: J2N.Character::ToString(): Improved both memory usage and speed by using String.Create() and ArrayPool, when supported. by @NightOwl888 in #81
- J2N.Text.StringExtensions::ReverseText(): Use String.Create() for optimal performance, when supported by @NightOwl888 in #82
- PERFORMANCE: J2N.Character: Optimized ToUpper() and ToLower() and added ToUpperInvariant() and ToLowerInvariant() by @NightOwl888 in #84
- PERFORMANCE: Removed ValueStringBuilder and reworked methods that used it to use stack/array pool explicitly by @NightOwl888 in #85
- J2N.Text (CharArrayExtensions + StringBuilderExtensions + StringExtensions): Added ReadOnlySpan overload of CompareToOrdinal() by @NightOwl888 in #86
- J2N.Text.StringBuilderExtensions: Added Replace() overload that accepts ReadOnlySpan by @NightOwl888 in #87
- J2N.MemoryExtensions: Added IndexOf(codePoint) and LastIndexOf(codePoint) extension methods by @NightOwl888 in #88
- J2N.Text.StringExtensions: Added ReadOnlySpan overload of ContentEquals() by @NightOwl888 in #89
- J2N.Text.StringExtensions: Added ReadOnlySpan overload to RegionMatches() by @NightOwl888 in #90
- Added support for Span/ReadOnlySpan in net40 by @NightOwl888 in #92
- Removed tests and CI for Xamarin, as they are now obsolete by @NightOwl888 in #96
- Removed FEATURE_ARRAYPOOL by @NightOwl888 in #97
- Removed FEATURE_SPAN and FEATURE_READONLYMEMORY by @NightOwl888 in #98
- J2N.Collections: Added AsReadOnly() method to each dictionary and set by @NightOwl888 in #100
- PERFORMANCE: J2N.Text.StringBuilderExtensions::Replace(): Reuse expansion memory by @NightOwl888 in #101
- azure-pipelines.yml: Use deep clone for Nerdbank.GitVersioning by @NightOwl888 in #102
- J2N.Character: Added overload of ToChars() that accepts a Span and returns ReadOnlySpan by @NightOwl888 in #103
- J2N.Runtime.InteropServices: Added CollectionMarshal class by @NightOwl888 in #99
- Upgraded Dictionary<TKey, TValue> to use a low level (rather than a wrapped) implementation by @NightOwl888 in #104
- Added net8.0 target and tests (Fixes #94) by @NightOwl888 in #110
- Reverted breaking API changes for 2.1.0 so we don't have to bump to 3.0.0 by @NightOwl888 in #113
Full Changelog: v2.0.0...v2.1.0
v2.0.0
Change Log
- #45:
J2N.Collections.Generic.EqualityComparer
,J2N.Collections.Generic.Comparer
: Added nullable value type support forfloat?
anddouble?
- #46:
J2N.Text.StringFormatter
: Added constructor overload forIFormatProvider
, deprecatedCulture
property, addedFormatProvider
property - #47: Added Source Link support
- #48: Updated build with the latest features
- Use latest SDKs for build and tests (6.0.101, 5.0.404, 3.1.416)
- Added readme.md to NuGet package
- Added target-framework-conditional support for
dependencies.props
- Added
.gitattributes
file - Added CLI build script for Windows, macOS, and Linux
- Added documentation for building, testing, releasing
- Renamed
build
directory to.build
- Added
PrintTargetFrameworks
MSBuild target to read the supported target frameworks for a given test project - Added
SkipGitVersioning
MSBuild property to remove the Nerdbank.GitVersioning NuGet package reference when creating versions via scripts - Updated
azure-pipelines.yml
to allow overriding version info using parameters
v2.0.0-beta-0017
Change Log
- Added target framework
net6.0
+ tests. - Removed support for testing
netcoreapp2.1
and replaced withnet461
for testingnetstandard2.0
. - Changed from
net461
tonet48
for testingnet45
.
v2.0.0-beta-0016
Change Log
- #32 -
J2N.Character
: Added code point overloads of Digit() and GetNumericValue() - BUG #33: - Updated
float.MinValue
anddouble.MinValue
tofloat.Epsilon
anddouble.Epsilon
, respectively (Epsilon is the corresponding constant in .NET) - #33 - Added
[DebuggerStepThrough]
attribute in test framework assert methods - BUG #33 -
J2N.Collections.Generic.EqualityComparer
: Fixed floating point comparison logic - #33 - Added
MathExtensions.CopySign()
method - BUG #33 -
J2N.Time
: Fixed implementations of bothNanoTime()
andCurrentTimeMilliseconds()
to match the JDK and added tests. Also added field forUnixEpoch
and methods forGetTimeSpanSinceUnixEpoch()
andGetMillisecondsSinceUnixEpoch()
. See "Time calculation issue in ControlledRealTimeReopenThread" apache/lucenenet#492. - #34 - Added Numbers Classes and support for parsing and formatting numeric types that are Java-compatible (Thanks @rclabo for your help on this).
- PERFORMANCE #36 -
Character.ToString()
: Optimized to use stack for the buffer when input array is 256 codepoints or less. - BREAKING #38 -
Character.IsWhiteSpace()
: fixed method overloads to use the same rules as the JDK, which do not match .NET or any Unicode standard. - #9, #40 -
J2N.Collections.Generic.List<T>
: AddedGetView()
method to provide a slice of a list without allocating a new array. - #40 -
J2N.Collections.Generic.Extensions.ListExtensions
: AddedGetView()
extension method to expose sublist functionality on theIList<T>
interface. If the list is other thanJ2N.Collections.Generic.List<T>
or aJ2N.Collections.ObjectModel.ReadOnlyList<T>
that wrapsJ2N.Collections.Generic.List<T>
, it provides a degraded wrapper class that doesn't necessarily throw exceptions when an ancestor list is edited, but provides all members ofIList<T>
. - #40 -
J2N.Collections.Generic.Extensions.ListExtensions
: AddedRemoveAll()
extension method on IList that provides an efficient way to do a forward iteration over a list while deleting items from it. This provides a partial replacement for Java's ability to delete items while iterating any collection as well as a way to implement features from Java's Collection interface such as .removeAll() and .retainAll(). - BUG #40 -
J2N.Collections.Generic.Extensions.ListExtensions
: Fixed bounds checking of theSwap()
extension method. - PERFORMANCE #40 -
J2N.Collections.Generic.Extensions.ListExtensions
: Optimized performance ofBinarySearch()
extension methods for common cases such asList<T>
and array.
v2.0.0-beta-0015
Change Log
- #28 - BUG: Fixed
enum
(and other non-custom formatting) support inJ2N.Text.StringFormatter
v2.0.0-beta-0014
Change Log
- #23, #10 - Completed nullable reference type support.
- #23 - Removed dependency on
System.Text.Encoding.CodePages
. - #24 -
J2N.Threading.ThreadJob
: Added support for original stack trace using ExceptionDispatchInfo on .NET Framework 4.5+ and marked the ThreadJob.Debug property obsolete, since this feature is always on. - #26 - Added
J2N.Text.ParseException
+ tests. - #27 -
J2N.Collections.BitSet
: Corrected documentation.
v2.0.0-beta-0013
Change Log
- #15 -
J2N.Threading.ThreadJob
: AllowThreadInterruptedException
to propagate to the calling thread - #16 -
J2N.IO
Buffers: Improved guard clauses. - #17 -
J2N.Character
: AddedToString()
methods to convert code point arrays to strings. - #18 -
J2N.MathExtensions
: AddedNextUp()
,NextDown()
andNextAfter()
methods for bothfloat
anddouble
types. - #19 -
J2N.IO
+J2N.Runtime.CompilerServices
: Added nullable reference type support (see #10). - #20 - Allow exceptions to be serialized on .NET Core and .NET 5+.
v2.0.0-beta-0012
Change Log
- Added tests for Xamarin.Android.
- Removed support for .NET Standard 1.3.
- Added target framework for .NET 5.0 + tests.
- Added tests for x86 for all target platforms/operating systems.
- BUG:
J2N.Collections.ArrayEqualityComparer<T>
: Fixed infinite recursion issue on Xamarin.Android due toArrayEqualityComparer<T>
abstract base class calling itself during static initialization. Refactored to flatten the class hierarchy for easier maintenance. - PERFORMANCE:
J2N.Collections.Generic.EqualityComparer<T>
: Don't implicitly cast tolong
before the negative zero comparison. - Enabled nullable reference type support for namespaces J2N, J2N.Threading, and J2N.Threading.Atomic. Added missing null checks, guard clauses, and updated documentation where appropriate (See #10).
- Removed unnecessary dependencies on
System.Text.Encoding.CodePages
andMicrosoft.CSharp
from thenetcoreapp3.0
target.
v2.0.0-beta-0011
Change Log
- BUG:
J2N.Text.StringFormatter
: Fixed negative zero decimal format so it takes into account culture sensitivity with theNumberFormatInfo.NumberDecimalSeparator
string. - Fixed the CI pipeline so .NET Core 1.x and 2.x tests run.
v2.0.0-beta-0010
Change Log
- apache/lucenenet#343: Fixed configuration of NuGet package so the
LICENSE.txt
and icon files are in the root of the NuGet package, not in thecontent
directory