Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-2171

Some error code messages are not parsed correctly due to unescaped single quote

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: 4.2.0
    • Component/s: None
    • Labels:
      None

      Description

      We noticed that the improved whitelist error messages added by OOZIE-2072 weren't being printed properly:
      e.g.

      Error: E0901 : E0901: NameNode [localhost:8020] not allowed, not in
      Oozies whitelist. Allowed values are: {1}
      

      Turns out that MessageFormat requires that single quotes are escaped by another single quote; otherwise, it:

      • doesn't render the single quote
      • doesn't parse the {#} tokens after the single quote.

      For example,

      foo("{0} don't have {1}", "I", "a problem")
      

      would render as

      "I dont have {1}"
      

      We have to replace ' with '' to escape it.

        Attachments

        1. OOZIE-2171-amendment.patch
          2 kB
          Robert Kanter
        2. OOZIE-2171.patch
          8 kB
          Robert Kanter
        3. OOZIE-2171.patch
          9 kB
          Robert Kanter

          Issue Links

            Activity

              People

              • Assignee:
                rkanter Robert Kanter
                Reporter:
                rkanter Robert Kanter
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: