diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index abb4e1f769..0dd0acd3f9 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -227,6 +227,15 @@ The following previously deprecated rules have been finally removed: * `findByExtension(String)` - removed without replacement. * {%jdoc !!core::lang.LanguageVersionDiscoverer %} - method `getLanguagesForFile(java.io.File)` removed. Use {%jdoc core::lang.LanguageVersionDiscoverer#getLanguagesForFile(java.lang.String) %} instead. + * {%jdoc !!core::properties.AbstractPropertySource %} + * field `propertyDescriptors` has been made private and is not accessible anymore. + Use {%jdoc core::properties.AbstractPropertySource#getPropertyDescriptors() %} instead. + * field `propertyValuesByDescriptor` has been made private and is not accessible anymore. + Use {%jdoc core::properties.AbstractPropertySource#getPropertiesByPropertyDescriptor() %} + or {%jdoc core::properties.AbstractPropertySource#getOverriddenPropertiesByPropertyDescriptor() %} instead. + * method `copyPropertyDescriptors()` has been removed. Use {%jdoc core::properties.AbstractPropertySource#getPropertyDescriptors() %} instead. + * method `copyPropertyValues()` has been removed. Use {%jdoc core::properties.AbstractPropertySource#getPropertiesByPropertyDescriptor() %} + or {%jdoc core::properties.AbstractPropertySource#getOverriddenPropertiesByPropertyDescriptor() %} instead. * pmd-apex * {%jdoc apex::lang.apex.ast.ApexNode %} and {% jdoc apex::lang.apex.ast.ASTApexFile %} * `#getApexVersion()`: In PMD 6, this method has been deprecated but was defined in the class `ApexRootNode`. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractPropertySource.java b/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractPropertySource.java index d58e2ada22..3ecbfb7070 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractPropertySource.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/properties/AbstractPropertySource.java @@ -26,15 +26,10 @@ public abstract class AbstractPropertySource implements PropertySource { // This would avoid duplicating the implementation between Rule and RuleReference, // which should use exactly the same mechanism to override properties (XML). - // TODO 7.0.0 these fields should be made private final - /** * The list of known properties that can be configured. - * - * @deprecated Will be made private final */ - @Deprecated - protected List> propertyDescriptors = new ArrayList<>(); + private final List> propertyDescriptors = new ArrayList<>(); /** * The values for each property that were overridden here. @@ -42,36 +37,8 @@ public abstract class AbstractPropertySource implements PropertySource { * In other words, if this map doesn't contain a descriptor * which is in {@link #propertyDescriptors}, then it's assumed * to have a default value. - * - * @deprecated Will be made private final */ - @Deprecated - protected Map, Object> propertyValuesByDescriptor = new HashMap<>(); - - - /** - * Creates a copied list of the property descriptors and returns it. - * - * @return a copy of the property descriptors. - * @deprecated Just use {@link #getPropertyDescriptors()} - */ - @Deprecated - protected List> copyPropertyDescriptors() { - return new ArrayList<>(propertyDescriptors); - } - - - /** - * Creates a copied map of the values of the properties and returns it. - * - * @return a copy of the values - * - * @deprecated Just use {@link #getPropertiesByPropertyDescriptor()} or {@link #getOverriddenPropertiesByPropertyDescriptor()} - */ - @Deprecated - protected Map, Object> copyPropertyValues() { - return new HashMap<>(propertyValuesByDescriptor); - } + private final Map, Object> propertyValuesByDescriptor = new HashMap<>(); @Override