Stage should execute over a List, not a Collection

Description

Stage#execute takes a Collection<Item<T>> parameter. I don't recall any case in which it has ever made sense for the items in that collection not to be treated as ordered. I know that a lot of the real-word use cases would fail if the ArrayList that underlies the current implementation was replaced by, say, a HashSet.

If we're actually assuming an ordered collection, we should probably make that explicit by changing that parameter to a List<Item<T>> instead.

This will obviously affect a lot of classes, although not as many as you might think (many are written as subclasses of a base class that implements the iteration, and operate only on a single item at a time). Nevertheless, to make a simpler transition for downstream packages, it might be worth seeing whether the old method signature can be changed to a deprecated default implementation which performs a cast and a deprecation warning. This is probably not absolutely required, as I think most of the affected classes not within the MDA itself will be in the ukf-mda and inc-mda projects, which are in my care in any case. 

Environment

None

Activity

Show:

Ian Young August 20, 2020 at 11:07 AM

I have updated the `mdq-server` and `ukf-mda` projects to track these changes fairly easily.

The remaining potential issue is with the `inc-mda` project, which doesn't yet have an 0.10-compatible branch so I've raised an issue over there to catch up with everything in 0.10. It doesn't look like this particular issue adds much burden there.

So, declaring victory here.

Ian Young August 19, 2020 at 3:35 PM

Commit 7aa398a543464f4c8dd79030e78b94554be73e0f implements this, but I will hold this open until I have had a chance to check that nothing terrible happens in the downstream packages.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Created July 27, 2020 at 8:59 AM
Updated May 16, 2024 at 12:37 PM
Resolved August 20, 2020 at 11:08 AM

Flag notifications