yesamer opened a new pull request, #6254:
URL: https://github.com/apache/incubator-kie-drools/pull/6254

   Closes: https://github.com/apache/incubator-kie-issues/issues/1807
   
   **The problem**
   The Test Scenario Engine needs to retrieve the scesim version from the xml 
root node to apply the correct migration strategy.
   The current logic that retrieves that info, uses a regex search, that is too 
strict: regex patterns with
   `<ScenarioSimulationModel version=\"x.x\"` will be found. That means if any 
other attribute is present in the XML node (or just a single whitespace), the 
search will fail
   eg. `<ScenarioSimulationModel    version=\"x.x\"`  `<ScenarioSimulationModel 
 namespace="..."  version=\"x.x\"` 
   
   **The solution**
   In the same block of code, the DomParser of the xml file is called. So, I 
just moved that in the first method line and took advantage of that to retrieve 
the version in a "safer" way.
   This means, the regex search is no longer required, and the version can be 
safely retrieved disregarding its position in the node and avoiding collision 
with other possible attributes with the name.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to