public IJavaClassType getGenericReturnType() { if (_genericReturnType == null) { int indexOfName = _methodNode.getChildOfTypeIndex(JavaParser.IDENTIFIER); _genericReturnType = JavaSourceType.createType(this, _methodNode.getChild(indexOfName - 1)); if (_genericReturnType == null) { throw new RuntimeException("Cannot compute return type."); } } return _genericReturnType; }
public IJavaClassType[] getBounds() { if (_bounds == null) { final List<? extends Tree> boundsList = _typeParameter.getBounds(); if (!boundsList.isEmpty()) { _bounds = new IJavaClassType[boundsList.size()]; for (int i = 0; i < _bounds.length; i++) { _bounds[i] = JavaSourceType.createType(_owner, boundsList.get(i)); } } else { _bounds = new IJavaClassType[] {JavaTypes.OBJECT().getBackingClassInfo()}; } } return _bounds; }
@Override public IJavaClassInfo getReturnClassInfo() { if (_returnType == null) { int indexOfName = _methodNode.getChildOfTypeIndex(JavaParser.IDENTIFIER); IJavaASTNode typeNode = _methodNode.getChild(indexOfName - 1); String typeName; if (typeNode instanceof TypeASTNode) { typeName = ((TypeASTNode) typeNode).getTypeName(); } else { typeName = typeNode.getText(); } _returnType = (IJavaClassInfo) JavaSourceType.createType(this, typeName, JavaSourceType.IGNORE_NONE) .getConcreteType(); if (_returnType == null) { throw new RuntimeException("Cannot compute return type."); } } return _returnType; }