forked from phoedos/pmd
[java] Remove new method getFormalParameters to preserve API compatibility
Refs #912 Refs #881
This commit is contained in:
@ -78,11 +78,15 @@ On both scenarios, disabling the cache takes precedence over setting a cache loc
|
|||||||
|
|
||||||
### API Changes
|
### API Changes
|
||||||
|
|
||||||
* A new CLI switch, `-no-cache`, disables incremental analysis and the related suggestion. This overrides the
|
* A new CLI switch, `-no-cache`, disables incremental analysis and the related suggestion. This overrides the
|
||||||
`-cache` option. The corresponding Ant task parameter is `noCache`.
|
`-cache` option. The corresponding Ant task parameter is `noCache`.
|
||||||
|
|
||||||
* The static method `PMDParameters.transformParametersIntoConfiguration(PMDParameters)` is now deprecated,
|
* The static method `PMDParameters.transformParametersIntoConfiguration(PMDParameters)` is now deprecated,
|
||||||
for removal in 7.0.0. The new instance method `PMDParameters.toConfiguration()` replaces it.
|
for removal in 7.0.0. The new instance method `PMDParameters.toConfiguration()` replaces it.
|
||||||
|
|
||||||
|
* The method `ASTConstructorDeclaration.getParameters()` has been deprecated in favor of the new method
|
||||||
|
`getFormalParameters()`. This method is available for both `ASTConstructorDeclaration` and
|
||||||
|
`ASTMethodDeclaration`.
|
||||||
|
|
||||||
### External Contributions
|
### External Contributions
|
||||||
|
|
||||||
|
@ -21,14 +21,6 @@ public class ASTConstructorDeclaration extends AbstractJavaAccessNode implements
|
|||||||
super(p, id);
|
super(p, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ASTFormalParameters getParameters() {
|
|
||||||
return (ASTFormalParameters) (jjtGetChild(0) instanceof ASTFormalParameters ? jjtGetChild(0) : jjtGetChild(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getParameterCount() {
|
|
||||||
return getParameters().getParameterCount();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accept the visitor. *
|
* Accept the visitor. *
|
||||||
*/
|
*/
|
||||||
@ -62,7 +54,16 @@ public class ASTConstructorDeclaration extends AbstractJavaAccessNode implements
|
|||||||
return signature;
|
return signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Deprecated // to be removed with PMD 7.0.0 - use getFormalParameters() instead
|
||||||
|
public ASTFormalParameters getParameters() {
|
||||||
|
return getFormalParameters();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getParameterCount() {
|
||||||
|
return getFormalParameters().getParameterCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
//@Override // enable this with PMD 7.0.0 - see interface ASTMethodOrConstructorDeclaration
|
||||||
public ASTFormalParameters getFormalParameters() {
|
public ASTFormalParameters getFormalParameters() {
|
||||||
return getFirstChildOfType(ASTFormalParameters.class);
|
return getFirstChildOfType(ASTFormalParameters.class);
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ public class ASTMethodDeclaration extends AbstractJavaAccessNode implements DFAG
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
//@Override // enable this with PMD 7.0.0 - see interface ASTMethodOrConstructorDeclaration
|
||||||
public ASTFormalParameters getFormalParameters() {
|
public ASTFormalParameters getFormalParameters() {
|
||||||
return getFirstChildOfType(ASTMethodDeclarator.class).getFirstChildOfType(ASTFormalParameters.class);
|
return getFirstChildOfType(ASTMethodDeclarator.class).getFirstChildOfType(ASTFormalParameters.class);
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,12 @@ public interface ASTMethodOrConstructorDeclaration extends
|
|||||||
@Override
|
@Override
|
||||||
JavaOperationSignature getSignature();
|
JavaOperationSignature getSignature();
|
||||||
|
|
||||||
|
//
|
||||||
/**
|
// Enable this with PMD 7.0.0
|
||||||
* Returns the formal parameters node of this method or constructor.
|
//
|
||||||
*/
|
///**
|
||||||
ASTFormalParameters getFormalParameters();
|
// * Returns the formal parameters node of this method or constructor.
|
||||||
|
// */
|
||||||
|
//ASTFormalParameters getFormalParameters();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user