Don't create order twice.

This commit is contained in:
asofold 2017-04-24 20:12:16 +02:00
parent d2ed656409
commit f82d387a88

View File

@ -207,17 +207,17 @@ public class RegisteredItemStore {
// Better support this to avoid confusion (?). // Better support this to avoid confusion (?).
order = ((IGetRegistrationOrder) item).getRegistrationOrder(); order = ((IGetRegistrationOrder) item).getRegistrationOrder();
} }
// Check Annotations. //
if (order == null) { if (order == null) {
// Check Annotations.
RegisterWithOrder annoOrder = item.getClass().getAnnotation(RegisterWithOrder.class); RegisterWithOrder annoOrder = item.getClass().getAnnotation(RegisterWithOrder.class);
if (annoOrder != null) { if (annoOrder != null) {
order = new RegistrationOrder(annoOrder); order = new RegistrationOrder(annoOrder);
} }
} else {
// // Default order.
if (order == null) { order = RegistrationOrder.DEFAULT_ORDER;
// Default order. }
order = RegistrationOrder.DEFAULT_ORDER;
} }
else { else {
// Copy what has been found outside, huh. // Copy what has been found outside, huh.