mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
UseBulkOperationInspection: qualifier expression checked; arrays support fixed for CrudRepository.save
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// "Replace iteration with bulk 'CrudRepository.save' call" "true"
|
||||
package org.springframework.data.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
interface CrudRepository<T,ID extends Serializable> {
|
||||
<S extends T> Iterable<S> save(Iterable<S> entities);
|
||||
<S extends T> S save(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(CrudRepository<CharSequence, Integer> repo, String[] stringsToSave) {
|
||||
repo.save(Arrays.asList(stringsToSave));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace iteration with bulk 'CrudRepository.save' call" "true"
|
||||
package org.springframework.data.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
interface CrudRepository<T,ID extends Serializable> {
|
||||
<S extends T> Iterable<S> save(Iterable<S> entities);
|
||||
<S extends T> S save(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(CrudRepository<CharSequence, Integer> repo, String[] stringsToSave) {
|
||||
Arrays.stream(stringsToSave).forEach(<caret>repo::save);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user