Examples of resolveBinding()


Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

  @Test
  public void testFieldInitializer() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("FieldInit", FIELD_INIT);
    MethodDeclaration c = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(c.resolveBinding());
    VariableDeclarationFragment f = EclipseTACSimpleTestDriver.getFirstField(cu);
    Expression init = f.getInitializer();
    Assert.assertNotNull(init);

    TACInstruction decl = tac.instruction(f);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testFieldInitNew() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("FieldInitNew", FIELD_INIT_NEW);
    MethodDeclaration c = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(c.resolveBinding());
    VariableDeclarationFragment f = EclipseTACSimpleTestDriver.getFirstField(cu);
    Expression init = f.getInitializer();
    Assert.assertNotNull(init);

    TACInstruction decl = tac.instruction(f);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

 
  @Test
  public void testFieldNoInitializer() throws Exception {
    CompilationUnit cu = EclipseTACSimpleTestDriver.parseCode("FieldNoInit", FIELD_NO_INIT);
    MethodDeclaration c = EclipseTACSimpleTestDriver.getFirstMethod(cu);
    EclipseTAC tac = new EclipseTAC(c.resolveBinding());
    VariableDeclarationFragment f = EclipseTACSimpleTestDriver.getFirstField(cu);
    Expression init = f.getInitializer();
    Assert.assertNull(init);

    TACInstruction decl = tac.instruction(f);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodDeclaration.resolveBinding()

    return compilationUnitCache.getSignatures(type, methodName);
  }

  public void changeInvocationsTo(String fromClass, String fromMethodName, String[] fromSignature, String code) {
    MethodDeclaration fromMethodDeclaration = compilationUnitCache.getMethodDeclaration(fromClass, fromMethodName, fromSignature);
    final IMethod fromMethod = (IMethod) fromMethodDeclaration.resolveBinding().getJavaElement();

    BlockModifier blockModifier = new ConvertMethodInvocationToCode(fromMethod, code);
    modifyBlocks(fromMethod, blockModifier);
  }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.Name.resolveBinding()

    switch (node.getNodeType()) {
    case ASTNode.SIMPLE_NAME:
    case ASTNode.QUALIFIED_NAME: {
      final Name name = (Name) node;

      if (name.resolveBinding().getJavaElement() == null)
        throw new DefinitelyNotEnumerizableException(
            Messages.ASTNodeProcessor_NonEnumerizableTypeEncountered, node);
      else {
        final IJavaElement elem = name.resolveBinding()
            .getJavaElement();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.QualifiedName.resolveBinding()

          new EclipseSuperFieldAccess(target, eclipseVariableQuery),
          eclipseVariableQuery);
    }
    if(targetNode instanceof QualifiedName) {
      QualifiedName target = (QualifiedName) targetNode;
      IBinding binding = target.resolveBinding();
      if(binding instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) binding;
        if(vb.isField()) {
          return new StoreFieldInstructionImpl(
              node,
View Full Code Here

Examples of org.eclipse.jdt.core.dom.QualifiedName.resolveBinding()

        }
      }
    }
    if(targetNode instanceof SimpleName) {
      SimpleName target = (SimpleName) targetNode;
      IBinding binding = target.resolveBinding();
      if(binding instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) binding;
        if(vb.isField()) {
          // implicit field access on this
          return new StoreFieldInstructionImpl(
View Full Code Here

Examples of org.eclipse.jdt.core.dom.SimpleName.resolveBinding()

    if (node.getExpression() instanceof SimpleName)
    {
      SimpleName var = (SimpleName) node.getExpression();
      String varName = var.getIdentifier();

      IBinding exprBinding = var.resolveBinding();

      if ( "it".equals(varName) && exprBinding instanceof IVariableBinding ) // call on 'it' field
      {
        IVariableBinding varBinding = (IVariableBinding) exprBinding;
        IMethodBinding mockMethod = getSurroundingMockMethod(node);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.SimpleName.resolveBinding()

   * Example: (2 in 1java.lang.System.out.println("Hello");
   */
  public boolean visit(QualifiedName node) {
    SimpleName name = node.getName();
    Name qualifier = node.getQualifier();
    IBinding nameBinding = name.resolveBinding();
    // If this is a Field access, then add children to CFG
    if(nameBinding.getKind() == IBinding.VARIABLE) {
      IVariableBinding variableBinding = (IVariableBinding) nameBinding;
      if(variableBinding.isField()) {
        ControlFlowNode nameCFN = controlFlowNode.newControlFlowNode(name);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.SimpleName.resolveBinding()

        }
      }
    }
    if(targetNode instanceof SimpleName) {
      SimpleName target = (SimpleName) targetNode;
      IBinding binding = target.resolveBinding();
      if(binding instanceof IVariableBinding) {
        IVariableBinding vb = (IVariableBinding) binding;
        if(vb.isField()) {
          // implicit field access on this
          return new StoreFieldInstructionImpl(
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.