Deprecate ASTCatchStatement::getBlock for #2202

This commit is contained in:
Clément Fournier
2020-01-16 22:21:20 +01:00
parent 99fdede0aa
commit d9719e850c
2 changed files with 12 additions and 0 deletions

View File

@ -94,6 +94,7 @@ You can identify them with the `@InternalApi` annotation. You'll also get a depr
* [`ASTAnyTypeDeclaration.TypeKind`](https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.21.0/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeDeclaration.TypeKind.html)
* {% jdoc !!java::lang.java.ast.ASTAnyTypeDeclaration#getKind() %}
* {% jdoc java::lang.java.ast.JavaQualifiedName %}
* {% jdoc !!java::lang.java.ast.ASTCatchStatement#getBlock() %}
* {% jdoc !!java::lang.java.ast.ASTCompilationUnit#declarationsAreInDefaultPackage() %}
* {% jdoc java::lang.java.ast.JavaQualifiableNode %}
* {% jdoc !!java::lang.java.ast.ASTAnyTypeDeclaration#getQualifiedName() %}

View File

@ -53,11 +53,22 @@ public class ASTCatchStatement extends AbstractJavaNode {
/**
* Returns the Block node of this catch branch.
*
* @deprecated Use {@link #getBody()}
*/
@Deprecated
public ASTBlock getBlock() {
return getFirstChildOfType(ASTBlock.class);
}
/**
* Returns the body of this catch clause.
*/
public ASTBlock getBody() {
return getFirstChildOfType(ASTBlock.class);
}
/**
* Returns the list of type nodes denoting the exception types
* caught by this catch block. The returned list has at least