* Make AbstractPropertySource.getPropertySourceType() abstract
* Readd RuleReference.hasOverriddenProperty()
This commit is contained in:
1 parent
faabb2a84e
commit
47171207ff
4 files changed
+18
-5
No files matched your search
@@ -48,6 +48,11 @@ public abstract class AbstractRule extends AbstractPropertySource implements Rul
|
||||
definePropertyDescriptor(Rule.VIOLATION_SUPPRESS_XPATH_DESCRIPTOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPropertySourceType() {
|
||||
return "rule";
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #deepCopy()} to create verbatim copies of rules.
|
||||
*/
|
||||
|
||||
@@ -329,6 +329,13 @@ public class RuleReference extends AbstractDelegateRule {
|
||||
|| super.hasDescriptor(descriptor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #isPropertyOverridden(PropertyDescriptor)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean hasOverriddenProperty(PropertyDescriptor<?> descriptor) {
|
||||
return isPropertyOverridden(descriptor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPropertyOverridden(PropertyDescriptor<?> descriptor) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.pmd.Rule;
|
||||
import net.sourceforge.pmd.util.CollectionUtil;
|
||||
|
||||
|
||||
@@ -103,10 +102,7 @@ public abstract class AbstractPropertySource implements PropertySource {
|
||||
}
|
||||
|
||||
|
||||
private String getPropertySourceType() {
|
||||
return this instanceof Rule ? "rule" : "renderer";
|
||||
}
|
||||
|
||||
protected abstract String getPropertySourceType();
|
||||
|
||||
@Override
|
||||
public PropertyDescriptor<?> getPropertyDescriptor(String name) {
|
||||
|
||||
@@ -27,6 +27,11 @@ public abstract class AbstractRenderer extends AbstractPropertySource implements
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPropertySourceType() {
|
||||
return "renderer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
|
||||
Reference in new issue
Block a user