Skip to content

Commit

Permalink
Back out "Simplify catch clauses in PoolFactory"
Browse files Browse the repository at this point in the history
Reviewed By: yanivsb

Differential Revision: D52289850

fbshipit-source-id: 7e371c1a73c8e760a15a8918834d7969275c7966
  • Loading branch information
Hazem Murad authored and facebook-github-bot committed Dec 19, 2023
1 parent 9ff76f3 commit 943c1f0
Showing 1 changed file with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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 @@ -106,7 +107,15 @@ public MemoryChunkPool getBufferMemoryChunkPool() {
mConfig.getMemoryTrimmableRegistry(),
mConfig.getMemoryChunkPoolParams(),
mConfig.getMemoryChunkPoolStatsTracker());
} catch (ReflectiveOperationException e) {
} catch (ClassNotFoundException e) {
mBufferMemoryChunkPool = null;
} catch (IllegalAccessException e) {
mBufferMemoryChunkPool = null;
} catch (InstantiationException e) {
mBufferMemoryChunkPool = null;
} catch (NoSuchMethodException e) {
mBufferMemoryChunkPool = null;
} catch (InvocationTargetException e) {
mBufferMemoryChunkPool = null;
}
}
Expand Down Expand Up @@ -140,7 +149,19 @@ public MemoryChunkPool getNativeMemoryChunkPool() {
mConfig.getMemoryTrimmableRegistry(),
mConfig.getMemoryChunkPoolParams(),
mConfig.getMemoryChunkPoolStatsTracker());
} catch (ReflectiveOperationException e) {
} 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) {
FLog.e("PoolFactory", "", e);
mNativeMemoryChunkPool = null;
}
Expand All @@ -162,7 +183,15 @@ private MemoryChunkPool getAshmemMemoryChunkPool() {
mConfig.getMemoryTrimmableRegistry(),
mConfig.getMemoryChunkPoolParams(),
mConfig.getMemoryChunkPoolStatsTracker());
} catch (ReflectiveOperationException e) {
} catch (ClassNotFoundException e) {
mAshmemMemoryChunkPool = null;
} catch (IllegalAccessException e) {
mAshmemMemoryChunkPool = null;
} catch (InstantiationException e) {
mAshmemMemoryChunkPool = null;
} catch (NoSuchMethodException e) {
mAshmemMemoryChunkPool = null;
} catch (InvocationTargetException e) {
mAshmemMemoryChunkPool = null;
}
}
Expand Down

0 comments on commit 943c1f0

Please sign in to comment.