mirror of https://github.com/grpc/grpc-java.git
core: change catch blocks for Android <19 (#6611)
Caught by lint warning during import
This commit is contained in:
parent
74cde7e8b4
commit
42f2e7f733
|
|
@ -576,8 +576,14 @@ public abstract class AbstractManagedChannelImplBuilder
|
||||||
recordStartedRpcs,
|
recordStartedRpcs,
|
||||||
recordFinishedRpcs,
|
recordFinishedRpcs,
|
||||||
recordRealTimeMetrics);
|
recordRealTimeMetrics);
|
||||||
} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
|
} catch (ClassNotFoundException e) {
|
||||||
| InvocationTargetException e) {
|
// Replace these separate catch statements with multicatch when Android min-API >= 19
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to apply census stats", e);
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
}
|
}
|
||||||
if (statsInterceptor != null) {
|
if (statsInterceptor != null) {
|
||||||
|
|
@ -595,9 +601,15 @@ public abstract class AbstractManagedChannelImplBuilder
|
||||||
Method getClientInterceptroMethod =
|
Method getClientInterceptroMethod =
|
||||||
censusTracingAccessor.getDeclaredMethod("getClientInterceptor");
|
censusTracingAccessor.getDeclaredMethod("getClientInterceptor");
|
||||||
tracingInterceptor = (ClientInterceptor) getClientInterceptroMethod.invoke(null);
|
tracingInterceptor = (ClientInterceptor) getClientInterceptroMethod.invoke(null);
|
||||||
} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
|
} catch (ClassNotFoundException e) {
|
||||||
| InvocationTargetException e) {
|
// Replace these separate catch statements with multicatch when Android min-API >= 19
|
||||||
log.log(Level.FINE, "Unable to apply census tracing", e);
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
}
|
}
|
||||||
if (tracingInterceptor != null) {
|
if (tracingInterceptor != null) {
|
||||||
effectiveInterceptors.add(0, tracingInterceptor);
|
effectiveInterceptors.add(0, tracingInterceptor);
|
||||||
|
|
|
||||||
|
|
@ -253,8 +253,14 @@ public abstract class AbstractServerImplBuilder<T extends AbstractServerImplBuil
|
||||||
recordStartedRpcs,
|
recordStartedRpcs,
|
||||||
recordFinishedRpcs,
|
recordFinishedRpcs,
|
||||||
recordRealTimeMetrics);
|
recordRealTimeMetrics);
|
||||||
} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
|
} catch (ClassNotFoundException e) {
|
||||||
| InvocationTargetException e) {
|
// Replace these separate catch statements with multicatch when Android min-API >= 19
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
log.log(Level.FINE, "Unable to apply census stats", e);
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
}
|
}
|
||||||
if (censusStatsTracerFactory != null) {
|
if (censusStatsTracerFactory != null) {
|
||||||
|
|
@ -270,9 +276,15 @@ public abstract class AbstractServerImplBuilder<T extends AbstractServerImplBuil
|
||||||
censusTracingAccessor.getDeclaredMethod("getServerStreamTracerFactory");
|
censusTracingAccessor.getDeclaredMethod("getServerStreamTracerFactory");
|
||||||
tracingStreamTracerFactory =
|
tracingStreamTracerFactory =
|
||||||
(ServerStreamTracer.Factory) getServerStreamTracerFactoryMethod.invoke(null);
|
(ServerStreamTracer.Factory) getServerStreamTracerFactoryMethod.invoke(null);
|
||||||
} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
|
} catch (ClassNotFoundException e) {
|
||||||
| InvocationTargetException e) {
|
// Replace these separate catch statements with multicatch when Android min-API >= 19
|
||||||
log.log(Level.FINE, "Unable to apply census tracing", e);
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
log.log(Level.FINE, "Unable to apply census stats", e);
|
||||||
}
|
}
|
||||||
if (tracingStreamTracerFactory != null) {
|
if (tracingStreamTracerFactory != null) {
|
||||||
tracerFactories.add(tracingStreamTracerFactory);
|
tracerFactories.add(tracingStreamTracerFactory);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue