Skip to content

Commit

Permalink
Simplify catch clauses in PoolFactory
Browse files Browse the repository at this point in the history
Reviewed By: steelrooter

Differential Revision: D52078065

fbshipit-source-id: 782830beda91faaa5b78ad4efceeb7f9229e312e
  • Loading branch information
Artem Kholodnyi authored and facebook-github-bot committed Dec 14, 2023
1 parent b7c5e97 commit ca643f9
Showing 1 changed file with 3 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.facebook.imagepipeline.core.NativeCodeSetup;
import com.facebook.infer.annotation.Nullsafe;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;

Expand Down Expand Up @@ -107,15 +106,7 @@ public MemoryChunkPool getBufferMemoryChunkPool() {
mConfig.getMemoryTrimmableRegistry(),
mConfig.getMemoryChunkPoolParams(),
mConfig.getMemoryChunkPoolStatsTracker());
} catch (ClassNotFoundException e) {
mBufferMemoryChunkPool = null;
} catch (IllegalAccessException e) {
mBufferMemoryChunkPool = null;
} catch (InstantiationException e) {
mBufferMemoryChunkPool = null;
} catch (NoSuchMethodException e) {
mBufferMemoryChunkPool = null;
} catch (InvocationTargetException e) {
} catch (ReflectiveOperationException e) {
mBufferMemoryChunkPool = null;
}
}
Expand Down Expand Up @@ -149,19 +140,7 @@ public MemoryChunkPool getNativeMemoryChunkPool() {
mConfig.getMemoryTrimmableRegistry(),
mConfig.getMemoryChunkPoolParams(),
mConfig.getMemoryChunkPoolStatsTracker());
} catch (ClassNotFoundException e) {
FLog.e("PoolFactory", "", e);
mNativeMemoryChunkPool = null;
} catch (IllegalAccessException e) {
FLog.e("PoolFactory", "", e);
mNativeMemoryChunkPool = null;
} catch (InstantiationException e) {
FLog.e("PoolFactory", "", e);
mNativeMemoryChunkPool = null;
} catch (NoSuchMethodException e) {
FLog.e("PoolFactory", "", e);
mNativeMemoryChunkPool = null;
} catch (InvocationTargetException e) {
} catch (ReflectiveOperationException e) {
FLog.e("PoolFactory", "", e);
mNativeMemoryChunkPool = null;
}
Expand All @@ -183,15 +162,7 @@ private MemoryChunkPool getAshmemMemoryChunkPool() {
mConfig.getMemoryTrimmableRegistry(),
mConfig.getMemoryChunkPoolParams(),
mConfig.getMemoryChunkPoolStatsTracker());
} catch (ClassNotFoundException e) {
mAshmemMemoryChunkPool = null;
} catch (IllegalAccessException e) {
mAshmemMemoryChunkPool = null;
} catch (InstantiationException e) {
mAshmemMemoryChunkPool = null;
} catch (NoSuchMethodException e) {
mAshmemMemoryChunkPool = null;
} catch (InvocationTargetException e) {
} catch (ReflectiveOperationException e) {
mAshmemMemoryChunkPool = null;
}
}
Expand Down

0 comments on commit ca643f9

Please sign in to comment.