Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/29/09 15:32:59 (15 years ago)
Author:
epitzer
Message:

Check for default constructor in all decomposers to ensure failure during serialization instead of deserialization. (#606)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Decomposers/DictionaryDecomposer.cs

    r1625 r1705  
    55using System.Collections.Generic;
    66using HeuristicLab.Persistence.Default.Decomposers.Storable;
     7using HeuristicLab.Persistence.Auxiliary;
    78
    89namespace HeuristicLab.Persistence.Default.Decomposers {
     
    1718
    1819    public bool CanDecompose(Type type) {
    19       return type.GetInterface(typeof(IDictionary).FullName) != null;
     20      return ReflectionTools.HasDefaultConstructor(type) &&
     21        type.GetInterface(typeof(IDictionary).FullName) != null;
    2022    }
    2123
     
    5456      } catch (ArgumentException e) {
    5557        throw new PersistenceException("Duplicate dictionary key.", e);
    56       }     
     58      }
    5759    }
    5860  }
Note: See TracChangeset for help on using the changeset viewer.