Package org.eclipse.jdt.core.dom

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


   
    AnnotationSummary summary = annoDB.getSummaryForMethod(method.resolveBinding());
   
    for (int ndx = 0; ndx < method.parameters().size(); ndx++) {
      SingleVariableDeclaration decl = (SingleVariableDeclaration) method.parameters().get(ndx);
      Variable paramVar = getAnalysisContext().getSourceVariable(decl.resolveBinding());
     
      if (summary.getParameter(ndx, BranchingNPEAnalysis.NON_NULL_ANNO) != null) //is this parameter annotated with @Nonnull?
        def.put(paramVar, NullLatticeElement.NOT_NULL);
    }
   
View Full Code Here


   
    AnnotationSummary summary = annoDB.getSummaryForMethod(method.resolveBinding());
   
    for (int ndx = 0; ndx < method.parameters().size(); ndx++) {
      SingleVariableDeclaration decl = (SingleVariableDeclaration) method.parameters().get(ndx);
      Variable paramVar = getAnalysisContext().getSourceVariable(decl.resolveBinding());
     
      if (summary.getParameter(ndx, AnnotatedNPEAnalysis.NON_NULL_ANNO) != null) //is this parameter annotated with @Nonnull?
        def.put(paramVar, NullLatticeElement.NOT_NULL);
    }
   
View Full Code Here

      removeAbstractModifier(methodDeclaration.modifiers());

      List parameters = methodDeclaration.parameters();
      for (int i = 0; i < parameters.size(); i++) {
        SingleVariableDeclaration parameter = (SingleVariableDeclaration) parameters.get(i);
        code = code.replaceAll("\\$\\{" + Integer.toString(i) + "\\}", parameter.resolveBinding().getName()); //$NON-NLS-1$ //$NON-NLS-2$
      }

      Block block = JDTUtils.parseBlock(code);
      block = (Block) ASTNode.copySubtree(methodDeclaration.getAST(), block);
View Full Code Here

    case ASTNode.SINGLE_VARIABLE_DECLARATION: {
      // its a formal parameter.
      final SingleVariableDeclaration svd = (SingleVariableDeclaration) node;
      // take care of local usage.
      final IJavaElement elem = svd.resolveBinding().getJavaElement();

      if (elem.isReadOnly() || svd.getName().resolveBoxing())
        throw new DefinitelyNotEnumerizableException(
            Messages.ASTNodeProcessor_SourceNotPresent, node);
      if (svd.resolveBinding().getType().isEqualTo(
View Full Code Here

      final IJavaElement elem = svd.resolveBinding().getJavaElement();

      if (elem.isReadOnly() || svd.getName().resolveBoxing())
        throw new DefinitelyNotEnumerizableException(
            Messages.ASTNodeProcessor_SourceNotPresent, node);
      if (svd.resolveBinding().getType().isEqualTo(
          node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
        throw new NonEnumerizableASTException(Messages.ASTNodeProcessor_IllegalArrayUpcast,
            svd);

      this.found.add(elem);
View Full Code Here

  public boolean visit(MethodDeclaration node) {
    if (node.getName().getStartPosition() == this.loc) {
      final SingleVariableDeclaration svd = (SingleVariableDeclaration) node
          .parameters().get(this.paramNumber);

      final IJavaElement elem = svd.resolveBinding().getJavaElement();
      if (elem.isReadOnly() || svd.getName().resolveBoxing())
        throw new DefinitelyNotEnumerizableException(
            Messages.ASTNodeProcessor_SourceNotPresent, svd);
      if (svd.resolveBinding().getType().isEqualTo(
          node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
View Full Code Here

      final IJavaElement elem = svd.resolveBinding().getJavaElement();
      if (elem.isReadOnly() || svd.getName().resolveBoxing())
        throw new DefinitelyNotEnumerizableException(
            Messages.ASTNodeProcessor_SourceNotPresent, svd);
      if (svd.resolveBinding().getType().isEqualTo(
          node.getAST().resolveWellKnownType("java.lang.Object"))) //$NON-NLS-1$
        throw new NonEnumerizableASTException(Messages.ASTNodeProcessor_IllegalArrayUpcast,
            svd);
      this.elements.add(elem);
    }
View Full Code Here

        lMethodID.append(AbstractFamixEntity.METHOD_START_BRACE);

        List<SingleVariableDeclaration> parameters = getASTNode().parameters();
        for (int i = 0; i < parameters.size(); i++) {
            SingleVariableDeclaration parameter = parameters.get(i);
            IVariableBinding lVariableBinding = parameter.resolveBinding();
            if (lVariableBinding != null) {
                lMethodID.append(convertParameterTypeBindingForMethodSignature(lVariableBinding.getType()));
            } else {
                lMethodID.append(convertParameterTypeForMethodSignature(parameter));
            }
View Full Code Here

   
    //first, create fresh variables for all the parameters
    Iterator itr = method.parameters().iterator();
    while (itr.hasNext()) {
      SingleVariableDeclaration param = (SingleVariableDeclaration) itr.next();
      Variable paramVar = getAnalysisContext().getSourceVariable(param.resolveBinding());
     
      ObjectLabel fresh = new DefaultObjectLabel(param.getType().resolveBinding(), false);
      entry.addPointsTo(paramVar, fresh);
      entry.addLabel(fresh);
    }
View Full Code Here

    //once we have all starting variables, figure out who might point to who
    itr = method.parameters().iterator();
    while (itr.hasNext()) {
      SingleVariableDeclaration param = (SingleVariableDeclaration) itr.next();
      Variable paramVar = getAnalysisContext().getSourceVariable(param.resolveBinding());
      entry.addPointsToAnySubtype(paramVar, param.getType().resolveBinding());
    }
   
    return entry;
  }
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.