summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2018-12-11 17:11:54 +0000
committerTobias Thierer <tobiast@google.com>2018-12-11 17:35:22 +0000
commitd853723d63578925added878ba66d52a4651e382 (patch)
tree66f031454d6058a102fbd3d68b517936b5174e6a /annotations/generate_annotated_java_files.py
parent7a629b6327588927c76bcc186c05fd1dcc4f6405 (diff)
Avoid I/O during DexPathList.Element.toString().
toString() was calling path.isDirectory(), which could be a StrictMode violation (eg. on the main thread) and therefore trigger a crash. This CL moves the check for path.isDirectory() from toString into the constructors. Note that when dexFile == path == null, then toString() will throw NPE both before and after this CL; invoking constructors that allow this to happen is only possible via reflection; a follow-up CL rules this out. URL findResource(String name) continues to perform I/O, but that (and I/O during construction) appears more reasonable than during toString(). I plan to rely on empirical observation (after this CL is submitted) rather than code analysis to confirm whether this CL is sufficient to resolve the associated bugs. Bug: 120099466 Bug: 77611513 Test: Treehugger Change-Id: I35a771f5891775e6dd77d98cbb09a18a85179e18
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions