Menu

#75 Polyline to Polyline Adapter crashes if followed by Copy to File Adapter

Pipistrelle 2.1
open
nobody
None
1
2015-08-19
2015-08-17
John Barnes
No

See the attached screenshot PolylineAdapter4.PNG for the scenario.

See the attached screenshot PolylineAdapter5.PNG for the crash. The _mapping map is empty because Consumers was empty when PrepareIt() function for the adapter was called.

1 Attachments

Discussion

  • John Barnes

    John Barnes - 2015-08-17

    Add second attachment.

     
  • John Barnes

    John Barnes - 2015-08-19

    These changes were made to fix this problem:

    @@ -146,9 +146,12 @@ namespace FluidEarth2.AdaptedOutputs
    
                 _mapping.Clear();
    
    
    -            foreach (var consumer in Consumers)
    +            var consumers = Consumers.Select(c => new Tuple<IBaseExchangeItem, IBaseInput>(c, c));
    +            var adaptedOutputs = AdaptedOutputs.Select(a => a.Consumers.Select(c => new Tuple<IBaseExchangeItem,     IBaseInput>(a, c))).SelectMany(c => c);
    +
    +            foreach (var consumer in consumers.Concat(adaptedOutputs))
                 {
    -                var adaptedElementSet = Utilities.AsElementSet(consumer);
    +                var adaptedElementSet = Utilities.AsElementSet(consumer.Item2);
    
                     Contract.Requires(adaptedElementSet != null,
                         "adaptedElementSet != null");
    @@ -206,7 +209,7 @@ namespace FluidEarth2.AdaptedOutputs
    
                     Trace.TraceInformation(MappingToString(map));
    
    
    -                _mapping.Add(consumer, map);
    +                _mapping.Add(consumer.Item1, map);
                 }
             }
    

    Comments on the validity of these changes would be welcome.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB