mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
generify: collapse to diamond when applicable
This commit is contained in:
@@ -0,0 +1 @@
|
||||
java.util.ArrayList<java.lang.String>\nnew
|
||||
@@ -0,0 +1 @@
|
||||
java.util.ArrayList\nnew
|
||||
@@ -0,0 +1,6 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
class Test
|
||||
{
|
||||
ArrayList<String> l = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
class Test
|
||||
{
|
||||
ArrayList<String> l = new ArrayList();
|
||||
}
|
||||
@@ -17,9 +17,11 @@ package com.intellij.refactoring;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.refactoring.typeCook.Settings;
|
||||
@@ -667,6 +669,18 @@ public class TypeCookTest extends MultiFileTestCase {
|
||||
start();
|
||||
}
|
||||
|
||||
public void testConvertToDiamond() throws Exception {
|
||||
final LanguageLevelProjectExtension levelProjectExtension = LanguageLevelProjectExtension.getInstance(getProject());
|
||||
final LanguageLevel oldLevel = levelProjectExtension.getLanguageLevel();
|
||||
try {
|
||||
levelProjectExtension.setLanguageLevel(LanguageLevel.JDK_1_8);
|
||||
start();
|
||||
}
|
||||
finally {
|
||||
levelProjectExtension.setLanguageLevel(oldLevel);
|
||||
}
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
start(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user