Examples of JTypeParameter


Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

    this.typeParams = typeParams;
  }

  @Override
  public void visitFormalTypeParameter(String name) {
    typeParams.add(new JTypeParameter(name, typeParams.size()));
  }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

    }
    if (type instanceof JRawType) {
      return resolveClass(logger, ((JRawType) type).getBaseType());
    }
    if (type instanceof JTypeParameter) {
      JTypeParameter typeParam = (JTypeParameter) type;
      if (!resolveClass(logger, typeParam.getDeclaringClass())) {
        return false;
      }
      for (JClassType bound : typeParam.getBounds()) {
        if (!resolveClass(logger, bound)) {
          return false;
        }
      }
      return true;
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

  private LinkedList<Map<String, JTypeParameter>> scopeStack = new LinkedList<Map<String, JTypeParameter>>();

  public JTypeParameter lookup(String name) {
    for (Map<String, JTypeParameter> scope : scopeStack) {
      JTypeParameter result = scope.get(name);
      if (result != null) {
        return result;
      }
    }
    return null;
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

   */
  public TypeParameterFlowInfo computeTypeParameterExposure(JGenericType type, int index) {
    // check if it has already been computed
    JTypeParameter[] typeParameters = type.getTypeParameters();
    assert (index < typeParameters.length);
    JTypeParameter typeParameter = typeParameters[index];
    TypeParameterFlowInfo queryFlow = typeParameterToFlowInfo.get(typeParameter);
    if (queryFlow != null) {
      return queryFlow;
    }

View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

   * Return the parameter flow info for a type parameter specified by class and
   * index. If the flow info did not previously exist, create it and add it to
   * the work list.
   */
  private TypeParameterFlowInfo getFlowInfo(JGenericType type, int index) {
    JTypeParameter typeParameter = type.getTypeParameters()[index];
    TypeParameterFlowInfo info = typeParameterToFlowInfo.get(typeParameter);
    if (info == null) {
      info = new TypeParameterFlowInfo(type, index);
      typeParameterToFlowInfo.put(typeParameter, info);
      worklist.add(info);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

    return false;
  }

  static void recordTypeParametersIn(JType type, Set<JTypeParameter> params) {
    JTypeParameter isTypeParameter = type.isTypeParameter();
    if (isTypeParameter != null) {
      params.add(isTypeParameter);
    }

    JArrayType isArray = type.isArray();
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

    }

    TreeLogger localLogger =
        logger.branch(TreeLogger.DEBUG, classType.getParameterizedQualifiedSourceName(), null);

    JTypeParameter isTypeParameter = classType.isTypeParameter();
    if (isTypeParameter != null) {
      if (typeParametersInRootTypes.contains(isTypeParameter)) {
        return computeTypeInstantiability(localLogger, isTypeParameter.getFirstBound(), TypePaths
            .createTypeParameterInRootPath(path, isTypeParameter), problems);
      }

      /*
       * This type parameter was not in a root type and therefore it is the
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

    if (tic.isDone() || tic.isPendingInstantiable()) {
      return tic;
    }
    tic.setPendingInstantiable();

    JTypeParameter isLeafTypeParameter = leafType.isTypeParameter();
    if (isLeafTypeParameter != null && !typeParametersInRootTypes.contains(isLeafTypeParameter)) {
      // Don't deal with non root type parameters, but make a TIC entry to
      // save time if it recurs. We assume they're indirectly instantiable.
      tic.setInstantiableSubtypes(true);
      tic.setInstantiable(false);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

          problems);
    }

    JArrayType typeArgAsArray = typeArg.isArray();
    if (typeArgAsArray != null) {
      JTypeParameter parameterOfTypeArgArray = typeArgAsArray.getLeafType().isTypeParameter();
      if (parameterOfTypeArgArray != null) {
        JGenericType declaringClass = parameterOfTypeArgArray.getDeclaringClass();
        if (declaringClass != null) {
          TypeParameterFlowInfo flowInfoForArrayParam =
              getFlowInfo(declaringClass, parameterOfTypeArgArray.getOrdinal());
          TypeParameterFlowInfo otherFlowInfo = getFlowInfo(baseType, paramIndex);
          if (otherFlowInfo.getExposure() >= 0
              && otherFlowInfo.isTransitivelyAffectedBy(flowInfoForArrayParam)) {
            problems.add(baseType, "Cannot serialize type '"
                + baseType.getParameterizedQualifiedSourceName()
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JTypeParameter

  private void markArrayTypes(TreeLogger logger, JArrayType array, TypePath path,
      ProblemReport problems) {
    logger = logger.branch(TreeLogger.DEBUG, "Adding array types for " + array);

    JType leafType = array.getLeafType();
    JTypeParameter isLeafTypeParameter = leafType.isTypeParameter();
    if (isLeafTypeParameter != null) {
      if (typeParametersInRootTypes.contains(isLeafTypeParameter)) {
        leafType = isLeafTypeParameter.getFirstBound(); // to match computeTypeInstantiability
      } else {
        // skip non-root leaf parameters, to match checkArrayInstantiable
        return;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.