use of com.intellij.openapi.roots.LanguageLevelProjectExtension in project intellij-community by JetBrains.
the class TypeMigrationByThreadLocalRuleTest method testLanguageLevel.
public void testLanguageLevel() throws Exception {
final LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(getProject());
final LanguageLevel languageLevel = extension.getLanguageLevel();
try {
extension.setLanguageLevel(LanguageLevel.JDK_1_3);
doTestFieldType("i", myJavaFacade.getElementFactory().createTypeFromText("java.lang.ThreadLocal", null));
} finally {
extension.setLanguageLevel(languageLevel);
}
}
use of com.intellij.openapi.roots.LanguageLevelProjectExtension in project intellij-community by JetBrains.
the class BooleanMethodInvertedTest method testMethodReferenceIgnored.
public void testMethodReferenceIgnored() throws Exception {
final LanguageLevelProjectExtension projectExtension = LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject());
final LanguageLevel oldLevel = projectExtension.getLanguageLevel();
try {
projectExtension.setLanguageLevel(LanguageLevel.JDK_1_8);
doTest();
} finally {
projectExtension.setLanguageLevel(oldLevel);
}
}
use of com.intellij.openapi.roots.LanguageLevelProjectExtension in project intellij-community by JetBrains.
the class UnnecessaryParenthesesInspectionTest method test.
public void test() throws Exception {
final UnnecessaryParenthesesInspection inspection = new UnnecessaryParenthesesInspection();
inspection.ignoreParenthesesOnConditionals = true;
final LanguageLevelProjectExtension levelProjectExtension = LanguageLevelProjectExtension.getInstance(getProject());
final LanguageLevel level = levelProjectExtension.getLanguageLevel();
try {
levelProjectExtension.setLanguageLevel(LanguageLevel.JDK_1_8);
doTest("com/siyeh/igtest/style/unnecessary_parentheses", new LocalInspectionToolWrapper(inspection), "java 1.8");
} finally {
levelProjectExtension.setLanguageLevel(level);
}
}
use of com.intellij.openapi.roots.LanguageLevelProjectExtension in project intellij-community by JetBrains.
the class InterfaceNeverImplementedInspectionTest method test.
public void test() throws Exception {
final LanguageLevelProjectExtension levelProjectExtension = LanguageLevelProjectExtension.getInstance(getProject());
final LanguageLevel level = levelProjectExtension.getLanguageLevel();
try {
levelProjectExtension.setLanguageLevel(LanguageLevel.JDK_1_8);
doTest("com/siyeh/igtest/inheritance/interface_never_implemented", new LocalInspectionToolWrapper(new InterfaceNeverImplementedInspection()), "java 1.8");
} finally {
levelProjectExtension.setLanguageLevel(level);
}
}
use of com.intellij.openapi.roots.LanguageLevelProjectExtension in project intellij-community by JetBrains.
the class ExtractMethodTest method doTestWithJava17.
private void doTestWithJava17() throws Exception {
LanguageLevelProjectExtension projectExtension = LanguageLevelProjectExtension.getInstance(getProject());
LanguageLevel oldLevel = projectExtension.getLanguageLevel();
try {
projectExtension.setLanguageLevel(LanguageLevel.JDK_1_7);
doTest();
} finally {
projectExtension.setLanguageLevel(oldLevel);
}
}
Aggregations