XPath rule not working in Sonar 4.4

落爺英雄遲暮 提交于 2019-12-12 02:57:37

问题


reproduce steps:

  1. click "Rules" link
  2. Search "xpath"
  3. click the Java XPath rule that is not deprecated
  4. click "create"
  5. Fill in "name"/"key"/"Description"/"Message" as "should not use Collections.synchronizedMap" , change status as "ready" , set xpathQuery as //IDENTIFIER[@tokenValue='synchronizedMap']

  6. click "create" button

  7. click "edit" and notice "xpathQuery" field is empty which is unexpected.
  8. fill the field "xpathQuery" with //IDENTIFIER[@tokenValue='synchronizedMap'] again
  9. click "save" button
  10. click "edit" and notice "xpathQuery" field is missing totally , which is unexpected.
  11. run sonar runner again code that contains "Map test = Collections.synchronizedMap()"
  12. no issue detected which is unexpected.

As test , Javascript XPath rule doesn't work either, and just test in Sonar 4.3.1 , both Java and Javascript XPath rule works. java plugin version is 2.4

Anyone please give some suggestion or help reporting it to Sonar JIRA where I didn't have permission to report bug.


回答1:


This is a known bug on SonarQube: SONAR-5575

Its fix is planned and should be available in a month or so. Feel free to vote and watch for the JIRA ticket.



来源:https://stackoverflow.com/questions/25887057/xpath-rule-not-working-in-sonar-4-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!