<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
<!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. -->
<divclass="alert alert-info"role="alert"><iclass="fa fa-info-circle"></i><b>Note:</b> Current plans are listed <ahref="https://github.com/pmd/pmd/labels/in%3Aast">here</a> and in particular <ahref="https://github.com/pmd/pmd/issues/1019">here</a></div>
<h2id="new-api-support-guidelines">New API support guidelines</h2>
<h3id="whats-new">What’s new</h3>
<p>Until now, all released public members and types were implicitly considered part
of PMD’s public API, including inheritance-specific members (protected members, abstract methods).
We have maintained those APIs with the goal to preserve full binary compatibility between minor releases,
only breaking those APIs infrequently, for major releases.</p>
<p>In order to allow PMD to move forward at a faster pace, this implicit contract will
be invalidated with PMD 7.0.0. We now introduce more fine-grained distinctions between
the type of compatibility support we guarantee for our libraries, and ways to make
them explicit to clients of PMD.</p>
<h4id="internal-packages-and-internalapi-annotation"><codeclass="highlighter-rouge">.internal</code> packages and <codeclass="highlighter-rouge">@InternalApi</code> annotation</h4>
<p><em>Internal API</em> is meant for use <em>only</em> by the main PMD codebase. Internal types and methods
may be modified in any way, or even removed, at any time.</p>
<p>Any API in a package that contains an <codeclass="highlighter-rouge">.internal</code> segment is considered internal.
The <codeclass="highlighter-rouge">@InternalApi</code> annotation will be used for APIs that have to live outside of
these packages, e.g. methods of a public type that shouldn’t be used outside of PMD (again,
<p>APIs marked with the <codeclass="highlighter-rouge">@Deprecated</code> annotation at the class or method level will remain supported
until the next major release but it is recommended to stop using them.</p>
<h3id="the-transition">The transition</h3>
<p><em>All currently supported APIs will remain so until 7.0.0</em>. All APIs that are to be moved to
<codeclass="highlighter-rouge">.internal</code> packages or hidden will be tagged <codeclass="highlighter-rouge">@InternalApi</code> before that major release, and
the breaking API changes will be performed in 7.0.0.</p>
<h2id="planned-api-removals">Planned API removals</h2>
<h3id="list-of-currently-deprecated-apis">List of currently deprecated APIs</h3>
<divclass="alert alert-danger"role="alert"><iclass="fa fa-exclamation-circle"></i><b>Warning:</b> This list is not exhaustive. The ultimate reference is whether
an API is tagged as <codeclass="highlighter-rouge">@Deprecated</code> or not in the latest minor release. During the development of 7.0.0,
we may decide to remove some APIs that were not tagged as deprecated, though we’ll try to avoid it.</div>
<p>Reminder: Please don’t use members marked with the annotation <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/annotation/InternalApi.html#"><codeclass="highlighter-rouge">InternalApi</code></a>, as they will likely be removed, hidden, or otherwise intentionally broken with 7.0.0.</p>
<li>Manual instantiation of nodes. <strong>Constructors of node classes are deprecated</strong> and marked <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/annotation/InternalApi.html#"><codeclass="highlighter-rouge">InternalApi</code></a>. Nodes should only be obtained from the parser, which for rules, means that never need to instantiate node themselves. Those constructors will be made package private with 7.0.0.</li>
<li><strong>Subclassing of abstract node classes, or usage of their type</strong>. Version 7.0.0 will bring a new set of abstractions that will be public API, but the base classes are and will stay internal. You should not couple your code to them.
<li>In the meantime you should use interfaces like <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/JavaNode.html#"><codeclass="highlighter-rouge">JavaNode</code></a> or <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/lang/ast/Node.html#"><codeclass="highlighter-rouge">Node</code></a>, or the other published interfaces in this package, to refer to nodes generically.</li>
<li>Concrete node classes will <strong>be made final</strong> with 7.0.0.</li>
</ul>
</li>
<li>Setters found in any node class or interface. <strong>Rules should consider the AST immutable</strong>. We will make those setters package private with 7.0.0.</li>
<p>Please look at <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.lang.java.ast</code></a> to find out the full list
<li>The method <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/lang/LanguageVersionHandler.html#getDumpFacade(Writer,String,boolean)"><codeclass="highlighter-rouge">LanguageVersionHandler#getDumpFacade</code></a> will be
removed as well. It is deprecated, along with all its implementations in the subclasses of <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/lang/LanguageVersionHandler.html#"><codeclass="highlighter-rouge">LanguageVersionHandler</code></a>.</li>
<h5id="command-line-interface">Command Line Interface</h5>
<p>The start scripts <codeclass="highlighter-rouge">run.sh</code>, <codeclass="highlighter-rouge">pmd.bat</code> and <codeclass="highlighter-rouge">cpd.bat</code> support the new environment variable <codeclass="highlighter-rouge">PMD_JAVA_OPTS</code>.
This can be used to set arbitrary JVM options for running PMD, such as memory settings (e.g. <codeclass="highlighter-rouge">PMD_JAVA_OPTS=-Xmx512m</code>)
or enable preview language features (e.g. <codeclass="highlighter-rouge">PMD_JAVA_OPTS=--enable-preview</code>).</p>
<p>The previously available variables such as <codeclass="highlighter-rouge">OPTS</code> or <codeclass="highlighter-rouge">HEAPSIZE</code> are deprecated and will be removed with PMD 7.0.0.</p>
<p><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/renderers/CodeClimateRule.html#"><codeclass="highlighter-rouge">CodeClimateRule</code></a> is deprecated in 7.0.0 because it was unused for 2 years and
Properties “cc_categories”, “cc_remediation_points_multiplier”, “cc_block_highlighting” will also be removed.
See <ahref="https://github.com/pmd/pmd/pull/1702">#1702</a> for more.</p>
</li>
<li>
<p>The Apex ruleset <codeclass="highlighter-rouge">rulesets/apex/ruleset.xml</code> has been deprecated and will be removed in 7.0.0. Please use the new
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/lang/rule/stat/StatisticalRule.html#"><codeclass="highlighter-rouge">StatisticalRule</code></a> and the related helper classes and base rule classes
are deprecated for removal in 7.0.0. This includes all of <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/stat/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.stat</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/lang/rule/stat/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.lang.rule.stat</code></a>,
and also <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/rule/AbstractStatisticalJavaRule.html#"><codeclass="highlighter-rouge">AbstractStatisticalJavaRule</code></a>, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-apex/6.18.0/net/sourceforge/pmd/lang/apex/rule/AbstractStatisticalApexRule.html#"><codeclass="highlighter-rouge">AbstractStatisticalApexRule</code></a> and the like.
The methods <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/Report.html#addMetric(net.sourceforge.pmd.stat.Metric)"><codeclass="highlighter-rouge">Report#addMetric</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/ThreadSafeReportListener.html#metricAdded(net.sourceforge.pmd.stat.Metric)"><codeclass="highlighter-rouge">metricAdded</code></a>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertySource.html#setProperty(net.sourceforge.pmd.properties.MultiValuePropertyDescriptor,Object[])"><codeclass="highlighter-rouge">setProperty</code></a> is deprecated,
because <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/MultiValuePropertyDescriptor.html#"><codeclass="highlighter-rouge">MultiValuePropertyDescriptor</code></a> is deprecated as well</li>
<p>The properties framework is about to get a lifting, and for that reason, we need to deprecate a lot of APIs
to remove them in 7.0.0. The proposed changes to the API are described <ahref="https://github.com/pmd/pmd/wiki/Property-framework-7-0-0">on the wiki</a></p>
<h6id="changes-to-how-you-define-properties">Changes to how you define properties</h6>
<ul>
<li>
<p>Construction of property descriptors has been possible through builders since 6.0.0. The 7.0.0 API will only allow
construction through builders. The builder hierarchy, currently found in the package <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/builders/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.properties.builders</code></a>,
is being replaced by the simpler <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyBuilder.html#"><codeclass="highlighter-rouge">PropertyBuilder</code></a>. Their APIs enjoy a high degree of source compatibility.</p>
<p>Concrete property classes like <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/IntegerProperty.html#"><codeclass="highlighter-rouge">IntegerProperty</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/StringMultiProperty.html#"><codeclass="highlighter-rouge">StringMultiProperty</code></a> will gradually
all be deprecated until 7.0.0. Their usages should be replaced by direct usage of the <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#"><codeclass="highlighter-rouge">PropertyDescriptor</code></a>
interface, e.g. <codeclass="highlighter-rouge">PropertyDescriptor<Integer></code> or <codeclass="highlighter-rouge">PropertyDescriptor<List<String>></code>.</p>
<p>Instead of spreading properties across countless classes, the utility class <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#"><codeclass="highlighter-rouge">PropertyFactory</code></a> will become
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/IntegerProperty.html#"><codeclass="highlighter-rouge">IntegerProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#intProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#intProperty</code></a>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/IntegerMultiProperty.html#"><codeclass="highlighter-rouge">IntegerMultiProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#intListProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#intListProperty</code></a></li>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/FloatProperty.html#"><codeclass="highlighter-rouge">FloatProperty</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/DoubleProperty.html#"><codeclass="highlighter-rouge">DoubleProperty</code></a> are both replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#doubleProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#doubleProperty</code></a>.
<li>Similarly, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/FloatMultiProperty.html#"><codeclass="highlighter-rouge">FloatMultiProperty</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/DoubleMultiProperty.html#"><codeclass="highlighter-rouge">DoubleMultiProperty</code></a> are replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#doubleListProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#doubleListProperty</code></a>.</li>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/StringProperty.html#"><codeclass="highlighter-rouge">StringProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#stringProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#stringProperty</code></a>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/StringMultiProperty.html#"><codeclass="highlighter-rouge">StringMultiProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#stringListProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#stringListProperty</code></a></li>
<p><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/RegexProperty.html#"><codeclass="highlighter-rouge">RegexProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#regexProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#regexProperty</code></a></p>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/EnumeratedProperty.html#"><codeclass="highlighter-rouge">EnumeratedProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#enumProperty(java.lang.String,java.util.Map)"><codeclass="highlighter-rouge">PropertyFactory#enumProperty</code></a>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/EnumeratedProperty.html#"><codeclass="highlighter-rouge">EnumeratedProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#enumListProperty(java.lang.String,java.util.Map)"><codeclass="highlighter-rouge">PropertyFactory#enumListProperty</code></a></li>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/BooleanProperty.html#"><codeclass="highlighter-rouge">BooleanProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#booleanProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#booleanProperty</code></a>
<li>Its multi-valued counterpart, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/BooleanMultiProperty.html#"><codeclass="highlighter-rouge">BooleanMultiProperty</code></a>, is not replaced, because it doesn’t have a use case.</li>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/CharacterProperty.html#"><codeclass="highlighter-rouge">CharacterProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#charProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#charProperty</code></a>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/CharacterMultiProperty.html#"><codeclass="highlighter-rouge">CharacterMultiProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#charListProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#charListProperty</code></a></li>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/LongProperty.html#"><codeclass="highlighter-rouge">LongProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#longIntProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#longIntProperty</code></a>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/LongMultiProperty.html#"><codeclass="highlighter-rouge">LongMultiProperty</code></a> is replaced by <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyFactory.html#longIntListProperty(java.lang.String)"><codeclass="highlighter-rouge">PropertyFactory#longIntListProperty</code></a></li>
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/MethodProperty.html#"><codeclass="highlighter-rouge">MethodProperty</code></a>, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/FileProperty.html#"><codeclass="highlighter-rouge">FileProperty</code></a>, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/TypeProperty.html#"><codeclass="highlighter-rouge">TypeProperty</code></a> and their multi-valued counterparts
are discontinued for lack of a use-case, and have no planned replacement in 7.0.0 for now.
<!-- TODO complete that as we proceed. --></li>
</ul>
</li>
</ul>
<p>Here’s an example:</p>
<divclass="language-java highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="c1">// Before 7.0.0, these are equivalent:</span>
and the related builders (in <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/builders/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.properties.builders</code></a>) will be removed.
to maintain. Their functionality will be mapped uniformly to <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/constraints/PropertyConstraint.html#"><codeclass="highlighter-rouge">PropertyConstraint</code></a>s,
related methods <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyTypeId.html#isPropertyNumeric()"><codeclass="highlighter-rouge">PropertyTypeId#isPropertyNumeric</code></a> and
<ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyTypeId.html#isPropertyPackaged()"><codeclass="highlighter-rouge">PropertyTypeId#isPropertyPackaged</code></a> are also deprecated.</p>
<p><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/MultiValuePropertyDescriptor.html#"><codeclass="highlighter-rouge">MultiValuePropertyDescriptor</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/SingleValuePropertyDescriptor.html#"><codeclass="highlighter-rouge">SingleValuePropertyDescriptor</code></a>
between single- and multi-valued properties. The method <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#isMultiValue()"><codeclass="highlighter-rouge">PropertyDescriptor#isMultiValue</code></a> will be removed
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#preferredRowCount()"><codeclass="highlighter-rouge">preferredRowCount</code></a> is deprecated with no intended replacement. It was never implemented, and does not belong
in this interface. The methods <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#uiOrder()"><codeclass="highlighter-rouge">uiOrder</code></a> and <codeclass="highlighter-rouge">compareTo(PropertyDescriptor)</code> are deprecated for the
same reason. These methods mix presentation logic with business logic and are not necessary for PropertyDescriptors to work.
<codeclass="highlighter-rouge">PropertyDescriptor</code> will not extend <codeclass="highlighter-rouge">Comparable<PropertyDescriptor></code> anymore come 7.0.0.</li>
<li>The method <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#propertyErrorFor(net.sourceforge.pmd.Rule)"><codeclass="highlighter-rouge">propertyErrorFor</code></a> is deprecated and will be removed with no intended
<li><codeclass="highlighter-rouge">T </code><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#valueFrom(java.lang.String)"><codeclass="highlighter-rouge">valueFrom(String)</code></a> and <codeclass="highlighter-rouge">String </code><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#asDelimitedString(java.lang.Object)"><codeclass="highlighter-rouge">asDelimitedString</code></a><codeclass="highlighter-rouge">(T)</code> are deprecated and will be removed. These were
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#isMultiValue()"><codeclass="highlighter-rouge">isMultiValue</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#type()"><codeclass="highlighter-rouge">type</code></a> are deprecated and won’t be replaced. The new XML syntax will remove the need
<li><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#errorFor(java.lang.Object)"><codeclass="highlighter-rouge">errorFor</code></a> is deprecated as its return type will be changed to <codeclass="highlighter-rouge">Optional<String></code> with the shift to Java 8.</li>
<p>The implementation of the adapters for the XPath engines Saxon and Jaxen (package <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/lang/ast/xpath/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.lang.ast.xpath</code></a>)
are now deprecated. They’ll be moved to an internal package come 7.0.0. Only <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/lang/ast/xpath/Attribute.html#"><codeclass="highlighter-rouge">Attribute</code></a> remains public API.</p>
<p>The classes <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptorField.html#"><codeclass="highlighter-rouge">PropertyDescriptorField</code></a>, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/builders/PropertyDescriptorBuilderConversionWrapper.html#"><codeclass="highlighter-rouge">PropertyDescriptorBuilderConversionWrapper</code></a>, and the methods
<ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#attributeValuesById"><codeclass="highlighter-rouge">PropertyDescriptor#attributeValuesById</code></a>, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyDescriptor.html#isDefinedExternally()"><codeclass="highlighter-rouge">PropertyDescriptor#isDefinedExternally</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/PropertyTypeId.html#getFactory()"><codeclass="highlighter-rouge">PropertyTypeId#getFactory</code></a>.
<p>The class <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/ValueParserConstants.html#"><codeclass="highlighter-rouge">ValueParserConstants</code></a> and the interface <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/ValueParser.html#"><codeclass="highlighter-rouge">ValueParser</code></a>.</p>
<p>All classes from <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/metrics/impl/visitors/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.lang.java.metrics.impl.visitors</code></a> are now considered internal API. They’re deprecated
<ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorAdapter.html#"><codeclass="highlighter-rouge">JavaParserVisitorAdapter</code></a> should be directly subclassed.</p>
<p>All classes from <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/properties/modules/package-summary.html#"><codeclass="highlighter-rouge">net.sourceforge.pmd.properties.modules</code></a> will be removed.</p>
<p>The interface <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/Dimensionable.html#"><codeclass="highlighter-rouge">Dimensionable</code></a> has been deprecated.
<p>Several methods from <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.html#"><codeclass="highlighter-rouge">ASTLocalVariableDeclaration</code></a> and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#"><codeclass="highlighter-rouge">ASTFieldDeclaration</code></a> have
<p><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#"><codeclass="highlighter-rouge">ASTFieldDeclaration</code></a> won’t be a <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/TypeNode.html#"><codeclass="highlighter-rouge">TypeNode</code></a> come 7.0.0, so
<ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#getType()"><codeclass="highlighter-rouge">getType</code></a> and
<ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.html#getTypeDefinition()"><codeclass="highlighter-rouge">getTypeDefinition</code></a> are deprecated.</p>
with different types (and obviously with different names). They both implement <codeclass="highlighter-rouge">Iterator<</code><ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/ASTVariableDeclaratorId.html#"><codeclass="highlighter-rouge">ASTVariableDeclaratorId</code></a><codeclass="highlighter-rouge">></code>
<ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/JavaParserControllessVisitorAdapter.html#"><codeclass="highlighter-rouge">JavaParserControllessVisitorAdapter</code></a>, and <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.18.0/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorDecorator.html#"><codeclass="highlighter-rouge">JavaParserVisitorDecorator</code></a> are deprecated with no intended replacement.</li>
<li>In <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/Rule.html#"><codeclass="highlighter-rouge">Rule</code></a>: <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/Rule.html#isDfa()"><codeclass="highlighter-rouge">isDfa()</code></a>, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/Rule.html#isTypeResolution()"><codeclass="highlighter-rouge">isTypeResolution()</code></a>, <ahref="https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.18.0/net/sourceforge/pmd/Rule.html#isMultifile()"><codeclass="highlighter-rouge">isMultifile()</code></a> and their
<p>All classes in the package <codeclass="highlighter-rouge">net.sourceforge.pmd.lang.dfa.report</code> have been deprecated and will be removed
with PMD 7.0.0. This includes the class <codeclass="highlighter-rouge">net.sourceforge.pmd.lang.dfa.report.ReportTree</code>. The reason is,
that this class is very specific to Java and not suitable for other languages. It has only been used for
<codeclass="highlighter-rouge">YAHTMLRenderer</code>, which has been rewritten to work without these classes.</p>
</li>
<li>
<p>The nodes RUNSIGNEDSHIFT and RSIGNEDSHIFT are deprecated and will be removed from the AST with PMD 7.0.0.
These represented the operator of ShiftExpression in two cases out of three, but they’re not needed and
make ShiftExpression inconsistent. The operator of a ShiftExpression is now accessible through
ShiftExpression#getOperator.</p>
</li>
</ul>
<h4id="650">6.5.0</h4>
<ul>
<li>
<p>The utility class <codeclass="highlighter-rouge">net.sourceforge.pmd.lang.java.ast.CommentUtil</code> has been deprecated and will be removed
with PMD 7.0.0. Its methods have been intended to parse javadoc tags. A more useful solution will be added
around the AST node <codeclass="highlighter-rouge">FormalComment</code>, which contains as children <codeclass="highlighter-rouge">JavadocElement</code> nodes, which in
turn provide access to the <codeclass="highlighter-rouge">JavadocTag</code>.</p>
<p>All comment AST nodes (<codeclass="highlighter-rouge">FormalComment</code>, <codeclass="highlighter-rouge">MultiLineComment</code>, <codeclass="highlighter-rouge">SingleLineComment</code>) have a new method
<codeclass="highlighter-rouge">getFilteredComment()</code> which provide access to the comment text without the leading <codeclass="highlighter-rouge">/*</code> markers.</p>
</li>
<li>
<p>The method <codeclass="highlighter-rouge">AbstractCommentRule.tagsIndicesIn()</code> has been deprecated and will be removed with
PMD 7.0.0. It is not very useful, since it doesn’t extract the information
in a useful way. You would still need check, which tags have been found, and with which
data they might be accompanied.</p>
</li>
</ul>
<h4id="640">6.4.0</h4>
<ul>
<li>The following classes in package <codeclass="highlighter-rouge">net.sourceforge.pmd.benchmark</code> have been deprecated: <codeclass="highlighter-rouge">Benchmark</code>, <codeclass="highlighter-rouge">Benchmarker</code>,
<codeclass="highlighter-rouge">BenchmarkReport</code>, <codeclass="highlighter-rouge">BenchmarkResult</code>, <codeclass="highlighter-rouge">RuleDuration</code>, <codeclass="highlighter-rouge">StringBuilderCR</code> and <codeclass="highlighter-rouge">TextReport</code>. Their API is not supported anymore
and is disconnected from the internals of PMD. Use the newer API based around <codeclass="highlighter-rouge">TimeTracker</code> instead, which can be found
in the same package.</li>
<li>The class <codeclass="highlighter-rouge">net.sourceforge.pmd.lang.java.xpath.TypeOfFunction</code> has been deprecated. Use the newer <codeclass="highlighter-rouge">TypeIsFunction</code> in the same package.</li>
<li>The <codeclass="highlighter-rouge">typeof</code> methods in <codeclass="highlighter-rouge">net.sourceforge.pmd.lang.java.xpath.JavaFunctions</code> have been deprecated.
Use the newer <codeclass="highlighter-rouge">typeIs</code> method in the same class instead..</li>
<li>The methods <codeclass="highlighter-rouge">isA</code>, <codeclass="highlighter-rouge">isEither</code> and <codeclass="highlighter-rouge">isNeither</code> of <codeclass="highlighter-rouge">net.sourceforge.pmd.lang.java.typeresolution.TypeHelper</code>.
Use the new <codeclass="highlighter-rouge">isExactlyAny</code> and <codeclass="highlighter-rouge">isExactlyNone</code> methods in the same class instead.</li>
</ul>
<h4id="620">6.2.0</h4>
<ul>
<li>
<p>The static method <codeclass="highlighter-rouge">PMDParameters.transformParametersIntoConfiguration(PMDParameters)</code> is now deprecated,
for removal in 7.0.0. The new instance method <codeclass="highlighter-rouge">PMDParameters.toConfiguration()</code> replaces it.</p>
</li>
<li>
<p>The method <codeclass="highlighter-rouge">ASTConstructorDeclaration.getParameters()</code> has been deprecated in favor of the new method
<codeclass="highlighter-rouge">getFormalParameters()</code>. This method is available for both <codeclass="highlighter-rouge">ASTConstructorDeclaration</code> and
<li>The method <codeclass="highlighter-rouge">getXPathNodeName</code> is added to the <codeclass="highlighter-rouge">Node</code> interface, which removes the
use of the <codeclass="highlighter-rouge">toString</code> of a node to get its XPath element name (see <ahref="https://github.com/pmd/pmd/issues/569">#569</a>).
<ul>
<li>The default implementation provided in <codeclass="highlighter-rouge">AbstractNode</code>, will
be removed with 7.0.0</li>
<li>With 7.0.0, the <codeclass="highlighter-rouge">Node.toString</code> method will not necessarily provide its XPath node
name anymore.</li>
</ul>
</li>
<li>
<p>The interface <codeclass="highlighter-rouge">net.sourceforge.pmd.cpd.Renderer</code> has been deprecated. A new interface
<codeclass="highlighter-rouge">net.sourceforge.pmd.cpd.renderer.CPDRenderer</code> has been introduced to replace it. The main
difference is that the new interface is meant to render directly to a <codeclass="highlighter-rouge">java.io.Writer</code>
rather than to a String. This allows to greatly reduce the memory footprint of CPD, as on
large projects, with many duplications, it was causing <codeclass="highlighter-rouge">OutOfMemoryError</code>s (see <ahref="https://github.com/pmd/pmd/issues/795">#795</a>).</p>
<p><codeclass="highlighter-rouge">net.sourceforge.pmd.cpd.FileReporter</code> has also been deprecated as part of this change, as it’s no longer needed.</p>
</li>
</ul>
<h4id="601">6.0.1</h4>
<ul>
<li>The constant <codeclass="highlighter-rouge">net.sourceforge.pmd.PMD.VERSION</code> has been deprecated and will be removed with PMD 7.0.0.
Please use <codeclass="highlighter-rouge">net.sourceforge.pmd.PMDVersion.VERSION</code> instead.</li>
</ul>
<h3id="list-of-currently-deprecated-rules">List of currently deprecated rules</h3>
<ahref="pmd_rules_java_codestyle.html#suspiciousconstantfieldname"><codeclass="highlighter-rouge">SuspiciousConstantFieldName</code></a>, and <ahref="pmd_rules_java_codestyle.html#avoidprefixingmethodparameters"><codeclass="highlighter-rouge">AvoidPrefixingMethodParameters</code></a> are
now deprecated, and will be removed with version 7.0.0. They are replaced by the more general
<ahref="pmd_rules_java_codestyle.html#fieldnamingconventions"><codeclass="highlighter-rouge">FieldNamingConventions</code></a>, <ahref="pmd_rules_java_codestyle.html#formalparameternamingconventions"><codeclass="highlighter-rouge">FormalParameterNamingConventions</code></a>, and
<p>The Java rules <ahref="pmd_rules_java_codestyle.html#whileloopsmustusebraces"><codeclass="highlighter-rouge">WhileLoopsMustUseBraces</code></a>, <ahref="pmd_rules_java_codestyle.html#forloopsmustusebraces"><codeclass="highlighter-rouge">ForLoopsMustUseBraces</code></a>, <ahref="pmd_rules_java_codestyle.html#ifstmtsmustusebraces"><codeclass="highlighter-rouge">IfStmtsMustUseBraces</code></a>, and <ahref="pmd_rules_java_codestyle.html#ifelsestmtsmustusebraces"><codeclass="highlighter-rouge">IfElseStmtsMustUseBraces</code></a>
are deprecated. They will be replaced by the new rule <ahref="pmd_rules_java_codestyle.html#controlstatementbraces"><codeclass="highlighter-rouge">ControlStatementBraces</code></a>.</p>
<p>The Java rules <ahref="pmd_rules_java_design.html#ncssconstructorcount"><codeclass="highlighter-rouge">NcssConstructorCount</code></a>, <ahref="pmd_rules_java_design.html#ncssmethodcount"><codeclass="highlighter-rouge">NcssMethodCount</code></a>, and <ahref="pmd_rules_java_design.html#ncsstypecount"><codeclass="highlighter-rouge">NcssTypeCount</code></a> have been
deprecated. They will be replaced by the new rule <ahref="pmd_rules_java_design.html#ncsscount"><codeclass="highlighter-rouge">NcssCount</code></a> in the category <codeclass="highlighter-rouge">design</code>.</p>
</li>
<li>
<p>The Java rule <codeclass="highlighter-rouge">LooseCoupling</code> in ruleset <codeclass="highlighter-rouge">java-typeresolution</code> is deprecated. Use the rule with the same name from category <codeclass="highlighter-rouge">bestpractices</code> instead.</p>
</li>
<li>
<p>The Java rule <codeclass="highlighter-rouge">CloneMethodMustImplementCloneable</code> in ruleset <codeclass="highlighter-rouge">java-typeresolution</code> is deprecated. Use the rule with the same name from category <codeclass="highlighter-rouge">errorprone</code> instead.</p>
</li>
<li>
<p>The Java rule <codeclass="highlighter-rouge">UnusedImports</code> in ruleset <codeclass="highlighter-rouge">java-typeresolution</code> is deprecated. Use the rule with
the same name from category <codeclass="highlighter-rouge">bestpractices</code> instead.</p>
</li>
<li>
<p>The Java rule <codeclass="highlighter-rouge">SignatureDeclareThrowsException</code> in ruleset <codeclass="highlighter-rouge">java-typeresolution</code> is deprecated. Use the rule with the same name from category <codeclass="highlighter-rouge">design</code> instead.</p>
</li>
<li>
<p>The Java rule <codeclass="highlighter-rouge">EmptyStaticInitializer</code> in ruleset <codeclass="highlighter-rouge">java-empty</code> is deprecated. Use the rule <ahref="pmd_rules_java_errorprone.html#emptyinitializer"><codeclass="highlighter-rouge">EmptyInitializer</code></a>, which covers both static and non-static empty initializers.`</p>
</li>
<li>
<p>The Java rules <codeclass="highlighter-rouge">GuardDebugLogging</code> (ruleset <codeclass="highlighter-rouge">java-logging-jakarta-commons</code>) and <codeclass="highlighter-rouge">GuardLogStatementJavaUtil</code>
(ruleset <codeclass="highlighter-rouge">java-logging-java</code>) have been deprecated. Use the rule <ahref="pmd_rules_java_bestpractices.html#guardlogstatement"><codeclass="highlighter-rouge">GuardLogStatement</code></a>, which covers all cases regardless of the logging framework.</p>
<p>The Java rule <ahref="pmd_rules_java_multithreading.html#unsynchronizedstaticdateformatter"><codeclass="highlighter-rouge">UnsynchronizedStaticDateFormatter</code></a> has been deprecated and
will be removed with PMD 7.0.0. The rule is replaced by the more general