Uploaded image for project: 'Keikai'
  1. Keikai
  2. KEIKAI-379

Wrong groupMatchText: 65年JUL月18日, regex mask: ^[ \t]*(19\d\d|[2-9]\d\d\d|\d\d|\d)([A-Z\p{InLatin-1Supplement}]{3,9})([0]?[1-9]|[12][0-9]|3[01])[ \t]*$

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.4.0
    • Fix Version/s: 5.5.0
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      Steps to Reproduce

      1. run keikai with a blank sheet with JDK 9 or above
      2. visit keikai with a browser in locale zh_TW
      3. type any character e.g. aaa in a cell

      Current Result

      Wrong groupMatchText: 65年JUL月18日, regex mask: ^[ \t]*(19\d\d|[2-9]\d\d\d|\d\d|\d)([A-Z\p{InLatin-1Supplement}]{3,9})([0]?[1-9]|[12][0-9]|3[01])[ \t]*$
      

      Expected Result

      no error

      Debug Information

      • https://bugs.openjdk.java.net/browse/JDK-8152154
      • The exception happens at
        public FormatInfo(Pattern mask, String format, String groupMatchText, String ampm1MatchText, Locale locale) {
        ...
        if (!m.matches()) { throw new RuntimeException("Wrong groupMatchText: "+ groupMatchText+ ", regex mask: "+_mask); }
      • In DateInputMask.java
        	private String[] getDate11(Locale locale, boolean withTime) {
        final AttributedCharacterIterator iter
        			= format.formatToCharacterIterator(cal.getTime());
        
      DateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
      

      format is different between java versions, therefore, in that method,
      With java 9, sb1 is 65年JUL月18日
      with java 8, sb1 is JUL 18, 65

      • Please ensure the solution works with both Java 8 and 9 or above.

      Workaround

      • run with Java 8
      • run with VM option -Djava.locale.providers=JRE,CLDR

        Attachments

          Activity

            People

            Assignee:
            wenninghsu wenninghsu
            Reporter:
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: