Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
19,000
boolean () { return true; }
shouldAddRuntimeDependenciesToTestCompilationClasspath
19,001
boolean (JpsDependencyElement element) { return JpsMavenExtensionService.getInstance().isProductionOnTestDependency(element); }
isProductionOnTestsDependency
19,002
boolean () { return false; }
shouldIncludeTestsFromDependentModulesToTestClasspath
19,003
boolean () { return false; }
shouldProcessDependenciesRecursively
19,004
JpsJavaDependenciesEnumerationHandler (@NotNull Collection<JpsModule> modules) { JpsMavenExtensionService service = JpsMavenExtensionService.getInstance(); for (JpsModule module : modules) { if (service.getExtension(module) != null) { return INSTANCE; } } return null; }
createHandler
19,005
ResourceRootConfiguration () { return myConfig; }
getConfiguration
19,006
String () { return myId; }
getRootId
19,007
File () { return myFile; }
getRootFile
19,008
MavenResourcesTarget () { return myTarget; }
getTarget
19,009
FileFilter () { return new MavenResourceFileFilter(myFile, myConfig); }
createFileFilter
19,010
boolean () { return true; }
canUseFileCache
19,011
int () { return myIndexInPom; }
getIndexInPom
19,012
boolean () { return myOverwrite; }
isOverwrite
19,013
MavenModuleResourceConfiguration (MavenIdBean id) { return getModuleConfigurationMap().get(id); }
findProject
19,014
String (final String propName, final MavenModuleResourceConfiguration moduleConfig, Map<String, String> additionalProperties) { boolean hasPrefix = false; String unprefixed = propName; if (propName.startsWith("pom.")) { unprefixed = propName.substring("pom.".length()); hasPrefix = true; } else if (propName.startsWith("...
resolveProperty
19,015
Properties () { Properties res = ourSystemProperties; if (res == null) { res = new Properties(); res.putAll(System.getProperties()); for (Iterator<Object> itr = res.keySet().iterator(); itr.hasNext(); ) { final String propertyName = itr.next().toString(); if (propertyName.startsWith("idea.") || propertyName.startsWith(...
getSystemProperties
19,016
void (File baseDir, String relativePath, Map<String, String> result, String valueIfMissing) { File configFile = new File(baseDir, relativePath); if (configFile.isFile()) { try { for (String parameter : ParametersListUtil.parse(FileUtil.loadFile(configFile, CharsetToolkit.UTF8))) { Matcher matcher = MAVEN_PROPERTY_PATTE...
readConfigFile
19,017
File (String path) { File workingDir = new File(FileUtil.toSystemDependentName(path)); File baseDir = workingDir; File dir = workingDir; while ((dir = dir.getParentFile()) != null) { if (new File(dir, ".mvn").exists()) { baseDir = dir; break; } } try { return baseDir.getCanonicalFile(); } catch (IOException e) { return...
getBaseDir
19,018
void (@NotNull JpsModule module, @NotNull Element rootElement) { boolean isMavenModule = Boolean.parseBoolean(rootElement.getAttributeValue(MAVEN_MODULE_ATTRIBUTE)) || rootElement.getChildren().stream() .anyMatch(element -> MAVEN_SYSTEM_ID.equals(element.getAttributeValue("externalSystem"))); if (isMavenModule) { JpsMa...
loadModuleOptions
19,019
void (JpsDependencyElement dependency, Element orderEntry) { if (orderEntry.getAttributeValue(PRODUCTION_ON_TEST_ATTRIBUTE) != null) { JpsMavenExtensionService.getInstance().setProductionOnTestDependency(dependency, true); } }
loadModuleDependencyProperties
19,020
String () { return myModule.getName(); }
getId
19,021
boolean () { return true; }
isCompiledBeforeModuleLevelBuilders
19,022
List<MavenResourceRootDescriptor> (@NotNull JpsModel model, @NotNull ModuleExcludeIndex index, @NotNull IgnoredFileIndex ignoredFileIndex, @NotNull BuildDataPaths dataPaths) { // todo: should we honor ignored and excluded roots here? final List<MavenResourceRootDescriptor> result = new ArrayList<>(); MavenModuleResourc...
computeRootDescriptors
19,023
Collection<ResourceRootConfiguration> (@Nullable MavenModuleResourceConfiguration moduleConfig) { if (moduleConfig != null) { return isTests() ? moduleConfig.testResources : moduleConfig.resources; } return Collections.emptyList(); }
getRootConfigurations
19,024
MavenModuleResourceConfiguration (BuildDataPaths dataPaths) { final MavenProjectConfiguration projectConfig = JpsMavenExtensionService.getInstance().getMavenProjectConfiguration(dataPaths); if (projectConfig == null) return null; return projectConfig.moduleConfigurations.get(myModule.getName()); }
getModuleResourcesConfiguration
19,025
boolean () { return ((MavenResourcesTargetType)getTargetType()).isTests(); }
isTests
19,026
MavenResourceRootDescriptor (@NotNull String rootId, @NotNull BuildRootIndex rootIndex) { for (MavenResourceRootDescriptor descriptor : rootIndex.getTargetRoots(this, null)) { if (descriptor.getRootId().equals(rootId)) { return descriptor; } } return null; }
findRootDescriptor
19,027
String () { return getTargetType().getTypeId() + ":" + myModule.getName(); }
getPresentableName
19,028
Collection<File> (@NotNull CompileContext context) { MavenModuleResourceConfiguration configuration = getModuleResourcesConfiguration(context.getProjectDescriptor().dataManager.getDataPaths()); if (configuration == null) return Collections.emptyList(); Set<File> result = FileCollectionFactory.createCanonicalFileSet(); ...
getOutputRoots
19,029
File () { return JpsJavaExtensionService.getInstance().getOutputDirectory(myModule, isTests()); }
getModuleOutputDir
19,030
File (@Nullable File moduleOutput, ResourceRootConfiguration config, @Nullable String outputDirectory) { if(outputDirectory != null) { moduleOutput = JpsPathUtil.urlToFile(outputDirectory); } if (moduleOutput == null) { return null; } String targetPath = config.targetPath; if (StringUtil.isEmptyOrSpaces(targetPath)) { ...
getOutputDir
19,031
void (@NotNull ProjectDescriptor pd, @NotNull PrintWriter out) { final BuildDataPaths dataPaths = pd.getTargetsState().getDataPaths(); final MavenModuleResourceConfiguration configuration = getModuleResourcesConfiguration(dataPaths); if (configuration != null) { out.write(Integer.toHexString(configuration.computeConfig...
writeConfiguration
19,032
Set<String> () { if (filteringExclusions.isEmpty()) { return MavenProjectConfiguration.DEFAULT_FILTERING_EXCLUDED_EXTENSIONS; } final Set<String> result = CollectionFactory.createFilePathSet(); result.addAll(MavenProjectConfiguration.DEFAULT_FILTERING_EXCLUDED_EXTENSIONS); result.addAll(filteringExclusions); return Col...
getFilteringExcludedExtensions
19,033
int (boolean forTestResources) { int result = computeModuleConfigurationHash(); final List<ResourceRootConfiguration> _resources = forTestResources? testResources : resources; result = 31 * result; for (ResourceRootConfiguration resource : _resources) { result += resource.computeConfigurationHash(); } return result; }
computeConfigurationHash
19,034
int () { int result = id.hashCode(); result = 31 * result + (parentId != null ? parentId.hashCode() : 0); result = 31 * result + directory.hashCode(); result = 31 * result + (manifest != null ? manifest.hashCode() : 0); result = 31 * result + (classpath != null ? classpath.hashCode() : 0); result = 31 * result + delimi...
computeModuleConfigurationHash
19,035
String () { return "MavenModuleResourceConfiguration{" + "id=" + id + ", parentId=" + parentId + ", directory='" + directory + '\'' + ", manifest='" + manifest + '\'' + ", classpath='" + classpath + '\'' + ", delimitersPattern='" + delimitersPattern + '\'' + ", modelMap=" + modelMap + ", properties=" + properties + ", ...
toString
19,036
boolean (JpsModule module) { // enable standard resource processing only if this is not a maven module // for maven modules use maven-aware resource builder return getExtension(module) == null; }
isResourceProcessingEnabled
19,037
JpsMavenModuleExtension (@NotNull JpsModule module) { return module.getContainer().getChild(JpsMavenModuleExtensionImpl.ROLE); }
getExtension
19,038
JpsMavenModuleExtension (@NotNull JpsModule module) { JpsMavenModuleExtension extension = module.getContainer().getChild(JpsMavenModuleExtensionImpl.ROLE); if (extension == null) { extension = new JpsMavenModuleExtensionImpl(); module.getContainer().setChild(JpsMavenModuleExtensionImpl.ROLE, extension); } return extens...
getOrCreateExtension
19,039
void (@NotNull JpsDependencyElement dependency, boolean value) { if (value) { dependency.getContainer().setChild(PRODUCTION_ON_TEST_ROLE, JpsElementFactory.getInstance().createSimpleElement(true)); } else { dependency.getContainer().removeChild(PRODUCTION_ON_TEST_ROLE); } }
setProductionOnTestDependency
19,040
boolean (@NotNull JpsDependencyElement dependency) { JpsSimpleElement<Boolean> child = dependency.getContainer().getChild(PRODUCTION_ON_TEST_ROLE); return child != null && child.getData(); }
isProductionOnTestDependency
19,041
boolean (@NotNull BuildDataPaths paths) { return myConfigFileExists.get(new File(paths.getDataStorageRoot(), MavenProjectConfiguration.CONFIGURATION_FILE_RELATIVE_PATH)); }
hasMavenProjectConfiguration
19,042
MavenProjectConfiguration (BuildDataPaths paths) { if (!hasMavenProjectConfiguration(paths)) { return null; } final File dataStorageRoot = paths.getDataStorageRoot(); return getMavenProjectConfiguration(dataStorageRoot); }
getMavenProjectConfiguration
19,043
MavenProjectConfiguration (@NotNull File dataStorageRoot) { final File configFile = new File(dataStorageRoot, MavenProjectConfiguration.CONFIGURATION_FILE_RELATIVE_PATH); MavenProjectConfiguration config; synchronized (myLoadedConfigs) { config = myLoadedConfigs.get(configFile); if (config == null) { config = new Maven...
getMavenProjectConfiguration
19,044
boolean () { return includes.isEmpty() && excludes.isEmpty(); }
isEmpty
19,045
boolean () { return myIsTests; }
isTests
19,046
List<MavenAnnotationProcessorTarget> (@NotNull JpsModel model) { List<MavenAnnotationProcessorTarget> targets = new ArrayList<>(); for (JpsModule module : model.getProject().getModules()) { targets.add(new MavenAnnotationProcessorTarget(this, module)); } return targets; }
computeAllTargets
19,047
BuildTargetLoader<MavenAnnotationProcessorTarget> (@NotNull JpsModel model) { final Map<String, JpsModule> modules = new HashMap<>(); for (JpsModule module : model.getProject().getModules()) { modules.put(module.getName(), module); } return new BuildTargetLoader<MavenAnnotationProcessorTarget>() { @Nullable @Override p...
createLoader
19,048
MavenAnnotationProcessorTarget (@NotNull String targetId) { JpsModule module = modules.get(targetId); return module == null ? null : new MavenAnnotationProcessorTarget(MavenAnnotationProcessorTargetType.this, module); }
createTarget
19,049
void () { loadProject("plugins/maven/jps-plugin/testData/compiler/classpathTest"); List<JpsModule> modules = myProject.getModules(); assertEquals(3, modules.size()); JpsModule main = modules.get(0); assertEquals("main", main.getName()); JpsModule dep = modules.get(1); assertEquals("dep", dep.getName()); JpsModule depTe...
testLoadProject
19,050
JpsMavenExtensionService () { return JpsMavenExtensionService.getInstance(); }
getService
19,051
void (Class<?> aClass, String testName) { if (!preimportTestMode) return; try { if (aClass.getDeclaredAnnotation(InstantImportCompatible.class) == null) { Method testMethod = aClass.getMethod(testName); Assume.assumeNotNull(testMethod.getDeclaredAnnotation(InstantImportCompatible.class)); } } catch (NoSuchMethodExcepti...
assumeTestCanBeReusedForPreimport
19,052
void () { assumeTestCanBeReusedForPreimport(this.getClass(), getName()); }
assumeThisTestCanBeReusedForPreimport
19,053
void () { String wslMsId = System.getProperty("wsl.distribution.name"); if (wslMsId == null) return; List<WSLDistribution> distributions = WslDistributionManager.getInstance().getInstalledDistributions(); if (distributions.isEmpty()) throw new IllegalStateException("no WSL distributions configured!"); myWSLDistribution...
setupWsl
19,054
void () { PlatformTestUtil.waitWithEventsDispatching(() -> "Waiting for MavenUtils runnables completed" + MavenUtil.getUncompletedRunnables(), () -> MavenUtil.noUncompletedRunnables(), 15); }
waitForMavenUtilRunnablesComplete
19,055
Set<Action> (@NotNull String category, @NotNull String message, String @NotNull [] details, @Nullable Throwable t) { boolean intercept = t != null && ( StringUtil.notNullize(t.getMessage()).contains("The network name cannot be found") && message.contains("Couldn't read shelf information") || "JDK annotations not found"...
processError
19,056
Sdk (String jdkPath) { Sdk sdk = ContainerUtil.find(ProjectJdkTable.getInstance().getAllJdks(), it -> jdkPath.equals(it.getHomePath())); ProjectJdkTable jdkTable = ProjectJdkTable.getInstance(); for (Sdk existingSdk : jdkTable.getAllJdks()) { if (existingSdk == sdk) return sdk; } Sdk newSdk = JavaSdk.getInstance().crea...
getWslSdk
19,057
void () { MavenProjectsManager manager = MavenProjectsManager.getInstanceIfCreated(myProject); if (manager == null) return; manager.getEmbeddersManager().releaseInTests(); }
tearDownEmbedders
19,058
void () { assertEmpty("all maven connectors should be disposed", MavenServerManager.getInstance().getAllConnectors()); }
checkAllMavenConnectorsDisposed
19,059
boolean () { return false; }
useDirectoryBasedProjectFormat
19,060
MavenProgressIndicator () { return myProgressIndicator; }
getMavenProgressIndicator
19,061
void (File dir) { FileUtil.delete(dir); // cannot use reliably the result of the com.intellij.openapi.util.io.FileUtil.delete() method // because com.intellij.openapi.util.io.FileUtilRt.deleteRecursivelyNIO() does not honor this contract if (dir.exists()) { System.err.println("Cannot delete " + dir); //printDirectoryCo...
deleteDirOnTearDown
19,062
void (File dir) { File[] files = dir.listFiles(); if (files == null) return; for (File file : files) { System.out.println(file.getAbsolutePath()); if (file.isDirectory()) { printDirectoryContent(file); } } }
printDirectoryContent
19,063
String () { if (SystemInfo.isWindows) return "c:"; return ""; }
getRoot
19,064
String () { if (SystemInfo.isWindows) { return "TEMP"; } else if (SystemInfo.isLinux) return "HOME"; return "TMPDIR"; }
getEnvVar
19,065
MavenGeneralSettings () { return MavenProjectsManager.getInstance(myProject).getGeneralSettings(); }
getMavenGeneralSettings
19,066
MavenImportingSettings () { return MavenProjectsManager.getInstance(myProject).getImportingSettings(); }
getMavenImporterSettings
19,067
String () { String path = getRepositoryFile().getPath(); return FileUtil.toSystemIndependentName(path); }
getRepositoryPath
19,068
File () { return getMavenGeneralSettings().getEffectiveLocalRepository(); }
getRepositoryFile
19,069
void (String path) { getMavenGeneralSettings().setLocalRepository(path); }
setRepositoryPath
19,070
String () { return myProjectRoot.getPath(); }
getProjectPath
19,071
String () { return myProjectRoot.getParent().getPath(); }
getParentPath
19,072
String (String relPath) { return pathFromBasedir(myProjectRoot, relPath); }
pathFromBasedir
19,073
String (VirtualFile root, String relPath) { return FileUtil.toSystemIndependentName(root.getPath() + "/" + relPath); }
pathFromBasedir
19,074
String (String content) { return "<settings>" + content + "</settings>\r\n"; }
createSettingsXmlContent
19,075
Module (String name) { return createModule(name, StdModuleTypes.JAVA); }
createModule
19,076
Module (final String name, final ModuleType type) { try { return WriteCommandAction.writeCommandAction(myProject).compute(() -> { VirtualFile f = createProjectSubFile(name + "/" + name + ".iml"); Module module = ModuleManager.getInstance(myProject).newModule(f.getPath(), type.getId()); PsiTestUtil.addContentRoot(module...
createModule
19,077
VirtualFile (String xml) { return createProfilesFile(myProjectRoot, xml, true); }
createProfilesXmlOldStyle
19,078
VirtualFile (String relativePath, String xml) { return createProfilesFile(createProjectSubDir(relativePath), xml, true); }
createProfilesXmlOldStyle
19,079
VirtualFile (String xml) { return createProfilesFile(myProjectRoot, xml, false); }
createProfilesXml
19,080
VirtualFile (String relativePath, String xml) { return createProfilesFile(createProjectSubDir(relativePath), xml, false); }
createProfilesXml
19,081
VirtualFile (VirtualFile dir, String xml, boolean oldStyle) { return createProfilesFile(dir, createValidProfiles(xml, oldStyle)); }
createProfilesFile
19,082
VirtualFile (String content) { return createProfilesFile(myProjectRoot, content); }
createFullProfilesXml
19,083
VirtualFile (String relativePath, String content) { return createProfilesFile(createProjectSubDir(relativePath), content); }
createFullProfilesXml
19,084
VirtualFile (final VirtualFile dir, String content) { VirtualFile f = dir.findChild("profiles.xml"); if (f == null) { try { f = WriteAction.computeAndWait(() -> dir.createChildData(null, "profiles.xml")); } catch (IOException e) { throw new RuntimeException(e); } } setFileContent(f, content, true); return f; }
createProfilesFile
19,085
void (String... relativePaths) { for (String path : relativePaths) { createProjectSubDir(path); } }
createProjectSubDirs
19,086
VirtualFile (String relativePath) { File f = new File(getProjectPath(), relativePath); f.mkdirs(); return LocalFileSystem.getInstance().refreshAndFindFileByIoFile(f); }
createProjectSubDir
19,087
void (final VirtualFile file, final String content, final boolean advanceStamps) { try { WriteAction.runAndWait(() -> { if (advanceStamps) { file.setBinaryContent(content.getBytes(StandardCharsets.UTF_8), -1, file.getTimeStamp() + 4000); } else { file.setBinaryContent(content.getBytes(StandardCharsets.UTF_8), file.getM...
setFileContent
19,088
void (Collection<String> actual, Collection<String> expected) { assertEquals(new SetWithToString<>(CollectionFactory.createFilePathSet(expected)), new SetWithToString<>(CollectionFactory.createFilePathSet(actual))); }
assertUnorderedPathsAreEqual
19,089
void (String filePath, String expectedText) { try { assertSameLinesWithFile(filePath, expectedText); } catch (FileComparisonFailure e) { String expected = e.getExpected(); String actual = e.getActual(); assertUnorderedElementsAreEqual(expected.split("\n"), actual.split("\n")); } }
assertUnorderedLinesWithFile
19,090
boolean () { //printIgnoredMessage(null); return false; }
ignore
19,091
boolean () { boolean result = getTestMavenHome() != null; if (!result) printIgnoredMessage("Maven installation not found"); return result; }
hasMavenInstallation
19,092
MavenServerConnector (MavenServerConnector connector) { assertTrue("Connector is Dummy!", connector instanceof MavenServerConnectorImpl); long timeout = TimeUnit.SECONDS.toMillis(10); long start = System.currentTimeMillis(); while (connector.getState() == MavenServerConnectorImpl.State.STARTING) { if (System.currentTim...
ensureConnected
19,093
void (String message) { String toPrint = "Ignored"; if (message != null) { toPrint += ", because " + message; } toPrint += ": " + getClass().getSimpleName() + "." + getName(); System.out.println(toPrint); }
printIgnoredMessage
19,094
String () { return System.getProperty("idea.maven.test.home"); }
getTestMavenHome
19,095
DataContext (VirtualFile pomFile) { final DataContext defaultContext = DataManager.getInstance().getDataContext(); return dataId -> { if (CommonDataKeys.PROJECT.is(dataId)) { return myProject; } if (CommonDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) { return new VirtualFile[]{pomFile}; } return defaultContext.getData(dataId...
createTestDataContext
19,096
int () { return myDelegate.size(); }
size
19,097
boolean (Object o) { return myDelegate.contains(o); }
contains
19,098
Iterator<T> () { return myDelegate.iterator(); }
iterator
19,099
boolean (Collection<?> c) { return myDelegate.containsAll(c); }
containsAll