Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment


    }
    classFile.addAttributes();
    unitResult.record(typeBinding.constantPoolName(), classFile);
  }
  public static ClassFile getNewInstance(SourceTypeBinding typeBinding) {
    LookupEnvironment env = typeBinding.scope.environment();
    return env.classFilePool.acquire(typeBinding);
  }
View Full Code Here


                  }
                  TypeBinding[] alternateArguments;
                  // need to clone for each iteration to avoid env paramtype cache interference
                  System.arraycopy(paramCastType.arguments, 0, alternateArguments = new TypeBinding[length], 0, length);
                  alternateArguments[i] = scope.getJavaLangObject();
                  LookupEnvironment environment = scope.environment();
                  ParameterizedTypeBinding alternateCastType = environment.createParameterizedType((ReferenceBinding)castType.erasure(), alternateArguments, castType.enclosingType());
                  if (alternateCastType.findSuperTypeOriginatingFrom(expressionType) == match) {
                    this.bits |= ASTNode.UnsafeCast;
                    break;
                  }
                }
View Full Code Here

    singleTypeReference.resolvedType = binaryTypeBinding;
    return singleTypeReference;
  }

  private static LookupEnvironment createMockLookupEnvironment() {
    LookupEnvironment lookupEnvironment = new LookupEnvironment(null, new CompilerOptions(),
        null, null);
    return lookupEnvironment;
  }
View Full Code Here

  public void testFindAllBinaryTypeReferenceSites() {
    CompilationResult compilationResult = new CompilationResult(
        "TestCompilationUnit.java".toCharArray(), 0, 0, 0);
    CompilationUnitDeclaration cud = new CompilationUnitDeclaration(null,
        compilationResult, 1);
    LookupEnvironment lookupEnvironment = createMockLookupEnvironment();
    cud.scope = new CompilationUnitScope(cud, lookupEnvironment);

    TypeDeclaration typeDeclaration = new TypeDeclaration(compilationResult);
    typeDeclaration.scope = new ClassScope(cud.scope, null);
    typeDeclaration.staticInitializerScope = new MethodScope(
View Full Code Here

    }
    classFile.addAttributes();
    unitResult.record(typeBinding.constantPoolName(), classFile);
  }
  public static ClassFile getNewInstance(SourceTypeBinding typeBinding) {
    LookupEnvironment env = typeBinding.scope.environment();
    return env.classFilePool.acquire(typeBinding);
  }
View Full Code Here

      && ((ParameterizedGenericMethodBinding) this.binding).isRaw;
  }

  public boolean isSubsignature(IMethodBinding otherMethod) {
    try {
      LookupEnvironment lookupEnvironment = this.resolver.lookupEnvironment();
      return lookupEnvironment != null
        && lookupEnvironment.methodVerifier().isMethodSubsignature(this.binding, ((MethodBinding) otherMethod).binding);
    } catch (AbortCompilation e) {
      // don't surface internal exception to clients
      // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=143013
      return false;
    }
View Full Code Here

  /**
   * @see IMethodBinding#overrides(IMethodBinding)
   */
  public boolean overrides(IMethodBinding otherMethod) {
      LookupEnvironment lookupEnvironment = this.resolver.lookupEnvironment();
      return lookupEnvironment != null
        && lookupEnvironment.methodVerifier().doesMethodOverride(this.binding, ((MethodBinding) otherMethod).binding);
  }
View Full Code Here

                  }
                  TypeBinding[] alternateArguments;
                  // need to clone for each iteration to avoid env paramtype cache interference
                  System.arraycopy(paramCastType.arguments, 0, alternateArguments = new TypeBinding[length], 0, length);
                  alternateArguments[i] = scope.getJavaLangObject();
                  LookupEnvironment environment = scope.environment();
                  ParameterizedTypeBinding alternateCastType = environment.createParameterizedType((ReferenceBinding)castType.erasure(), alternateArguments, castType.enclosingType());
                  if (alternateCastType.findSuperTypeOriginatingFrom(expressionType) == match) {
                    this.bits |= ASTNode.UnsafeCast;
                    break;
                  }
                }
View Full Code Here

    }
    classFile.addAttributes();
    unitResult.record(typeBinding.constantPoolName(), classFile);
  }
  public static ClassFile getNewInstance(SourceTypeBinding typeBinding) {
    LookupEnvironment env = typeBinding.scope.environment();
    return env.classFilePool.acquire(typeBinding);
  }
View Full Code Here

   
    TypeBinding match = overriderBinding.declaringClass.findSuperTypeOriginatingFrom(overriddenBinding.declaringClass);
    if (!(match instanceof ReferenceBinding)) return false;

    org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] superMethods = ((ReferenceBinding)match).getMethods(selector);
    LookupEnvironment lookupEnvironment = _env.getLookupEnvironment();
    if (lookupEnvironment == null) return false;
    MethodVerifier methodVerifier = lookupEnvironment.methodVerifier();
    for (int i = 0, length = superMethods.length; i < length; i++) {
      if (superMethods[i].original() == overriddenBinding) {
        return methodVerifier.doesMethodOverride(overriderBinding, superMethods[i]);
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment

Copyright © 2018 www.massapicom. 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.