Examples of SourceTypeBinding


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

    scope.compilationUnitScope().recordTypeReference(declaringClass);
    // System.err.println("canBeSeenBy: " + this + ", " + isPublic());
    if (isPublic())
      return true;

    SourceTypeBinding invocationType = scope.invocationType();
    // System.out.println("receiver: " + receiverType + ", " + invocationType);
    ReferenceBinding declaringType = declaringClass;

    // FIXME asc what about parameterized types and private ITD generic fields on interfaces?
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

    this.assertionSyntheticFieldBinding = assertionSyntheticFieldBinding;

    // we need to add the field right now, because the field infos are generated before the methods
    if (needClassLiteralField) {
      SourceTypeBinding sourceType =
        this.scope.outerMostClassScope().enclosingSourceType();
      // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=22334
      if (!sourceType.isInterface() && !sourceType.isBaseType()) {     
        this.classLiteralSyntheticField = sourceType.addSyntheticFieldForClassLiteral(sourceType, scope);
      }
    }
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

  IJavaElement res;
  if(fieldBinding.declaringClass instanceof ParameterizedTypeBinding) {
    LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)fieldBinding.declaringClass).genericType();
    res = findLocalElement(localTypeBinding.sourceStart());
  } else {
    SourceTypeBinding typeBinding = (SourceTypeBinding)fieldBinding.declaringClass;
    res = findLocalElement(typeBinding.sourceStart());
  }
  if (res != null && res.getElementType() == IJavaElement.TYPE) {
    IType type = (IType) res;
    IField field= type.getField(new String(fieldBinding.name));
    if (field.exists()) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

  IJavaElement res;
  if(typeVariableBinding.declaringElement instanceof ParameterizedTypeBinding) {
    LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)typeVariableBinding.declaringElement).genericType();
    res = findLocalElement(localTypeBinding.sourceStart());
  } else {
    SourceTypeBinding typeBinding = (SourceTypeBinding)typeVariableBinding.declaringElement;
    res = findLocalElement(typeBinding.sourceStart());
  }
  if (res != null && res.getElementType() == IJavaElement.TYPE) {
    IType type = (IType) res;
    ITypeParameter typeParameter = type.getTypeParameter(new String(typeVariableBinding.sourceName));
    if (typeParameter.exists()) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

    List<SourceTypeBinding> aspectsToProcess = new ArrayList<SourceTypeBinding>();
    for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
      CompilationUnitScope cus = units[i].scope;
      SourceTypeBinding[] stbs = cus.topLevelTypes;
      for (int j = 0; j < stbs.length; j++) {
        SourceTypeBinding stb = stbs[j];
        typesToProcess.add(stb);
        TypeDeclaration typeDeclaration = stb.scope.referenceContext;
        if (typeDeclaration instanceof AspectDeclaration) {
          aspectsToProcess.add(stb);
        }
      }
    }
    factory.getWorld().getCrosscuttingMembersSet().reset();

    // Need to do these before the other ITDs
    for (SourceTypeBinding aspectToProcess : aspectsToProcess) {
      processInterTypeMemberTypes(aspectToProcess.scope);
    }

    while (typesToProcess.size() > 0) {
      // removes types from the list as they are processed...
      collectAllITDsAndDeclares(typesToProcess.get(0), typesToProcess);
    }

    factory.finishTypeMungers();

    // now do weaving
    List<ConcreteTypeMunger> typeMungers = factory.getTypeMungers();

    List<DeclareParents> declareParents = factory.getDeclareParents();
    List<DeclareAnnotation> declareAnnotationOnTypes = factory.getDeclareAnnotationOnTypes();

    doPendingWeaves();

    // We now have some list of types to process, and we are about to apply
    // the type mungers.
    // There can be situations where the order of types passed to the
    // compiler causes the
    // output from the compiler to vary - THIS IS BAD. For example, if we
    // have class A
    // and class B extends A. Also, an aspect that 'declare parents: A+
    // implements Serializable'
    // then depending on whether we see A first, we may or may not make B
    // serializable.

    // The fix is to process them in the right order, ensuring that for a
    // type we process its
    // supertypes and superinterfaces first. This algorithm may have
    // problems with:
    // - partial hierarchies (e.g. suppose types A,B,C are in a hierarchy
    // and A and C are to be woven but not B)
    // - weaving that brings new types in for processing (see
    // pendingTypesToWeave.add() calls) after we thought
    // we had the full list.
    //
    // but these aren't common cases (he bravely said...)
    boolean typeProcessingOrderIsImportant = declareParents.size() > 0 || declareAnnotationOnTypes.size() > 0; // DECAT

    if (typeProcessingOrderIsImportant) {
      typesToProcess = new ArrayList<SourceTypeBinding>();
      for (int i = lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
        CompilationUnitScope cus = units[i].scope;
        SourceTypeBinding[] stbs = cus.topLevelTypes;
        for (int j = 0; j < stbs.length; j++) {
          SourceTypeBinding stb = stbs[j];
          typesToProcess.add(stb);
        }
      }

      List<SourceTypeBinding> stb2 = new ArrayList<SourceTypeBinding>();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

    doSupertypesFirst(sourceType.superclass(), yetToProcess);

    // now check our membertypes (pr119570)
    ReferenceBinding[] memberTypes = sourceType.memberTypes;
    for (int i = 0, length = memberTypes.length; i < length; i++) {
      SourceTypeBinding rb = (SourceTypeBinding) memberTypes[i];
      if (!rb.superclass().equals(sourceType)) {
        doSupertypesFirst(rb.superclass(), yetToProcess);
      }
    }

    buildInterTypeAndPerClause(sourceType.scope);
    addCrosscuttingStructures(sourceType.scope);
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

    typesToProcess.remove(typeToWeave);
  }

  private void doPendingWeaves() {
    for (Iterator i = pendingTypesToWeave.iterator(); i.hasNext();) {
      SourceTypeBinding t = (SourceTypeBinding) i.next();
      ContextToken tok = CompilationAndWeavingContext.enteringPhase(
          CompilationAndWeavingContext.WEAVING_INTERTYPE_DECLARATIONS, t.sourceName);
      weaveInterTypeDeclarations(t);
      CompilationAndWeavingContext.leavingPhase(tok);
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

    if (dec instanceof AspectDeclaration) {
      ResolvedType typeX = factory.fromEclipse(dec.binding);
      factory.getWorld().getCrosscuttingMembersSet().addAdviceLikeDeclares(typeX);
    }

    SourceTypeBinding sourceType = s.referenceContext.binding;
    ReferenceBinding[] memberTypes = sourceType.memberTypes;
    for (int i = 0, length = memberTypes.length; i < length; i++) {
      addAdviceLikeDeclares(((SourceTypeBinding) memberTypes[i]).scope);
    }
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

      if (typeX.getSuperclass().isAspect() && !typeX.getSuperclass().isExposedToWeaver()) {
        factory.getWorld().getCrosscuttingMembersSet().addOrReplaceAspect(typeX.getSuperclass(), false);
      }
    }

    SourceTypeBinding sourceType = s.referenceContext.binding;
    ReferenceBinding[] memberTypes = sourceType.memberTypes;
    for (int i = 0, length = memberTypes.length; i < length; i++) {
      addCrosscuttingStructures(((SourceTypeBinding) memberTypes[i]).scope);
    }
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding

    }
  }

  private void resolvePointcutDeclarations(ClassScope s) {
    TypeDeclaration dec = s.referenceContext;
    SourceTypeBinding sourceType = s.referenceContext.binding;
    boolean hasPointcuts = false;
    AbstractMethodDeclaration[] methods = dec.methods;
    boolean initializedMethods = false;
    if (methods != null) {
      for (int i = 0; i < methods.length; i++) {
        if (methods[i] instanceof PointcutDeclaration) {
          hasPointcuts = true;
          if (!initializedMethods) {
            sourceType.methods(); // force initialization
            initializedMethods = true;
          }
          ((PointcutDeclaration) methods[i]).resolvePointcut(s);
        }
      }
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.