Formatting + PMD fix in response to CR
PMD does not like manually throwing NPEs, even if they have more verbose information than the default NPE. As such, use an `IllegalArgumentException` instead.
This commit is contained in:
parent
4b70d81e5c
commit
e6c6c28f5f
@ -531,7 +531,10 @@ class NotificationHelper {
|
|||||||
// Need to check that the notification is still valid, and also that the image
|
// Need to check that the notification is still valid, and also that the image
|
||||||
// is indeed cached now, so we won't get stuck in an endless loop.
|
// is indeed cached now, so we won't get stuck in an endless loop.
|
||||||
AppUpdateStatusManager.AppUpdateStatus oldEntry = appUpdateStatusManager.get(entry.getUniqueKey());
|
AppUpdateStatusManager.AppUpdateStatus oldEntry = appUpdateStatusManager.get(entry.getUniqueKey());
|
||||||
if (oldEntry != null && oldEntry.app != null && oldEntry.app.iconUrl != null && DiskCacheUtils.findInCache(oldEntry.app.iconUrl, ImageLoader.getInstance().getDiskCache()) != null) {
|
if (oldEntry != null
|
||||||
|
&& oldEntry.app != null
|
||||||
|
&& oldEntry.app.iconUrl != null
|
||||||
|
&& DiskCacheUtils.findInCache(oldEntry.app.iconUrl, ImageLoader.getInstance().getDiskCache()) != null) {
|
||||||
createNotification(oldEntry); // Update with new image!
|
createNotification(oldEntry); // Update with new image!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ class ApkSignatureVerifier {
|
|||||||
|
|
||||||
PackageInfo pkgInfo = pm.getPackageArchiveInfo(pkgPath, PackageManager.GET_SIGNATURES);
|
PackageInfo pkgInfo = pm.getPackageArchiveInfo(pkgPath, PackageManager.GET_SIGNATURES);
|
||||||
if (pkgInfo == null) {
|
if (pkgInfo == null) {
|
||||||
throw new NullPointerException("Could not find PackageInfo for package at \"" + pkgPath + "\".");
|
throw new IllegalArgumentException("Could not find PackageInfo for package at \"" + pkgPath + "\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
return signatureToBytes(pkgInfo.signatures);
|
return signatureToBytes(pkgInfo.signatures);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user