Fix bug in AsYouTypeFormatter where we hit a IndexOutOfBoundsException in its Java...
authorAndy Staudacher <staudacher@google.com>
Wed, 18 Feb 2015 10:04:10 +0000 (11:04 +0100)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 9 Jun 2015 11:43:24 +0000 (20:43 +0900)
commit965754b3f8eae3bf4e9a7c73bf13b2db526101af
treef41d0382459cd25dd5cb5572d44c61321431b819
parentf208ad764b9b5e4e2b7879c83c9c2f3579d579ce
Fix bug in AsYouTypeFormatter where we hit a IndexOutOfBoundsException in its Java implementation when extracting the Chinese national prefix 17951 and didn't reset the format template / lastMatchPosition.

Includes corresponding changes for C++ and JavaScript as well to keep the implementations in sync. (C++ and JS didn't exhibit buggy behavior because the corresponding substring methods don't throw errors for invalid start positions.)

Bugfix for https://github.com/googlei18n/libphonenumber/issues/592
cpp/src/phonenumbers/asyoutypeformatter.cc
java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java
javascript/i18n/phonenumbers/asyoutypeformatter.js