Examples of SourceTypeBinding


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

    TypeDeclaration dec = s.referenceContext;
    if (dec instanceof AspectDeclaration) {
      ((AspectDeclaration) dec).buildInterTypeAndPerClause(s);
    }

    SourceTypeBinding sourceType = s.referenceContext.binding;
    // test classes don't extend aspects
    if (sourceType.superclass != null) {
      ResolvedType parent = factory.fromEclipse(sourceType.superclass);
      if (parent.isAspect() && !isAspect(dec)) {
        factory.showMessage(IMessage.ERROR, "class \'" + new String(sourceType.sourceName) + "\' can not extend aspect \'"
            + parent.getName() + "\'", factory.fromEclipse(sourceType).getSourceLocation(), null);
      }
    }

    ReferenceBinding[] memberTypes = sourceType.memberTypes;
    if (memberTypes == null) {
      System.err.println("Unexpectedly found null for memberTypes of " + sourceType.debugName());
    }
    if (memberTypes != null) {
      for (int i = 0, length = memberTypes.length; i < length; i++) {
        buildInterTypeAndPerClause(((SourceTypeBinding) memberTypes[i]).scope);
      }
View Full Code Here

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

    // dec@type in a BinaryTypeBinding (so has to be accessed via bcel) and
    // the
    // affected type is a real SourceTypeBinding. Mostly works (pr128665)
    // 3. ?

    SourceTypeBinding stb = (SourceTypeBinding) tb;
    Annotation[] toAdd = null;
    long abits = 0;

    AbstractMethodDeclaration methodDecl = null;
    // Might have to retrieve the annotation through BCEL and construct an
View Full Code Here

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

    StringBuffer sourceContents = new StringBuffer();
    // put the whole original file in the buffer
    boolean changed = false;
    sourceContents.append(compilationUnitDeclaration.compilationResult.compilationUnit.getContents());
    for (int t = types.length - 1; t >= 0; t--) {
      SourceTypeBinding sourceTypeBinding = compilationUnitDeclaration.scope.topLevelTypes[t];
      if (!hasChanged(sourceTypeBinding)) {
        if (debug) {
          System.out.println(getName(compilationUnitDeclaration) + " has nothing applied");
        }
        continue;
View Full Code Here

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

      if (this.indexOfFirstFieldBinding == 1) { // was an implicit reference to the first field binding
        ReferenceBinding declaringClass = lastFieldBinding.declaringClass;
        // check if accessing enum static field in initializer         
        if (declaringClass.isEnum()) {
          MethodScope methodScope = currentScope.methodScope();
          SourceTypeBinding sourceType = methodScope.enclosingSourceType();
          if (lastFieldBinding.isStatic()
              && (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
              && lastFieldBinding.constant() == Constant.NotAConstant
              && !methodScope.isStatic
              && methodScope.isInsideInitializerOrConstructor()) {
View Full Code Here

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

        FieldBinding fieldBinding = (FieldBinding) this.binding;
        ReferenceBinding declaringClass = fieldBinding.declaringClass;
        // check if accessing enum static field in initializer         
        if (declaringClass.isEnum()) {
          MethodScope methodScope = currentScope.methodScope();
          SourceTypeBinding sourceType = methodScope.enclosingSourceType();
          if (fieldBinding.isStatic()
              && (sourceType == declaringClass || sourceType.superclass == declaringClass) // enum constant body
              && fieldBinding.constant() == Constant.NotAConstant
              && !methodScope.isStatic
              && methodScope.isInsideInitializerOrConstructor()) {
View Full Code Here

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

   */
  private TypeDeclaration getTypeDeclaration() {
    if (realBinding instanceof MethodBinding) {
      MethodBinding mb = (MethodBinding) realBinding;
      if (mb != null) {
        SourceTypeBinding stb = (SourceTypeBinding) mb.declaringClass;
        if (stb != null) {
          ClassScope cScope = stb.scope;
          if (cScope != null) {
            return cScope.referenceContext;
          }
        }
      }
    } else if (realBinding instanceof FieldBinding) {
      FieldBinding fb = (FieldBinding) realBinding;
      if (fb != null) {
        SourceTypeBinding stb = (SourceTypeBinding) fb.declaringClass;
        if (stb != null) {
          ClassScope cScope = stb.scope;
          if (cScope != null) {
            return cScope.referenceContext;
          }
View Full Code Here

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

    scope.compilationUnitScope().recordTypeReference(declaringClass);

    if (isPublic())
      return true;

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

    if (invocationType == declaringClass)
      return true;
View Full Code Here

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

  // very similar to code in AspectDeclaration
  private boolean mungeNewInnerClass(SourceTypeBinding sourceType, ResolvedType onType, NewMemberClassTypeMunger munger,
      boolean isExactTargetType) {

    SourceTypeBinding aspectTypeBinding = (SourceTypeBinding) world.makeTypeBinding(aspectType);

    char[] mungerMemberTypeName = ("$" + munger.getMemberTypeName()).toCharArray();
    ReferenceBinding innerTypeBinding = null;
    for (ReferenceBinding innerType : aspectTypeBinding.memberTypes) {
      char[] compounded = CharOperation.concatWith(innerType.compoundName, '.');
View Full Code Here

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

    }

    ReferenceBinding[] interfaces = sourceTypeBinding.superInterfaces();
    for (int i = 0; i < interfaces.length; i++) {
      if (interfaces[i] instanceof SourceTypeBinding) {
        SourceTypeBinding intSTB = (SourceTypeBinding) interfaces[i];
        addPublicITDSFrom(intSTB, ret);
      }
    }

    if (ret.isEmpty()) {
View Full Code Here

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

        // check that class doesn't extend aspect
        TypeReference parentRef = typeDecl.superclass;
        if (parentRef != null) {
          TypeBinding parentBinding = parentRef.resolvedType;
          if (parentBinding instanceof SourceTypeBinding) {
            SourceTypeBinding parentSTB = (SourceTypeBinding) parentBinding;
            if (parentSTB.scope != null) {
              TypeDeclaration parentDecl = parentSTB.scope.referenceContext;
              if (isAspect(parentDecl)) {
                typeDecl.scope.problemReporter().signalError(typeDecl.sourceStart, typeDecl.sourceEnd,
                    "a class cannot extend an aspect");
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.