Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
52,600
String () { if (SystemInfo.isWindows) { return "TEMP"; } else if (SystemInfo.isLinux) return "HOME"; return "TMPDIR"; }
getEnvVar
52,601
MavenGeneralSettings () { return MavenProjectsManager.getInstance(myProject).getGeneralSettings(); }
getMavenGeneralSettings
52,602
MavenImportingSettings () { return MavenProjectsManager.getInstance(myProject).getImportingSettings(); }
getMavenImporterSettings
52,603
String () { String path = getRepositoryFile().getPath(); return FileUtil.toSystemIndependentName(path); }
getRepositoryPath
52,604
File () { return getMavenGeneralSettings().getEffectiveLocalRepository(); }
getRepositoryFile
52,605
void (String path) { getMavenGeneralSettings().setLocalRepository(path); }
setRepositoryPath
52,606
String () { return myProjectRoot.getPath(); }
getProjectPath
52,607
String () { return myProjectRoot.getParent().getPath(); }
getParentPath
52,608
String (String relPath) { return pathFromBasedir(myProjectRoot, relPath); }
pathFromBasedir
52,609
String (VirtualFile root, String relPath) { return FileUtil.toSystemIndependentName(root.getPath() + "/" + relPath); }
pathFromBasedir
52,610
String (String content) { if (!mirrorDiscoverable) { System.err.println("Maven mirror at " + mavenMirrorUrl + " not reachable, so not using it."); return "<settings>" + content + "</settings>"; } System.out.println("Using Maven mirror at " + mavenMirrorUrl); return "<settings>" + content + "<mirrors>" + " <mirror>" + "...
createSettingsXmlContent
52,611
String (String xml, boolean oldStyle) { if (oldStyle) { return "<?xml version=\"1.0\"?>" + "<profiles>" + xml + "</profiles>"; } return "<?xml version=\"1.0\"?>" + "<profilesXml>" + "<profiles>" + xml + "</profiles>" + "</profilesXml>"; }
createValidProfiles
52,612
void () { createProjectSubDirs("src/main/java", "src/main/resources", "src/test/java", "src/test/resources"); }
createStdProjectFolders
52,613
void (String... relativePaths) { for (String path : relativePaths) { createProjectSubDir(path); } }
createProjectSubDirs
52,614
VirtualFile (String relativePath) { File f = new File(getProjectPath(), relativePath); f.mkdirs(); return LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f); }
createProjectSubDir
52,615
void (Collection<String> actual, Collection<String> expected) { assertEquals(new SetWithToString<String>(CollectionFactory.createFilePathSet(expected)), new SetWithToString<String>(CollectionFactory.createFilePathSet(actual))); }
assertUnorderedPathsAreEqual
52,616
boolean () { printIgnoredMessage(null); return true; }
ignore
52,617
boolean () { boolean result = getTestMavenHome() != null; if (!result) printIgnoredMessage("Maven installation not found"); return result; }
hasMavenInstallation
52,618
void (String message) { String toPrint = "Ignored"; if (message != null) { toPrint += ", because " + message; } toPrint += ": " + getClass().getSimpleName() + "." + getName(); System.out.println(toPrint); }
printIgnoredMessage
52,619
String () { return System.getProperty("idea.maven.test.home"); }
getTestMavenHome
52,620
int () { return myDelegate.size(); }
size
52,621
boolean (Object o) { return myDelegate.contains(o); }
contains
52,622
Iterator<T> () { return myDelegate.iterator(); }
iterator
52,623
boolean (Collection<?> c) { return myDelegate.containsAll(c); }
containsAll
52,624
boolean (Object o) { return myDelegate.equals(o); }
equals
52,625
int () { return myDelegate.hashCode(); }
hashCode
52,626
void (String settingName, Object value, Class<?> valueType, Object... objects) { for (Object object : objects) { if (setSettingWithField(settingName, object, value) || setSettingWithMethod(settingName, object, value, valueType)) { return; } } throw new IllegalArgumentException(String.format( "There's no property or met...
setSettingValue
52,627
void (String setting, Boolean value, Object... objects) { setSettingValue(setting, value, boolean.class, objects); }
setBooleanSetting
52,628
void (String setting, Integer value, Object... objects) { setSettingValue(setting, value, int.class, objects); }
setIntSetting
52,629
void () { for (String trueSetting : settingsToTrue) { setBooleanSetting(trueSetting, true, objects); } for (String falseSetting : settingsToFalse) { setBooleanSetting(falseSetting, false, objects); } for (Pair<String, Integer> setting : settingsToIntValue) { setIntSetting(setting.getFirst(), setting.getSecond(), object...
configureSettings
52,630
void () { for (String trueSetting : settingsToTrue) { setBooleanSetting(trueSetting, false, objects); } for (String falseSetting : settingsToFalse) { setBooleanSetting(falseSetting, true, objects); } for (Pair<String, Integer> setting : settingsToIntValue) { setIntSetting(setting.getFirst(), setting.getSecond(), object...
configureInvertedSettings
52,631
boolean (String settingName, Object object, Object value) { try { Field field = object.getClass().getField(settingName); field.set(object, value); return true; } catch (IllegalAccessException e) { throw new IllegalArgumentException(String.format("Can't set property with the name %s in object %s", settingName, object));...
setSettingWithField
52,632
boolean (String setterName, Object object, Object value, Class<?> valueType) { try { Method method = object.getClass().getMethod(setterName, valueType); method.invoke(object, value); return true; } catch (InvocationTargetException e) { throw new IllegalArgumentException(String.format("Can't call method with name %s for...
setSettingWithMethod
52,633
void () { try { //noinspection ConstantConditions instrumented(null); } catch (IllegalArgumentException e) { return; } Assert.fail("IllegalArgumentException is expected"); }
testArgument
52,634
void (@NotNull Object o) { // This method should be instrumented with not null check }
instrumented
52,635
void (@NotNull String path) { VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(path); if (virtualFile != null) { virtualFile.getChildren(); virtualFile.refresh(false, true); } }
refreshPath
52,636
void () { super.setUp(); TestUtilsKt.invalidateLibraryCache(getProject()); }
setUp
52,637
PsiClass (String className) { PsiClass psiClass = JavaPsiFacade.getInstance(getProject()).findClass(className, getGlobalScope()); assertNotNull("Couldn't find a psiClass: " + className, psiClass); return psiClass; }
getPsiClass
52,638
GlobalSearchScope () { return GlobalSearchScope.allScope(getProject()); }
getGlobalScope
52,639
GlobalSearchScope () { return GlobalSearchScope.projectScope(getProject()); }
getProjectScope
52,640
String (Object member) { if (member instanceof PsiClass) { return "class:" + ((PsiClass) member).getName(); } if (member instanceof PsiMethod) { return "method:" + ((PsiMethod) member).getName(); } if (member instanceof PsiField) { return "field:" + ((PsiField) member).getName(); } if (member instanceof PsiParameter) {...
stringRepresentation
52,641
LightProjectDescriptor () { return KotlinLightProjectDescriptor.INSTANCE; }
getProjectDescriptor
52,642
LightProjectDescriptor () { return KotlinStdJSProjectDescriptor.INSTANCE; }
getProjectDescriptor
52,643
void (String unused) { myFixture.configureByFile(fileName()); myFixture.checkHighlighting(true, false, false); }
doTest
52,644
long (boolean checkWarnings, boolean checkInfos, boolean checkWeakWarnings, boolean checkSymbolNames) { PsiFile file = getFile(); KtFile ktFile = file instanceof KtFile ? (KtFile) file : null; String text = file.getText(); boolean suppressHighlight = InTextDirectivesUtils.isDirectiveDefined(text, "// " + SUPPRESS_HIGHL...
checkHighlighting
52,645
Unit (PsiElement element) { if (element instanceof KtElement) { AbstractKotlinHighlightVisitor.suppressHighlight((KtElement) element); } return Unit.INSTANCE; }
invoke
52,646
void (@NotNull KtDeclaration dcl) { if (areDescriptorsCreatedForDeclaration(dcl)) { ResolutionUtils.unsafeResolveToDescriptor(dcl, BodyResolveMode.FULL); // check for exceptions } dcl.acceptChildren(this, null); }
visitDeclaration
52,647
LocalInspectionTool (String toolString) { if ("StaticCallOnSubclassInspection".equals(toolString)) return new StaticCallOnSubclassInspection(); if ("StaticFieldReferenceOnSubclassInspection".equals(toolString)) return new StaticFieldReferenceOnSubclassInspection(); if ("NullableStuffInspection".equals(toolString)) retu...
mapStringToTool
52,648
String () { String className = getClass().getName(); boolean isJavaWithKotlin = className.contains("JavaWithKotlin"); File configureFile = new File(configPath(isJavaWithKotlin ? "javaWithKotlin" : "javaAgainstKotlin")); if (!configureFile.exists()) return null; try { return FileUtil.loadFile(configureFile, true); } cat...
getConfigFileText
52,649
String (String testKind) { return new File(IDEA_TEST_DATA_DIR, "kotlinAndJavaChecker/" + testKind + "/" + getTestName(false) + ".txt").getAbsolutePath(); }
configPath
52,650
LocalInspectionTool[] () { String configFileText = getConfigFileText(); if (configFileText == null) return DEFAULT_TOOLS; List<String> toolsStrings = InTextDirectivesUtils.findListWithPrefixes(configFileText, "TOOL:"); return CollectionsKt .map(toolsStrings, toolString -> mapStringToTool(toolString)) .toArray(LocalInsp...
configureLocalInspectionTools
52,651
boolean () { String configFileText = getConfigFileText(); if (configFileText == null) return super.doTestLineMarkers(); return InTextDirectivesUtils.isDirectiveDefined(configFileText, "LINE_MARKERS"); }
doTestLineMarkers
52,652
Sdk () { return IdeaTestUtil.getMockJdk18(); }
getTestProjectJdk
52,653
String () { return TestMetadataUtil.getTestDataPath(getClass()); }
getTestDataPath
52,654
void () { runAll( () -> super.tearDown(), () -> KotlinTestUtils.disposeVfsRootAccess(vfsDisposable) ); }
tearDown
52,655
void () { for (DeclarationDescriptor descriptor : getAllStandardDescriptors()) { // ExperimentalStdlibApi is incorrectly written in built-ins, see KT-53073 if (descriptor.getName().toString().equals("ExperimentalStdlibApi")) continue; // default values for annotation arguments are missing from protobuf KT-58052 if (des...
testAllReferencesResolved
52,656
Collection<DeclarationDescriptor> () { List<DeclarationDescriptor> descriptors = new ArrayList<>(); MemberScope builtIns = DefaultBuiltIns.getInstance().getBuiltInsPackageScope(); for (DeclarationDescriptor packageMember : DescriptorUtils.getAllDescriptors(builtIns)) { packageMember.acceptVoid(new DeclarationDescriptor...
getAllStandardDescriptors
52,657
Void (ClassDescriptor descriptor, Void data) { descriptors.add(descriptor); for (DeclarationDescriptor classMember : DescriptorUtils .getAllDescriptors(descriptor.getDefaultType().getMemberScope())) { classMember.acceptVoid(this); } return null; }
visitClassDescriptor
52,658
Void (DeclarationDescriptor descriptor, Void data) { descriptors.add(descriptor); return null; }
visitDeclarationDescriptor
52,659
Void (PackageViewDescriptor descriptor, Void data) { return null; }
visitPackageViewDescriptor
52,660
LightProjectDescriptor () { return ProjectDescriptorWithStdlibSources.getInstanceWithStdlibSources(); }
getProjectDescriptor
52,661
String () { return IdeActions.ACTION_GOTO_SUPER; }
getActionName
52,662
void (String path) { myFixture.configureByFile(path); checkGotoDirectives(new GotoSymbolModel2(getProject(), myFixture.getTestRootDisposable()), myFixture.getEditor()); }
doSymbolTest
52,663
void (String path) { myFixture.configureByFile(path); checkGotoDirectives(new GotoClassModel2(getProject()), myFixture.getEditor()); }
doClassTest
52,664
void () { doKotlinJavaTest(); }
testImplementFunInJava
52,665
void () { doKotlinJavaTest(); }
testImplementKotlinClassInJava
52,666
void () { doKotlinJavaTest(); }
testImplementKotlinAbstractClassInJava
52,667
void () { doKotlinJavaTest(); }
testImplementKotlinInterfaceInJava
52,668
void () { doKotlinJavaTest(); }
testImplementJavaClassInKotlin
52,669
void () { doKotlinJavaTest(); }
testImplementJavaAbstractClassInKotlin
52,670
void () { doKotlinJavaTest(); }
testImplementJavaInterfaceInKotlin
52,671
void () { doKotlinJavaTest(); }
testImplementMethodInKotlin
52,672
void () { doKotlinJavaTest(); }
testImplementVarInJava
52,673
void () { doJavaKotlinTest(); }
testImplementJavaInnerInterface
52,674
void () { doJavaKotlinTest(); }
testImplementJavaInnerInterfaceFromUsage
52,675
void () { doMultiFileTest(getTestName(false) + ".kt", getTestName(false) + ".java"); }
doKotlinJavaTest
52,676
void () { doMultiFileTest(getTestName(false) + ".java", getTestName(false) + ".kt"); }
doJavaKotlinTest
52,677
LightProjectDescriptor () { return KotlinLightProjectDescriptor.INSTANCE; }
getProjectDescriptor
52,678
void (String... fileNames) { myFixture.configureByFiles(fileNames); GotoTargetHandler.GotoData gotoData = NavigationTestUtils.invokeGotoImplementations(getEditor(), getFile()); NavigationTestUtils.assertGotoDataMatching(getEditor(), gotoData); }
doMultiFileTest
52,679
File () { return new File(IDEA_TEST_DATA_DIR, "navigation/implementations/multifile/" + getTestName(false)); }
getTestDataDirectory
52,680
void (Editor editor, GotoTargetHandler.GotoData gotoData) { assertGotoDataMatching(editor, gotoData, false); }
assertGotoDataMatching
52,681
void (Editor editor, GotoTargetHandler.GotoData gotoData, boolean renderModule) { String documentText = editor.getDocument().getText(); // Get expected references from the tested document List<String> expectedReferences = InTextDirectivesUtils.findListWithPrefixes(documentText, "// REF:"); for (int i = 0; i < expectedR...
assertGotoDataMatching
52,682
String (Project project, Collection<? extends PsiElement> navigableElements) { MultiMap<VirtualFile, Pair<Integer, Integer>> filesToNumbersAndOffsets = new MultiMap<>(); int refNumber = 1; for (PsiElement navigationElement : navigableElements) { Pair<Integer, Integer> numberAndOffset = new Pair<>(refNumber++, navigatio...
getNavigateElementsText
52,683
void () { super.setUp(); myFixture.enableInspections(KDocMissingDocumentationInspection.class); }
setUp
52,684
void () { doTest("bar"); }
testParamReference
52,685
void () { doTest("R"); }
testTypeParamReference
52,686
void () { doTest("xyzzy"); }
testCodeReference
52,687
void () { super.setUp(); }
setUp
52,688
void (String newName) { myFixture.configureByFile(getTestName(false) + ".kt"); PsiElement element = TargetElementUtil .findTargetElement(getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); assertNotNull(element); new RenameProcessor(getProject(), element, newName, true...
doTest
52,689
void (@NotNull String path) { //this line intentionally creates wrong file structure for java file String fileName = fileName(); myFixture.configureByFile(fileName.replace(".kt", ".java")); myFixture.configureByFile(fileName); performChecks(); }
doTest
52,690
String (@Nullable Object node, @Nullable Queryable.PrintInfo printInfo) { if (node instanceof AbstractTreeNode) { return ((AbstractTreeNode<?>) node).toTestString(printInfo); } FilteringTreeStructure.FilteringNode filteringNode = tryCast(node, FilteringTreeStructure.FilteringNode.class); if (filteringNode != null && fi...
toString
52,691
String (JTree tree, boolean withSelection) { return print(tree, withSelection, null, null); }
print
52,692
String ( JTree tree, boolean withSelection, @Nullable Queryable.PrintInfo printInfo, @Nullable Condition<String> nodePrintCondition) { StringBuilder buffer = new StringBuilder(); Collection<String> strings = printAsList(tree, withSelection, printInfo, nodePrintCondition); for (String string : strings) { buffer.append(s...
print
52,693
Collection<String> ( JTree tree, boolean withSelection, @Nullable Queryable.PrintInfo printInfo, @Nullable Condition<String> nodePrintCondition) { Collection<String> strings = new ArrayList<String>(); Object root = tree.getModel().getRoot(); printImpl(tree, root, strings, 0, withSelection, printInfo, nodePrintCondition...
printAsList
52,694
void (JTree tree, Object root, Collection<String> strings, int level, boolean withSelection, @Nullable Queryable.PrintInfo printInfo, @Nullable Condition<String> nodePrintCondition) { DefaultMutableTreeNode defaultMutableTreeNode = (DefaultMutableTreeNode)root; Object userObject = defaultMutableTreeNode.getUserObject()...
printImpl
52,695
void () { Collection<String> versions; try { versions = ConfigureDialogWithModulesAndVersion.loadVersions("1.0.0"); } catch (IOException e) { ExternalResourcesChecker.reportUnavailability("Kotlin artifact repository", e); return; } assertTrue(versions.size() > 0); for (String version : versions) { assertTrue(VersionCom...
testDownload
52,696
void (@NotNull String beforeFile) { File file = new File(beforeFile); String parent = file.getParent(); if (moduleInfoFile != null) { String afterFileName = PsiJavaModule.MODULE_INFO_FILE.replace(".java", "_after.java"); commitAllDocuments(); KotlinTestUtils.assertEqualsToFile(new File(parent, afterFileName), moduleInf...
checkModuleInfoFile
52,697
LightProjectDescriptor () { return new SimpleLightProjectDescriptor(getModuleTypeId(), getProjectJDK()); }
getProjectDescriptor
52,698
String () { return myModuleTypeId; }
getModuleTypeId
52,699
Sdk () { return mySdk; }
getSdk