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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user