ALF 1.0 FTF Avatar
  1. OMG Issue

ALF_ — Errors in the Collection Classes Implemenation

  • Key: ALF_-61
  • Legacy Issue Number: 16482
  • Status: closed  
  • Source: Model Driven Solutions ( Mr. Ed Seidewitz)
  • Summary:

    Subclause: C.4 Alf Standard Library Collection Classes Implementation

    • All the collection implementation classes have an incorrect namespace declaration containing “Collections::CollectionClasses”, rather than just “CollectionClasses”. They also import “Alf::Library::FunctionBehaviors::Collections::CollectionFunctions” rather than “Alf::Library::CollectionFunctions”.
    • Return types should not be given on constructors.
    • Several classes have destructors that call CollectionImpl<T>::destroy, but CollectionImpl has no such destructor.
    • The classes that have multiple specializations have to redefine indistinguishable operations inherited from both classes.
    • In C.4.2 CollectionImpl,
    o excludesAll and includesAll have seq as their parameter, but incorrectly use the name “element” in their bodies.
    o In the first statement of removeOne, “self” is used instead of “this”.
    o In the last statement of retainAll, there should not be “()” after “preSize”.
    • In C.4.3 OrderedCollectionImpl,
    o In the body of addAt, the call to “addAllAt” should be proceeded by “this.”.
    o In the body of indexOf, the reference to “indexof” should be “indexOf”.
    • In C.4.5 OrderedSet,
    o In the body of equals, “OrdredCollcetionImpl” should be “OrderedCollectionImpl”.
    o In the body of subOrderedSet, the constructor “OrderedSet” should be “OrderedSet<T>”.
    • In C.4.6 Bag, the super constructor call should be to CollectionImpl, not OrderedCollection.
    • In C.4.7 List,
    o CollectionClasses::Impl::List should specialize CollectionClasses::List, not CollectionClasses::OrderedSet.
    o subList should return List<T>, not OrderedSet<T>.
    o In subList, the constructor “List” should be “List<T>”.
    o The parameter for setContent should be a “sequence”.
    • In C.4.8 Queue,
    o Queue should specialize CollectionClasses::Queue, not CollectionClasses::Set.
    o In the body of removeFirst, “toSequence” should be “toSequence()”.
    o removeFirstOne should have a return multiploicity of 1..1.
    o The body of removeFirstOne should return the argument element or null, depending on whether the element was actually found for deletion.
    • In C.4.9 Deque,
    o Deque should specialize CollectionClasses::Deque in addition to Queue.
    o The super constructor call should be super.Queue<T>::Queue, not just super, and the super destructor call should be super.Queue<T>::destroy.
    o The implementation of removeLastOne removes all occurrences of the given element, not just the last one.
    o toSequence cannot return “this.content”, since “content” is private to Queue.
    o The (constructor) operation Queue is inherited from both superclasses and must be redefined.

  • Reported: ALF 1.0b2 — Fri, 29 Jul 2011 04:00 GMT
  • Disposition: Resolved — ALF 1.0
  • Disposition Summary:


  • Updated: Fri, 6 Mar 2015 21:48 GMT