[ 
https://issues.apache.org/jira/browse/XALANC-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464045#comment-13464045
 ] 

Steven J. Hathaway commented on XALANC-733:
-------------------------------------------

Modification based on IBM C++ definition of static members within a class.

Example from IBM Document:

  class Test
  { public:
     static const int N = 10;
  };

  const int Test::N;

Note that the constant initializer is not a definition. You still need to 
define the static member in an enclosing namespace.  See the above example.

  class XalanLocator
  {
    public:

    static const XalanDOMChar*
    getSystemId(
            const Locator*          theLocator,
            const XalanDOMChar*     theAlternateId = &s_dczero)
    {
        return theLocator == 0 ? theAlternateId : (theLocator->getSystemId() ?
            theLocator->getPublicId() : theAlternateId);
    } 

    ... 

    private:
    const static XalanDOMChar s_dczero = 0;
  };

  const XalanDOMChar XalanLocator::s_dczero;  // THIS LINE NEEDS TO BE ADDED

Adding this line to the XalanLocator.hpp file should solve the link problem.

- Steve
                
> Ensure that XalanLocator::getSystemId() and getPublicId() do not return NULL
> ----------------------------------------------------------------------------
>
>                 Key: XALANC-733
>                 URL: https://issues.apache.org/jira/browse/XALANC-733
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC, XPathC
>    Affects Versions: 1.11
>            Reporter: Steven J. Hathaway
>            Assignee: Steven J. Hathaway
>         Attachments: XalanLocator-3.patch, XalanLocator.patch, 
> XalanLocator.patch2
>
>
> The recommended patch to "xalanc/PlatformSupport/XalanLocator.hpp"
> ensures that getSystemId() and getPublicId() do not return NULL pointers.
> XalanC source files that can benefit from the patch include:
> xalanc/PlatformSupport/ProblemListenerBase.cpp
> xalanc/PlatformSupport/XSLException.cpp
> xalanc/XPath/XPathExecutionContextDefault.cpp
> The patch will be submitted shortly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to