Skip to content
This repository
Browse code

inlined method invocation to JDK7 specific method

  • Loading branch information...
commit eff02c9683d7bd02caee92a3c4812f762e7edd45 1 parent c373b97
Allard Buijze abuijze authored
5 trade-engine/src/main/java/org/axonframework/samples/trader/tradeengine/command/OrderBook.java
@@ -126,7 +126,10 @@ protected void onTradeExecuted(TradeExecutedEvent event) {
126 126 private static class OrderComparator implements Comparator<Order> {
127 127
128 128 public int compare(Order o1, Order o2) {
129   - return Long.compare(o1.getItemPrice(), o2.getItemPrice());
  129 + // copied from Java 7 Long.compareTo to support java 6
  130 + long x = o1.getItemPrice();
  131 + long y = o2.getItemPrice();
  132 + return (x < y) ? -1 : ((x == y) ? 0 : 1);
130 133 }
131 134 }
132 135 }

0 comments on commit eff02c9

Please sign in to comment.
Something went wrong with that request. Please try again.