mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
UseBulkOperationInspection: register BulkMethodInfo via extension points; JPA classes extracted
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
// "Replace iteration with bulk 'CrudRepository.save' call" "true"
|
||||
package org.springframework.data.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
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, Iterable<String> stringsToSave) {
|
||||
repo.save(stringsToSave);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// "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));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// "Replace iteration with bulk 'CrudRepository.save' call" "true"
|
||||
package org.springframework.data.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
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<Iterable<String>, Integer> repo, Iterable<List<String>> stringsToSave) {
|
||||
repo.save(stringsToSave);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace iteration with bulk 'TestClass.test' call" "true"
|
||||
package testpackage;
|
||||
|
||||
interface TestClass<T> {
|
||||
<S extends T> Iterable<S> test(Iterable<S> entities);
|
||||
<S extends T> S test(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(TestClass<CharSequence> repo, Iterable<String> stringsToSave) {
|
||||
repo.test(stringsToSave);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace iteration with bulk 'TestClass.test' call" "true"
|
||||
package testpackage;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
interface TestClass<T> {
|
||||
<S extends T> Iterable<S> test(Iterable<S> entities);
|
||||
<S extends T> S test(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(TestClass<CharSequence> repo, String[] stringsToSave) {
|
||||
repo.test(Arrays.asList(stringsToSave));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace iteration with bulk 'TestClass.test' call" "true"
|
||||
package testpackage;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
interface TestClass<T> {
|
||||
<S extends T> Iterable<S> test(Iterable<S> entities);
|
||||
<S extends T> S test(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(TestClass<Iterable<String>> repo, Iterable<List<String>> stringsToSave) {
|
||||
repo.test(stringsToSave);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
// "Replace iteration with bulk 'CrudRepository.save' call" "true"
|
||||
package org.springframework.data.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
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, Iterable<String> stringsToSave) {
|
||||
stringsToSave.forEach(<caret>repo::save);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// "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);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// "Replace iteration with bulk 'CrudRepository.save' call" "false"
|
||||
package org.springframework.data.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
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, Iterable<List<String>> stringsToSave) {
|
||||
stringsToSave.forEach(<caret>repo::save);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// "Replace iteration with bulk 'CrudRepository.save' call" "true"
|
||||
package org.springframework.data.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
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<Iterable<String>, Integer> repo, Iterable<List<String>> stringsToSave) {
|
||||
stringsToSave.forEach(<caret>repo::save);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace iteration with bulk 'TestClass.test' call" "true"
|
||||
package testpackage;
|
||||
|
||||
interface TestClass<T> {
|
||||
<S extends T> Iterable<S> test(Iterable<S> entities);
|
||||
<S extends T> S test(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(TestClass<CharSequence> repo, Iterable<String> stringsToSave) {
|
||||
stringsToSave.forEach(<caret>repo::test);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace iteration with bulk 'TestClass.test' call" "true"
|
||||
package testpackage;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
interface TestClass<T> {
|
||||
<S extends T> Iterable<S> test(Iterable<S> entities);
|
||||
<S extends T> S test(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(TestClass<CharSequence> repo, String[] stringsToSave) {
|
||||
Arrays.stream(stringsToSave).forEach(<caret>repo::test);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace iteration with bulk 'TestClass.test' call" "false"
|
||||
package testpackage;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
interface TestClass<T> {
|
||||
<S extends T> Iterable<S> test(Iterable<S> entities);
|
||||
<S extends T> S test(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(TestClass<CharSequence> repo, Iterable<List<String>> stringsToSave) {
|
||||
stringsToSave.forEach(<caret>repo::test);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Replace iteration with bulk 'TestClass.test' call" "true"
|
||||
package testpackage;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
interface TestClass<T> {
|
||||
<S extends T> Iterable<S> test(Iterable<S> entities);
|
||||
<S extends T> S test(S entity);
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public void test(TestClass<Iterable<String>> repo, Iterable<List<String>> stringsToSave) {
|
||||
stringsToSave.forEach(<caret>repo::test);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user