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:
Peter Serwylo 2017-04-26 08:38:02 +10:00
parent 4b70d81e5c
commit e6c6c28f5f
2 changed files with 5 additions and 2 deletions

View File

@ -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!
} }
} }

View File

@ -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);