code: static boolean isInitializer(Env<AttrContext> env) {
          Symbol owner = env.info.scope.owner;
          return owner.isConstructor() ||
              owner.owner.kind == TYP &&
              (owner.kind == VAR ||
               owner.kind == MTH && (owner.flags() & BLOCK) != 0) &&
              (owner.flags() & STATIC) == 0;
      }
docs: An environment is an "initializer" if it is a constructor or
  an instance initializer.