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

LocaleEnhanceTest has incorrectly passing test case

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 26
    • 26
    • core-libs
    • b21
    • generic
    • generic

      While working on JDK-8369452, I noticed that LocaleEnhanceTest has a test case that checks if Locale.Builder.setLanguageTag(String) throws IllFormedException when passed a tag with multiple extensions or when passed a tag with duplicate keys for the unicode locale extension. Specifically,

      `new BuilderILE() { public void call() { b.setLanguageTag("und-a-xx-yy-b-ww-A-00-11-c-vv"); }};`

      and

      `new Builder().setLanguageTag("und-u-nu-thai-NU-chinese-xx-1234")`

      In actuality, no test is run because the original code did not pass any arguments to the BuilderILE ctor (which is the test's helper class). When run() is called, no args are available, and run is executed 0 times.

      While fixing this, we can also get rid of the in-house test framework classes in favor of JUnit utilities.

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

              Created:
              Updated:
              Resolved: