Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2027

When a marker contains list-block FOP crashes with NPE

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: layout/unqualified
    • Labels:
      None
    • Environment:
      Operating System: Windows Vista
      Platform: PC
    • External issue ID:
      52763

      Description

      The BlockLayoutManager throws an NPE in the line

      FontTriplet[] fontkeys = getBlockFO().getCommonFont().getFontState(fi);
      in the initialize() method when the marker contains fo:block/fo:list-block:

      <fo:flow flow-name="xsl-region-body">
      <fo:block><fo:marker
      marker-class-name="message"><fo:block>
      WARNING: Page sequence contains: <fo:page-number-citation
      ref-id="end-seq1"/> pages.
      </fo:block>
      <fo:block>
      <fo:list-block><fo:list-item><fo:list-item-label><fo:block font-weight="bold" color="black">NOTE:</fo:block>
      </fo:list-item-label>
      <fo:list-item-body start-indent="0.5in"><fo:block text-align="left" color="black">This manual supersedes TM PUBNAME-00 dated 15 December 2004. Zero in the "Change No." column indicates an original page or work package.</fo:block>
      </fo:list-item-body>
      </fo:list-item>
      </fo:list-block>
      </fo:block>

      </fo:marker>
      </fo:block>

      The reason is that the layout manager tries to set itself up using the properties of the block. However the block is not bound to the property list, because the inMarker() function returns true for such a block:

      FObj.java

      public void processNode(String elementName, Locator locator,
      Attributes attlist, PropertyList pList)
      throws FOPException {
      setLocator(locator);
      pList.addAttributesToList(attlist);
      if (!inMarker()

      "marker".equals(elementName)) { pList.setWritingMode(); bind(pList); }

      Thus the block contains all empty fields and attempt to retrieve them causes an NPE.

      Don't know if it has been resolved in FOP 1.1

        Attachments

        1. bug52763.fo.xml
          1 kB
          Glenn Adams
        2. output.txt
          10 kB
          Ilia Masliev
        3. hide.fo
          5 kB
          Ilia Masliev

          Activity

            People

            • Assignee:
              fop-dev@xmlgraphics.apache.org fop-dev
              Reporter:
              ilia@siberlogic.com Ilia Masliev
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: