Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-1625

Add hasKey to the TextProvider interface

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • None
    • 2.0.7
    • Other
    • None
    • Patch

    Description

      See: http://jira.opensymphony.com/browse/WW-1390

      "I'm trying to a write a method which returns true if a key exists in a resource bundle (as used by the TextProvider). At the moment, I have something along the lines of:

      public boolean doesTextKeyExist(String labelKey)
      {
      String s = getText(labelKey);
      return s != null && !s.equals(labelKey);
      }

      which works fine. But it does have some annoying logging like:

      WARN [LocalizedTextUtil:424] Unable to find text for key 'export.js.title.description' in 'class com.atlassian.bamboo.ww2.actions.build.admin.config.ConfigureBuildPostAction' and locale 'en_US'

      I could turn off logging to for this class to hide this, but it would be nice if the TextProvider interface had something along the lines of:

      boolean hasKey(String key);

      that does this a bit nicer.

      See http://forums.opensymphony.com/thread.jspa?forumID=1&threadID=51663 for more discussions "

      Attachments

        Activity

          People

            husted Ted Husted
            pluppens Philip Luppens
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: