ProhibitMethod Class — spring-boot Architecture
Architecture documentation for the ProhibitMethod class in TaskConfigurationAvoidanceTests.java from the spring-boot codebase.
Entity Profile
Source Code
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/TaskConfigurationAvoidanceTests.java lines 128–154
private static final class ProhibitMethod extends ProhibitMethodsNamed {
private final List<Class<?>> parameterTypes;
private ProhibitMethod(Class<?> owner, String name, List<Class<?>> parameterTypes) {
super(owner, name);
this.parameterTypes = parameterTypes;
}
@Override
public boolean test(JavaMethodCall methodCall) {
return super.test(methodCall) && match(methodCall.getTarget().getParameterTypes());
}
private boolean match(List<JavaType> callParameterTypes) {
if (this.parameterTypes.size() != callParameterTypes.size()) {
return false;
}
for (int i = 0; i < this.parameterTypes.size(); i++) {
if (!callParameterTypes.get(i).toErasure().isEquivalentTo(this.parameterTypes.get(i))) {
return false;
}
}
return true;
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free