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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.3, 0.4, 0.5, 0.6, 0.7
    • Fix Version/s: 0.8
    • Component/s: Utilities
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: