@Test public void normalizeBadPropagationValues() { assertNull("Unexpected result for null", TransactionOperationFinalizer.normalizePropagation(new Operation())); assertNull("Unexpected result for negative index", TransactionOperationFinalizer.normalizePropagation(new Operation().put("propagation", (-1)))); assertNull("Unexpected result for out-of-bounds index", TransactionOperationFinalizer.normalizePropagation( new Operation().put("propagation", TransactionOperationFinalizer.propagationNames.size() + 1))); }
static String normalizePropagation(Operation operation) { int propagation = operation.getInt("propagation", (-1)); if ((propagation >= 0) && (propagation < propagationNames.size())) { return propagationNames.get(propagation); } else { return null; } }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizePropagation(Operation operation) { int propagation = operation.getInt("propagation", (-1)); if ((propagation >= 0) && (propagation < propagationNames.size())) { return propagationNames.get(propagation); } else { return null; } } }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizePropagation(Operation operation) { int propagation = operation.getInt("propagation", (-1)); if ((propagation >= 0) && (propagation < propagationNames.size())) { return propagationNames.get(propagation); } else { return null; } }  }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizePropagation(Operation operation) { int propagation = operation.getInt("propagation", (-1)); if ((propagation >= 0) && (propagation < propagationNames.size())) { return propagationNames.get(propagation); } else { return null; } }  static void register(Operation operation); void finalize(Operation operation, Map<String, Object> richObjects); }
TransactionOperationFinalizer implements OperationFinalizer { static String normalizePropagation(Operation operation) { int propagation = operation.getInt("propagation", (-1)); if ((propagation >= 0) && (propagation < propagationNames.size())) { return propagationNames.get(propagation); } else { return null; } }  static void register(Operation operation); void finalize(Operation operation, Map<String, Object> richObjects);  }