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:
Xavier Le Vourch
2007-01-29 02:26:05 +00:00
parent 10a60053c2
commit 4b01aad267
13 changed files with 21 additions and 21 deletions

View File

@ -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;
}

View File

@ -47,7 +47,7 @@ class NonRuleWithAllPropertyTypes extends AbstractRule {
super();
}
protected Map propertiesByName() {
protected Map<String, PropertyDescriptor> propertiesByName() {
return propertyDescriptorsByName;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -48,7 +48,7 @@ public class VariableNamingConventions extends AbstractRule {
/**
* @return Map
*/
protected Map propertiesByName() {
protected Map<String, PropertyDescriptor> propertiesByName() {
return propertyDescriptorsByName;
}

View File

@ -114,7 +114,7 @@ public class NonThreadSafeSingleton extends AbstractRule {
/**
* @return Map
*/
protected Map propertiesByName() {
protected Map<String, PropertyDescriptor> propertiesByName() {
return propertyDescriptorsByName;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -141,7 +141,7 @@ public abstract class StatisticalRule extends AbstractRule {
}
}
protected Map propertiesByName() {
protected Map<String, PropertyDescriptor> propertiesByName() {
return propertyDescriptorsByName;
}
}