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

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


    if (scope == null) { // synthetic fields do not have a scope nor any annotations
      this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
      return 0;
    }
    TypeDeclaration typeDecl = scope.referenceContext;
    FieldDeclaration fieldDecl = typeDecl.declarationOf(originalField);
    if (fieldDecl != null) {
      MethodScope initializationScope = isStatic() ? typeDecl.staticInitializerScope : typeDecl.initializerScope;
      FieldBinding previousField = initializationScope.initializedField;
      int previousFieldID = initializationScope.lastVisibleFieldID;
      try {
View Full Code Here


    needRecheck = false;
    FieldBinding existingField;
    if ((existingField = 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 = 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 = 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 = 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 = 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 = 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

      this.contents[this.contentsOffset++] = (byte) (signatureIndex >> 8);
      this.contents[this.contentsOffset++] = (byte) signatureIndex;
      attributesNumber++;
    }
    if (this.targetJDK >= ClassFileConstants.JDK1_5) {
      FieldDeclaration fieldDeclaration = fieldBinding.sourceField();
      if (fieldDeclaration != null) {
        Annotation[] annotations = fieldDeclaration.annotations;
        if (annotations != null) {
          attributesNumber += generateRuntimeAnnotations(annotations);
        }
View Full Code Here

    this.contents[this.contentsOffset++] = (byte) (fieldCount >> 8);
    this.contents[this.contentsOffset++] = (byte) fieldCount;

    FieldDeclaration[] fieldDecls = currentBinding.scope.referenceContext.fields;
    for (int i = 0, max = fieldDecls == null ? 0 : fieldDecls.length; i < max; i++) {
      FieldDeclaration fieldDecl = fieldDecls[i];
      if (fieldDecl.binding != null) {
        addFieldInfo(fieldDecl.binding);
      }
    }
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.