Пример #1
0
  /**
   * @ast method
   * @aspect AccessControl
   * @declaredat /home/uoji/JastAddJ/Java1.4Frontend/AccessControl.jrag:167
   */
  public void accessControl() {
    super.accessControl();

    if (!isCircular()) {
      // 9.1.2
      HashSet set = new HashSet();
      for (int i = 0; i < getNumSuperInterfaceId(); i++) {
        TypeDecl decl = getSuperInterfaceId(i).type();

        if (!decl.isInterfaceDecl() && !decl.isUnknown())
          error(
              "interface " + fullName() + " tries to extend non interface type " + decl.fullName());
        if (!decl.isCircular() && !decl.accessibleFrom(this))
          error(
              "interface " + fullName() + " can not extend non accessible type " + decl.fullName());

        if (set.contains(decl))
          error(
              "extended interface "
                  + decl.fullName()
                  + " mentionened multiple times in extends clause");
        set.add(decl);
      }
    }
  }
Пример #2
0
 /**
  * @ast method
  * @aspect PreciseRethrow
  * @declaredat
  *     /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:163
  */
 public void exceptionHandling() {
   Collection<TypeDecl> exceptionTypes = getExpr().throwTypes();
   for (TypeDecl exceptionType : exceptionTypes) {
     if (exceptionType == typeNull()) exceptionType = typeNullPointerException();
     // 8.4.4
     if (!handlesException(exceptionType))
       error("" + this + " throws uncaught exception " + exceptionType.fullName());
   }
 }