Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6614

AbstractRangeValidator looks up string with the wrong key if locale is Turkish

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.6.0
    • Fix Version/s: 7.11.0, 8.2.0, 9.0.0-M1
    • Component/s: wicket-core
    • Labels:
      None

      Description

      If you run your Wicket application on a system with Turkish locale, and you're using `StringValidator`, the string key you end up looking up is `"StringValidator.mınımum"`, when it should be `"StringValidator.minimum"`. This results in either an empty message or an exception, depending on the resource settings for the application.

      `AbstractRangeValidator` turns out to have this:

      	public static enum Mode {
      		MINIMUM, MAXIMUM, RANGE, EXACT;
      
      		public String getVariation()
      		{
      			return name().toLowerCase();
      		}
      	}
      

      This `toLowerCase()` should probably be `toLowerCase(Locale.ROOT)`.

      I'd also recommend setting up forbidden-apis or similar to catch similar issues at build-time.

        Attachments

        1. report.txt
          331 kB
          Trejkaz
        2. WICKET-6614.patch
          0.9 kB
          Trejkaz

          Activity

            People

            • Assignee:
              svenmeier Sven Meier
              Reporter:
              trejkaz Trejkaz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: