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]*$


    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Critical Critical
    • 5.5.0
    • 5.4.0
    • None
    • Security Level: Jimmy

      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.


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

            jumperchen jumperchen
            hawk hawk
            0 Vote for this issue
            2 Start watching this issue