[scala] Deprecate ScalaParserVisitorAdapter#zero and #combine

Those will go away with PMD 7.
This commit is contained in:
Andreas Dangel 2020-08-22 18:24:48 +02:00
parent d6853c5d0e
commit 6a4b1a7a2d
2 changed files with 15 additions and 2 deletions

View File

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

View File

@ -35,12 +35,23 @@ import scala.meta.Type;
*/
public class ScalaParserVisitorAdapter<D, R> implements ScalaParserVisitor<D, R> {
/** 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;
}