Returns the closure of a class or interface type.
358278
public List<Type> closure(Type t) {
        List<Type> cl = closureCache.get(t);
        if (cl == null) {
            Type st = supertype(t);
            if (!t.isCompound()) {
                if (st.hasTag(CLASS)) {
                    cl = insert(closure(st), t);
                } else if (st.hasTag(TYPEVAR)) {
                    cl = closure(st).prepend(t);
                } else {
                    cl = List.of(t);
                }
            } else {
                cl = closure(supertype(t));
            }
            for (List<Type> l = interfaces(t); l.nonEmpty(); l = l.tail)
                cl = union(cl, closure(l.head));
            closureCache.put(t, cl);
        }
        return cl;
    }
1079668
function Return(type) {
    // 
    return function (target, propertyKey, descriptor) {
        if (!target.methodReturns) {
            target.methodReturns = {};
        }
        target.methodReturns[propertyKey] = type;
    };
}
1284449
public static function rowMapper(): Closure
    {
        return static function (stdClass $row): Source {
            return Source::getInstance($row->s_id, Tree::findById((int) $row->s_file), $row->s_gedcom);
        };
    }
198903
public int getTypeId(Class classType) {

        final Class origType = classType;
        while (null != classType) {
            Integer typeObj = (Integer) _typeMap.get(classType);
            if (null != typeObj) {
                return typeObj.intValue();
            }
            classType = classType.getSuperclass();
        }

        //
        // special check for blobs/clobs they are interfaces not derived from
        //
        if (Blob.class.isAssignableFrom(origType)) {
            return _typeMap.get(Blob.class).intValue();
        } else if (Clob.class.isAssignableFrom(origType)) {
            return _typeMap.get(Clob.class).intValue();
        }

        return TYPE_UNKNOWN;
    }
786402
public <T> T with( Closure<T> closure ) {
        return DefaultGroovyMethods.with( null, closure ) ;
    }
265179
public static <S extends Storable> ClosedFilter<S> getClosedFilter(Class<S> type) {
        SoftValuedCache<Object, Filter<S>> filterCache = getFilterCache(type);
        synchronized (filterCache) {
            Filter<S> filter = filterCache.get(CLOSED_KEY);
            if (filter == null) {
                filter = ClosedFilter.getCanonical(type);
                filterCache.put(CLOSED_KEY, filter);
            }
            return (ClosedFilter<S>) filter;
        }
    }
191161
private Class getCollectionType()
  {
    Class collectionType = Collection.class;
    IParsedElement parent = getParsedElement().getParent();
    if( parent instanceof NewExpression )
    {
      IType newType = ((NewExpression)parent).getType();
      IJavaClassInfo classInfo = IRTypeResolver.getJavaBackedClass(newType);
      Class javaBackedClass = classInfo != null ? classInfo.getBackingClass() : null;
      if( classInfo != null && javaBackedClass != null )
      {
        collectionType = javaBackedClass;
      }
      else if( JavaTypes.getJreType(AbstractCollection.class).isAssignableFrom( newType ) )
      {
        collectionType = AbstractCollection.class;
      }
    }
    return collectionType;
  }
1000669
def get_kind(self):
        
        scope = self.parent.get_scope()
        if isinstance(self.parent, PyClass):
            for decorator in self.decorators:
                pyname = rope.base.evaluate.eval_node(scope, decorator)
                if pyname == rope.base.builtins.builtins['staticmethod']:
                    return 'staticmethod'
                if pyname == rope.base.builtins.builtins['classmethod']:
                    return 'classmethod'
            return 'method'
        return 'function'
1251267
public Object use(GroovyObject object, Closure closure) {
        // grab existing meta (usually adaptee but we may have nested use calls)
        MetaClass origMetaClass = object.getMetaClass();
        object.setMetaClass(this);
        try {
            return closure.call();
        } finally {
            object.setMetaClass(origMetaClass);
        }
    }
860844
public static Type getGenericInterfaceType(Object instance, Class<?> iface, int position) {
    Class<?> type = instance.getClass();
    while (type != Object.class) {
      for (Type genericType : type.getGenericInterfaces()) {
        if (genericType instanceof ParameterizedType) {
          ParameterizedType parameterizedType = (ParameterizedType) genericType;
          if (parameterizedType.getRawType() == iface) {
            return parameterizedType.getActualTypeArguments()[position];
          }
        }
      }
      type = type.getSuperclass();
    }
    return null;
  }
872119
public static Closure getMethodPointer(Object object, String methodName) {
        if (object == null) {
            throw new NullPointerException("Cannot access method pointer for '" + methodName + "' on null object");
        }
        return new MethodClosure(object, methodName);
    }
350944
private IRExpression maybeGetFromEnclosingFunction( ICompilableType gsClass, TypeVariableType type, String strTypeVarField )
  {
    if( gsClass.isAnonymous() )
    {
      IDynamicFunctionSymbol dfs = getEnclosingDFS( gsClass );
      if( dfs != null && dfs != getEnclosingDFS( gsClass.getEnclosingType() ) )
      {
        for( IGenericTypeVariable gv : getTypeVarsForDFS( dfs ) )
        {
          if( gv.getName().equals( type.getName() ) )
          {
            return getInstanceField( gsClass, strTypeVarField, getDescriptor( LazyTypeResolver.class ), AccessibilityUtil.forTypeParameter(), pushThisOrOuter( gsClass ) );
          }
        }
      }
    }
    return null;
  }
498362
public static<T extends Object> T getWrapper(Class<T> clientType){
        return getWrapper(clientType,generateClientId(clientType));
    }
335920
function getClosureDep(deps, args) {
  let closureDep = deps.find(d => d.closureSymbols.indexOf('goog') >= 0);

  // We need the path to Closure Library to be able to write a dependency file.
  // Note that if we find base.js via a dependency file (like Closure's deps.js)
  // it doesn't help us - we need the actual path of base.js, but the dependency
  // only knows the relative path from Closure Library to base.js, which is
  // always "base.js".
  if (!args.closurePath && (!closureDep || closureDep.isParsedFromDepsFile())) {
    throw new Error(
        'Could not find path to Closure. Closure\'s base.js either needs to ' +
        'be included or --closure-path provided.');
  }

  if (args.closurePath && closureDep && !closureDep.isParsedFromDepsFile()) {
    throw new Error(
        'Both --closure-path and Closure\'s base.js file should not be ' +
        'inputs.');
  }

  if (args.closurePath && closureDep && closureDep.isParsedFromDepsFile()) {
    closureDep.setClosurePath(args.closurePath);
  }

  if (!closureDep) {
    closureDep = new depGraph.Dependency(
        depGraph.DependencyType.SCRIPT, path.join(args.closurePath, 'base.js'),
        ['goog'], []);
    deps.push(closureDep);
  }

  return closureDep;
}
1105241
def _closure_parent_pk(self):
        """"""
        if hasattr(self, "%s_id" % self._closure_parent_attr):
            return getattr(self, "%s_id" % self._closure_parent_attr)
        else:
            parent = getattr(self, self._closure_parent_attr)
            return parent.pk if parent else None
1125434
public static <T> T identity(Object self, Closure<T> closure) {
        return DefaultGroovyMethods.with(self, closure);
    }
171478
public <T> T get(Class<T> cls, String name, Closure<String,T> closure){
        return Objects.cast(get(name,closure),cls);
    }