summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2017-06-28 15:45:26 +0100
committerTobias Thierer <tobiast@google.com>2017-08-02 20:55:57 +0100
commitbce13c50c300d35ebf91e6592951f7756c784736 (patch)
tree4731107171d4ec86bf5bd06566888afb5f7af64e /annotations/generate_annotated_java_files.py
parent6ea6973dc177bb57a4558cb6203b4b27a20a8d1e (diff)
Fix NPE in URLClassLoader.getPermissions() introduced in Android N.
From Android N until before this CL, URLClassLoader.getPermissions() could throw NPE because it unconditionally called endsWith() on the return value of FilePermission.getName(), which is stubbed to return null on Android. This CL fixes this by un-stubbing getName() to instead return the value that was passed to the constructor. Before Android N, URLClassLoader.getPermissions() used URL.getFile() rather than FilePermission.getName() to get the file path. Bug: 37380202 Test: Checked that OldURLClassLoaderTest#test_getPermissions_fileURLConnection_doesNotThrow passes after this CL, but encounters NullPointerException during the getPermissions() call, when run on Android versions built before this CL (checked both immediately before this CL and on Android 7.0 Nougat). Change-Id: I77f853c468a2f4f276e88464fcad10306f2a52bf
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions