use of meghanada.reflect.MethodParameter in project meghanada-server by mopemope.
the class MethodAnalyzeVisitor method toMemberDescriptor.
private void toMemberDescriptor() {
String modifier = ASMReflector.toModifier(this.access, this.hasDefault);
if (this.interfaceMethod) {
modifier = ClassNameUtils.replace(modifier, "abstract", "").trim();
}
final CandidateUnit.MemberType memberType = name.equals("<init>") ? CandidateUnit.MemberType.CONSTRUCTOR : CandidateUnit.MemberType.METHOD;
final String methodName = memberType == CandidateUnit.MemberType.CONSTRUCTOR ? this.classAnalyzeVisitor.className : this.name;
final EntryMessage message = log.traceEntry("className={} memberType={} methodName={} returnType={}", this.classAnalyzeVisitor.className, methodName, memberType, this.returnType);
if (methodName.startsWith("lambda$")) {
// skip
log.traceExit(message);
return;
}
if (memberType == CandidateUnit.MemberType.CONSTRUCTOR && methodName.equals(ClassNameUtils.OBJECT_CLASS)) {
// skip
log.traceExit(message);
return;
}
final String returnFQCN = memberType == CandidateUnit.MemberType.CONSTRUCTOR ? methodName : this.returnType.getFQCN();
final List<MethodParameter> methodParameters = this.parameterTypes.stream().map(typeInfo -> new MethodParameter(typeInfo.getFQCN(), typeInfo.paramName)).collect(Collectors.toList());
final MethodDescriptor descriptor = new MethodDescriptor(this.classAnalyzeVisitor.className, methodName, modifier, methodParameters, this.exceptions, returnFQCN, this.hasDefault, memberType);
descriptor.setTypeParameters(this.typeParameters);
log.trace("formalType={}", this.formalType);
if (this.formalType != null) {
descriptor.formalType = this.formalType.toString();
}
this.classAnalyzeVisitor.members.add(descriptor);
log.traceExit(message);
}
Aggregations