Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
61,600
void () { int i = 0; do { ProgressManager.checkCanceled(); i++; } while (i < 100); }
foo
61,601
void () { int i = 0; <warning descr="Cancellation check 'com.intellij.openapi.progress.ProgressManager.checkCanceled' should be the first statement in a loop body">do<caret></warning> i++; while (i < 100); }
foo
61,602
void () { int i = 0; <warning descr="Cancellation check 'com.intellij.openapi.progress.ProgressManager.checkCanceled' should be the first statement in a loop body">while<caret></warning> (i < 5) i++; }
foo
61,603
void (PsiElement a1, String b1) { System.out.println(<warning descr="Potential memory leak: don't hold PsiElement, use SmartPsiElementPointer instead. See also LocalQuickFixOnPsiElement.">a</warning>); System.out.println(b); System.out.println(a1); System.out.println(b1); }
a
61,604
void (PsiElement a1, String b1) { System.out.println(a); System.out.println(b); System.out.println(a1); System.out.println(b1); }
a
61,605
void (PsiElement a, String b) { class B implements LocalQuickFix { B(PsiElement aa) { } private void a(PsiElement a1, String b1) { System.out.println(<warning descr="Potential memory leak: don't hold PsiElement, use SmartPsiElementPointer instead. See also LocalQuickFixOnPsiElement.">a</warning>); System.out.println(b)...
test
61,606
void (PsiElement a1, String b1) { System.out.println(<warning descr="Potential memory leak: don't hold PsiElement, use SmartPsiElementPointer instead. See also LocalQuickFixOnPsiElement.">a</warning>); System.out.println(b); System.out.println(a1); System.out.println(b1); }
a
61,607
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,608
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,609
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,610
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,611
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,612
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,613
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,614
void () { configureByFile(getTestName(true) + ".java"); }
doTest
61,615
void () { doTestResolved("something:2020.1", "201"); }
testGradle2020_1
61,616
void () { doTestResolved("something:2016.2", "162"); }
testGradle2016_2
61,617
void () { doTestResolved("something:193.6911.18", "193.6911.18"); }
testGradle193_6911_18
61,618
void () { doTestResolved("something:202.6397-EAP-CANDIDATE-SNAPSHOT", "202.6397"); }
testGradle202_6397_EAP_CANDIDATE_SNAPSHOT
61,619
void () { doTestResolved("something:201-EAP-SNAPSHOT", "201"); }
testGradle201_EAP_SNAPSHOT
61,620
void () { doTestResolved("Gradle: com.jetbrains:ideaLocal:IU-222.SNAPSHOT", "222.SNAPSHOT"); }
testGradleLocalPath_IU_Snapshot
61,621
void () { doTestResolved("Gradle: com.jetbrains:ideaLocal:IU-2020.1", "201.0"); }
testGradleLocalPath_IU_2020_1
61,622
void () { doTestResolved("Gradle: com.jetbrains:ideaLocal:IC-213.7172.25", "213.7172.25"); }
testGradleLocalPath_IC_2021_3_3
61,623
void () { doTestResolved("Gradle: com.jetbrains:ideaLocal:OC-213.7172.21", "213.7172.21"); }
testGradleLocalPath_AC_2021_3_3
61,624
void (String libraryName, String expectedBuildNumber) { setupPlatformLibrary(libraryName); try { final PluginPlatformInfo info = PluginPlatformInfo.forModule(getModule()); assertEquals(PluginPlatformInfo.PlatformResolveStatus.GRADLE, info.getResolveStatus()); assertEquals(BuildNumber.fromString(expectedBuildNumber), in...
doTestResolved
61,625
void () { doTestUnresolved(null); }
testGradleUnresolvedNoPlatformClass
61,626
void () { myFixture.addClass("package com.intellij.ui.components; public class JBList {}"); doTestUnresolved(null); }
testGradleUnresolvedPlatformClassNotInLibrary
61,627
void () { doTestUnresolved("something"); }
testGradleUnresolvedLibraryNameNoVersion
61,628
void () { doTestUnresolved("something:20."); }
testGradleUnresolvedLibraryBadVersion
61,629
void () { doTestUnresolved("something:2012345"); }
testGradleUnresolvedLibraryMissingBranchVersion
61,630
void (@Nullable String libraryName) { if (libraryName != null) { setupPlatformLibrary(libraryName); } try { final PluginPlatformInfo info = PluginPlatformInfo.forModule(getModule()); assertEquals(PluginPlatformInfo.PlatformResolveStatus.UNRESOLVED, info.getResolveStatus()); assertNull(info.getSinceBuildNumber()); } fin...
doTestUnresolved
61,631
void (String libraryName) { String platformApiJar = PathUtil.getJarPathForClass(JBList.class); File file = new File(platformApiJar); PsiTestUtil.addLibrary(getModule(), libraryName, file.getParent(), file.getName()); }
setupPlatformLibrary
61,632
void (String libraryName) { Library library = LibraryUtil.findLibrary(getModule(), libraryName); PsiTestUtil.removeLibrary(getModule(), library); }
removePlatformLibrary
61,633
void (JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.addLibrary("platform-util", PathUtil.getJarPathForClass(Attribute.class)); moduleBuilder.addLibrary("platform-lang-impl", PathUtil.getJarPathForClass(CustomizableConsoleFoldingBean.class)); }
tuneFixture
61,634
void () { List<String> randomMethodNames = generateRandomMethodNames(); myFixture.configureByText("plugin.xml", generatePluginXmlText(randomMethodNames)); PsiClass psiClass = myFixture.addClass(generateJavaClassText(randomMethodNames)); PlatformTestUtil.startPerformanceTest("Locating extension tag by PsiClass", 2000, (...
testLocatingByPsiClass
61,635
List<String> () { return IntStream.range(0, 1000) .mapToObj(i -> UUID.randomUUID().toString().replace("-", "").toLowerCase()) .collect(Collectors.toList()); }
generateRandomMethodNames
61,636
String (List<String> methodNames) { StringBuilder sb = new StringBuilder("package myPkg;\n\npublic class MyClass {\n"); methodNames.forEach(s -> sb.append(" public void ").append(s).append("() {}\n")); sb.append("}"); return sb.toString(); }
generateJavaClassText
61,637
String (List<String> methodNames) { StringBuilder sb = new StringBuilder() .append("<idea-plugin>\n") .append(" <id>com.intellij</id>\n") .append(" <name>myPlugin</name>\n"); sb.append(" <extensionPoints>"); sb.append(" <extensionPoint name=\"stacktrace.fold\"" + " beanClass=\"com.intellij.execution.console.Customizabl...
generatePluginXmlText
61,638
void () { myFixture.copyFileToProject("simple.xml", "META-INF/plugin.xml"); assertSameElements(DescriptorUtil.getPluginAndOptionalDependenciesIds(getModule()), "com.intellij.example"); }
testSimple
61,639
void () { myFixture.copyFileToProject("withDependency.xml", "META-INF/plugin.xml"); assertSameElements(DescriptorUtil.getPluginAndOptionalDependenciesIds(getModule()), "com.intellij.example"); }
testWithDependency
61,640
void () { myFixture.copyFileToProject("withOptionalDependency.xml", "META-INF/plugin.xml"); assertSameElements(DescriptorUtil.getPluginAndOptionalDependenciesIds(getModule()), "com.intellij.example", "my.dependency"); }
testWithOptionalDependency
61,641
String () { return DevkitJavaTestsUtil.TESTDATA_PATH + "util/descriptor"; }
getBasePath
61,642
String () { return DevkitJavaTestsUtil.TESTDATA_PATH + "util/extensionLocator"; }
getBasePath
61,643
void () { VirtualFile virtualFile = myFixture.copyFileToProject("pluginXml_locateByEp.xml"); PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(virtualFile); XmlFile xmlFile = assertInstanceOf(psiFile, XmlFile.class); IdeaPlugin ideaPlugin = DescriptorUtil.getIdeaPlugin(xmlFile); List<? extends ExtensionPo...
testByExtensionPoint
61,644
void () { myFixture.copyFileToProject("pluginXml_locateByPsiClass.xml"); myFixture.copyFileToProject("SomeClass.java"); PsiClass arrayListPsiClass = myFixture.findClass("java.util.ArrayList"); PsiClass hashMapPsiClass = myFixture.findClass(CommonClassNames.JAVA_UTIL_HASH_MAP); PsiClass myList1PsiClass = myFixture.findC...
testByPsiClass
61,645
void (List<ExtensionCandidate> candidates, int expectedExtensionCount) { assertSize(expectedExtensionCount, candidates); for (int i = 0; i < expectedExtensionCount; i++) { ExtensionCandidate candidate = candidates.get(i); assertNotNull(candidate); DomElement domElement = DomManager.getDomManager(getProject()).getDomEle...
verifyLocator
61,646
void (JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.addLibrary("platform-projectModel", PathUtil.getJarPathForClass(State.class)); moduleBuilder.addLibrary("platform-ide", PathUtil.getJarPathForClass(JBList.class)); }
tuneFixture
61,647
String () { return DevkitJavaTestsUtil.TESTDATA_PATH + "references/messageBundle"; }
getBasePath
61,648
void () { doHighlightImplicitUsagesTest(); }
testIconTooltipKeyImplicitUsage
61,649
void () { doHighlightImplicitUsagesTest("PluginDescriptionKeyImplicitUsage.xml"); }
testPluginDescriptionKeyImplicitUsage
61,650
void () { doHighlightImplicitUsagesTest("ActionOrGroupImplicitUsage.xml"); }
testActionOrGroupImplicitUsage
61,651
void () { doHighlightImplicitUsagesTest("ToolWindowIdImplicitUsage.xml"); }
testToolWindowIdImplicitUsage
61,652
void () { doHighlightImplicitUsagesTest("ExportableIdImplicitUsage.java"); }
testExportableIdImplicitUsage
61,653
void () { doHighlightImplicitUsagesTest("AdvancedSettingImplicitUsage.xml"); }
testAdvancedSettingImplicitUsage
61,654
void () { myFixture.enableInspections(new UnusedPropertyInspection()); myFixture.testHighlighting("NoImplicitUsageWrongFilename.properties"); }
testNoImplicitUsageWrongFilename
61,655
void (String... additionalFiles) { final String testName = getTestName(false); myFixture.enableInspections(new UnusedPropertyInspection()); myFixture.testHighlighting(ArrayUtil.prepend(testName + "Bundle.properties", additionalFiles)); }
doHighlightImplicitUsagesTest
61,656
void () { myFixture.copyFileToProject("ToolWindowIdImplicitUsage.xml"); myFixture.configureByText("MyBundle.properties", "toolwindow.stripe.<caret>"); myFixture.completeBasic(); assertSameElements(myFixture.getLookupElementStrings(), "myToolWindowId", "myToolWindowId_With_Spaces"); }
testToolWindowIdCompletionVariants
61,657
void () { myFixture.copyFileToProject("ExportableIdImplicitUsage.java"); myFixture.configureByText("MyBundle.properties", "exportable.<caret>.presentable.name"); myFixture.completeBasic(); assertContainsElements(myFixture.getLookupElementStrings(), "MyStateName"); }
testExportableIdCompletionVariants
61,658
void () { myFixture.copyFileToProject("PluginDescriptionKeyImplicitUsage.xml"); myFixture.configureByText("MyBundle.properties", "plugin.<caret>.description"); myFixture.completeBasic(); assertContainsElements(myFixture.getLookupElementStrings(), "my.plugin.id"); }
testPluginIdCompletionVariants
61,659
void () { myFixture.copyFileToProject("AdvancedSettingImplicitUsage.xml"); myFixture.configureByText("MyBundle.properties", "advanced.setting.<caret>"); myFixture.completeBasic(); assertContainsElements(myFixture.getLookupElementStrings(), "my.advanced.setting.id", "my.another.advanced.setting.id"); }
testAdvancedSettingIdCompletionVariants
61,660
String () { return DevkitJavaTestsUtil.TESTDATA_PATH + "references/extensions"; }
getBasePath
61,661
PsiElement () { return myFixture.getFile().findElementAt(myFixture.getEditor().getCaretModel().getOffset()); }
getOriginalElement
61,662
void () { doBeanClassExtensionPointTest("beanClassExtensionPointDocumentation.xml"); }
testBeanClassExtensionPointDocumentation
61,663
void () { doBeanClassExtensionPointTest("beanClassExtensionPointQualifiedNameDocumentation.xml"); }
testBeanClassExtensionPointQualifiedNameDocumentation
61,664
void (String pluginXml) { myFixture.configureByFiles(pluginXml, "bar/MyExtensionPoint.java", "bar/MyExtension.java"); myFixture.addClass("package com.intellij.openapi.extensions; public @interface RequiredElement {}"); myFixture.addClass("package com.intellij.util.xmlb.annotations; public @interface Attribute {}"); myF...
doBeanClassExtensionPointTest
61,665
void () { myFixture.configureByFiles("interfaceExtensionPointDocumentation.xml", "bar/MyExtension.java"); final PsiElement docElement = DocumentationManager.getInstance(getProject()).findTargetElement(myFixture.getEditor(), myFixture.getFile()); DocumentationProvider provider = DocumentationManager.getProviderFromEleme...
testInterfaceExtensionPointDocumentation
61,666
void () { runEdtAction(); }
testEdtActionOnEdt
61,667
void () { assertThrows(RuntimeExceptionWithAttachments.class, MUST_EXECUTE_UNDER_EDT, ()-> throwExecutionExceptionCauseFromBackground( () -> runEdtAction())); }
testEdtActionInBackground
61,668
void () { ThreadingAssertions.assertEventDispatchThread(); assertThrows(RuntimeException.class, ()->runBackgroundAction()); }
testBackgroundActionOnEdt
61,669
void () { runReadAction(); }
testReadActionOnEdt
61,670
void () { assertThrows(RuntimeExceptionWithAttachments.class, MUST_EXECUTE_INSIDE_READ_ACTION, () -> throwExecutionExceptionCauseFromBackground( () -> runReadAction())); }
testReadActionInBackground
61,671
void () { WriteAction.run(() -> runWriteAction()); }
testWriteActionOnEdtWithWriteLock
61,672
void () { assertThrows(RuntimeExceptionWithAttachments.class, MUST_EXECUTE_INSIDE_WRITE_ACTION, () -> runWriteAction()); }
testWriteActionOnEdt
61,673
void () { assertThrows(RuntimeExceptionWithAttachments.class, MUST_EXECUTE_INSIDE_WRITE_ACTION, () -> throwExecutionExceptionCauseFromBackground( () -> runWriteAction())); }
testWriteActionInBackground
61,674
void () { assertThrows(RuntimeExceptionWithAttachments.class, MUST_NOT_EXECUTE_INSIDE_READ_ACTION, () -> runNonReadAction()); }
testNonReadActionOnEdt
61,675
void () { assertThrows(RuntimeExceptionWithAttachments.class, MUST_NOT_EXECUTE_INSIDE_READ_ACTION, () -> throwExecutionExceptionCauseFromBackground(() -> ReadAction.run(() -> runNonReadAction()))); }
testNonReadActionInBackgroundWithReadLock
61,676
void () { assertThrows(RuntimeExceptionWithAttachments.class, MUST_EXECUTE_UNDER_EDT, () -> throwExecutionExceptionCauseFromBackground(() -> WriteAction.run(() -> runNonReadAction()))); }
testNonReadActionInBackgroundWithWriteLock
61,677
void () { runBackgroundActionNoAssertion(); }
testBackgroundActionOnEdtNoAssertion
61,678
void () {}
runEdtAction
61,679
void () {}
runBackgroundAction
61,680
void () {}
runReadAction
61,681
void () {}
runWriteAction
61,682
void () {}
runNonReadAction
61,683
void () {}
runEdtActionNoAssertion
61,684
void () {}
runBackgroundActionNoAssertion
61,685
void () {}
runReadActionNoAssertion
61,686
void () {}
runWriteActionNoAssertion
61,687
void () { PsiFile file = myFixture.configureByText("MyIcons.java", """ package icons; /** * NOTE THIS FILE IS AUTO-GENERATED * DO NOT EDIT IT BY HAND, run build/scripts/icons.gant instead */ public class RubyIcons {}"""); assertTrue(new IconsGeneratedSourcesFilter().isGeneratedSource(file.getVirtualFile(), myFixture.ge...
testGeneratedFile
61,688
void () { PsiFile file = myFixture.configureByText("MyIcons.java", """ package icons; /** * NOTE THIS FILE IS AUTO-GENERATED * DO NOT EDIT IT BY HAND, run "Generate icon classes" configuration instead */ public class RubyIcons {}"""); assertTrue(new IconsGeneratedSourcesFilter().isGeneratedSource(file.getVirtualFile(),...
testNewGeneratedFile
61,689
void () { PsiFile file = myFixture.configureByText("MyIconsTest.java", """ package icons; /** * NOTE THIS FILE IS AUTO-GENERATED * DO NOT EDIT IT BY HAND, run build/scripts/icons.gant instead */ public class RubyIcons {}"""); assertFalse(new IconsGeneratedSourcesFilter().isGeneratedSource(file.getVirtualFile(), myFixtu...
testFilterByName
61,690
void () { PsiFile file = myFixture.configureByText("MyIcons.java", "package icons;\npublic class RubyIcons {}"); assertFalse(new IconsGeneratedSourcesFilter().isGeneratedSource(file.getVirtualFile(), myFixture.getProject())); }
testFilterByComment
61,691
boolean () { return true; }
isIconRequired
61,692
String () { return DevkitJavaTestsUtil.TESTDATA_PATH + "navigation/descriptionType"; }
getBasePath
61,693
void () { doTestInspectionDescription("MyWithDescriptionInspection.java", "MyWithDescription.html"); }
testInspectionDescription
61,694
void () { doTestInspectionDescription("MyWithDescriptionFromFieldReferenceInspection.java", "MyWithDescriptionFromFieldReferenceInspection.html"); }
testInspectionDescriptionFromFieldReference
61,695
void () { myFixture.copyDirectoryToProject("intentionDescriptions", "intentionDescriptions"); List<GutterMark> gutters = myFixture.findAllGutters("MyIntentionActionWithDescription.java"); assertThat(gutters.size()).isEqualTo(2); Collections.sort(gutters, Comparator.comparing(GutterMark::getTooltipText)); DevKitGutterTa...
testIntentionDescription
61,696
String () { return DevkitJavaTestsUtil.TESTDATA_PATH + "navigation/actionDeclaration"; }
getBasePath
61,697
void (JavaModuleFixtureBuilder moduleBuilder) { moduleBuilder.addLibrary("platform-editor", PathUtil.getJarPathForClass(AnAction.class)); moduleBuilder.addLibrary("platform-ide", PathUtil.getJarPathForClass(JBList.class)); moduleBuilder.addLibrary("platform-util-ui", PathUtil.getJarPathForClass(AllIcons.class)); }
tuneFixture
61,698
void () { myFixture.copyFileToProject("pluginActionSingleDeclaration.xml"); GutterMark gutter = myFixture.findGutter("MyAction.java"); DevKitGutterTargetsChecker.checkGutterTargets(gutter, buildTooltipText("singleDeclaration") , DevKitIcons.Gutter.Plugin, "action"); }
testActionSingleDeclaration
61,699
void () { myFixture.copyFileToProject("pluginActionMultipleDeclarations.xml"); GutterMark gutter = myFixture.findGutter("MyAction.java"); DevKitGutterTargetsChecker.checkGutterTargets(gutter, buildTooltipText("firstDeclaration", "secondDeclaration"), DevKitIcons.Gutter.Plugin, "action"); List<GotoRelatedItem> relatedIt...
testActionMultipleDeclarations