use of scenelib.annotations.el.BoundLocation in project checker-framework by typetools.
the class ToIndexFileConverter method visit.
@Override
public Void visit(MethodDeclaration decl, AElement elem) {
Type type = decl.getType();
List<Parameter> params = decl.getParameters();
List<TypeParameter> typeParams = decl.getTypeParameters();
Optional<ReceiverParameter> rcvrParam = decl.getReceiverParameter();
BlockStmt body = decl.getBody().orElse(null);
StringBuilder sb = new StringBuilder(decl.getNameAsString()).append('(');
AClass clazz = (AClass) elem;
AMethod method;
if (params != null) {
for (Parameter param : params) {
Type ptype = param.getType();
sb.append(getJVML(ptype));
}
}
sb.append(')').append(getJVML(type));
method = clazz.methods.getVivify(sb.toString());
visitDecl(decl, method);
visitType(type, method.returnType);
if (params != null) {
for (int i = 0; i < params.size(); i++) {
Parameter param = params.get(i);
AField field = method.parameters.getVivify(i);
visitType(param.getType(), field.type);
}
}
if (rcvrParam.isPresent()) {
for (AnnotationExpr expr : rcvrParam.get().getAnnotations()) {
Annotation anno = extractAnnotation(expr);
method.receiver.type.tlAnnotationsHere.add(anno);
}
}
if (typeParams != null) {
for (int i = 0; i < typeParams.size(); i++) {
TypeParameter typeParam = typeParams.get(i);
List<ClassOrInterfaceType> bounds = typeParam.getTypeBound();
if (bounds != null) {
for (int j = 0; j < bounds.size(); j++) {
ClassOrInterfaceType bound = bounds.get(j);
BoundLocation loc = new BoundLocation(i, j);
bound.accept(this, method.bounds.getVivify(loc));
}
}
}
}
return body == null ? null : body.accept(this, method);
}
Aggregations