diff --git a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxDraggable.java b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxDraggable.java index 8a9e81d2eda..ba7a60c88e6 100644 --- a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxDraggable.java +++ b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxDraggable.java @@ -102,11 +102,12 @@ public boolean isStateless() { return true; } + @SuppressWarnings("unchecked") public static Object draggableObjectForPage(WOComponent page, String draggableID) { Object droppedObject = null; - Map componentDraggablesMap = (Map)page.context().session().objectForKey(AjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); + Map> componentDraggablesMap = (Map>)page.context().session().objectForKey(AjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); if (componentDraggablesMap != null) { - Map draggablesMap = (Map) componentDraggablesMap.get(page); + Map draggablesMap = componentDraggablesMap.get(page); if (draggablesMap != null) { droppedObject = draggablesMap.get(draggableID); } @@ -115,18 +116,19 @@ public static Object draggableObjectForPage(WOComponent page, String draggableID } @Override + @SuppressWarnings("unchecked") public void appendToResponse(WOResponse res, WOContext ctx) { if (canGetValueForBinding("draggableObject")) { Object draggableObject = valueForBinding("draggableObject"); WOComponent page = context().page(); - Map componentDraggablesMap = (Map)ctx.session().objectForKey(AjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); + Map> componentDraggablesMap = (Map>) ctx.session().objectForKey(AjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); if (componentDraggablesMap == null) { - componentDraggablesMap = new WeakHashMap(); + componentDraggablesMap = new WeakHashMap>(); ctx.session().setObjectForKey(componentDraggablesMap, AjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); } - Map draggablesMap = (Map) componentDraggablesMap.get(page); + Map draggablesMap = componentDraggablesMap.get(page); if (draggablesMap == null) { - draggablesMap = new HashMap(); + draggablesMap = new HashMap(); componentDraggablesMap.put(page, draggablesMap); } String id = draggableID(); @@ -140,8 +142,8 @@ public void appendToResponse(WOResponse res, WOContext ctx) { super.appendToResponse(res, ctx); } - public NSDictionary createAjaxOptions() { - NSMutableArray ajaxOptionsArray = new NSMutableArray(); + public NSDictionary createAjaxOptions() { + NSMutableArray ajaxOptionsArray = new NSMutableArray(); // PROTOTYPE OPTIONS ajaxOptionsArray.addObject(new AjaxOption("starteffect", AjaxOption.SCRIPT)); ajaxOptionsArray.addObject(new AjaxOption("reverteffect", AjaxOption.SCRIPT)); @@ -154,7 +156,7 @@ public NSDictionary createAjaxOptions() { ajaxOptionsArray.addObject(new AjaxOption("change", AjaxOption.SCRIPT)); ajaxOptionsArray.addObject(new AjaxOption("keyPress", AjaxOption.SCRIPT)); ajaxOptionsArray.addObject(new AjaxOption("scroll", AjaxOption.SCRIPT)); - NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); return options; } diff --git a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxSortableList.java b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxSortableList.java index 30bca6c49ee..f44f4002bf0 100644 --- a/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxSortableList.java +++ b/Frameworks/Ajax/Ajax/Sources/er/ajax/AjaxSortableList.java @@ -130,8 +130,8 @@ protected void addRequiredWebResources(WOResponse res) { addScriptResourceInHead(res, "dragdrop.js"); } - public NSDictionary createAjaxOptions() { - NSMutableArray ajaxOptionsArray = new NSMutableArray(); + public NSDictionary createAjaxOptions() { + NSMutableArray ajaxOptionsArray = new NSMutableArray(); ajaxOptionsArray.addObject(new AjaxOption("tag", AjaxOption.STRING)); ajaxOptionsArray.addObject(new AjaxOption("treeTag", AjaxOption.STRING)); ajaxOptionsArray.addObject(new AjaxOption("only", AjaxOption.STRING_ARRAY)); @@ -147,7 +147,7 @@ public NSDictionary createAjaxOptions() { ajaxOptionsArray.addObject(new AjaxOption("dropOnEmpty", AjaxOption.BOOLEAN)); ajaxOptionsArray.addObject(new AjaxOption("scroll", AjaxOption.BOOLEAN)); ajaxOptionsArray.addObject(new AjaxOption("onChange", AjaxOption.SCRIPT)); - NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); return options; } @@ -183,6 +183,7 @@ public String onUpdate() { return onUpdateBuffer.toString(); } + @SuppressWarnings("unchecked") @Override public WOActionResults handleRequest(WORequest request, WOContext context) { if (!canGetValueForBinding("list")) { @@ -193,26 +194,26 @@ public WOActionResults handleRequest(WORequest request, WOContext context) { } String listItemIDKeyPath = (String) valueForBinding("listItemIDKeyPath"); Object listItemIDArrayObj = request.formValues().objectForKey(_sortOrderKeyName + "[]"); - NSArray listItemIDArray; + NSArray listItemIDArray; if (listItemIDArrayObj instanceof NSArray) { - listItemIDArray = (NSArray) listItemIDArrayObj; + listItemIDArray = (NSArray) listItemIDArrayObj; } else if (listItemIDArrayObj instanceof String) { String listItemIDStr = (String) listItemIDArrayObj; - listItemIDArray = new NSArray(listItemIDStr); + listItemIDArray = new NSArray(listItemIDStr); } else { throw new IllegalArgumentException("Unknown list item ID array " + listItemIDArrayObj); } - NSArray list = (NSArray) valueForBinding("list"); + NSArray list = (NSArray) valueForBinding("list"); boolean mutableList = (list instanceof NSMutableArray); - NSMutableArray reorderedList; + NSMutableArray reorderedList; if (mutableList) { - reorderedList = (NSMutableArray) list; + reorderedList = (NSMutableArray) list; } else { - reorderedList = new NSMutableArray(); + reorderedList = new NSMutableArray(); } int startIndex = 0; @@ -238,9 +239,9 @@ else if (listItemIDArrayObj instanceof String) { else { itemPageRange = new NSRange(startIndex, listItemIDCount); } - NSArray itemPageArray = list.subarrayWithRange(itemPageRange); + NSArray itemPageArray = list.subarrayWithRange(itemPageRange); EOQualifier itemIDQualifier = new EOKeyValueQualifier(listItemIDKeyPath, EOQualifier.QualifierOperatorEqual, itemID); - NSArray matchingItems = EOQualifier.filteredArrayWithQualifier(itemPageArray, itemIDQualifier); + NSArray matchingItems = EOQualifier.filteredArrayWithQualifier(itemPageArray, itemIDQualifier); if (matchingItems.count() == 0) { throw new NoSuchElementException("There was no item that matched the ID '" + itemID + "' in " + list + "."); }