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

IndexOutOfBoundsException in LineAppender

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3
    • 0.4
    • Utilities
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: