Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.ASTNode


    if (location instanceof InvocationSite) {
      InvocationSite site = (InvocationSite) location;
      start = site.sourceStart();
      end = site.sourceEnd();
    } else if (location instanceof ASTNode) {
      ASTNode node = (ASTNode) location;
      start = node.sourceStart();
      end = node.sourceEnd();
    }
  }
  this.handle(
    IProblem.IsClassPathCorrect,
    arguments,
View Full Code Here


  int severity = computeSeverity(IProblem.UnsafeReturnTypeOverride);
  if (severity == ProblemSeverities.Ignore) return;
  int start = type.sourceStart();
  int end = type.sourceEnd();
  if (currentMethod.declaringClass == type) {
    ASTNode location = ((MethodDeclaration) currentMethod.sourceMethod()).returnType;
    start = location.sourceStart();
    end = location.sourceEnd();
  }
  this.handle(
      IProblem.UnsafeReturnTypeOverride,
      new String[] {
        new String(currentMethod.returnType.readableName()),
View Full Code Here

    this.lookupEnvironment.unitBeingCompleted = this.compilationUnitDeclaration;
    try {
      this.hasComputedVisibleElementBindings = true;
 
      Scope scope = this.assistScope;
      ASTNode astNode = this.assistNode;
      boolean notInJavadoc = this.completionContext.javadoc == 0;
 
      this.visibleLocalVariables = new ObjectVector();
      this.visibleFields = new ObjectVector();
      this.visibleMethods = new ObjectVector();
View Full Code Here

  }

  private ASTNode[] computeMergedMemberDeclarations(ASTNode[] nodes){
    ArrayList mergedNodes = new ArrayList();
    for (int i = 0, max = nodes.length; i < max; i++) {
      ASTNode currentNode = nodes[i];
      if (currentNode instanceof FieldDeclaration) {
        FieldDeclaration currentField = (FieldDeclaration) currentNode;
        if (mergedNodes.size() == 0) {
          // first node
          mergedNodes.add(currentNode);
        } else {
          // we need to check if the previous merged node is a field declaration
          ASTNode previousMergedNode = (ASTNode) mergedNodes.get(mergedNodes.size() - 1);
          if (previousMergedNode instanceof MultiFieldDeclaration) {
            // we merge the current node
            MultiFieldDeclaration multiFieldDeclaration = (MultiFieldDeclaration) previousMergedNode;
            int length = multiFieldDeclaration.declarations.length;
            System.arraycopy(multiFieldDeclaration.declarations, 0, multiFieldDeclaration.declarations= new FieldDeclaration[length+1], 0, length);
View Full Code Here

            }
            continue;
          }
          // next member is a field
          if (fieldStart == previousFieldStart){
            ASTNode previousMember = members[index - 1];
            if (previousMember instanceof MultiFieldDeclaration) {
              MultiFieldDeclaration multiField = (MultiFieldDeclaration) previousMember;
              int length = multiField.declarations.length;
              System.arraycopy(multiField.declarations, 0, multiField.declarations=new FieldDeclaration[length+1], 0, length);
              multiField.declarations[length] = field;
View Full Code Here

        int[] operators = builder.operators();
        do {
          try {
            final int max = fragmentsSize - 1;
            for (int i = 0; i < max; i++) {
              ASTNode fragment = fragments[i];
              fragment.traverse(this, scope);
              this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
              if (this.scribe.lastNumberOfNewLines == 1) {
                // a new line has been inserted while printing the comment
                // hence we need to use the break indentation level before printing next token...
                this.scribe.indentationLevel = binaryExpressionAlignment.breakIndentationLevel;
View Full Code Here

    boolean ok = false;
    int startIndex = 0;
    do {
      try {
        for (int i = startIndex, max = mergedNodes.length; i < max; i++) {
          ASTNode member = mergedNodes[i];
          if (member instanceof FieldDeclaration) {
            isChunkStart = memberAlignment.checkChunkStart(FIELD, i, this.scribe.scanner.currentPosition);
            if (member instanceof MultiFieldDeclaration){
              MultiFieldDeclaration multiField = (MultiFieldDeclaration) member;
              format(multiField, this, null, isChunkStart, i == 0);
View Full Code Here

            while (isNextToken(TerminalTokens.TokenNameSEMICOLON)) {
              this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);
              this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
            }
            this.scribe.printNewLine();
            ASTNode member = members[i];
            if (member instanceof FieldDeclaration) {
              isChunkStart = memberAlignment.checkChunkStart(Alignment.CHUNK_FIELD, i, this.scribe.scanner.currentPosition);
              if (member instanceof MultiFieldDeclaration) {
                MultiFieldDeclaration multiField = (MultiFieldDeclaration) member;
 
View Full Code Here

    this.scribe.enterAlignment(binaryExpressionAlignment);
    boolean ok = false;
    do {
      try {
        for (int i = 0; i < fragmentsSize - 1; i++) {
          ASTNode fragment = fragments[i];
          fragment.traverse(this, scope);
          this.scribe.printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT);
          if (this.scribe.lastNumberOfNewLines == 1) {
            // a new line has been inserted by printComment(CodeFormatter.K_UNKNOWN, Scribe.BASIC_TRAILING_COMMENT)
            this.scribe.indentationLevel = binaryExpressionAlignment.breakIndentationLevel;
          }
View Full Code Here

  }

  // check inconsistent null checks
  if ((this.tagBits & FlowContext.DEFER_NULL_DIAGNOSTIC) != 0) { // within an enclosing loop, be conservative
    for (int i = 0; i < this.nullCount; i++) {
      ASTNode location = this.nullReferences[i];
      switch (this.nullCheckTypes[i] & ~HIDE_NULL_COMPARISON_WARNING_MASK) {
        case ASSIGN_TO_NONNULL:
          int nullStatus = flowInfo.nullStatus(this.nullLocals[i]);
          if (nullStatus != FlowInfo.NON_NULL) {
            this.parent.recordNullityMismatch(scope, (Expression) location,
                this.providedExpectedTypes[i][0], this.providedExpectedTypes[i][1], nullStatus);
          }
          break;
        case IN_UNBOXING:
          checkUnboxing(scope, (Expression) location, flowInfo);
          break;
        default:
          this.parent.recordUsingNullReference(scope, this.nullLocals[i],
              this.nullReferences[i]this.nullCheckTypes[i], flowInfo);
      }

    }
  }
  else { // no enclosing loop, be as precise as possible right now
    for (int i = 0; i < this.nullCount; i++) {
      ASTNode location = this.nullReferences[i];
      // final local variable
      LocalVariableBinding local = this.nullLocals[i];
      switch (this.nullCheckTypes[i] & ~HIDE_NULL_COMPARISON_WARNING_MASK) {
        case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NULL:
        case CAN_ONLY_NULL_NON_NULL | IN_COMPARISON_NON_NULL:
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.ast.ASTNode

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.