Examples of FieldDeclaration


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_ENUM_VALUES,
            ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
          needRecheck = true;
View Full Code Here

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(
            fieldName,
            ("_" + String.valueOf(index++)).toCharArray()); //$NON-NLS-1$
          needRecheck = true;
View Full Code Here

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

        ? 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

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

        }

        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

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

        }

        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

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

  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

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

                // completion is inside an initializer
                searchVisibleVariablesAndMethods(scope, this.visibleLocalVariables, this.visibleFields, this.visibleMethods, notInJavadoc);
                break done;
              }
            } else {
              FieldDeclaration fieldDeclaration = fields[i];             
              if (fieldDeclaration.initialization != null) {
                boolean isInsideInitializer = false;
                if (fieldDeclaration.initialization.sourceEnd > 0) {
                  if (fieldDeclaration.initialization.sourceStart <= astNode.sourceStart &&
                      astNode.sourceEnd <= fieldDeclaration.initialization.sourceEnd) {
View Full Code Here

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

    type.sourceEnd());
}
public void abstractMethodInAbstractClass(SourceTypeBinding type, AbstractMethodDeclaration methodDecl) {
  if (type.isEnum() && type.isLocalType()) {
    FieldBinding field = type.scope.enclosingMethodScope().initializedField;
    FieldDeclaration decl = field.sourceField();
    String[] arguments = new String[] {new String(decl.name), new String(methodDecl.selector)};
    this.handle(
      IProblem.AbstractMethodInEnum,
      arguments,
      arguments,
View Full Code Here

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

  }
}
public void abstractMethodInConcreteClass(SourceTypeBinding type) {
  if (type.isEnum() && type.isLocalType()) {
    FieldBinding field = type.scope.enclosingMethodScope().initializedField;
    FieldDeclaration decl = field.sourceField();
    String[] arguments = new String[] {new String(decl.name)};
    this.handle(
      IProblem.EnumConstantCannotDefineAbstractMethod,
      arguments,
      arguments,
      decl.sourceStart(),
      decl.sourceEnd());
  } else {
    String[] arguments = new String[] {new String(type.sourceName())};
    this.handle(
      IProblem.AbstractMethodsInConcreteClass,
      arguments,
View Full Code Here

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

  }
}
public void abstractMethodMustBeImplemented(SourceTypeBinding type, MethodBinding abstractMethod) {
  if (type.isEnum() && type.isLocalType()) {
    FieldBinding field = type.scope.enclosingMethodScope().initializedField;
    FieldDeclaration decl = field.sourceField();
    this.handle(
      // Must implement the inherited abstract method %1
      // 8.4.3 - Every non-abstract subclass of an abstract type, A, must provide a concrete implementation of all of A's methods.
      IProblem.EnumConstantMustImplementAbstractMethod,
      new String[] {
              new String(abstractMethod.selector),
              typesAsString(abstractMethod, false),
              new String(decl.name),
      },
      new String[] {
              new String(abstractMethod.selector),
              typesAsString(abstractMethod, true),
              new String(decl.name),
      },
      decl.sourceStart(),
      decl.sourceEnd());
  } else {
    this.handle(
      // Must implement the inherited abstract method %1
      // 8.4.3 - Every non-abstract subclass of an abstract type, A, must provide a concrete implementation of all of A's methods.
      IProblem.AbstractMethodMustBeImplemented,
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.