private static DistinctObservation find( final DistinctObservation[] existingObservations, final Throwable observation) { DistinctObservation existingObservation = null; for (final DistinctObservation o : existingObservations) { if (equals(o.throwable, observation)) { existingObservation = o; break; } } return existingObservation; }
@SuppressWarnings("FinalParameters") private static boolean equals(Throwable lhs, Throwable rhs) { while (true) { if (lhs == rhs) { return true; } if (lhs.getClass() == rhs.getClass() && equals(lhs.getStackTrace(), rhs.getStackTrace())) { lhs = lhs.getCause(); rhs = rhs.getCause(); if (null == lhs && null == rhs) { return true; } else if (null != lhs && null != rhs) { continue; } } return false; } }
private static DistinctObservation find(final DistinctObservation[] existingObservations, final Throwable observation) { DistinctObservation existingObservation = null; for (final DistinctObservation o : existingObservations) { if (equals(o.throwable, observation)) { existingObservation = o; break; } } return existingObservation; }
private static DistinctObservation find( final DistinctObservation[] existingObservations, final Throwable observation) { DistinctObservation existingObservation = null; for (final DistinctObservation o : existingObservations) { if (equals(o.throwable, observation)) { existingObservation = o; break; } } return existingObservation; }
private static boolean equals(Throwable lhs, Throwable rhs) { while (true) { if (lhs == rhs) { return true; } if (lhs.getClass() == rhs.getClass() && equals(lhs.getStackTrace(), rhs.getStackTrace())) { lhs = lhs.getCause(); rhs = rhs.getCause(); if (null == lhs && null == rhs) { return true; } else if (null != lhs && null != rhs) { continue; } } return false; } }
@SuppressWarnings("FinalParameters") private static boolean equals(Throwable lhs, Throwable rhs) { while (true) { if (lhs == rhs) { return true; } if (lhs.getClass() == rhs.getClass() && equals(lhs.getStackTrace(), rhs.getStackTrace())) { lhs = lhs.getCause(); rhs = rhs.getCause(); if (null == lhs && null == rhs) { return true; } else if (null != lhs && null != rhs) { continue; } } return false; } }