sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SIS-140) IndexOutOfBoundsException in LineAppender
Date Tue, 15 Oct 2013 14:32:42 GMT

     [ https://issues.apache.org/jira/browse/SIS-140?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Desruisseaux resolved SIS-140.
-------------------------------------

    Resolution: Fixed

> IndexOutOfBoundsException in LineAppender
> -----------------------------------------
>
>                 Key: SIS-140
>                 URL: https://issues.apache.org/jira/browse/SIS-140
>             Project: Spatial Information Systems
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 0.3
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>             Fix For: 0.4
>
>
> 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:
> {code:java}
> LineAppender f = ...;
> f.append("First line");
> f.flush();
> f.append("\tSecond line");
> {code}
> This cause {{MonolineFormatter}} to fail to log some events. The symptom is the following
stack trace:
> {noformat}
> 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....)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message