Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
22,400
void (String key, String value) { PropertiesComponent props = PropertiesComponent.getInstance(); props.setValue(key, value); }
saveValue
22,401
JComponent () { return myMainPanel; }
getComponent
22,402
MavenProject (Project project) { if (!MavenProjectsManager.getInstance(project).isMavenizedProject()) return null; VirtualFile parentPom = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(myContext.getProjectFileDirectory(), MavenConstants.POM_XML)); if (parentPom == null) return null; return MavenProj...
findPotentialParentProject
22,403
void (@NotNull JTextField artifactIdField, @Nullable String text) { if (StringUtil.isEmpty(artifactIdField.getText())) { artifactIdField.setText(StringUtil.notNullize(text)); } }
setTextIfEmpty
22,404
void () { if (myArchetypes != null && myArchetypes.isSkipUpdateUI()) return; if (isMavenizedProject()) { MavenProject parent = findPotentialParentProject(myProjectOrNull); myAggregator = parent; myParent = parent; } MavenId projectId = myBuilder.getProjectId(); if (projectId == null) { setTextIfEmpty(myArtifactIdField,...
updateStep
22,405
boolean () { return myProjectOrNull != null && MavenProjectsManager.getInstance(myProjectOrNull).isMavenizedProject(); }
isMavenizedProject
22,406
void () { myAddToPanel.setVisible(isMavenizedProject()); myAggregatorNameLabel.setText(formatProjectString(myAggregator)); myParentNameLabel.setText(formatProjectString(myParent)); if (myParent == null) { myGroupIdField.setEnabled(true); myVersionField.setEnabled(true); myInheritGroupIdCheckBox.setEnabled(false); myInh...
updateComponents
22,407
String () { if (myContext.isCreatingNewProject()) { String baseDir = myContext.getProjectFileDirectory(); return ProjectWizardUtil.findNonExistingFileName(baseDir, "untitled", ""); } return ""; }
suggestArtifactId
22,408
String (MavenProject project) { if (project == null) return MavenProjectBundle.message("maven.parent.label.none"); return project.getMavenId().getDisplayString(); }
formatProjectString
22,409
void () { myContext.setProjectBuilder(myBuilder); myBuilder.setAggregatorProject(myAggregator); myBuilder.setParentProject(myParent); myBuilder.setProjectId(new MavenId(myGroupIdField.getText(), myArtifactIdField.getText(), myVersionField.getText())); myBuilder.setInheritedOptions(myInheritGroupIdCheckBox.isSelected(),...
updateDataModel
22,410
Icon () { return WIZARD_ICON; }
getIcon
22,411
String () { return "reference.dialogs.new.project.fromScratch.maven"; }
getHelpId
22,412
void () { if (myArchetypes != null) { Disposer.dispose(myArchetypes); } }
disposeUIResources
22,413
void (@NotNull DocumentEvent e) { doValidateInput(); }
textChanged
22,414
JComponent () { return myMainPanel; }
createCenterPanel
22,415
JComponent () { return myGroupIdField; }
getPreferredFocusedComponent
22,416
String () { return "Add_Archetype_Dialog"; }
getHelpId
22,417
void () { List<String> errors = new ArrayList<>(); if (StringUtil.isEmptyOrSpaces(myGroupIdField.getText())) errors.add("GroupId"); if (StringUtil.isEmptyOrSpaces(myArtifactIdField.getText())) errors.add("ArtifactId"); if (StringUtil.isEmptyOrSpaces(myVersionField.getText())) errors.add("Version"); if (errors.isEmpty()...
doValidateInput
22,418
MavenArchetype () { return new MavenArchetype(myGroupIdField.getText(), myArtifactIdField.getText(), myVersionField.getText(), myRepositoryField.getText(), null); }
getArchetype
22,419
FrameworkSupportConfigurable (@NotNull FrameworkSupportModel model) { return new FrameworkSupportConfigurable() { @Override public JComponent getComponent() { return new JPanel(); } @Override public void addSupport(@NotNull Module module, @NotNull ModifiableRootModel model, @Nullable Library library) { VirtualFile[] ro...
createConfigurable
22,420
JComponent () { return new JPanel(); }
getComponent
22,421
void (@NotNull Module module, @NotNull ModifiableRootModel model, @Nullable Library library) { VirtualFile[] roots = model.getContentRoots(); VirtualFile root; if (roots.length == 0) { VirtualFile moduleFile = module.getModuleFile(); if (moduleFile != null) { root = moduleFile.getParent(); model.addContentEntry(root); ...
addSupport
22,422
void (@NotNull ModifiableRootModel model, @NotNull VirtualFile root) { VirtualFile src = root.findChild("src"); if (src == null || !src.isDirectory()) return; if (ArrayUtil.contains(src, model.getSourceRoots())) { try { VirtualFile java = VfsUtil.createDirectories(src.getPath() + "/main/java"); if (java != null && java...
prepareProjectStructure
22,423
boolean (@NotNull ModuleBuilder builder) { return false; }
isEnabledForModuleBuilder
22,424
boolean (@NotNull Module module) { return MavenProjectsManager.getInstance(module.getProject()).isMavenizedModule(module); }
isSupportAlreadyAdded
22,425
boolean (@NotNull ModuleType moduleType) { return moduleType.equals(StdModuleTypes.JAVA); }
isEnabledForModuleType
22,426
Icon () { return RepositoryLibraryLogo; }
getIcon
22,427
void () { myEnvironmentForm = new MavenEnvironmentForm(); Project project = myProjectOrNull == null ? ProjectManager.getInstance().getDefaultProject() : myProjectOrNull; myEnvironmentForm.initializeFormData(MavenProjectsManager.getInstance(project).getGeneralSettings().clone(), project); myEnvironmentPanel.add(myEnviro...
initComponents
22,428
void () { MavenArchetype archetype = myBuilder.getArchetype(); MavenId projectId = myBuilder.getProjectId(); Map<String, String> descriptor = getArchetypeDescriptor(archetype); Map<String, String> props = new LinkedHashMap<>(); props.put("groupId", projectId.getGroupId()); props.put("artifactId", projectId.getArtifactI...
updateStep
22,429
JComponent () { return myMainPanel; }
getComponent
22,430
boolean () { return myBuilder.getArchetype() != null; }
isStepVisible
22,431
void () { myBuilder.setEnvironmentForm(myEnvironmentForm); myBuilder.setPropertiesToCreateByArtifact(myMavenPropertiesPanel.getDataAsMap()); }
updateDataModel
22,432
String () { return "New_Projects_from_Scratch_Maven_Settings_Page"; }
getHelpId
22,433
ModuleWizardStep[] (@NotNull WizardContext wizardContext, @NotNull ModulesProvider modulesProvider) { return new ModuleWizardStep[]{ new MavenModuleWizardStep(this, wizardContext, !wizardContext.isNewWizard()), new SelectPropertiesStep(wizardContext.getProject(), this) }; }
createWizardSteps
22,434
Promise<Object> (@NotNull PlaybackContext context) { String path = extractCommandArgument(PREFIX).split(" ")[0]; var settings = MavenProjectsManager.getInstance(context.getProject()).getGeneralSettings(); var promise = new AsyncPromise<>(); settings.addListener(() -> { promise.setResult(null); }); settings.setUserSetti...
_execute
22,435
byte[] (Properties properties) { StringBuilder builder = new StringBuilder(); TreeSet<String> sortedKeys = new TreeSet<>((Set)properties.keySet()); for (String each : sortedKeys) { builder.append(StringUtil.escapeProperty(each, true)); builder.append("="); builder.append(StringUtil.escapeProperty(properties.getProperty...
createContent
22,436
String () { return myPath; }
getName
22,437
VirtualFileSystem () { return myFS; }
getFileSystem
22,438
String () { return myPath; }
getPath
22,439
boolean () { return false; }
isWritable
22,440
boolean () { return false; }
isDirectory
22,441
boolean () { return true; }
isValid
22,442
VirtualFile () { return null; }
getParent
22,443
VirtualFile[] () { return null; }
getChildren
22,444
long () { return -1; }
getTimeStamp
22,445
long () { return Arrays.hashCode(myContent); }
getModificationStamp
22,446
long () { return myContent.length; }
getLength
22,447
void (boolean asynchronous, boolean recursive, Runnable postRunnable) { }
refresh
22,448
MavenPropertiesVirtualFileSystem () { return (MavenPropertiesVirtualFileSystem)VirtualFileManager.getInstance().getFileSystem(PROTOCOL); }
getInstance
22,449
String () { return PROTOCOL; }
getProtocol
22,450
VirtualFile () { if (mySystemPropertiesFile == null) { Properties systemProperties = new Properties(); for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) { if (entry.getKey() instanceof String key && entry.getValue() instanceof String) { if (!key.startsWith("idea.")) { systemProperties.setPropert...
getSystemPropertiesFile
22,451
VirtualFile () { if (myEnvPropertiesFile == null) { Properties envProperties = new Properties(); for (Map.Entry<String, String> each : System.getenv().entrySet()) { String key = each.getKey(); if (key.startsWith("=")) continue; envProperties.setProperty(SystemInfo.isWindows ? StringUtil.toUpperCase(key) : key, each.get...
getEnvPropertiesFile
22,452
IProperty (Project project, @NotNull String propertyName) { return MavenDomUtil.findProperty(project, getSystemPropertiesFile(), propertyName); }
findSystemProperty
22,453
IProperty (Project project, @NotNull String propertyName) { return MavenDomUtil.findProperty(project, getEnvPropertiesFile(), propertyName); }
findEnvProperty
22,454
Icon (@NotNull String path, int cacheKey, int flags) { return IconManager.getInstance().loadRasterizedIcon(path, MavenIcons.class.getClassLoader(), cacheKey, flags); }
load
22,455
MavenModuleMap () { return ourInstance; }
getInstance
22,456
boolean (Artifact artifact) { String extension = artifact.getArtifactHandler().getExtension(); File file = findArtifact(artifact.getGroupId(), artifact.getArtifactId(), extension, artifact.getType(), artifact.getBaseVersion()); if (file == null) { return false; } artifact.setFile(file); artifact.setResolved(true); retu...
resolveToModule
22,457
File (String groupId, String artifactId, String extension, String classifier, String baseVersion) { String type = extension; if ("jar".equals(type) && classifier != null && !classifier.isEmpty()) { type = "tests".equals(classifier) || "test-jar".equals(classifier) ? "test-jar" : classifier; } String key = groupId + ':'...
findArtifact
22,458
MavenServerEmbedder (MavenEmbedderSettings settings, MavenToken token) { MavenServerUtil.checkToken(token); try { Maven40ServerEmbedderImpl result = new Maven40ServerEmbedderImpl(settings); UnicastRemoteObject.exportObject(result, 0); return result; } catch (MavenCoreInitializationException e) { throw e; } catch (Throw...
createEmbedder
22,459
MavenServerIndexer (MavenToken token) { MavenServerUtil.checkToken(token); throw new UnsupportedOperationException(); }
createIndexer
22,460
MavenModel (MavenModel model, File basedir, File pomDir, MavenToken token) { MavenServerUtil.checkToken(token); try { return Maven40ProfileUtil.interpolateAndAlignModel(model, basedir, pomDir); } catch (Throwable e) { throw wrapToSerializableRuntimeException(e); } }
interpolateAndAlignModel
22,461
MavenModel (MavenModel model, MavenModel parentModel, MavenToken token) { MavenServerUtil.checkToken(token); try { return Maven40ModelInheritanceAssembler.assembleInheritance(model, parentModel); } catch (Throwable e) { throw wrapToSerializableRuntimeException(e); } }
assembleInheritance
22,462
ProfileApplicationResult (MavenModel model, File basedir, MavenExplicitProfiles explicitProfiles, HashSet<String> alwaysOnProfiles, MavenToken token) { MavenServerUtil.checkToken(token); try { return Maven40ProfileUtil.applyProfiles(model, basedir, explicitProfiles, alwaysOnProfiles); } catch (Throwable e) { throw wrap...
applyProfiles
22,463
MavenServerStatus (boolean clean) { return new MavenServerStatus(); }
getDebugStatus
22,464
void (PlexusContainer container) { ((DefaultPlexusContainer)container).setLoggerManager(new BaseLoggerManager() { @Override protected Logger createLogger(String s) { return myConsoleWrapper; } }); }
customizeContainer
22,465
Logger (String s) { return myConsoleWrapper; }
createLogger
22,466
List<String> (MavenServerSettings serverSettings) { List<String> commandLineOptions = new ArrayList<String>(serverSettings.getUserProperties().size()); for (Map.Entry<Object, Object> each : serverSettings.getUserProperties().entrySet()) { commandLineOptions.add("-D" + each.getKey() + "=" + each.getValue()); } if (serve...
createCommandLineOptions
22,467
MavenServerResponse<ArrayList<MavenServerExecutionResult>> (@NotNull String longRunningTaskId, @NotNull ProjectResolutionRequest request, MavenToken token) { MavenServerUtil.checkToken(token); List<File> files = request.getPomFiles(); List<String> activeProfiles = request.getActiveProfiles(); List<String> inactiveProfi...
resolveProjects
22,468
boolean () { return true; }
canResolveDependenciesInParallel
22,469
File () { return new File(myEmbedderSettings.getSettings().getLocalRepositoryPath()); }
getLocalRepositoryFile
22,470
void (@Nullable File file, @NotNull Collection<? extends Exception> exceptions, @NotNull List<? extends ModelProblem> modelProblems, @NotNull Collection<? super MavenProjectProblem> collector) { for (Throwable each : exceptions) { collector.addAll(collectExceptionProblems(file, each)); } for (ModelProblem problem : mod...
collectProblems
22,471
List<MavenProjectProblem> (@Nullable File file, Throwable ex) { List<MavenProjectProblem> result = new ArrayList<>(); if (ex == null) return result; MavenServerGlobals.getLogger().print(ExceptionUtils.getFullStackTrace(ex)); myConsoleWrapper.info("Validation error:", ex); Artifact problemTransferArtifact = getProblemTr...
collectExceptionProblems
22,472
String (Throwable each) { String baseMessage = each.getMessage() != null ? each.getMessage() : ""; Throwable rootCause = ExceptionUtils.getRootCause(each); String rootMessage = rootCause != null ? rootCause.getMessage() : ""; return StringUtils.isNotEmpty(rootMessage) ? rootMessage : baseMessage; }
getRootMessage
22,473
Artifact (Throwable each) { Throwable[] throwables = ExceptionUtils.getThrowables(each); if (throwables == null) return null; for (Throwable throwable : throwables) { if (throwable instanceof ArtifactTransferException) { return RepositoryUtils.toArtifact(((ArtifactTransferException)throwable).getArtifact()); } } return...
getProblemTransferArtifact
22,474
MavenId (Throwable exception) { try { Field field = exception.getClass().getDeclaredField("extension"); field.setAccessible(true); CoreExtension extension = (CoreExtension)field.get(exception); return new MavenId(extension.getGroupId(), extension.getArtifactId(), extension.getVersion()); } catch (Throwable e) { return ...
extractIdFromException
22,475
MavenExecutionRequest (File file, List<String> activeProfiles, List<String> inactiveProfiles) { return createRequest(file, activeProfiles, inactiveProfiles, new Properties()); }
createRequest
22,476
MavenExecutionRequest (@Nullable File file, @Nullable List<String> activeProfiles, @Nullable List<String> inactiveProfiles, @NotNull Properties customProperties) { MavenExecutionRequest result = new DefaultMavenExecutionRequest(); try { injectDefaultRepositories(result); injectDefaultPluginRepositories(result); getComp...
createRequest
22,477
File (@Nullable File file) { File mavenMultiModuleProjectDirectory; if (file == null) { mavenMultiModuleProjectDirectory = new File(FileUtilRt.getTempDirectory()); } else { mavenMultiModuleProjectDirectory = MavenServerUtil.findMavenBasedir(file); } return mavenMultiModuleProjectDirectory; }
getMultimoduleProjectDir
22,478
List<String> (@Nullable List<String> defaultActiveProfiles, @Nullable List<String> explicitActiveProfiles, @Nullable List<String> explicitInactiveProfiles) { if (defaultActiveProfiles == null || defaultActiveProfiles.isEmpty()) { return explicitActiveProfiles != null ? explicitActiveProfiles : Collections.emptyList(); ...
collectActiveProfiles
22,479
void (MavenExecutionRequest request, Runnable runnable) { DefaultMaven maven = (DefaultMaven)getComponent(Maven.class); SessionScope sessionScope = getComponent(SessionScope.class); sessionScope.enter(); try { MavenSession mavenSession = createMavenSession(request, maven); sessionScope.seed(MavenSession.class, mavenSes...
executeWithMavenSession
22,480
void (MavenSession mavenSession) { try { for (AbstractMavenLifecycleParticipant listener : getLifecycleParticipants(Collections.emptyList())) { listener.afterSessionStart(mavenSession); } } catch (MavenExecutionException e) { throw new RuntimeException(e); } }
notifyAfterSessionStart
22,481
Collection<AbstractMavenLifecycleParticipant> (Collection<MavenProject> projects) { Collection<AbstractMavenLifecycleParticipant> lifecycleListeners = new LinkedHashSet<>(); ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); try { try { lifecycleListeners.addAll(getContainer().lookupList(...
getLifecycleParticipants
22,482
void (String message, Throwable e) { MavenServerGlobals.getLogger().warn(new RuntimeException(message, e)); }
warn
22,483
PlexusContainer () { return myContainer; }
getContainer
22,484
MavenSession (MavenExecutionRequest request, DefaultMaven maven) { RepositorySystemSession repositorySession = maven.newRepositorySession(request); request.getProjectBuildingRequest().setRepositorySession(repositorySession); return new MavenSession(getContainer(), repositorySession, request, new DefaultMavenExecutionRe...
createMavenSession
22,485
MavenServerResponse<ArrayList<PluginResolutionResponse>> (@NotNull String longRunningTaskId, @NotNull ArrayList<PluginResolutionRequest> pluginResolutionRequests, boolean forceUpdateSnapshots, MavenToken token) { MavenServerUtil.checkToken(token); boolean runInParallel = canResolveDependenciesInParallel(); try (LongRun...
resolvePlugins
22,486
PluginResolutionResponse (LongRunningTask task, MavenId mavenPluginId, List<Dependency> pluginDependencies, List<RemoteRepository> remoteRepos, RepositorySystemSession session) { long startTime = System.currentTimeMillis(); List<MavenArtifact> artifacts = new ArrayList<>(); if (task.isCanceled()) return new PluginResol...
resolvePlugin
22,487
String (@NotNull File file, @NotNull ArrayList<String> activeProfiles, @NotNull ArrayList<String> inactiveProfiles, MavenToken token) { MavenServerUtil.checkToken(token); try { return Maven40EffectivePomDumper.evaluateEffectivePom(this, file, activeProfiles, inactiveProfiles); } catch (Exception e) { throw wrapToSerial...
evaluateEffectivePom
22,488
MavenServerResponse<ArrayList<MavenGoalExecutionResult>> (@NotNull String longRunningTaskId, @NotNull ArrayList<MavenGoalExecutionRequest> requests, @NotNull String goal, MavenToken token) { MavenServerUtil.checkToken(token); try (LongRunningTask task = newLongRunningTask(longRunningTaskId, requests.size(), myConsoleWr...
executeGoal
22,489
ArrayList<MavenGoalExecutionResult> (@NotNull LongRunningTask task, @NotNull Collection<MavenGoalExecutionRequest> requests, @NotNull String goal) { try { ArrayList<MavenGoalExecutionResult> results = new ArrayList<>(); for (MavenGoalExecutionRequest request : requests) { if (task.isCanceled()) break; MavenGoalExecutio...
executeGoal
22,490
MavenGoalExecutionResult (@NotNull MavenGoalExecutionRequest request, @NotNull String goal) { File file = request.file(); MavenExplicitProfiles profiles = request.profiles(); List<String> activeProfiles = new ArrayList<>(profiles.getEnabledProfiles()); List<String> inactiveProfiles = new ArrayList<>(profiles.getDisable...
doExecute
22,491
MavenGoalExecutionResult (@NotNull File file, Maven40ExecutionResult result) { Collection<MavenProjectProblem> problems = MavenProjectProblem.createProblemsList(); collectProblems(file, result.getExceptions(), result.getModelProblems(), problems); MavenGoalExecutionResult.Folders folders = new MavenGoalExecutionResult....
createEmbedderExecutionResult
22,492
List<Exception> (List<Throwable> list) { for (Throwable throwable : list) { if (!(throwable instanceof Exception)) { throw new RuntimeException(throwable); } } return (List<Exception>)((List)list); }
filterExceptions
22,493
MavenModel (File file, MavenToken token) { MavenServerUtil.checkToken(token); try { Map<String, Object> inputOptions = new HashMap<>(); inputOptions.put(ModelProcessor.SOURCE, new FileModelSource(file)); ModelReader reader = null; if (!StringUtilRt.endsWithIgnoreCase(file.getName(), "xml")) { try { Object polyglotManag...
readModel
22,494
void (MavenToken token) { MavenServerUtil.checkToken(token); try { myContainer.dispose(); } catch (Exception e) { throw wrapToSerializableRuntimeException(e); } }
release
22,495
MavenServerResponse<ArrayList<MavenArtifact>> (@NotNull String longRunningTaskId, @NotNull ArrayList<MavenArtifactResolutionRequest> requests, MavenToken token) { MavenServerUtil.checkToken(token); try (LongRunningTask task = newLongRunningTask(longRunningTaskId, requests.size(), myConsoleWrapper)) { return new MavenSe...
resolveArtifacts
22,496
ArrayList<MavenArtifact> (@NotNull LongRunningTask task, @NotNull Collection<MavenArtifactResolutionRequest> requests) { try { ArrayList<MavenArtifact> artifacts = new ArrayList<>(); for (MavenArtifactResolutionRequest request : requests) { if (task.isCanceled()) break; MavenArtifact artifact = doResolveArtifact(reques...
doResolveArtifacts
22,497
MavenArtifact (MavenArtifactInfo info, List<MavenRemoteRepository> remoteRepositories) { Artifact resolved = doResolveArtifact(createArtifact(info), convertRepositories(remoteRepositories)); return Maven40ModelConverter.convertArtifact(resolved, getLocalRepositoryFile()); }
doResolveArtifact
22,498
Artifact (Artifact artifact, List<ArtifactRepository> remoteRepositories) { try { MavenExecutionRequest request = createRequest(null, null, null); for (ArtifactRepository artifactRepository : remoteRepositories) { request.addRemoteRepository(artifactRepository); } DefaultMaven maven = (DefaultMaven)getComponent(Maven.c...
doResolveArtifact
22,499
void (Maven40ServerConsoleLogger consoleWrapper) { Maven40Sl4jLoggerWrapper.setCurrentWrapper(consoleWrapper); }
initLogging