Package org.aspectj.org.eclipse.jdt.internal.compiler.env

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.env.AccessRestriction


      // ignore cases where field is used from within inside itself
      field.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
    }

    if ((field.modifiers & ExtraCompilerModifiers.AccRestrictedAccess) != 0) {
      AccessRestriction restriction =
        scope.environment().getAccessRestriction(field.declaringClass.erasure());
      if (restriction != null) {
        scope.problemReporter().forbiddenReference(field, this,
            restriction.getFieldAccessMessageTemplate(), restriction.getProblemId());
      }
    }

    if (!field.isViewedAsDeprecated()) return false;
View Full Code Here


    // TODO (maxime) consider separating concerns between deprecation and access restriction.
    //          Caveat: this was not the case when access restriction funtion was added.
    if (isExplicitUse && (method.modifiers & ExtraCompilerModifiers.AccRestrictedAccess) != 0) {
      // note: explicit constructors calls warnings are kept despite the 'new C1()' case (two
      //       warnings, one on type, the other on constructor), because of the 'super()' case.
      AccessRestriction restriction =
        scope.environment().getAccessRestriction(method.declaringClass.erasure());
      if (restriction != null) {
        if (method.isConstructor()) {
          scope.problemReporter().forbiddenReference(method, this,
              restriction.getConstructorAccessMessageTemplate(),
              restriction.getProblemId());
        }
        else {
          scope.problemReporter().forbiddenReference(method, this,
              restriction.getMethodAccessMessageTemplate(),
              restriction.getProblemId());
        }
      }
    }

    if (!method.isViewedAsDeprecated()) return false;
View Full Code Here

      // ignore cases where type is used from within inside itself
      ((ReferenceBinding)refType.erasure()).modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
    }

    if (refType.hasRestrictedAccess()) {
      AccessRestriction restriction = scope.environment().getAccessRestriction(type.erasure());
      if (restriction != null) {
        scope.problemReporter().forbiddenReference(type, this, restriction.getMessageTemplate(), restriction.getProblemId());
      }
    }

    // force annotations resolution before deciding whether the type may be deprecated
    refType.initializeDeprecatedAnnotationTagBits();
View Full Code Here

            }
            break;
        }

        // Accept document path
        AccessRestriction accessRestriction = null;
        if (access != null) {
          // Compute document relative path
          int pkgLength = (record.pkg==null || record.pkg.length==0) ? 0 : record.pkg.length+1;
          int nameLength = record.simpleName==null ? 0 : record.simpleName.length;
          char[] path = new char[pkgLength+nameLength];
View Full Code Here

            }
            break;
        }

        // Accept document path
        AccessRestriction accessRestriction = null;
        if (access != null) {
          // Compute document relative path
          int pkgLength = (record.pkg==null || record.pkg.length==0) ? 0 : record.pkg.length+1;
          int nameLength = record.simpleName==null ? 0 : record.simpleName.length;
          char[] path = new char[pkgLength+nameLength];
View Full Code Here

            }
            break;
        }

        // Accept document path
        AccessRestriction accessRestriction = null;
        if (access != null) {
          // Compute document relative path
          int qualificationLength = (record.qualification == null || record.qualification.length == 0) ? 0 : record.qualification.length + 1;
          int nameLength = record.simpleName == null ? 0 : record.simpleName.length;
          char[] path = new char[qualificationLength + nameLength];
View Full Code Here

    }
    char[] packageName = type.getPackageFragment().getElementName().toCharArray();
    boolean isBinary = type instanceof BinaryType;
   
    // determine associated access restriction
    AccessRestriction accessRestriction = null;
   
    if (this.checkAccessRestrictions && (isBinary || !type.getJavaProject().equals(this.project))) {
      PackageFragmentRoot root = (PackageFragmentRoot)type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
      ClasspathEntry entry = (ClasspathEntry) this.nameLookup.rootToResolvedEntries.get(root);
      if (entry != null) { // reverse map always contains resolved CP entry
View Full Code Here

    IJavaProject javaProject = null;
    Answer suggestedAnswer = null;
    for (int i= 0; i < length; i++) {
      type = findType(typeName, packages[i], partialMatch, acceptFlags);
      if (type != null) {
        AccessRestriction accessRestriction = null;
        if (checkRestrictions) {
          accessRestriction = getViolatedRestriction(typeName, packageName, type, accessRestriction);
        }
        Answer answer = new Answer(type, accessRestriction);
        if (!answer.ignoreIfBetter()) {
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.env.AccessRestriction

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.