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

[PATCH] NumberFormatException when page-sequence format can't be parsed as an Integer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1
    • None
    • None
    • None

    Description

      This was introduced in FOP-2548 "Support Barcode4J page number". The test FO of FOP-2548 was changed by specifying a format in

      <fo:page-sequence master-reference="simple" format="A">

      To reproduce it:

      $ ./fop barcode-test.fo -if out.if.xml
      Feb 26, 2016 2:29:14 PM org.apache.fop.events.LoggingEventListener processEvent
      INFO: Rendered page #1.
      Feb 26, 2016 2:29:14 PM org.apache.fop.events.LoggingEventListener processEvent
      INFO: Rendered page #2.
      
      
      $ ./fop -ifin out.if.xml out.pdf
      Feb 26, 2016 2:29:47 PM org.apache.fop.cli.Main startFOP
      SEVERE: Exception
      org.apache.fop.apps.FOPException: For input string: "A"
      java.lang.NumberFormatException: For input string: "A"
      	at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:288)
      	at org.apache.fop.cli.IFInputHandler.renderTo(IFInputHandler.java:77)
      	at org.apache.fop.cli.Main.startFOP(Main.java:186)
      	at org.apache.fop.cli.Main.main(Main.java:217)
      Caused by: java.lang.NumberFormatException: For input string: "A"
      	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      	at java.lang.Integer.parseInt(Integer.java:492)
      	at java.lang.Integer.parseInt(Integer.java:527)
      	at org.apache.fop.render.intermediate.IFParser$Handler$PageHandler.startElement(IFParser.java:526)
      	at org.apache.fop.render.intermediate.IFParser$Handler.startIFElement(IFParser.java:369)
      	at org.apache.fop.render.intermediate.IFParser$Handler.startElement(IFParser.java:310)
      	at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
      	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      	at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
      	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      	at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
      	at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:285)
      	... 3 more
      

      Attachments

        1. FOP-2581.patch
          0.8 kB
          Alexios Giotis
        2. out.pdf
          16 kB
          Alexios Giotis
        3. out.if.xml
          2 kB
          Alexios Giotis
        4. barcode-test.fo
          1 kB
          Alexios Giotis

        Activity

          People

            ssteiner Simon Steiner
            alex.giotis Alexios Giotis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: