forked from phoedos/pmd
Checking in some Java 5 changes
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5004 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -45,7 +45,7 @@ public class AbstractRuleTest extends TestCase {
|
||||
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(new PropertyDescriptor[] { pd, xpath });
|
||||
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class AbstractRuleTest extends TestCase {
|
||||
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(new PropertyDescriptor[] { pd });
|
||||
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ class NonRuleWithAllPropertyTypes extends AbstractRule {
|
||||
super();
|
||||
}
|
||||
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
||||
|
@ -451,8 +451,8 @@ public abstract class AbstractRule extends JavaParserVisitorAdapter implements R
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
protected Map propertiesByName() {
|
||||
return Collections.EMPTY_MAP;
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -462,7 +462,7 @@ public abstract class AbstractRule extends JavaParserVisitorAdapter implements R
|
||||
* @return PropertyDescriptor
|
||||
*/
|
||||
public PropertyDescriptor propertyDescriptorFor(String propertyName) {
|
||||
PropertyDescriptor desc = (PropertyDescriptor)propertiesByName().get(propertyName);
|
||||
PropertyDescriptor desc = propertiesByName().get(propertyName);
|
||||
if (desc == null) throw new IllegalArgumentException("unknown property: " + propertyName);
|
||||
return desc;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class DaaRule extends AbstractRule implements Executable {
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(
|
||||
new PropertyDescriptor[] { maxPathDescriptor, maxViolationsDescriptor});
|
||||
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class AvoidDeeplyNestedIfStmtsRule extends AbstractRule {
|
||||
1.0f
|
||||
);
|
||||
|
||||
private static final Map propertyDescriptorsByName = asFixedMap(problemDepthDescriptor);
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(problemDepthDescriptor);
|
||||
|
||||
public Object visit(ASTCompilationUnit node, Object data) {
|
||||
depth = 0;
|
||||
@ -46,7 +46,7 @@ public class AvoidDeeplyNestedIfStmtsRule extends AbstractRule {
|
||||
/**
|
||||
* @return Map
|
||||
*/
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class BeanMembersShouldSerializeRule extends AbstractRule {
|
||||
"prefix", "Prefix somethingorother?", "", 1.0f
|
||||
);
|
||||
|
||||
private static final Map propertyDescriptorsByName = asFixedMap(prefixDescriptor);
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(prefixDescriptor);
|
||||
|
||||
|
||||
public Object visit(ASTCompilationUnit node, Object data) {
|
||||
@ -111,7 +111,7 @@ public class BeanMembersShouldSerializeRule extends AbstractRule {
|
||||
/**
|
||||
* @return Map
|
||||
*/
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class CloseResource extends AbstractRule {
|
||||
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(new PropertyDescriptor[] { typesDescriptor, closeTargetsDescriptor });
|
||||
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class CouplingBetweenObjects extends AbstractRule {
|
||||
"threshold", "Coupling threshold value", 2, 1.0f
|
||||
);
|
||||
|
||||
private static final Map propertyDescriptorsByName = asFixedMap(thresholdDescriptor);
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(thresholdDescriptor);
|
||||
|
||||
|
||||
public Object visit(ASTCompilationUnit cu, Object data) {
|
||||
@ -160,7 +160,7 @@ public class CouplingBetweenObjects extends AbstractRule {
|
||||
/**
|
||||
* @return Map
|
||||
*/
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class VariableNamingConventions extends AbstractRule {
|
||||
/**
|
||||
* @return Map
|
||||
*/
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class NonThreadSafeSingleton extends AbstractRule {
|
||||
/**
|
||||
* @return Map
|
||||
*/
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class TooManyFields extends AbstractRule {
|
||||
1.0f
|
||||
);
|
||||
|
||||
private static final Map propertyDescriptorsByName = asFixedMap(maxFieldsDescriptor);
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(maxFieldsDescriptor);
|
||||
|
||||
public Object visit(ASTCompilationUnit node, Object data) {
|
||||
|
||||
@ -77,7 +77,7 @@ public class TooManyFields extends AbstractRule {
|
||||
/**
|
||||
* @return Map
|
||||
*/
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class ConsecutiveLiteralAppends extends AbstractRule {
|
||||
1.0f
|
||||
);
|
||||
|
||||
private static final Map propertyDescriptorsByName = asFixedMap(thresholdDescriptor);
|
||||
private static final Map<String, PropertyDescriptor> propertyDescriptorsByName = asFixedMap(thresholdDescriptor);
|
||||
|
||||
|
||||
private int threshold = 1;
|
||||
@ -315,7 +315,7 @@ public class ConsecutiveLiteralAppends extends AbstractRule {
|
||||
return "StringBuffer".equals(((SimpleNode) nn.jjtGetChild(0)).getImage());
|
||||
}
|
||||
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
@ -141,7 +141,7 @@ public abstract class StatisticalRule extends AbstractRule {
|
||||
}
|
||||
}
|
||||
|
||||
protected Map propertiesByName() {
|
||||
protected Map<String, PropertyDescriptor> propertiesByName() {
|
||||
return propertyDescriptorsByName;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user