summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2019-10-11 17:49:22 +0100
committerVictor Chang <vichang@google.com>2019-10-15 08:17:10 +0100
commit7b05ba0cd9a70a52cc19674d2a78597c724a4aa9 (patch)
treee1ac30d4e3d7e2ddbb632402b26bdf9f1d34be33 /annotations/generate_annotated_java_files.py
parente432968dfcc645efe9c27a81f9a2d982b1a92eb3 (diff)
Change state of Matcher only if NativeMatcher is created successfully
- It's little bug fix to avoid corrupted state when NativeMatcher.create throws, the Matcher holds a inconsistent reference to the new Pattern and the old pair of nativeMatcher and nativePattern. - It does not fix thread-safety-related issue - Setting parentPattern does not acquire a lock, because 1. APIs pattern() and usePattern() does not guarantee thread-safe. It's the only place where parentPattern is being used. The race could exist before and after this change. 2. parentPattern is only used in the getter, i.e. pattern(), and setter, i.e. usePattern(), but not used in any internal operations. Multiple-threaded calls to usePattern() and pattern() shoudl not cause new possible corrupted state. This issue also exists before and after this change. Bug: 138994281 Test: atest --test-mapping libcore/ojluni/src/main/java/java/util/regex:postsubmit Change-Id: I97783b124d59dcaa7d37ad34d528d4919c2649a7
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions