Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-26

Properties.Load throws ArgumentOutOfRangeException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.6 RC1
    • Fix Version/s: 0.6 RC2
    • Component/s: Spring-NET-CORE
    • Labels:
      None

      Description

      Here is the stack trace:

      System.ArgumentOutOfRangeException: Length cannot be less than zero.
      Parameter name: length
      at System.String.Substring(Int32 startIndex, Int32 length)
      at System.String.Substring(Int32 startIndex)
      at Spring.Util.Properties.SplitLine(String line) in C:\Projects\Spring.Net\src\Spring\Spring.Core\Util\Properties.cs:line 206
      at Spring.Util.Properties.Load(Stream stream) in C:\Projects\Spring.Net\src\Spring\Spring.Core\Util\Properties.cs:line 86

      The input is a MemoryStream made out of this string:
      "\r\n\tpint = 2\r\n\tnull-value = "

      like this:
      UnicodeEncoding ue = new UnicodeEncoding();
      byte [] buf = ue.GetBytes(text.ToCharArray(), 0, len);
      MemoryStream ms = new MemoryStream(buf);
      properties.Load(ms);

        Attachments

          Activity

            People

            Assignee:
            aseovic Aleksandar Seovic
            Reporter:
            alex322 Sandu Turcan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: