Skip to content

Releases: NightOwl888/J2N

v2.1.0

20 Oct 16:44
Compare
Choose a tag to compare

Summary

This release focuses primarily on the following:

  • Increasing support for System.Memory types such as ReadOnlySpan<T> and Span<T>, especially on strings
  • Normalizing behavior of Dictionary<TKey, TValue>, SortedDictionary<TKey, TValue> and SortedSet<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

15 Jan 04:40
Compare
Choose a tag to compare

Change Log

  1. #45: J2N.Collections.Generic.EqualityComparer, J2N.Collections.Generic.Comparer: Added nullable value type support for float? and double?
  2. #46: J2N.Text.StringFormatter: Added constructor overload for IFormatProvider, deprecated Culture property, added FormatProvider property
  3. #47: Added Source Link support
  4. #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

24 Oct 02:45
Compare
Choose a tag to compare
v2.0.0-beta-0017 Pre-release
Pre-release

Change Log

  1. Added target framework net6.0 + tests.
  2. Removed support for testing netcoreapp2.1 and replaced with net461 for testing netstandard2.0.
  3. Changed from net461 to net48 for testing net45.

v2.0.0-beta-0016

24 Jul 10:06
Compare
Choose a tag to compare
v2.0.0-beta-0016 Pre-release
Pre-release

Change Log

  1. #32 - J2N.Character: Added code point overloads of Digit() and GetNumericValue()
  2. BUG #33: - Updated float.MinValue and double.MinValue to float.Epsilon and double.Epsilon, respectively (Epsilon is the corresponding constant in .NET)
  3. #33 - Added [DebuggerStepThrough] attribute in test framework assert methods
  4. BUG #33 - J2N.Collections.Generic.EqualityComparer: Fixed floating point comparison logic
  5. #33 - Added MathExtensions.CopySign() method
  6. BUG #33 - J2N.Time: Fixed implementations of both NanoTime() and CurrentTimeMilliseconds() to match the JDK and added tests. Also added field for UnixEpoch and methods for GetTimeSpanSinceUnixEpoch() and GetMillisecondsSinceUnixEpoch(). See "Time calculation issue in ControlledRealTimeReopenThread" apache/lucenenet#492.
  7. #34 - Added Numbers Classes and support for parsing and formatting numeric types that are Java-compatible (Thanks @rclabo for your help on this).
  8. PERFORMANCE #36 - Character.ToString(): Optimized to use stack for the buffer when input array is 256 codepoints or less.
  9. BREAKING #38 - Character.IsWhiteSpace(): fixed method overloads to use the same rules as the JDK, which do not match .NET or any Unicode standard.
  10. #9, #40 - J2N.Collections.Generic.List<T>: Added GetView() method to provide a slice of a list without allocating a new array.
  11. #40 - J2N.Collections.Generic.Extensions.ListExtensions: Added GetView() extension method to expose sublist functionality on the IList<T> interface. If the list is other than J2N.Collections.Generic.List<T> or a J2N.Collections.ObjectModel.ReadOnlyList<T> that wraps J2N.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 of IList<T>.
  12. #40 - J2N.Collections.Generic.Extensions.ListExtensions: Added RemoveAll() 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().
  13. BUG #40 - J2N.Collections.Generic.Extensions.ListExtensions: Fixed bounds checking of the Swap() extension method.
  14. PERFORMANCE #40 - J2N.Collections.Generic.Extensions.ListExtensions: Optimized performance of BinarySearch() extension methods for common cases such as List<T> and array.

v2.0.0-beta-0015

25 Apr 10:37
Compare
Choose a tag to compare
v2.0.0-beta-0015 Pre-release
Pre-release

Change Log

  1. #28 - BUG: Fixed enum (and other non-custom formatting) support in J2N.Text.StringFormatter

v2.0.0-beta-0014

24 Apr 21:59
Compare
Choose a tag to compare
v2.0.0-beta-0014 Pre-release
Pre-release

Change Log

  1. #23, #10 - Completed nullable reference type support.
  2. #23 - Removed dependency on System.Text.Encoding.CodePages.
  3. #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.
  4. #26 - Added J2N.Text.ParseException + tests.
  5. #27 - J2N.Collections.BitSet: Corrected documentation.

v2.0.0-beta-0013

20 Apr 08:34
Compare
Choose a tag to compare
v2.0.0-beta-0013 Pre-release
Pre-release

Change Log

  1. #15 - J2N.Threading.ThreadJob: Allow ThreadInterruptedException to propagate to the calling thread
  2. #16 - J2N.IO Buffers: Improved guard clauses.
  3. #17 - J2N.Character: Added ToString() methods to convert code point arrays to strings.
  4. #18 - J2N.MathExtensions: Added NextUp(), NextDown() and NextAfter() methods for both float and double types.
  5. #19 - J2N.IO + J2N.Runtime.CompilerServices: Added nullable reference type support (see #10).
  6. #20 - Allow exceptions to be serialized on .NET Core and .NET 5+.

v2.0.0-beta-0012

10 Mar 19:44
Compare
Choose a tag to compare
v2.0.0-beta-0012 Pre-release
Pre-release

Change Log

  1. Added tests for Xamarin.Android.
  2. Removed support for .NET Standard 1.3.
  3. Added target framework for .NET 5.0 + tests.
  4. Added tests for x86 for all target platforms/operating systems.
  5. BUG: J2N.Collections.ArrayEqualityComparer<T>: Fixed infinite recursion issue on Xamarin.Android due to ArrayEqualityComparer<T> abstract base class calling itself during static initialization. Refactored to flatten the class hierarchy for easier maintenance.
  6. PERFORMANCE: J2N.Collections.Generic.EqualityComparer<T>: Don't implicitly cast to long before the negative zero comparison.
  7. 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).
  8. Removed unnecessary dependencies on System.Text.Encoding.CodePages and Microsoft.CSharp from the netcoreapp3.0 target.

v2.0.0-beta-0011

03 Dec 08:22
Compare
Choose a tag to compare
v2.0.0-beta-0011 Pre-release
Pre-release

Change Log

  1. BUG: J2N.Text.StringFormatter: Fixed negative zero decimal format so it takes into account culture sensitivity with the NumberFormatInfo.NumberDecimalSeparator string.
  2. Fixed the CI pipeline so .NET Core 1.x and 2.x tests run.

v2.0.0-beta-0010

21 Sep 12:52
Compare
Choose a tag to compare
v2.0.0-beta-0010 Pre-release
Pre-release

Change Log

  1. 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 the content directory