Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
19,800
File (File mavenHome) { return new File(new File(mavenHome, BIN_DIR), M2_CONF_FILE); }
getMavenConfFile
19,801
String (@Nullable File mavenHome) { if (mavenHome == null) return null; File[] libs = new File(mavenHome, "lib").listFiles(); if (libs != null) { for (File mavenLibFile : libs) { String lib = mavenLibFile.getName(); if (lib.equals("maven-core.jar")) { MavenLog.LOG.trace("Choosing version by maven-core.jar"); return get...
getMavenVersion
19,802
String (final File file) { WSLDistribution distribution = WslPath.getDistributionByWindowsUncPath(file.getPath()); File fileToRead = Optional.ofNullable(distribution) .map(it -> distribution.getWslPath(file.toPath())) .map(it -> distribution.resolveSymlink(it)) .map(it -> distribution.getWindowsPath(it)) .map(it -> new...
getMavenLibVersion
19,803
String (String mavenHome) { return getMavenVersion(new File(mavenHome)); }
getMavenVersion
19,804
String (Project project, String workingDir) { MavenHomeType homeType = MavenWorkspaceSettingsComponent.getInstance(project).getSettings().getGeneralSettings().getMavenHomeType(); if (homeType instanceof StaticResolvedMavenHomeType srmt) { return getMavenVersion(srmt); } MavenDistribution distribution = MavenDistributio...
getMavenVersion
19,805
String (StaticResolvedMavenHomeType mavenHomeType) { return getMavenVersion(getMavenHomeFile(mavenHomeType)); }
getMavenVersion
19,806
boolean (String mavenHome) { String version = getMavenVersion(mavenHome); return version != null && version.compareTo("3.0.0") >= 0; }
isMaven3
19,807
File (@NotNull StaticResolvedMavenHomeType mavenHomeType) { File directory = getMavenHomeFile(mavenHomeType); if (directory == null) return null; return new File(new File(directory, CONF_DIR), SETTINGS_XML); }
resolveGlobalSettingsFile
19,808
File (@NotNull File mavenHome) { return new File(new File(mavenHome, CONF_DIR), SETTINGS_XML); }
resolveGlobalSettingsFile
19,809
File (@Nullable String overriddenUserSettingsFile) { if (!isEmptyOrSpaces(overriddenUserSettingsFile)) return new File(overriddenUserSettingsFile); return new File(resolveM2Dir(), SETTINGS_XML); }
resolveUserSettingsFile
19,810
File () { return new File(SystemProperties.getUserHome(), DOT_M2_DIR); }
resolveM2Dir
19,811
File (@Nullable String overriddenLocalRepository, @Nullable String overriddenMavenHome, @Nullable String overriddenUserSettingsFile) { MavenHomeType type = resolveMavenHomeType(overriddenMavenHome); if (type instanceof StaticResolvedMavenHomeType st) { return resolveLocalRepository(overriddenLocalRepository, st, overri...
resolveLocalRepository
19,812
File () { String forcedM2Home = System.getProperty(PROP_FORCED_M2_HOME); if (forcedM2Home != null) { return new File(forcedM2Home); } File result = doResolveLocalRepository(resolveUserSettingsFile(null), null); if (result == null) { result = new File(resolveM2Dir(), REPOSITORY_DIR); } try { return result.getCanonicalFi...
resolveDefaultLocalRepository
19,813
File (@Nullable String overriddenLocalRepository, @NotNull StaticResolvedMavenHomeType mavenHomeType, @Nullable String overriddenUserSettingsFile) { String forcedM2Home = System.getProperty(PROP_FORCED_M2_HOME); if (forcedM2Home != null) { return new File(forcedM2Home); } File result = null; if (!isEmptyOrSpaces(overri...
resolveLocalRepository
19,814
File (@NotNull Project project, @NotNull MavenId id, @NotNull String extension, @Nullable String classifier) { if (id.getGroupId() == null || id.getArtifactId() == null || id.getVersion() == null) { return null; } MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(project); return makeLocalReposito...
getRepositoryFile
19,815
File (MavenId id, File localRepository, @NotNull String extension, @Nullable String classifier) { String relPath = id.getGroupId().replace(".", "/"); relPath += "/" + id.getArtifactId(); relPath += "/" + id.getVersion(); relPath += "/" + id.getArtifactId() + "-" + id.getVersion(); relPath = classifier == null ? relPath...
makeLocalRepositoryFile
19,816
File (@Nullable File userSettingsFile, @Nullable File globalSettingsFile) { if (userSettingsFile != null) { final String fromUserSettings = getRepositoryFromSettings(userSettingsFile); if (!isEmpty(fromUserSettings)) { return new File(fromUserSettings); } } if (globalSettingsFile != null) { final String fromGlobalSetti...
doResolveLocalRepository
19,817
String (final File file) { try { Element repository = getRepositoryElement(file); if (repository == null) { return null; } String text = repository.getText(); if (isEmptyOrSpaces(text)) { return null; } return expandProperties(text.trim()); } catch (Exception e) { return null; } }
getRepositoryFromSettings
19,818
String (final File settingsFile, String url, String id) { try { Element mirrorParent = getElementWithRegardToNamespace(getDomRootElement(settingsFile), "mirrors", settingsListNamespaces); if (mirrorParent == null) { return url; } List<Element> mirrors = getElementsWithRegardToNamespace(mirrorParent, "mirror", settingsL...
getMirroredUrl
19,819
boolean (String mirrorOf, String url, String id) { HashSet<String> patterns = new HashSet<>(split(mirrorOf, ",")); if (patterns.contains("!" + id)) { return false; } if (patterns.contains("*")) { return true; } if (patterns.contains(id)) { return true; } if (patterns.contains("external:*")) { try { URI uri = URI.create...
isMirrorApplicable
19,820
Element (@NotNull Element parent, String childName, List<String> namespaces) { Element element = parent.getChild(childName); if (element != null) return element; for (String namespace : namespaces) { element = parent.getChild(childName, Namespace.getNamespace(namespace)); if (element != null) return element; } return n...
getElementWithRegardToNamespace
19,821
List<Element> (@NotNull Element parent, String childrenName, List<String> namespaces) { List<Element> elements = parent.getChildren(childrenName); if (!elements.isEmpty()) return elements; for (String namespace : namespaces) { elements = parent.getChildren(childrenName, Namespace.getNamespace(namespace)); if (!elements...
getElementsWithRegardToNamespace
19,822
String (String text, Properties props) { if (StringUtil.isEmptyOrSpaces(text)) return text; for (Map.Entry<Object, Object> each : props.entrySet()) { Object val = each.getValue(); text = text.replace("${" + each.getKey() + "}", val instanceof CharSequence ? (CharSequence)val : val.toString()); } return text; }
expandProperties
19,823
String (String text) { return expandProperties(text, MavenServerUtil.collectSystemProperties()); }
expandProperties
19,824
VirtualFile (@NotNull File mavenHome) { return doResolveSuperPomFile(new File(mavenHome, LIB_DIR)); }
resolveSuperPomFile
19,825
VirtualFile (@NotNull File mavenHome) { File[] files = mavenHome.listFiles(); if (files == null) return null; for (File library : files) { for (Pair<Pattern, String> path : SUPER_POM_PATHS) { if (path.first.matcher(library.getName()).matches()) { VirtualFile libraryVirtualFile = LocalFileSystem.getInstance().findFileBy...
doResolveSuperPomFile
19,826
List<LookupElement> (MavenProjectsManager manager) { Set<String> goals = new HashSet<>(MavenConstants.PHASES); for (MavenProject mavenProject : manager.getProjects()) { for (MavenPlugin plugin : mavenProject.getPlugins()) { MavenPluginInfo pluginInfo = MavenArtifactUtil.readPluginInfo(manager.getLocalRepository(), plug...
getPhaseVariants
19,827
boolean (Project project) { return ExternalSystemUtil.confirmLoadingUntrustedProject(project, SYSTEM_ID); }
isProjectTrustedEnoughToImport
19,828
void (@NotNull Project project, boolean wait, Predicate<MavenServerConnector> condition) { MavenServerManager.getInstance().restartMavenConnectors(project, wait, condition); }
restartMavenConnectors
19,829
void (@NotNull Project project, boolean wait) { restartMavenConnectors(project, wait, c -> Boolean.TRUE); }
restartMavenConnectors
19,830
boolean (@NotNull Sdk jdk, String mavenVersion) { if (compareVersionNumbers(mavenVersion, "3.3.1") < 0) { return true; } SdkTypeId sdkType = jdk.getSdkType(); if (sdkType instanceof JavaSdk) { JavaSdkVersion version = ((JavaSdk)sdkType).getVersion(jdk); if (version == null || version.isAtLeast(JavaSdkVersion.JDK_1_7)) ...
verifyMavenSdkRequirements
19,831
void (@Nullable String string) { if (string == null) return; for (int i = 0, end = string.length(); i < end; i++) { crc.update(string.charAt(i)); } }
putString
19,832
void (String uri, String localName, String qName, Attributes attributes) { textContentOccur = false; crc.update(1); putString(qName); for (int i = 0; i < attributes.getLength(); i++) { putString(attributes.getQName(i)); putString(attributes.getValue(i)); } }
startElement
19,833
void (String uri, String localName, String qName) { textContentOccur = false; crc.update(2); putString(qName); }
endElement
19,834
void (char[] ch, int start, int length) { for (int i = start, end = start + length; i < end; i++) { char a = ch[i]; if (Character.isWhitespace(a)) { if (textContentOccur) { spacesCrc = spacesCrc * 31 + a; } } else { if (textContentOccur && spacesCrc != 0) { crc.update(spacesCrc); crc.update(spacesCrc >> 8); } crc.updat...
processTextOrSpaces
19,835
void (char[] ch, int start, int length) { processTextOrSpaces(ch, start, length); }
characters
19,836
void (char[] ch, int start, int length) { processTextOrSpaces(ch, start, length); }
ignorableWhitespace
19,837
void (String target, String data) { putString(target); putString(data); }
processingInstruction
19,838
void (String name) { putString(name); }
skippedEntity
19,839
void (SAXParseException e) { crc.update(100); }
error
19,840
String (@Nullable Sdk sdk) { if (sdk == null) return null; VirtualFile homeDirectory = sdk.getHomeDirectory(); if (homeDirectory == null) return null; if (!"jre".equals(homeDirectory.getName())) { VirtualFile jreDir = homeDirectory.findChild("jre"); if (jreDir != null) { homeDirectory = jreDir; } } return homeDirectory...
getSdkPath
19,841
String (@NotNull MavenProjectsManager mavenProjectsManager, @NotNull MavenProject mavenProject) { return getSdkPath(getModuleJdk(mavenProjectsManager, mavenProject)); }
getModuleJreHome
19,842
String (@NotNull MavenProjectsManager mavenProjectsManager, @NotNull MavenProject mavenProject) { Sdk sdk = getModuleJdk(mavenProjectsManager, mavenProject); if (sdk == null) return null; return sdk.getVersionString(); }
getModuleJavaVersion
19,843
Sdk (@NotNull MavenProjectsManager mavenProjectsManager, @NotNull MavenProject mavenProject) { Module module = mavenProjectsManager.findModule(mavenProject); if (module == null) return null; return ModuleRootManager.getInstance(module).getSdk(); }
getModuleJdk
19,844
boolean (@Nullable Module module) { return module != null && MavenProjectsManager.getInstance(module.getProject()).isMavenizedModule(module); }
isMavenModule
19,845
String (String packaging, Module module, boolean exploded) { return getArtifactName(packaging, module.getName(), exploded); }
getArtifactName
19,846
String (String packaging, String moduleName, boolean exploded) { return moduleName + ":" + packaging + (exploded ? " exploded" : ""); }
getArtifactName
19,847
String (Module module, boolean exploded) { return getEjbClientArtifactName(module.getName(), exploded); }
getEjbClientArtifactName
19,848
String (String moduleName, boolean exploded) { return moduleName + ":ejb" + (exploded ? CLIENT_EXPLODED_ARTIFACT_SUFFIX : CLIENT_ARTIFACT_SUFFIX); }
getEjbClientArtifactName
19,849
String () { return ApplicationInfoImpl.getShadowInstance().getMajorVersion() + "." + ApplicationInfoImpl.getShadowInstance().getMinorVersion(); }
getIdeaVersionToPassToMavenProcess
19,850
boolean (String fileName) { return fileName.equals(MavenConstants.POM_XML) || fileName.endsWith(".pom") || fileName.startsWith("pom.") || fileName.equals(MavenConstants.SUPER_POM_XML); }
isPomFileName
19,851
boolean (String nameOrPath) { return ArrayUtil.contains(FileUtilRt.getExtension(nameOrPath), MavenConstants.POM_EXTENSIONS); }
isPotentialPomFile
19,852
boolean (@Nullable VirtualFile file) { return isPomFile(null, file); }
isPomFile
19,853
boolean (@Nullable Project project, @Nullable VirtualFile file) { if (file == null) return false; String name = file.getName(); if (isPomFileName(name)) return true; if (!isPotentialPomFile(name)) return false; return isPomFileIgnoringName(project, file); }
isPomFile
19,854
boolean (final File extensionFile, @NotNull MavenId mavenId) { try { Element extensions = getDomRootElement(extensionFile); if (extensions == null) return false; if (!extensions.getName().equals("extensions")) return false; for (Element extension : getElementsWithRegardToNamespace(extensions, "extension", extensionList...
containsDeclaredExtension
19,855
boolean (@Nullable Project project, @NotNull VirtualFile file) { if (project == null || !project.isInitialized()) { if (!FileUtilRt.extensionEquals(file.getName(), "xml")) return false; try { try (InputStream in = file.getInputStream()) { Ref<Boolean> isPomFile = Ref.create(false); Reader reader = new BufferedReader(ne...
isPomFileIgnoringName
19,856
Stream<VirtualFile> (@Nullable Project project, @Nullable VirtualFile root) { if (root == null) return Stream.empty(); return Stream.of(root.getChildren()).filter(file -> isPomFile(project, file)); }
streamPomFiles
19,857
void (Collection<MavenProject> projects) { VirtualFile[] configFiles = getConfigFiles(projects); ApplicationManager.getApplication().invokeLater(() -> { FileContentUtilCore.reparseFiles(configFiles); }); }
restartConfigHighlighting
19,858
VirtualFile[] (Collection<MavenProject> projects) { List<VirtualFile> result = new SmartList<>(); for (MavenProject project : projects) { VirtualFile file = getConfigFile(project, MavenConstants.MAVEN_CONFIG_RELATIVE_PATH); if (file != null) { result.add(file); } } if (result.isEmpty()) { return VirtualFile.EMPTY_ARRAY...
getConfigFiles
19,859
VirtualFile (MavenProject mavenProject, String fileRelativePath) { VirtualFile baseDir = getVFileBaseDir(mavenProject.getDirectoryFile()); return baseDir.findFileByRelativePath(fileRelativePath); }
getConfigFile
19,860
Path (@Nullable MavenProject mavenProject, String path) { if (!Paths.get(path).isAbsolute()) { if (mavenProject == null) { throw new IllegalArgumentException("Project should be not-nul for non-absolute paths"); } path = new File(mavenProject.getDirectory(), path).getPath(); } return new Path(path); }
toPath
19,861
Sdk (@NotNull String name) { for (Sdk projectJdk : ProjectJdkTable.getInstance().getAllJdks()) { if (projectJdk.getName().equals(name)) { if (projectJdk.getSdkType() instanceof JavaSdkType) { return projectJdk; } } } return null; }
getSdkByExactName
19,862
File () { return Paths.get(PathManager.getCommunityHomePath(), "plugins", "maven").toFile(); }
getMavenPluginParentFile
19,863
boolean () { if (shouldRunTasksAsynchronouslyInTests()) { return false; } return ApplicationManager.getApplication().isUnitTestMode(); }
isMavenUnitTestModeEnabled
19,864
boolean () { return Boolean.getBoolean("maven.unit.tests.remove"); }
shouldRunTasksAsynchronouslyInTests
19,865
String (@NotNull MavenProject mavenProject) { MavenPlugin plugin = mavenProject.findPlugin("org.apache.maven.plugins", "maven-compiler-plugin"); return plugin != null ? plugin.getVersion() : ""; }
getCompilerPluginVersion
19,866
boolean (@NotNull MavenGeneralSettings settings) { return settings.getMavenHomeType() instanceof MavenWrapper; }
isWrapper
19,867
void (@NotNull Project project) { if (ProjectRootManager.getInstance(project).getProjectSdk() == null) { Sdk projectSdk = suggestProjectSdk(project); if (projectSdk == null) return; ApplicationManager.getApplication().runWriteAction(() -> { JavaSdkUtil.applyJdkToProject(project, projectSdk); }); } }
setupProjectSdk
19,868
Sdk (@NotNull Project project) { Project defaultProject = ProjectManager.getInstance().getDefaultProject(); ProjectRootManager defaultProjectManager = ProjectRootManager.getInstance(defaultProject); Sdk defaultProjectSdk = defaultProjectManager.getProjectSdk(); if (defaultProjectSdk != null) return null; ProjectJdkTabl...
suggestProjectSdk
19,869
Set<MavenRemoteRepository> (@NotNull Project project) { MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(project); Set<MavenRemoteRepository> repositories = projectsManager.getRemoteRepositories(); MavenEmbeddersManager embeddersManager = projectsManager.getEmbeddersManager(); String baseDir = pr...
getRemoteResolvedRepositories
19,870
boolean (@NotNull Module m) { try { return !m.isDisposed() && ExternalSystemModulePropertyManager.getInstance(m).isMavenized(); } catch (AlreadyDisposedException e) { return false; } }
isMavenizedModule
19,871
boolean (Collection<MavenProjectProblem> readingProblems) { if (Registry.is("maven.always.reset")) return true; MavenProjectProblem unrecoverable = ContainerUtil.find(readingProblems, it -> !it.isRecoverable()); return unrecoverable == null; }
shouldResetDependenciesAndFolders
19,872
MavenProjectModelReadHelper (Project project) { return new MavenProjectModelServerModelReadHelper(project); }
createModelReadHelper
19,873
boolean () { return !MavenUtil.isMavenUnitTestModeEnabled() && !isHeadless() && !isDefault(); }
isNormalProject
19,874
boolean () { return ApplicationManager.getApplication().isHeadlessEnvironment() && !WarmupStatus.InProgress.INSTANCE.equals(WarmupStatus.Companion.currentStatus(ApplicationManager.getApplication())); }
isHeadless
19,875
boolean () { return myProject.isDefault(); }
isDefault
19,876
Project () { return myProject; }
getProject
19,877
MavenArtifactScope (String name) { for (MavenArtifactScope scope : MavenArtifactScope.values()) { if (scope.name().equalsIgnoreCase(name)) return scope; } return null; }
fromString
19,878
void (@NotNull AnActionEvent e) { super.update(e); boolean available = isAvailable(e); e.getPresentation().setEnabledAndVisible(available); }
update
19,879
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
19,880
boolean (@NotNull AnActionEvent e) { return !MavenActionUtil.getMavenProjects(e.getDataContext()).isEmpty(); }
isAvailable
19,881
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabled(isAvailable(e)); }
update
19,882
boolean (@NotNull AnActionEvent e) { return MavenActionUtil.hasProject(e.getDataContext()); }
isAvailable
19,883
boolean (@NotNull AnActionEvent e) { if (!isAvailable(e)) return false; return doIsSelected(e); }
isSelected
19,884
boolean (DataContext context) { return CommonDataKeys.PROJECT.getData(context) != null; }
hasProject
19,885
Project (DataContext context) { return CommonDataKeys.PROJECT.getData(context); }
getProject
19,886
boolean (DataContext context) { Project project = CommonDataKeys.PROJECT.getData(context); if (project == null) return false; MavenProjectsManager mavenProjectsManager = MavenProjectsManager.getInstanceIfCreated(project); if (mavenProjectsManager == null) return false; return mavenProjectsManager.isMavenizedProject(); ...
isMavenizedProject
19,887
MavenProject (DataContext context) { MavenProject result; final MavenProjectsManager manager = getProjectsManager(context); if (manager == null) return null; final VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(context); if (file != null) { result = manager.findProject(file); if (result != null) return result; ...
getMavenProject
19,888
MavenProjectsManager (DataContext context) { final Project project = getProject(context); if (project == null) return null; return MavenProjectsManager.getInstanceIfCreated(project); }
getProjectsManager
19,889
boolean (VirtualFile file) { return file != null && !file.isDirectory() && file.isInLocalFileSystem() && MavenUtil.isPomFile(file); }
isMavenProjectFile
19,890
List<MavenProject> (DataContext context) { Project project = CommonDataKeys.PROJECT.getData(context); if (project == null) return Collections.emptyList(); VirtualFile[] virtualFiles = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(context); if (virtualFiles == null || virtualFiles.length == 0) return Collections.emptyList()...
getMavenProjects
19,891
List<VirtualFile> (DataContext context) { return MavenUtil.collectFiles(getMavenProjects(context)); }
getMavenProjectsFiles
19,892
List<JavadocTagInfo> () { return ContainerUtil.map(ANNOTATION_NAMES, name -> new MojoAnnotationInfo(name)); }
getSupportedTags
19,893
String () { return myName; }
getName
19,894
boolean () { return false; }
isInline
19,895
boolean (PsiElement element) { if (element instanceof PsiClass psiClass) { return InheritanceUtil.isInheritor(psiClass, BASE_CLASS); } return false; }
isValidInContext
19,896
String (PsiDocTagValue value) { return null; }
checkTagValue
19,897
PsiReference (PsiDocTagValue value) { return null; }
getReference
19,898
List<RESULT_TYPE> (Project project, String pattern, int maxResult) { return searchImpl(project, pattern, maxResult); }
search
19,899
JTextField () { return mySearchField; }
getSearchField