Fop
  1. Fop
  2. FOP-2027

When a marker contains list-block FOP crashes with NPE

    Details

    • Type: Bug 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

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

        Activity

        Ilia Masliev created issue -
        Hide
        Glenn Adams added a comment -

        resetting P2 open bugs to P3 pending further review

        Show
        Glenn Adams added a comment - resetting P2 open bugs to P3 pending further review
        Hide
        Glenn Adams added a comment -

        please provide (1) a minimal input FO file, (2) any produced output file, (3) full console output

        Show
        Glenn Adams added a comment - please provide (1) a minimal input FO file, (2) any produced output file, (3) full console output
        Hide
        Ilia Masliev added a comment -

        A modification of the hide.fo from samples.The only change is addition of list block to the marker.

        Show
        Ilia Masliev added a comment - A modification of the hide.fo from samples.The only change is addition of list block to the marker.
        Hide
        Ilia Masliev added a comment -

        Attachment hide.fo has been added with description: This is the test fo file on which the problem can be reproduced.

        Show
        Ilia Masliev added a comment - Attachment hide.fo has been added with description: This is the test fo file on which the problem can be reproduced.
        Hide
        Ilia Masliev added a comment -

        fop 1.0 was used to process the fo.

        Show
        Ilia Masliev added a comment - fop 1.0 was used to process the fo.
        Hide
        Ilia Masliev added a comment -

        Attachment output.txt has been added with description: Output from the fop processor.

        Show
        Ilia Masliev added a comment - Attachment output.txt has been added with description: Output from the fop processor.
        Hide
        Ilia Masliev added a comment -

        Information provided.

        Show
        Ilia Masliev added a comment - Information provided.
        Hide
        Glenn Adams added a comment -

        Attachment bug52763.fo.xml has been added with description: minimal FO test file

        Show
        Glenn Adams added a comment - Attachment bug52763.fo.xml has been added with description: minimal FO test file
        Show
        Glenn Adams added a comment - http://svn.apache.org/viewvc?rev=1325016&view=rev

          People

          • Assignee:
            fop-dev
            Reporter:
            Ilia Masliev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development