如:Pageable pageable =newPageRequest(page, size, sort); 点进PageRequest方法, 可以看到 已经加了@Deprecated .....
/** @deprecated */ @Deprecated public PageRequest(int page, int size, Sort sort) { super(page, size); this.sort = sort; } 往后看,在同一个类中会发现同样的
public static PageRequest of(int page, int size, Direction direction, String... properties) { return of(page, size, Sort.by(direction, properties)); } 把原来的 new PageRequest 改成 PageRequest.of(int page, int size, Sort sort);