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

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


    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_OUTER_LOCAL_PREFIX,
            actualOuterLocalVariable.name,
            ("$" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
View Full Code Here


    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          if (this.scope.compilerOptions().complianceLevel >= ClassFileConstants.JDK1_5) {
            synthField.name = CharOperation.concat(
              synthField.name,
              "$".toCharArray()); //$NON-NLS-1$
View Full Code Here

  // ensure there is not already such a field defined by the user
  FieldBinding existingField;
  if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
    TypeDeclaration typeDecl = blockScope.referenceType();
    for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
      FieldDeclaration fieldDecl = typeDecl.fields[i];
      if (fieldDecl.binding == existingField) {
        blockScope.problemReporter().duplicateFieldInType(this, fieldDecl);
        break;
      }
    }
View Full Code Here

    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_ASSERT_DISABLED,
            ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
          needRecheck = true;
View Full Code Here

    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            TypeConstants.SYNTHETIC_ENUM_VALUES,
            ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
          needRecheck = true;
View Full Code Here

    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = this.getField(synthField.name, true /*resolve*/)) != null) {
      TypeDeclaration typeDecl = this.scope.referenceContext;
      for (int i = 0, max = typeDecl.fields.length; i < max; i++) {
        FieldDeclaration fieldDecl = typeDecl.fields[i];
        if (fieldDecl.binding == existingField) {
          synthField.name = CharOperation.concat(
            fieldName,
            ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
          needRecheck = true;
View Full Code Here

        ? this.scope.referenceContext.staticInitializerScope
        : this.scope.referenceContext.initializerScope;
      FieldBinding previousField = initializationScope.initializedField;
      try {
        initializationScope.initializedField = field;
        FieldDeclaration fieldDecl = fieldDecls[f];
        TypeBinding fieldType =
          fieldDecl.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT
            ? initializationScope.environment().convertToRawType(this, false /*do not force conversion of enclosing types*/) // enum constant is implicitly of declaring enum type
            : fieldDecl.type.resolveType(initializationScope, true /* check bounds*/);
        field.type = fieldType;
        field.modifiers &= ~ExtraCompilerModifiers.AccUnresolved;
        if (fieldType == null) {
View Full Code Here

        }

        if (x.fields != null) {
          // Process fields
          for (int i = 0, n = x.fields.length; i < n; ++i) {
            FieldDeclaration fieldDeclaration = x.fields[i];
            if (fieldDeclaration.isStatic()) {
              // clinit
              currentMethod = currentClass.getMethods().get(0);
              currentMethodBody = (JMethodBody) currentMethod.getBody();
              currentMethodScope = x.staticInitializerScope;
            } else {
View Full Code Here

        }

        if (x.fields != null) {
          // Process fields
          for (int i = 0, n = x.fields.length; i < n; ++i) {
            FieldDeclaration fieldDeclaration = x.fields[i];
            if (fieldDeclaration.isStatic()) {
              // clinit
              currentMethod = currentClass.getMethods().get(0);
              currentMethodBody = (JMethodBody) currentMethod.getBody();
              currentMethodScope = x.staticInitializerScope;
            } else {
View Full Code Here

  private boolean resolveFields(TreeLogger logger, JClassType type,
      FieldDeclaration[] jfields) {
    if (jfields != null) {
      for (int i = 0; i < jfields.length; i++) {
        FieldDeclaration jfield = jfields[i];
        if (!resolveField(logger, type, jfield)) {
          return false;
        }
      }
    }
View Full Code Here

TOP

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

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.