Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
59,300
void (@NotNull List<String> taskNames, @NotNull Consumer<String> initScriptConsumer, @NotNull Map<String, String> parameters) { var isRunAsTest = Boolean.parseBoolean(parameters.get(IS_RUN_AS_TEST_KEY)); var isBuiltInTestEventsUsed = Boolean.parseBoolean(parameters.get(IS_BUILT_IN_TEST_EVENTS_USED_KEY)); var jvmParamet...
enhanceTaskProcessing
59,301
void (@NotNull List<String> taskNames, @Nullable String jvmParametersSetup, @NotNull Consumer<String> initScriptConsumer) { if (!StringUtil.isEmpty(jvmParametersSetup)) { LOG.assertTrue(!jvmParametersSetup.contains(ForkedDebuggerHelper.JVM_DEBUG_SETUP_PREFIX), "Please use org.jetbrains.plugins.gradle.service.debugger.G...
enhanceTaskProcessing
59,302
String (@NotNull List<String> strings, @NotNull String separator) { final List<String> quotedStrings = ContainerUtil.map(strings, s -> StringUtil.escapeChar(toStringLiteral(s), '$')); return StringUtil.join(quotedStrings, separator); }
toStringListLiteral
59,303
String (@NotNull String s) { return StringUtil.wrapWithDoubleQuote(StringUtil.escapeStringCharacters(s)); }
toStringLiteral
59,304
void (@NotNull IdeaProject ideaProject, @NotNull DataNode<ProjectData> projectNode) { String compileOutputPath = getCompileOutputPath(); LanguageLevel languageLevel = getLanguageLevel(ideaProject); String targetBytecodeVersion = getTargetBytecodeVersion(ideaProject); JavaSdkVersion jdkVersion = JavaProjectData.resolveS...
populateJavaProjectCompilerSettings
59,305
void (@NotNull IdeaModule ideaModule, @NotNull DataNode<ModuleData> moduleNode) { ExternalProject externalProject = resolverCtx.getExtraProject(ideaModule, ExternalProject.class); if (externalProject == null) return; if (resolverCtx.isResolveModulePerSourceSet()) { Map<ExternalSourceSet, DataNode<GradleSourceSetData>> ...
populateJavaModuleCompilerSettings
59,306
JavaModuleData (@NotNull IdeaModule ideaModule, @NotNull ExternalProject externalProject) { LanguageLevel languageLevel = getLanguageLevel(ideaModule, externalProject); String targetBytecodeVersion = getTargetBytecodeVersion(ideaModule, externalProject); return new JavaModuleData(GradleConstants.SYSTEM_ID, languageLeve...
createMainModuleData
59,307
JavaModuleData (@NotNull IdeaModule ideaModule, @NotNull ExternalSourceSet sourceSet) { LanguageLevel languageLevel = getLanguageLevel(ideaModule, sourceSet); String targetBytecodeVersion = getTargetBytecodeVersion(ideaModule, sourceSet); return new JavaModuleData(GradleConstants.SYSTEM_ID, languageLevel, targetBytecod...
createSourceSetModuleData
59,308
LanguageLevel (@NotNull LanguageLevel languageLevel, boolean isPreview) { if (languageLevel.isPreview() == isPreview) return languageLevel; com.intellij.util.lang.JavaVersion javaVersion = languageLevel.toJavaVersion(); return Arrays.stream(LanguageLevel.values()) .filter(it -> it.isPreview() == isPreview) .filter(it -...
setPreview
59,309
boolean (@NotNull ExternalProject externalProject) { final Collection<? extends ExternalSourceSet> values = externalProject.getSourceSets().values(); if (values.isEmpty()) { return false; } else { return ContainerUtil.and(values, it -> it.isPreview()); } }
isPreview
59,310
void (@NotNull IdeaProject ideaProject, @NotNull DataNode<? extends ProjectData> projectNode) { String jdkName = ideaProject.getJdkName(); String sdkName = resolveSdkName(jdkName); ProjectSdkData projectSdkData = new ProjectSdkData(sdkName); projectNode.createChild(ProjectSdkData.KEY, projectSdkData); }
populateProjectSdkModel
59,311
void (@NotNull IdeaModule ideaModule, @NotNull DataNode<? extends ModuleData> moduleNode, @Nullable ExternalSourceSet sourceSet) { try { String jdkName = ideaModule.getJdkName(); String sdkName; if (jdkName != null || sourceSet == null || sourceSet.getJdkInstallationPath() == null) { sdkName = resolveSdkName(jdkName); ...
populateModuleSdkModel
59,312
String (@NotNull String jdkInstallationPath) { String sdkName = ExternalSystemJdkProvider.getInstance().getJavaSdkType().suggestSdkName(null, jdkInstallationPath); ProjectJdkTable jdkTable = ProjectJdkTable.getInstance(); Sdk sdk = ReadAction.compute(() -> ContainerUtil.find(jdkTable.getAllJdks(), candidate -> jdkInsta...
lookupSdkByPath
59,313
Key<BuildScriptClasspathData> () { return BuildScriptClasspathData.KEY; }
getTargetDataKey
59,314
void (final @NotNull Collection<? extends DataNode<BuildScriptClasspathData>> toImport, @Nullable final ProjectData projectData, @NotNull final Project project, @NotNull final IdeModifiableModelsProvider modelsProvider) { if (projectData == null || toImport.isEmpty()) { return; } final GradleInstallationManager gradleI...
importData
59,315
void (@NotNull Project project) { ImportSpecBuilder previewSpec = new ImportSpecBuilder(project, GradleConstants.SYSTEM_ID); previewSpec.usePreviewMode(); previewSpec.use(MODAL_SYNC); previewSpec.callback(new ConfigureGradleModuleCallback(previewSpec)); ExternalSystemUtil.refreshProject(PathKt.getSystemIndependentPath(...
loadPreviewProject
59,316
void (@NotNull Project project) { ExternalProjectsManagerImpl.getInstance(project).runWhenInitialized(() -> { ImportSpecBuilder importSpec = new ImportSpecBuilder(project, GradleConstants.SYSTEM_ID); if (createEmptyContentRoots) { importSpec.createDirectoriesForEmptyContentRoots(); } importSpec.callback(new ConfigureGr...
reloadProject
59,317
void (@NotNull Project project) { var vcs = GitSilentFileAdderProvider.create(project); vcs.markFileForAdding(rootProjectPath.resolve("gradle"), true); vcs.markFileForAdding(rootProjectPath.resolve("gradlew"), false); vcs.markFileForAdding(rootProjectPath.resolve("gradlew.bat"), false); GradleWrapperUtil.generateGradle...
generateGradleWrapper
59,318
void (@NotNull Consumer<GradleBuildScriptBuilder<?>> configure) { buildScriptConfigurators.add(configure); }
configureBuildScript
59,319
void (@NotNull BiConsumer<@NotNull VirtualFile, @NotNull VirtualFile> configure) { preImportConfigurators.add(configure); }
configurePreImport
59,320
void (@NotNull Project project, VirtualFile buildScriptFile) { if (buildScriptFile == null) return; PsiManager psiManager = PsiManager.getInstance(project); PsiFile psiFile = psiManager.findFile(buildScriptFile); if (psiFile == null) return; EditorHelper.openInEditor(psiFile); }
openBuildScriptFile
59,321
ModuleWizardStep[] (@NotNull WizardContext wizardContext, @NotNull ModulesProvider modulesProvider) { return ModuleWizardStep.EMPTY_ARRAY; }
createWizardSteps
59,322
boolean (SdkTypeId sdk) { return sdk instanceof JavaSdkType && !(sdk instanceof DependentSdkType); }
isSuitableSdkType
59,323
String () { return JavaModuleType.JAVA_GROUP; }
getParentGroup
59,324
int () { return JavaModuleBuilder.BUILD_SYSTEM_WEIGHT; }
getWeight
59,325
void (@Nullable ProjectData parentProject) { myParentProject = parentProject; }
setParentProject
59,326
boolean () { return myParentProject == null; }
isCreatingNewLinkedProject
59,327
boolean () { return myInheritGroupId; }
isInheritGroupId
59,328
void (boolean inheritGroupId) { myInheritGroupId = inheritGroupId; }
setInheritGroupId
59,329
boolean () { return myInheritVersion; }
isInheritVersion
59,330
void (boolean inheritVersion) { myInheritVersion = inheritVersion; }
setInheritVersion
59,331
ProjectId () { return myProjectId; }
getProjectId
59,332
void (@NotNull ProjectId projectId) { myProjectId = projectId; }
setProjectId
59,333
boolean () { return isCreatingNewProject; }
isCreatingNewProject
59,334
void (boolean creatingNewProject) { isCreatingNewProject = creatingNewProject; }
setCreatingNewProject
59,335
void (boolean createEmptyContentRoots) { this.createEmptyContentRoots = createEmptyContentRoots; }
setCreateEmptyContentRoots
59,336
void (@NotNull GradleVersion version) { gradleVersion = version; }
setGradleVersion
59,337
void (@NotNull DistributionType distributionType) { gradleDistributionType = distributionType; }
setGradleDistributionType
59,338
void (@Nullable String path) { gradleHome = path; }
setGradleHome
59,339
void () { myJdk = null; }
cleanup
59,340
ModuleWizardStep (@NotNull SettingsStep settingsStep) { if (settingsStep instanceof ProjectSettingsStep projectSettingsStep) { if (myProjectId != null) { final ModuleNameLocationSettings nameLocationSettings = settingsStep.getModuleNameLocationSettings(); String artifactId = myProjectId.getArtifactId(); if (nameLocatio...
modifySettingsStep
59,341
String (@NotNull VirtualFile file) { String lineSeparator = LoadTextUtil.detectLineSeparator(file, true); if (lineSeparator == null) { lineSeparator = CodeStyle.getDefaultSettings().getLineSeparator(); } return lineSeparator; }
lineSeparator
59,342
BuildScriptDataBuilder (@Nullable Module module) { return module == null ? null : module.getUserData(BUILD_SCRIPT_DATA); }
getBuildScriptData
59,343
Project (String name, String path) { setCreatingNewProject(true); return super.createProject(name, path); }
createProject
59,344
boolean () { return myUseKotlinDSL; }
isUseKotlinDsl
59,345
void (boolean useKotlinDSL) { myUseKotlinDSL = useKotlinDSL; }
setUseKotlinDsl
59,346
void (@Nullable DataNode<ProjectData> externalProject) { if (externalProject != null) { configureModulesSdk(externalProject); } defaultCallback.onSuccess(externalProject); }
onSuccess
59,347
void (@NotNull DataNode<ProjectData> projectNode) { DataNode<ModuleData> moduleNode = ExternalSystemApiUtil.findChild(projectNode, ProjectKeys.MODULE, this::isTargetModule); if (moduleNode == null) return; configureModuleSdk(moduleNode); Collection<DataNode<GradleSourceSetData>> sourceSetsNodes = ExternalSystemApiUtil....
configureModulesSdk
59,348
void (@NotNull DataNode<? extends ModuleData> moduleNode) { DataNode<ModuleSdkData> moduleSdkNode = ExternalSystemApiUtil.find(moduleNode, ModuleSdkData.KEY); if (moduleSdkNode == null) return; moduleSdkNode.getData().setSdkName(sdkName); }
configureModuleSdk
59,349
boolean (@NotNull DataNode<ModuleData> moduleNode) { ModuleData moduleData = moduleNode.getData(); String linkedExternalProjectPath = moduleData.getLinkedExternalProjectPath(); return linkedExternalProjectPath.equals(externalConfigPath); }
isTargetModule
59,350
void () { myParentPathField = new TextViewer("", getProject()); }
createUIComponents
59,351
void () { myPanel.setVisible(myIsVisible); if (!myIsVisible) return; mySelectParent.setIcon(AllIcons.Nodes.Module); mySelectParent.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myParent = doSelectProject(myParent); myConsumer.accept(myParent); } }); if (myParent == null...
initComponents
59,352
void (ActionEvent e) { myParent = doSelectProject(myParent); myConsumer.accept(myParent); }
actionPerformed
59,353
JPanel () { return myPanel; }
getComponent
59,354
ProjectData () { return myParent; }
getParentProject
59,355
void (@Nullable ProjectData parent) { myParent = parent; }
setParentProject
59,356
boolean () { return myIsVisible; }
isVisible
59,357
void () { if (myIsVisible) { myParentPathField.setText(myParent == null ? EMPTY_PARENT : myParent.getLinkedExternalProjectPath()); collapseIfPossible(myParentPathField, GradleConstants.SYSTEM_ID, getProject()); } }
updateComponents
59,358
void () { myParentPathField.removeNotify(); }
dispose
59,359
ProjectData (ProjectData current) { assert myProjectOrNull != null : "must not be called when creating a new project"; SelectExternalProjectDialog d = new SelectExternalProjectDialog(GradleConstants.SYSTEM_ID, myProjectOrNull, current); if (!d.showAndGet()) { return current; } return d.getResult(); }
doSelectProject
59,360
Project () { Project project = myProjectOrNull != null ? myProjectOrNull : ArrayUtil.getFirstElement(ProjectManager.getInstance().getOpenProjects()); return project == null ? ProjectManager.getInstance().getDefaultProject() : project; }
getProject
59,361
ProjectData (@Nullable Project project) { if (project == null) return null; String contextProjectFileDirectory = myContext.getProjectFileDirectory(); ExternalProjectSettings linkedProjectSettings = null; for (Object settings : ExternalSystemApiUtil.getSettings(project, GradleConstants.SYSTEM_ID).getLinkedProjectsSettin...
findPotentialParentProject
59,362
void (@NotNull EditorTextField editorTextField, @NotNull ProjectSystemId systemId, @NotNull Project project) { Editor editor = editorTextField.getEditor(); if (editor != null) { String rawText = editor.getDocument().getText(); if (StringUtil.isEmpty(rawText)) return; if (EMPTY_PARENT.equals(rawText)) { editorTextField....
collapseIfPossible
59,363
Document (@NotNull String initialText) { return EditorFactory.getInstance().createDocument(initialText); }
createDocument
59,364
void (@Nullable String text) { super.setText(text != null ? StringUtil.convertLineSeparators(text) : null); }
setText
59,365
EditorEx () { final EditorEx editor = super.createEditor(); editor.setHorizontalScrollbarVisible(true); editor.setCaretEnabled(isEnabled()); editor.getScrollPane().setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); editor.setEmbeddedIntoDialogWrapper(myEmbeddedIntoDialogWrapper); editor.setBo...
createEditor
59,366
void (boolean enabled) { // do not reset com.intellij.ui.EditorTextField.myIsViewer field }
setViewerEnabled
59,367
void () { // The editor needs to be removed manually because it normally is removed by invokeLater, which may happen to late Editor editor = getEditor(); if (editor != null && !editor.isDisposed()) { EditorFactory.getInstance().releaseEditor(editor); } super.removeNotify(); }
removeNotify
59,368
boolean (WizardContext myContext) { for (Module module : myContext.getModulesProvider().getModules()) { if (ExternalSystemApiUtil.isExternalSystemAwareModule(GradleConstants.SYSTEM_ID, module)) return true; } return false; }
gradleModuleExists
59,369
String () { return GradleBundle.message("gradle.name"); }
getName
59,370
Icon () { return GradleIcons.Gradle; }
getIcon
59,371
Sdk (@NotNull WizardContext context) { JavaSdk javaSdkType = JavaSdk.getInstance(); ProjectJdkTable jdkTable = ProjectJdkTable.getInstance(); // gradle older than 4.2.1 doesn't support new java the version number format like 9.0.1, see https://github.com/gradle/gradle/issues/2992 Predicate<Sdk> sdkCondition = sdk -> { ...
resolveProjectJdk
59,372
void (@NotNull WizardContext context) { String pathToUse = getFileToImport(); VirtualFile file = LocalFileSystem.getInstance().refreshAndFindFileByPath(pathToUse); if (file != null && !file.isDirectory() && file.getParent() != null) { pathToUse = file.getParent().getPath(); } final ImportFromGradleControl importFromGra...
doPrepare
59,373
ExternalProjectRefreshCallback (@NotNull final Project project, @NotNull ExternalProjectSettings projectSettings) { return new ExternalProjectRefreshCallback() { @Override public void onSuccess(@Nullable final DataNode<ProjectData> externalProject) { if (externalProject == null) return; Runnable selectDataTask = () -> ...
createFinalImportCallback
59,374
void (@Nullable final DataNode<ProjectData> externalProject) { if (externalProject == null) return; Runnable selectDataTask = () -> { ExternalProjectDataSelectorDialog dialog = new ExternalProjectDataSelectorDialog( project, new InternalExternalProjectInfo( GradleConstants.SYSTEM_ID, projectSettings.getExternalProjectP...
onSuccess
59,375
void (@NotNull DataNode<ProjectData> dataNode, @NotNull Project project) { if (project.getUserData(ExternalSystemDataKeys.NEWLY_IMPORTED_PROJECT) == Boolean.TRUE && GradleSettings.getInstance(project).getLinkedProjectsSettings().isEmpty()) { ExternalProjectsManagerImpl.getInstance(project).setStoreExternally(true); } D...
beforeCommit
59,376
void (@NotNull WizardContext context) { DataNode<ProjectData> node = getExternalProjectNode(); if (node == null) { return; } DataNode<JavaProjectData> javaProjectNode = ExternalSystemApiUtil.find(node, JavaProjectData.KEY); if (javaProjectNode != null) { JavaProjectData data = javaProjectNode.getData(); context.setComp...
applyExtraSettings
59,377
File (@NotNull File file) { return file.isDirectory() ? file : file.getParentFile(); }
getExternalProjectConfigToUse
59,378
boolean (SdkTypeId sdk) { return sdk == JavaSdk.getInstance(); }
isSuitableSdkType
59,379
Project (String name, String path) { return ExternalProjectsManagerImpl.setupCreatedProject(super.createProject(name, path)); }
createProject
59,380
GradleProjectImportBuilder () { if (ourInstance == null) { ourInstance = new GradleProjectImportBuilder(); } return ourInstance; }
getInstance
59,381
ProjectImportBuilder () { return GradleProjectImportBuilder.getInstance(); }
doGetBuilder
59,382
boolean (VirtualFile file) { return GradleConstants.EXTENSION.equals(file.getExtension()) || file.getName().endsWith("." + GradleConstants.KOTLIN_DSL_SCRIPT_EXTENSION); }
canImportFromFile
59,383
String () { return GradleInspectionBundle.message("gradle.build.script"); }
getFileSample
59,384
void (@NotNull Notification notification, @NotNull HyperlinkEvent event) { new GotoSourceNotificationCallback(myNotificationData, myProject).hyperlinkActivated(notification, event); final AnAction action = ActionManager.getInstance().getAction(AddGradleDslPluginAction.ID); assert action instanceof AddGradleDslPluginAct...
hyperlinkActivated
59,385
boolean (@NotNull Throwable error) { return false; }
isInternalError
59,386
void (@NotNull NotificationData notificationData, @NotNull Project project, @NotNull ExternalSystemException e) { for (String fix : e.getQuickFixes()) { if (ApplyGradlePluginCallback.ID.equals(fix)) { notificationData.setListener(ApplyGradlePluginCallback.ID, new ApplyGradlePluginCallback(notificationData, project)); }...
updateNotification
59,387
void (@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor<? super PsiReference> consumer) { final PsiElement element = queryParameters.getElementToSearch(); if (element instanceof Property property && isContainingFileGradlePropertyFile(element.getContainingFile()) && queryParameters.getEffect...
processQuery
59,388
boolean (PsiFile file) { for (String filename : GRADLE_PROPERTY_FILES) { if (file.getName().equalsIgnoreCase(filename)) { return true; } } return false; }
isContainingFileGradlePropertyFile
59,389
boolean (@NotNull PsiElement element, int offsetInElement, @NotNull Processor<? super PsiReference> consumer) { if (element instanceof PsiReference) { if (!consumer.process((PsiReference)element)) { return false; } } return true; }
processTextOccurrence
59,390
boolean (@NotNull VirtualFile file) { return super.contains(file) && extension.equalsIgnoreCase(file.getExtension()); }
contains
59,391
void (Collection<ResourceRootFilter> filters) { myFilters.addAll(filters); }
addAll
59,392
void (ResourceRootFilter... filters) { Collections.addAll(myFilters, filters); }
add
59,393
Reader (Reader original) { Reader value = original; for (ResourceRootFilter filter : myFilters) { value = doTransform(filter, value); } return value; }
transform
59,394
Reader (ResourceRootFilter filter, Reader original) { if ("RenamingCopyFilter".equals(filter.filterType)) { final Matcher matcher = (Matcher)filter.getProperties().get("matcher"); final String replacement = (String)filter.getProperties().get("replacement"); if (matcher == null || replacement == null) return original; m...
doTransform
59,395
String () { return GradleJpsBundle.message("gradle.resources.compiler"); }
getPresentableName
59,396
JpsGradleArtifactExtension (JpsArtifact artifact, ArtifactBuildPhase buildPhase) { if (buildPhase == ArtifactBuildPhase.PRE_PROCESSING) { return JpsGradleExtensionService.getArtifactExtension(artifact); } return null; }
getArtifactExtension
59,397
void (final CompileContext context) { if (myProperties.manifest != null) { try { File output = new File(myArtifact.getOutputPath(), JarFile.MANIFEST_NAME); FileUtil.writeToFile(output, Base64.getDecoder().decode(myProperties.manifest)); } // do not fail the whole 'Make' if there is an invalid manifest cached catch (Exc...
build
59,398
void (final CompileContext context) { if (myProperties.additionalFiles != null) { for (Map.Entry<String, String> entry : myProperties.additionalFiles.entrySet()) { try { File output = new File(entry.getKey()); FileUtil.writeToFile(output, Base64.getDecoder().decode(entry.getValue())); } // do not fail the whole 'Make' ...
build
59,399
JpsGradleArtifactExtension (@NotNull JpsArtifact artifact) { return artifact.getContainer().getChild(JpsGradleArtifactExtensionImpl.ROLE); }
getArtifactExtension