From 7ae2ee1e4edb6748d2823d7d31cc1eaa1dd0fbe6 Mon Sep 17 00:00:00 2001 From: Javier Moran Rua Date: Sat, 13 Oct 2012 17:36:39 +0200 Subject: [PATCH] Add the suitable casting on getting items of the list of resources with their load ratios. FEA: ItEr77S10ResourceAllocationLoadInformation --- .../search/NewAllocationSelectorController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/resources/search/NewAllocationSelectorController.java b/libreplan-webapp/src/main/java/org/libreplan/web/resources/search/NewAllocationSelectorController.java index aacfd2b02..17f6d82cc 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/resources/search/NewAllocationSelectorController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/resources/search/NewAllocationSelectorController.java @@ -291,7 +291,8 @@ public class NewAllocationSelectorController extends @SuppressWarnings("unchecked") Collection items = listBoxResources.getItems(); for (Listitem item : items) { - Resource itemResource = (Resource) item.getValue(); + Resource itemResource = ((ResourceWithItsLoadRatios) item + .getValue()).getResource(); if (itemResource != null && itemResource.getId().equals(resource.getId())) { return item; @@ -398,7 +399,8 @@ public class NewAllocationSelectorController extends List result = new ArrayList(); List selectedItems = listBoxResources.getItems(); for (Listitem item : selectedItems) { - result.add((Resource) item.getValue()); + result.add(((ResourceWithItsLoadRatios) item.getValue()) + .getResource()); } return result; } @@ -408,7 +410,9 @@ public class NewAllocationSelectorController extends List result = new ArrayList(); Set selectedItems = listBoxResources.getSelectedItems(); for (Listitem item : selectedItems) { - result.add((Resource) item.getValue()); + + result.add(((ResourceWithItsLoadRatios) item.getValue()) + .getResource()); } return result; }