Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/21/09 15:34:44 (16 years ago)
Author:
epitzer
Message:

Fix small bugs found by test suite. (#593)

Location:
trunk/sources/HeuristicLab.Persistence/3.3/Default
Files:
7 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs

    r1612 r1616  
    4141        try {
    4242          iterator = handlers[reader.Name].Invoke();
    43         }
    44         catch (KeyNotFoundException) {
     43        } catch (KeyNotFoundException) {
    4544          throw new InvalidOperationException(String.Format(
    4645            "No handler for XML tag \"{0}\" installed",
     
    5857      if (idString != null)
    5958        id = int.Parse(idString);
    60       yield return new PrimitiveToken(
    61         reader.GetAttribute("name"),
    62         int.Parse(reader.GetAttribute("typeId")),
    63         id,
    64         new XmlString(reader.ReadString()));
     59      string name = reader.GetAttribute("name");
     60      int typeId = int.Parse(reader.GetAttribute("typeId"));
     61      XmlReader inner = reader.ReadSubtree();
     62      inner.Read();
     63      string xml = inner.ReadInnerXml();
     64      inner.Close();     
     65      yield return new PrimitiveToken(name, typeId, id, new XmlString(xml));
    6566    }
    6667
     
    123124      XmlParser parser = new XmlParser(
    124125        new StreamReader(zipFile.GetInputStream(zipFile.GetEntry("data.xml"))));
    125       return deSerializer.Deserialize(parser);
     126      object result = deSerializer.Deserialize(parser);
     127      zipFile.Close();
     128      return result;
    126129    }
    127130  }
Note: See TracChangeset for help on using the changeset viewer.