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

CompoundFormat.parse(CharSequence text, ParsePosition pos) javadoc is inconsistent with implementation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3, 0.4, 0.5, 0.6, 0.7
    • 0.8
    • Utilities
    • None

    Description

      In the CompoundFormat class, the Javadoc of following method give a description of ParseException.getErrorOffset() value which is inconsistent with what most Apache SIS implementations actually do:

      public abstract T parse(CharSequence text, ParsePosition pos) throws ParseException;
      

      The current specification of above method is more convolved than what we usually expect from a method throwing ParseException. It said that the error offset of the exception is relative to the error index of the ParsePosition. But the TreeTableFormat subclass is the only one to follow that specification; all other subclasses apply the more usual and straightforward interpretation where ParseException.getErrorOffset() gives directly the index where parsing error occurred.

      Instead than modifying WKTFormat - which is a much more sensitive subclass than TreeTableFormat, we should rather modify the CompoundFormat.parse(CharSequence, ParsePosition) specification for making it less surprising and adapt TreeTableFormat accordingly.

      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: