Stop using return within finally

Refactor code to avoid a return statement inside a finally block. Such
constructs interfere with exception propagation in non-obvious ways
and are therefore considered bad practice.

Bug: 32586420
Test: manual code walk
This commit is contained in:
Ray Essick
2016-11-03 14:45:56 -07:00
parent 6054a30a7f
commit 7601049275

View File

@@ -530,14 +530,13 @@ public final class RadioMetadata implements Parcelable {
Bitmap bmp = null;
try {
bmp = BitmapFactory.decodeByteArray(value, 0, value.length);
} catch (Exception e) {
} finally {
if (bmp == null) {
return -1;
if (bmp != null) {
mBundle.putParcelable(key, bmp);
return 0;
}
mBundle.putParcelable(key, bmp);
return 0;
} catch (Exception e) {
}
return -1;
}
int putClockFromNative(int nativeKey, long utcEpochSeconds, int timezoneOffsetInMinutes) {