Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8349494

Replace sun.util.locale.ParseStatus usage with java.text.ParsePosition

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • 25
    • core-libs
    • None
    • behavioral
    • low
    • Hide
      As a byproduct of the cleanup, the error message for the exception thrown by `Locale.caseFoldLanguageTag(String)` is slightly changed. "Ill formed tag: " is no longer prepended to the message. It is unlikely (although not impossible) that there is dependence on the exact String message for the exception of a method introduced in JDK21. Thus, there is low risk.



      Show
      As a byproduct of the cleanup, the error message for the exception thrown by `Locale.caseFoldLanguageTag(String)` is slightly changed. "Ill formed tag: " is no longer prepended to the message. It is unlikely (although not impossible) that there is dependence on the exact String message for the exception of a method introduced in JDK21. Thus, there is low risk.
    • Java API
    • SE

      Summary

      Replace usages of the internal sun.util.locale.ParseStatus class with java.text.ParsePosition.

      Problem

      ParseStatus has almost 1 to 1 behavior with ParsePosition. We can get rid of the internal class by making the switch.

      Solution

      Replace usages of the internal class with java.text.ParsePosition. Remove the sun.util.locale.ParseStatus.

      As a byproduct of this switch, the exception message for Locale.caseFoldLanguageTag(String) is updated to no longer be prepended with "Ill formed tag: ". This change should be okay, as the rest of the message contains sufficient detail. It is also clear the tag is ill formed, as the holder exception is an IllFormedLocaleException.

      Note that while this cleanup/switch itself is compatibility friendly, this CSR is filed solely to address the changed exception message.

      Specification

      n/a

            jlu Justin Lu
            jlu Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: