报错 Inferred type 'S' for type parameter 'S' is not within its bound; 解决办法

出现情况:

Inferred type 'S' for type parameter 'S' is not within its bound;

should extends xxxxxx

出现这种问题的原因:

  SpringBoot 版本问题,SpringBoot 2.0后新特性。

解决方法:

  1、修改版本,降为SpringBoot 1.5.x;

  2、修改代码:

修改前:  return this.userRepository.findOne(id);
修改后:  return this.userRepository.findById(id).orElse(null);

原文地址:https://www.cnblogs.com/da19951208/p/10231743.html