Package org.aspectj.ajdt.internal.compiler.lookup

Examples of org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.fromBinding()


    FormalBinding[] bindings = new FormalBinding[baseArgumentCount];
    for (int i = 0, len = baseArgumentCount; i < len; i++) {
      Argument arg = arguments[i];
      String name = new String(arg.name);
      UnresolvedType type = world.fromBinding(parameters[i]);
      // pr268710: allow for inner interfaces in a generic aspect
      if (parameters[i].isInterface() && parameters[i].isParameterizedType() && parameters[i].isMemberType()) {
        TypeVariableBinding[] tvs = parameters[i].typeVariables();
        if (tvs == null || tvs.length == 0) {
          type = type.getRawType();
View Full Code Here


    } else if (depthCounter == 0) { // Allow case testSuperItds_pr198196_2/3

      char[] accessName;
      if (call.isSuperAccess() && !call.binding.isStatic()) {
        call.receiver = new ThisReference(call.receiver.sourceStart, call.receiver.sourceEnd);
        accessName = NameMangler.superDispatchMethod(factory.fromBinding(targetClass), new String(superBinding.selector))
            .toCharArray();
      } else if (call.receiver.isThis() && call.binding.isProtected() && !call.binding.isStatic()) {
        // XXX this is a hack that violates some binary compatibility rules
        ReferenceBinding superBindingDeclaringClass = superBinding.declaringClass;
        if (superBindingDeclaringClass.isParameterizedType()) {
View Full Code Here

        ReferenceBinding superBindingDeclaringClass = superBinding.declaringClass;
        if (superBindingDeclaringClass.isParameterizedType()) {
          superBindingDeclaringClass = ((ParameterizedTypeBinding) superBindingDeclaringClass).type;
        }
        if (superBindingDeclaringClass.equals(targetClass)) {
          accessName = NameMangler.protectedDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
        } else {
          accessName = NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
        }
View Full Code Here

        }
        if (superBindingDeclaringClass.equals(targetClass)) {
          accessName = NameMangler.protectedDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
        } else {
          accessName = NameMangler.superDispatchMethod(factory.fromBinding(targetClass),
              new String(superBinding.selector)).toCharArray();
        }
      } else {
        return;
      }
View Full Code Here

      scope.problemReporter().signalError(sourceStart, sourceEnd,
          "Intertype declared member types can only be static (compiler limitation)");
      return null;
    }

    ResolvedType declaringType = world.fromBinding(onTypeResolvedBinding).resolve(world.getWorld());
    if (declaringType.isRawType() || declaringType.isParameterizedType()) {
      declaringType = declaringType.getGenericType();
    }

    if (interTypeScope == null) {
View Full Code Here

    if (hasPre) {
      final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);

      codeStream.invokestatic(world.makeMethodBindingForCall(
        AjcMemberMaker.ajcPreClinitMethod(
          world.fromBinding(classScope.referenceContext.binding)
        )));
    }
    super.generateSyntheticCode(classScope, codeStream);
  }
 
View Full Code Here

    if (hasPost) {
      final EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(classScope);

      codeStream.invokestatic(world.makeMethodBindingForCall(
        AjcMemberMaker.ajcPostClinitMethod(
          world.fromBinding(classScope.referenceContext.binding)
        )));
    }
   
    if (initFailureField != null) {
      // Changes to this exception handling code may require changes to
View Full Code Here

      // now create a ResolvedPointcutDefinition,make an attribute out of
      // it, and add it to the method
      UnresolvedType[] paramTypes = new UnresolvedType[bindings.length];
      for (int i = 0; i < paramTypes.length; i++)
        paramTypes[i] = bindings[i].getType();
      ResolvedPointcutDefinition resPcutDef = new ResolvedPointcutDefinition(factory.fromBinding(((TypeDeclaration) typeStack
          .peek()).binding), methodDeclaration.modifiers, "anonymous", paramTypes, pc);
      AjAttribute attr = new AjAttribute.PointcutDeclarationAttribute(resPcutDef);
      ((AjMethodDeclaration) methodDeclaration).addAttribute(new EclipseAttributeAdapter(attr));
    } catch (ParserException pEx) {
      methodDeclaration.scope.problemReporter().parseError(pcLocation[0] + pEx.getLocation().getStart(),
View Full Code Here

    FormalBinding[] ret = new FormalBinding[mDecl.arguments.length];
    for (int i = 0; i < mDecl.arguments.length; i++) {
      Argument arg = mDecl.arguments[i];
      String name = new String(arg.name);
      TypeBinding argTypeBinding = mDecl.binding.parameters[i];
      UnresolvedType type = factory.fromBinding(argTypeBinding);
      if (CharOperation.equals(joinPoint, argTypeBinding.signature())
          || CharOperation.equals(joinPointStaticPart, argTypeBinding.signature())
          || CharOperation.equals(joinPointEnclosingStaticPart, argTypeBinding.signature())
          || CharOperation.equals(proceedingJoinPoint, argTypeBinding.signature()) || name.equals(extraArgName)) {
        ret[i] = new FormalBinding.ImplicitFormalBinding(type, name, i);
View Full Code Here

  }

  private MethodDeclaration makePreMethod(ClassScope scope, ExplicitConstructorCall explicitConstructorCall) {
    EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(scope);

    UnresolvedType aspectTypeX = world.fromBinding(binding.declaringClass);
    UnresolvedType targetTypeX = world.fromBinding(onTypeBinding);

    ArrayBinding objectArrayBinding = scope.createArrayType(scope.getJavaLangObject(), 1);

    MethodDeclaration pre = new MethodDeclaration(compilationResult);
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.