NumericShaper allows illegal ranges

XMLWordPrintable

    • Type: CSR
    • Resolution: Approved
    • Priority: P4
    • 26
    • Component/s: client-libs
    • None
    • 2d
    • behavioral
    • low
    • Hide
      The illegal values would not have had any effect on shaping.
      The principal compatibility impact is on clients that expected what they supplied to be reported back.
      Show
      The illegal values would not have had any effect on shaping. The principal compatibility impact is on clients that expected what they supplied to be reported back.
    • Java API
    • SE

      Summary

      Specify that for the factory methods of java.awt.font.NumericShaper, illegal values and values that are of lesser precedence are discarded. The implementation is updated where necessary to discard these.

      Problem

      When using Set<Range> no illegal values are possible and values of lesser precedence are discarded. However this latter point is undocumented. For the construction using a bitmask, the latter also needs documenting, but in addition and contrary to what anyone would expect, illegal values are stored and used in calculations for hashCode which create inconsistencies with hashCode.

      Solution

      Specify that illegal values are discarded, and that values of lesser precedence are also discarded. The implementation is updated where necessary to discard these.

      Specification

      <pre> public class java.awt.font.NumericShaper + * Any bit set in the {@code ranges} bitmask which is not a + * recognised value is discarded. Similarly if two bits are + * specified where one takes precedence, the lesser one is discarded. public static NumericShaper getContextualShaper(int ranges) + * If two ranges are specified where one takes precedence over the + * other the lesser range is discarded. public static NumericShaper getContextualShaper(Set<Range> ranges) + * If two ranges are specified where one takes precedence over the + * other the lesser range is discarded. public static NumericShaper getContextualShaper(Set<Range> ranges, Range defaultContext) </pre>

            Assignee:
            Philip Race
            Reporter:
            Philip Race
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: