You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2010/09/02 22:24:32 UTC
svn commit: r992104 -
/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/plugins/PluginRules.java
Author: simonetripodi
Date: Thu Sep 2 20:24:31 2010
New Revision: 992104
URL: http://svn.apache.org/viewvc?rev=992104&view=rev
Log:
fixed PMD warning "nested if statements could be combined."
Modified:
commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/plugins/PluginRules.java
Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/plugins/PluginRules.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/plugins/PluginRules.java?rev=992104&r1=992103&r2=992104&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/plugins/PluginRules.java (original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester/plugins/PluginRules.java Thu Sep 2 20:24:31 2010
@@ -283,25 +283,24 @@ public class PluginRules implements Rule
pattern = pattern.substring(1);
}
- if (mountPoint != null) {
- if (!pattern.equals(mountPoint)
- && !pattern.startsWith(mountPoint + "/")) {
- // This can only occur if a plugin attempts to add a
- // rule with a pattern that doesn't start with the
- // prefix passed to the addRules method. Plugins mustn't
- // add rules outside the scope of the tag they were specified
- // on, so refuse this.
-
- // alas, can't throw exception
- log.warn(
- "An attempt was made to add a rule with a pattern that"
- + "is not at or below the mountpoint of the current"
- + " PluginRules object."
- + " Rule pattern: " + pattern
- + ", mountpoint: " + mountPoint
- + ", rule type: " + rule.getClass().getName());
- return;
- }
+ if (mountPoint != null
+ && !pattern.equals(mountPoint)
+ && !pattern.startsWith(mountPoint + "/")) {
+ // This can only occur if a plugin attempts to add a
+ // rule with a pattern that doesn't start with the
+ // prefix passed to the addRules method. Plugins mustn't
+ // add rules outside the scope of the tag they were specified
+ // on, so refuse this.
+
+ // alas, can't throw exception
+ log.warn(
+ "An attempt was made to add a rule with a pattern that"
+ + "is not at or below the mountpoint of the current"
+ + " PluginRules object."
+ + " Rule pattern: " + pattern
+ + ", mountpoint: " + mountPoint
+ + ", rule type: " + rule.getClass().getName());
+ return;
}
decoratedRules.add(pattern, rule);