From ba325eb8a27c1ec04a3e9983678eeb1fd0a87628 Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 16 Jan 2017 11:35:49 -0800 Subject: [PATCH 1/2] Dead code removal --- .../apex/rule/security/ApexOpenRedirectRule.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectRule.java index 554b492554..22cedeaf22 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/security/ApexOpenRedirectRule.java @@ -101,9 +101,11 @@ public class ApexOpenRedirectRule extends AbstractApexRule { } } else { if (node instanceof ASTField) { - /* sergey.gorbaty: - * Apex Jorje parser is returning a null from Field.getFieldInfo(), but the info is available from an inner field. - * DO NOT attempt to optimize this block without checking that Jorje parser actually fixed its bug. + /* + * sergey.gorbaty: Apex Jorje parser is returning a null from + * Field.getFieldInfo(), but the info is available from an inner + * field. DO NOT attempt to optimize this block without checking + * that Jorje parser actually fixed its bug. * */ try { @@ -143,13 +145,6 @@ public class ApexOpenRedirectRule extends AbstractApexRule { } } - private void addVariable(AbstractApexNode node) { - ASTVariableExpression variable = node.getFirstChildOfType(ASTVariableExpression.class); - if (variable != null) { - listOfStringLiteralVariables.add(Helper.getFQVariableName(variable)); - } - } - /** * Traverses all new declarations to find PageReferences * From 291698cdbc0ab284d348e78c1ac635c0b492e164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Mon, 16 Jan 2017 18:26:10 -0300 Subject: [PATCH 2/2] Update changelog --- src/site/markdown/overview/changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/site/markdown/overview/changelog.md b/src/site/markdown/overview/changelog.md index 6acb8ca121..421e9ed982 100644 --- a/src/site/markdown/overview/changelog.md +++ b/src/site/markdown/overview/changelog.md @@ -232,4 +232,5 @@ to avoid XSS attacks. * [#181](https://github.com/pmd/pmd/pull/181): \[apex] Control flow based CRUD rule checking * [#184](https://github.com/pmd/pmd/pull/184): \[apex] Improving open redirect detection for static fields & assignment operations * [#191](https://github.com/pmd/pmd/pull/191): \[apex] Detection of sharing violation when Database. methods are used +* [#192](https://github.com/pmd/pmd/pull/192): \[apex] Dead code removal