Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-140

IndexOutOfBoundsException in LineAppender

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.3
    • Fix Version/s: 0.4
    • Component/s: Utilities
    • Labels:
      None

      Description

      When a call to LineAppender.flush() is interleaved between two calls to LineAppender.append(String) and the String argument of the second line begins by a tabulation, an IndexOutOfBoundsException occurs. Example of sequence of method calls:

      LineAppender f = ...;
      f.append("S1");
      f.flush();
      f.append("\tS2");
      

      This cause MonolineFormatter to fail to log some events. The symptom is the following stack trace:

      java.lang.StringIndexOutOfBoundsException: String index out of range: 8
          at java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:203)
          at java.lang.StringBuilder.charAt(StringBuilder.java:72)
          at org.apache.sis.io.LineAppender.deleteSoftHyphen(LineAppender.java:333)
          at org.apache.sis.io.LineAppender.write(LineAppender.java:399)
          at org.apache.sis.io.LineAppender.append(LineAppender.java:526)
          at org.apache.sis.util.logging.MonolineFormatter.format(MonolineFormatter.java:669)
          at java.util.logging.StreamHandler.publish(StreamHandler.java:196)
          at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:105)
          at java.util.logging.Logger.log(Logger.java:610)
          (...snip....)
      

        Attachments

          Activity

            People

            • Assignee:
              desruisseaux Martin Desruisseaux
              Reporter:
              desruisseaux Martin Desruisseaux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: