diff options
author | Tobias Thierer <tobiast@google.com> | 2017-06-28 15:45:26 +0100 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2017-08-03 22:53:44 +0100 |
commit | 0c192e4211dd5a10b7a59e1b427422ae13a7186c (patch) | |
tree | 1a6945c569fd1ba326cc7d0922ca9a50d30f56ca /annotations/generate_annotated_java_files.py | |
parent | 85b1e2230c0ff555bb987ffe10d9f183b789a578 (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).
(cherry picked from commit bce13c50c300d35ebf91e6592951f7756c784736)
Change-Id: Ic58a16736f851acad43e5e7d6aa023083f66de16
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions