Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-666

SAXSourceLocator Not Reporting Location Correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2.0
    • None
    • Other
    • None
    • Operating System: Windows NT/2K
      Platform: PC
    • 4796

    Description

      In the constructor:
      public SAXSourceLocator(Locator locator)

      { m_locator = locator; this.setColumnNumber(locator.getColumnNumber()); this.setLineNumber(locator.getLineNumber()); this.setPublicId(locator.getPublicId()); this.setSystemId(locator.getSystemId()); }

      The correct values are being set.

      However, in the 'get' methods (e.g.)
      public int getColumnNumber()

      { return (null == m_locator) ? super.getColumnNumber() : m_locator.getColumnNumber(); }

      it appears that values in m_locator have changed and no longer have the values
      they had upon initialisation.

      I would suggest that m_locator is removed from this class (and its values only
      unsed during construction). This would make this class immutable. And the get
      methods would simply be:

      public int getColumnNumber()

      { return super.getColumnNumber(); }

      er, or even unneccesary (just rely on superclass implementation).

      Attachments

        Activity

          People

            sboag@apache.org Scott Boag
            peter@infopop.com Peter Bryant
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: