protected JavaType _fromVariable(ClassStack context, TypeVariable<?> var, TypeBindings bindings) { // ideally should find it via bindings: final String name = var.getName(); if (bindings == null) throw new Error("No Bindings!"); JavaType type = bindings.findBoundType(name); if (type != null) { return type; } // but if not, use bounds... note that approach here is simplistic; not taking // into account possible multiple bounds, nor consider upper bounds. if (bindings.hasUnbound(name)) { return CORE_TYPE_OBJECT; } bindings = bindings.withUnboundVariable(name); Type[] bounds = var.getBounds(); return _fromAny(context, bounds[0], bindings); }
protected JavaType _fromVariable(ClassStack context, TypeVariable<?> var, TypeBindings bindings) { // ideally should find it via bindings: final String name = var.getName(); if (bindings == null) throw new Error("No Bindings!"); JavaType type = bindings.findBoundType(name); if (type != null) { return type; } // but if not, use bounds... note that approach here is simplistic; not taking // into account possible multiple bounds, nor consider upper bounds. if (bindings.hasUnbound(name)) { return CORE_TYPE_OBJECT; } bindings = bindings.withUnboundVariable(name); Type[] bounds = var.getBounds(); return _fromAny(context, bounds[0], bindings); }
protected JavaType _fromVariable(ClassStack context, TypeVariable<?> var, TypeBindings bindings) { // ideally should find it via bindings: final String name = var.getName(); JavaType type = bindings.findBoundType(name); if (type != null) { return type; } // but if not, use bounds... note that approach here is simplistic; not taking // into account possible multiple bounds, nor consider upper bounds. if (bindings.hasUnbound(name)) { return CORE_TYPE_OBJECT; } bindings = bindings.withUnboundVariable(name); Type[] bounds = var.getBounds(); return _fromAny(context, bounds[0], bindings); }