6e50bbee3b
Motivation: Calling AbstractCharClass.setNegative always leads to mayContainSupplCodepoints being `true`, even when `alt` is already equal to the argument. Given that CharClass always calls setNegative with its constructor parameter - `negative`, mayContainSupplCodepoints always gets set. i.e. `[a]` will have mayContainSupplCodepoints set. mayContainSupplCodepoints affects what node (RangeSet or SupplementaryRangeSet) wraps this char class. See Pattern.processRangeSet. RangeSet is better optimized and avoids recursion when it is quantified. Modification: Set `mayContainSupplCodepoints` flag only when `alt` is updated. When `alt` is updated, this char class gets inverted, hence now may contain supplementary code points. Otherwise, content of this char class does not change, i.e. no new supplementary code points is added. Result: Fixes KT-46211.