Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

inlined method invocation to JDK7 specific method

  • Loading branch information...
commit eff02c9683d7bd02caee92a3c4812f762e7edd45 1 parent c373b97
@abuijze abuijze authored
View
5 trade-engine/src/main/java/org/axonframework/samples/trader/tradeengine/command/OrderBook.java
@@ -126,7 +126,10 @@ protected void onTradeExecuted(TradeExecutedEvent event) {
private static class OrderComparator implements Comparator<Order> {
public int compare(Order o1, Order o2) {
- return Long.compare(o1.getItemPrice(), o2.getItemPrice());
+ // copied from Java 7 Long.compareTo to support java 6
+ long x = o1.getItemPrice();
+ long y = o2.getItemPrice();
+ return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.