From 7dd70417157c4976f29c2a232da085da86af360f Mon Sep 17 00:00:00 2001 From: neal1991 Date: Wed, 23 Dec 2020 13:30:41 +0800 Subject: [PATCH 1/2] address issue #4870, modify getParamName method to elimate false positive results --- java/ql/src/semmle/code/java/Javadoc.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/semmle/code/java/Javadoc.qll b/java/ql/src/semmle/code/java/Javadoc.qll index 61d978fbd357..a561a4e61db3 100755 --- a/java/ql/src/semmle/code/java/Javadoc.qll +++ b/java/ql/src/semmle/code/java/Javadoc.qll @@ -100,7 +100,7 @@ class ParamTag extends JavadocTag { ParamTag() { this.getTagName() = "@param" } /** Gets the name of the parameter. */ - string getParamName() { result = this.getChild(0).toString() } + string getParamName() { result = this.getChild(0).toString().replaceAll(",", "") } /** Gets the documentation for the parameter. */ override string getText() { result = this.getChild(1).toString() } From ebce06f3f40de40947125a003c1427a0c3d1fc7a Mon Sep 17 00:00:00 2001 From: neal1991 Date: Wed, 23 Dec 2020 14:11:30 +0800 Subject: [PATCH 2/2] add more chars to elimate false positive results --- java/ql/src/semmle/code/java/Javadoc.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/semmle/code/java/Javadoc.qll b/java/ql/src/semmle/code/java/Javadoc.qll index a561a4e61db3..5f3d5c714435 100755 --- a/java/ql/src/semmle/code/java/Javadoc.qll +++ b/java/ql/src/semmle/code/java/Javadoc.qll @@ -100,7 +100,7 @@ class ParamTag extends JavadocTag { ParamTag() { this.getTagName() = "@param" } /** Gets the name of the parameter. */ - string getParamName() { result = this.getChild(0).toString().replaceAll(",", "") } + string getParamName() { result = this.getChild(0).toString().regexpReplaceAll(",|:|\\.","") } /** Gets the documentation for the parameter. */ override string getText() { result = this.getChild(1).toString() }