瀏覽代碼

HPCC-16424 Fix Coverity errors

- Overridden methods in subclass did not match signature in base class
- Signatures match
- Make sure correct method called through v-table

Signed-off-by: Ken Rowland <kenneth.rowland@lexisnexisrisk.com>
Ken Rowland 8 年之前
父節點
當前提交
72086d8695

+ 2 - 2
configuration/configurator/schemas/SchemaSimpleType.cpp

@@ -28,12 +28,12 @@ using namespace CONFIGURATOR;
 #define StringBuffer ::StringBuffer
 #define IPropertyTree ::IPropertyTree
 
-CXSDNodeBase* CSimpleType::getNodeByTypeAndNameAscending(NODE_TYPES eNodeType, const char *pName)
+const CXSDNodeBase* CSimpleType::getNodeByTypeAndNameAscending(NODE_TYPES eNodeType, const char *pName) const
 {
     return (this->checkSelf(eNodeType, pName, this->getName()) ? this : nullptr);
 }
 
-CXSDNodeBase* CSimpleType::getNodeByTypeAndNameDescending(NODE_TYPES eNodeType, const char *pName)
+const CXSDNodeBase* CSimpleType::getNodeByTypeAndNameDescending(NODE_TYPES eNodeType, const char *pName) const
 {
     return (this->checkSelf(eNodeType, pName, this->getName()) ? this : nullptr);
 }

+ 2 - 2
configuration/configurator/schemas/SchemaSimpleType.hpp

@@ -36,8 +36,8 @@ public:
     {
     }
 
-    virtual CXSDNodeBase* getNodeByTypeAndNameAscending(NODE_TYPES eNodeType, const char *pName);
-    virtual CXSDNodeBase* getNodeByTypeAndNameDescending(NODE_TYPES eNodeType, const char *pName);
+    virtual const CXSDNodeBase* getNodeByTypeAndNameAscending(NODE_TYPES eNodeType, const char *pName) const;
+    virtual const CXSDNodeBase* getNodeByTypeAndNameDescending(NODE_TYPES eNodeType, const char *pName) const;
     virtual void dump(::std::ostream& cout, unsigned int offset = 0) const;
     virtual void getDocumentation(StringBuffer &strDoc) const;
     virtual void populateEnvXPath(StringBuffer strXPath, unsigned int index = 1);