mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
BulkMethodInfo: support for Java 1.4 (fixes EA-101278).
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace iteration with bulk 'Collection.addAll' call" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Collect {
|
||||
class Person {}
|
||||
|
||||
void collectNames(Person[] persons){
|
||||
List names = new ArrayList();
|
||||
names.addAll(Arrays.asList(persons));
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace iteration with bulk 'Collection.addAll' call" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Collect {
|
||||
class Person {}
|
||||
|
||||
void collectNames(Person[] persons){
|
||||
List names = new ArrayList();
|
||||
for(int i = 0; i<persons.length; i = i + 1) {
|
||||
Person p = persons[i];
|
||||
names.<caret>add(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -20,6 +20,9 @@ import com.intellij.codeInspection.bulkOperation.BulkMethodInfo;
|
||||
import com.intellij.codeInspection.bulkOperation.BulkMethodInfoProvider;
|
||||
import com.intellij.codeInspection.bulkOperation.UseBulkOperationInspection;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -58,4 +61,21 @@ public class UseBulkOperationInspectionTest extends LightQuickFixParameterizedTe
|
||||
protected String getBasePath() {
|
||||
return "/codeInsight/daemonCodeAnalyzer/quickFix/useBulkOperation";
|
||||
}
|
||||
|
||||
public static class UseBulkOperationJava14Test extends UseBulkOperationInspectionTest {
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return super.getBasePath()+"/java14";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LanguageLevel getLanguageLevel() {
|
||||
return LanguageLevel.JDK_1_4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Sdk getProjectJDK() {
|
||||
return IdeaTestUtil.getMockJdk14();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user