private static String inferMethodTypeName(CtMethod method) { try { if ( method.getMethodInfo2().getAttribute( SignatureAttribute.tag ) == null ) { return method.getReturnType().getName(); } return inferGenericTypeName( method.getReturnType(), SignatureAttribute.toMethodSignature( method.getGenericSignature() ).getReturnType() ); } catch (BadBytecode ignore) { return null; } catch (NotFoundException e) { return null; } }
if (method.getGenericSignature() != null) { SignatureAttribute.MethodSignature methodSignature = SignatureAttribute.toMethodSignature(method.getGenericSignature()); List<ResolvedType> parametersOfReturnType = parseTypeParameters(methodSignature.getReturnType().toString(), typeSolver, invokationContext); ResolvedType newReturnType = methodUsage.returnType();
if (method.getGenericSignature() != null) { SignatureAttribute.MethodSignature methodSignature = SignatureAttribute.toMethodSignature(method.getGenericSignature()); List<ResolvedType> parametersOfReturnType = parseTypeParameters(methodSignature.getReturnType().toString(), typeSolver, invokationContext); ResolvedType newReturnType = methodUsage.returnType();
if (method.getGenericSignature() != null) { SignatureAttribute.MethodSignature methodSignature = SignatureAttribute.toMethodSignature(method.getGenericSignature()); List<ResolvedType> parametersOfReturnType = parseTypeParameters(methodSignature.getReturnType().toString(), typeSolver, invokationContext); ResolvedType newReturnType = methodUsage.returnType();
public TypeInfo getReturnType() { if (returnType != null) return returnType; MethodSignature sig = getMethodSignature(); boolean doneReturn = false; if (sig != null) { if (sig.getReturnType() instanceof BaseType == false) { returnType = typeInfo.getFactory().getTypeInfo(typeInfo.getClassLoaderInternal(), sig.getReturnType(), BytecodeTypeVariableSpy.createForBehavior(((BytecodeClassInfo)getDeclaringClass()).getClassSignature(), sig)); doneReturn = true; } } if (!doneReturn) { String name = SignatureKey.getReturnType(behaviour); try { returnType = typeInfo.getFactory().getTypeInfo(name, typeInfo.getClassLoaderInternal()); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return returnType; }
public TypeInfo getReturnType() { if (returnType != null) return returnType; try { CtMethod ctMethod = (CtMethod)ctBehavior; MethodSignature sig = getMethodSignature(); if (sig != null) { if (sig.getReturnType() instanceof BaseType == false) return typeInfo.getFactory().getTypeInfo(typeInfo.getClassLoaderInternal(), sig.getReturnType(), JavassistTypeVariableSpy.createForBehavior(((JavassistClassInfo)getDeclaringClass()).getClassSignature(), sig)); } CtClass clazz = ctMethod.getReturnType(); returnType = typeInfo.getFactory().getTypeInfo(clazz); } catch (NotFoundException e) { throw JavassistTypeInfoFactoryImpl.raiseClassNotFound("for return type of method " + getName(), e); } return returnType; }
private static String inferMethodTypeName(CtMethod method) { try { if ( method.getMethodInfo2().getAttribute( SignatureAttribute.tag ) == null ) { return method.getReturnType().getName(); } return inferGenericTypeName( method.getReturnType(), SignatureAttribute.toMethodSignature( method.getGenericSignature() ).getReturnType() ); } catch (BadBytecode ignore) { return null; } catch (NotFoundException e) { return null; } }
private static InternalMethodDefinition toInternalMethodDefinition(CtMethod ctMethod, SymbolResolver resolver) { try { Map<String, TypeUsageNode.TypeVariableData> visibleTypeVariables = getVisibleTypeVariables(ctMethod); TypeUsage returnType = toTypeUsage(ctMethod.getReturnType(), resolver); if (ctMethod.getGenericSignature() != null) { SignatureAttribute.MethodSignature methodSignature = SignatureAttribute.toMethodSignature(ctMethod.getGenericSignature()); returnType = toTypeUsage(methodSignature.getReturnType(), resolver, visibleTypeVariables); } return new InternalMethodDefinition(ctMethod.getName(), formalParameters(ctMethod, resolver), returnType, JavassistTypeDefinitionFactory.toMethodDefinition(ctMethod)); } catch (NotFoundException e) { throw new RuntimeException(e); } catch (BadBytecode badBytecode) { throw new RuntimeException(badBytecode); } }
@Override public ResolvedType getReturnType() { try { if (ctMethod.getGenericSignature() != null) { javassist.bytecode.SignatureAttribute.Type genericSignatureType = SignatureAttribute.toMethodSignature(ctMethod.getGenericSignature()).getReturnType(); return JavassistUtils.signatureTypeToType(genericSignatureType, typeSolver, this); } else { return JavassistFactory.typeUsageFor(ctMethod.getReturnType(), typeSolver); } } catch (NotFoundException e) { throw new RuntimeException(e); } catch (BadBytecode e) { throw new RuntimeException(e); } }
@Override public ResolvedType getReturnType() { try { if (ctMethod.getGenericSignature() != null) { javassist.bytecode.SignatureAttribute.Type genericSignatureType = SignatureAttribute.toMethodSignature(ctMethod.getGenericSignature()).getReturnType(); return JavassistUtils.signatureTypeToType(genericSignatureType, typeSolver, this); } else { return JavassistFactory.typeUsageFor(ctMethod.getReturnType(), typeSolver); } } catch (NotFoundException e) { throw new RuntimeException(e); } catch (BadBytecode e) { throw new RuntimeException(e); } }
@Override public ResolvedType getReturnType() { try { if (ctMethod.getGenericSignature() != null) { javassist.bytecode.SignatureAttribute.Type genericSignatureType = SignatureAttribute.toMethodSignature(ctMethod.getGenericSignature()).getReturnType(); return JavassistUtils.signatureTypeToType(genericSignatureType, typeSolver, this); } else { return JavassistFactory.typeUsageFor(ctMethod.getReturnType(), typeSolver); } } catch (NotFoundException | BadBytecode e) { throw new RuntimeException(e); } }