diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index cf76864928..cfef83ecf5 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -123,6 +123,8 @@ See also [[all] Ensure PMD/CPD uses tab width of 1 for tabs consistently #2656]( * {% jdoc !!jsp::lang.jsp.ast.ASTJspDeclarations %} * {% jdoc !!jsp::lang.jsp.ast.ASTJspDocument %} +* {% jdoc !!scala::lang.scala.ast.ScalaParserVisitorAdapter#zero() %} +* {% jdoc !!scala::lang.scala.ast.ScalaParserVisitorAdapter#combine(Object, Object) %} ### External Contributions diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaParserVisitorAdapter.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaParserVisitorAdapter.java index 763c06385d..4dd12cc6d1 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaParserVisitorAdapter.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaParserVisitorAdapter.java @@ -35,12 +35,23 @@ import scala.meta.Type; */ public class ScalaParserVisitorAdapter implements ScalaParserVisitor { - /** Initial value when combining values returned by children. */ + /** + * Initial value when combining values returned by children. + * + * @deprecated This method will be removed with PMD 7. See {@link #combine(Object, Object)}. + */ + @Deprecated protected R zero() { return null; } - /** Merge two values of type R, used to combine values returned by children. */ + /** + * Merge two values of type R, used to combine values returned by children. + * + * @deprecated This method will be removed with PMD 7. This is just not so useful, most visitors use + * side effects on the data input directly, or, return the data input again, + * which is only possible if `D = R`, and so only known in the specific subclass. + */ protected R combine(R acc, R r) { return r; }