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

Inconsistent method name "toSAX"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.5
    • None
    • None
    • None

    Description

      The method body code seems to add a new attribute to the parameter "handler".
      Identifier "addSAX" should be better than "toSAX" since 'toSAX' is prone to convert one thing to another.

          /** {@inheritDoc} */
          public void toSAX(ContentHandler handler) throws SAXException {
              AttributesImpl atts = new AttributesImpl();
              if (name != null && name.length() > 0) {
                  atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
              }
              if (this.src != null) {
                  atts.addAttribute("", ATT_SRC, ATT_SRC, "CDATA", this.src.toASCIIString());
              }
              handler.startElement(CATEGORY, elementName, elementName, atts);
              handler.endElement(CATEGORY, elementName, elementName);
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            BruceKuiLIU KuiLIU
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: