Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
22,200
MavenDistribution (@Nullable String workingDirectory) { if (!useWrapper() || workingDirectory == null) { return mySettingsDistribution.getValue(); } String multiModuleDir = myWorkingDirToMultiModuleMap.computeIfAbsent(workingDirectory, this::resolveMultiModuleDirectory); return myMultimoduleDirToWrapperedMavenDistribut...
getMavenDistribution
22,201
MavenDistribution (@NotNull String multiModuleDir) { String distributionUrl = getWrapperDistributionUrl(multiModuleDir); return (distributionUrl == null) ? resolveEmbeddedMavenHome() : getMavenWrapper(distributionUrl); }
getWrapperDistribution
22,202
MavenDistribution (String distributionUrl) { MavenDistribution distribution = MavenWrapperSupport.getCurrentDistribution(distributionUrl); if (distribution == null) { distribution = resolveEmbeddedMavenHome(); } return distribution; }
getMavenWrapper
22,203
LocalMavenDistribution () { if (PluginManagerCore.isRunningFromSources()) { Path mavenPath = mySourcePath.getValue(); return new LocalMavenDistribution(mavenPath, BundledMaven3.INSTANCE.getTitle()); } else { final Path pluginFileOrDir = Path.of(PathUtil.getJarPathForClass(MavenServerManager.class)); final Path root = p...
resolveEmbeddedMavenHome
22,204
Path () { BuildDependenciesCommunityRoot communityRoot = new BuildDependenciesCommunityRoot(Path.of(PathManager.getCommunityHomePath())); return BundledMavenDownloader.INSTANCE.downloadMavenDistributionSync(communityRoot); }
getSourceMavenPath
22,205
String (@NotNull String workingDirectory) { MavenProjectsManager manager = MavenProjectsManager.getInstance(myProject); if (!manager.isMavenizedProject()) { return FileUtilRt.toSystemIndependentName(calculateMultimoduleDirUpToFileTree(workingDirectory)); } return FileUtilRt.toSystemIndependentName(manager.getRootProjec...
resolveMultiModuleDirectory
22,206
String (String directory) { VirtualFile path = LocalFileSystem.getInstance().findFileByPath(directory); if (path == null) return directory; Collection<String> knownWorkingDirs = myWorkingDirToMultiModuleMap.values(); for (String known : knownWorkingDirs) { if (FileUtil.isAncestor(known, directory, false)) { return know...
calculateMultimoduleDirUpToFileTree
22,207
String (@NotNull String workingDirectory) { return myWorkingDirToMultiModuleMap.computeIfAbsent(workingDirectory, this::resolveMultiModuleDirectory); }
getMultimoduleDirectory
22,208
boolean () { MavenWorkspaceSettings settings = MavenWorkspaceSettingsComponent.getInstance(myProject).getSettings(); return MavenUtil.isWrapper(settings.getGeneralSettings()); }
useWrapper
22,209
Transformer (@NotNull Project project) { List<RemotePathTransformerFactory> transformers = MAVEN_REMOTE_PATH_TRANSFORMER_EP_NAME.getExtensionList(); List<RemotePathTransformerFactory> aTransformers = ContainerUtil.filter(transformers, factory -> factory.isApplicable(project)); if (aTransformers.size() > 1) { Logger.get...
createForProject
22,210
boolean (String s) { return false; }
canBeRemotePath
22,211
MavenServerProgressIndicator (final MavenProgressIndicator indicator) { return doWrapAndExport(new RemoteMavenServerProgressIndicator(indicator)); }
wrapAndExport
22,212
void (@NlsContexts.ProgressText String text) { myProcess.setText(text); }
setText
22,213
void (@NlsContexts.ProgressDetails String text) { myProcess.setText2(text); }
setText2
22,214
boolean () { return myProcess.isCanceled(); }
isCanceled
22,215
void (boolean value) { myProcess.getIndicator().setIndeterminate(value); }
setIndeterminate
22,216
void (double fraction) { myProcess.setFraction(fraction); }
setFraction
22,217
MavenRemoteProcessSupport (Sdk jdk, String vmOptions, MavenDistribution distribution, Project project, Integer debugPort) { MavenActionsUsagesCollector.trigger(project, MavenActionsUsagesCollector.START_LOCAL_MAVEN_SERVER); return new LocalMavenServerRemoteProcessSupport(jdk, vmOptions, distribution, project, debugPort...
create
22,218
MavenRemoteProcessSupport (Sdk jdk, String vmOptions, MavenDistribution distribution, Integer debugPort) { return new LocalMavenIndexServerRemoteProcessSupport(jdk, vmOptions, distribution, debugPort); }
createIndexerSupport
22,219
boolean (Project project) { return false; }
isApplicable
22,220
boolean () { return false; }
shouldLogErrors
22,221
boolean () { return !myConnectStarted.get(); }
isNew
22,222
void () { if (!myConnectStarted.compareAndSet(false, true)) { return; } MavenLog.LOG.debug("connecting new maven server: " + this); ApplicationManager.getApplication().executeOnPooledThread(newStartServerTask()); }
connect
22,223
MavenServer () { while (!myServerPromise.isDone()) { try { myServerPromise.get(100, TimeUnit.MILLISECONDS); } catch (Exception ignore) { } if (throwExceptionIfProjectDisposed && myProject.isDisposed()) { throw new CannotStartServerException("Project already disposed"); } ProgressManager.checkCanceled(); } return myServ...
waitForServer
22,224
MavenServer () { try { MavenServer server = waitForServer(); if (server == null) { throw new ProcessCanceledException(); } return server; } catch (ProcessCanceledException e) { throw e; } catch (Throwable e) { try { MavenServerManager.getInstance().shutdownConnector(this, false); } catch (Throwable ignored) { } throw e...
getServer
22,225
void (boolean wait) { MavenLog.LOG.debug("[connector] shutdown " + this + " " + (mySupport == null)); cleanUpFutures(); MavenRemoteProcessSupportFactory.MavenRemoteProcessSupport support = mySupport; if (support != null) { support.stopAll(wait); } myTerminated.set(true); }
stop
22,226
State () { return switch (myServerPromise.getState()) { case SUCCEEDED -> myTerminated.get() ? State.STOPPED : State.RUNNING; case REJECTED -> State.FAILED; default -> State.STARTING; }; }
getState
22,227
boolean () { MavenRemoteProcessSupportFactory.MavenRemoteProcessSupport support = mySupport; return support != null && !support.getActiveConfigurations().isEmpty(); }
checkConnected
22,228
boolean () { try { boolean pinged = getServer().ping(MavenRemoteObjectWrapper.ourToken); if (MavenLog.LOG.isTraceEnabled()) { MavenLog.LOG.trace("maven server ping: " + pinged); } return pinged; } catch (RemoteException e) { MavenLog.LOG.warn("maven server ping error", e); return false; } }
ping
22,229
MavenRemoteProcessSupportFactory (@NotNull Project project) { MavenRemoteProcessSupportFactory applicable = MAVEN_SERVER_SUPPORT_EP_NAME.findFirstSafe(factory -> factory.isApplicable(project)); if (applicable == null) { return new LocalMavenRemoteProcessSupportFactory(); } return applicable; }
forProject
22,230
MavenRemoteProcessSupportFactory () { return new LocalMavenRemoteProcessSupportFactory(); }
forIndexer
22,231
void () { }
fireModificationCountChanged
22,232
String (@NotNull Object file) { return MavenServerManager.class.getSimpleName(); }
getName
22,233
void (ProcessHandler handler) { if (handler.getProcessInput() == null) { return; } OutputStreamWriter writer = new OutputStreamWriter(handler.getProcessInput(), StandardCharsets.UTF_8); try { writer.write(TokenReader.PREFIX + MavenRemoteObjectWrapper.ourToken); writer.write(System.lineSeparator()); writer.flush(); Mave...
sendDataAfterStart
22,234
void (Consumer<ProcessEvent> onTerminate) { this.onTerminate = onTerminate; }
onTerminate
22,235
void (ProcessEvent event) { Consumer<ProcessEvent> eventConsumer = onTerminate; if (eventConsumer != null) { eventConsumer.accept(event); } if (event.getExitCode() == 0) { return; } myImportEventProcessor.finish(); Project[] openProjects = ProjectManager.getInstance().getOpenProjects(); for (Project p : openProjects) {...
onProcessTerminated
22,236
void (@NotNull Object configuration, @NotNull ProcessEvent event, @NotNull Key outputType) { super.logText(configuration, event, outputType); myMavenSpyEventsBuffer.addText(event.getText(), outputType); }
logText
22,237
void () { if (myParent != null) myParent.onWrappeeAccessed(); }
onWrappeeAccessed
22,238
boolean (Sdk jdk, String vmOptions, MavenDistribution distribution) { throw new UnsupportedOperationException(); }
isCompatibleWith
22,239
StartIndexingServerTask () { return new StartIndexingServerTask(); }
newStartServerTask
22,240
void () { }
cleanUpFutures
22,241
String () { MavenRemoteProcessSupportFactory.MavenRemoteProcessSupport support = mySupport; return support == null ? "INDEX-?" : "INDEX-" + support.type(); }
getSupportType
22,242
void () { ProgressIndicator indicator = new EmptyProgressIndicator(); String dirForLogs = myMultimoduleDirectories.iterator().next(); MavenLog.LOG.debug("Connecting maven connector in " + dirForLogs); try { if (myDebugPort != null) { //noinspection UseOfSystemOutOrSystemErr System.out.println("Listening for transport d...
run
22,243
MavenServerManager () { return ApplicationManager.getApplication().getService(MavenServerManager.class); }
getInstance
22,244
MavenServerManager () { return ApplicationManager.getApplication().getServiceIfCreated(MavenServerManager.class); }
getInstanceIfCreated
22,245
MavenServerConnector (@NotNull Project project, @NotNull Sdk jdk, @NotNull String vmOptions, @Nullable Integer debugPort, @NotNull MavenDistribution mavenDistribution, @NotNull String multimoduleDirectory) { return new MavenServerConnectorImpl(project, jdk, vmOptions, debugPort, mavenDistribution, multimoduleDirectory)...
create
22,246
void (@NotNull Project project, @Nullable String workingDir) { checkOrInstall(project, workingDir, null); }
checkOrInstall
22,247
void (@NotNull Project project, @Nullable String workingDir) { checkOrInstall(project, workingDir, MavenProjectsManager.getInstance(project).getSyncConsole()); }
checkOrInstallForSync
22,248
void (@NotNull ProgressIndicator indicator) { }
run
22,249
void (String text) { super.setText(text); if (mySyncConsole != null && text != null) { mySyncConsole.addWrapperProgressText(text); } }
setText
22,250
void (double fraction) { super.setFraction(fraction); if (mySyncConsole != null) { long newFraction = Math.round(fraction * 100); if (myFraction == newFraction) return; myFraction = newFraction; ProgressBuildEventImpl event = new ProgressBuildEventImpl( SyncBundle.message("maven.sync.wrapper"), SyncBundle.message("mave...
setFraction
22,251
void (boolean isRestart) { shutdown(false); }
appWillBeClosed
22,252
void (@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) { if (MavenUtil.INTELLIJ_PLUGIN_ID.equals(pluginDescriptor.getPluginId().getIdString())) { shutdown(false); } }
beforePluginUnload
22,253
void (@NotNull Project project) { MavenProjectsManager manager = MavenProjectsManager.getInstance(project); if (manager.isMavenizedProject()) { MavenUtil.restartMavenConnectors(project, true, it -> isDummy(it)); } }
onProjectTrusted
22,254
void (@NotNull Project project) { MavenProjectsManager manager = MavenProjectsManager.getInstance(project); if (manager.isMavenizedProject()) { MavenUtil.restartMavenConnectors(project, true, it -> !isDummy(it)); } }
onProjectUntrusted
22,255
void (@NotNull Project project) { MavenProjectsManager manager = MavenProjectsManager.getInstance(project); if (manager.isMavenizedProject()) { manager.forceUpdateAllProjectsOrFindAllAvailablePomFiles(); } }
onProjectTrustedFromNotification
22,256
Collection<MavenServerConnector> () { Set<MavenServerConnector> set = Collections.newSetFromMap(new IdentityHashMap<>()); synchronized (myMultimoduleDirToConnectorMap) { set.addAll(myMultimoduleDirToConnectorMap.values()); if (myIndexingConnector != null) { set.add(myIndexingConnector); } } return set; }
getAllConnectors
22,257
void (Project project, boolean wait, Predicate<MavenServerConnector> condition) { List<MavenServerConnector> connectorsToShutDown = new ArrayList<>(); synchronized (myMultimoduleDirToConnectorMap) { getAllConnectors().forEach(it -> { if (project.equals(it.getProject()) && condition.test(it)) { connectorsToShutDown.add(...
restartMavenConnectors
22,258
MavenServerConnector (@NotNull Project project, @NotNull String workingDirectory) { String multimoduleDirectory = MavenDistributionsCache.getInstance(project).getMultimoduleDirectory(workingDirectory); MavenWorkspaceSettings settings = MavenWorkspaceSettingsComponent.getInstance(project).getSettings(); Sdk jdk = getJdk...
doGetConnector
22,259
MavenServerConnector (@NotNull Project project, @NotNull String workingDirectory) { var connector = doGetConnector(project, workingDirectory); if (!connector.ping()) { shutdownConnector(connector, true); connector = doGetConnector(project, workingDirectory); } return connector; }
getConnector
22,260
MavenServerConnector (@NotNull Project project, @NotNull String multimoduleDirectory, @NotNull Sdk jdk) { MavenServerConnector connector; synchronized (myMultimoduleDirToConnectorMap) { connector = myMultimoduleDirToConnectorMap.get(multimoduleDirectory); if (connector != null) return connector; connector = findCompati...
doGetOrCreateConnector
22,261
MavenServerConnector (Project project, Sdk jdk, String multimoduleDirectory) { MavenDistribution distribution = MavenDistributionsCache.getInstance(project).getMavenDistribution(multimoduleDirectory); String vmOptions = MavenDistributionsCache.getInstance(project).getVmOptions(multimoduleDirectory); Integer debugPort =...
registerNewConnector
22,262
void (Project project, MavenServerConnector connector) { Disposer.register(MavenDisposable.getInstance(project), () -> { ApplicationManager.getApplication().executeOnPooledThread(() -> shutdownConnector(connector, false)); }); }
registerDisposable
22,263
void () { shutdown(false); }
dispose
22,264
boolean (MavenServerConnector connector, boolean wait) { MavenServerConnector connectorToStop = removeConnector(connector); if (connectorToStop == null) return false; connectorToStop.stop(wait); return true; }
shutdownConnector
22,265
MavenServerConnector (@Nullable MavenServerConnector connector) { if (connector == null) return null; synchronized (myMultimoduleDirToConnectorMap) { if (myIndexingConnector == connector) { myIndexingConnector = null; myIndexerWrapper = null; return connector; } if (!myMultimoduleDirToConnectorMap.containsValue(connect...
removeConnector
22,266
void (boolean wait) { Collection<MavenServerConnector> values; synchronized (myMultimoduleDirToConnectorMap) { values = new ArrayList<>(myMultimoduleDirToConnectorMap.values()); } shutdownConnector(myIndexingConnector, wait); values.forEach(c -> shutdownConnector(c, wait)); }
shutdown
22,267
File () { return getEventListenerJar(); }
getMavenEventListener
22,268
File () { if (eventListenerJar != null) { return eventListenerJar; } final File pluginFileOrDir = new File(PathUtil.getJarPathForClass(MavenServerManager.class)); final String root = pluginFileOrDir.getParent(); if (pluginFileOrDir.isDirectory()) { eventListenerJar = getEventSpyPathForLocalBuild(); if (!eventListenerJa...
getEventListenerJar
22,269
MavenEmbedderWrapper (final Project project, final boolean alwaysOnline, @NotNull String multiModuleProjectDirectory) { return new MavenEmbedderWrapper(project) { private MavenServerConnector myConnector; @NotNull @Override protected synchronized MavenServerEmbedder create() throws RemoteException { MavenServerSettings...
createEmbedder
22,270
MavenIndexerWrapper () { return createDedicatedIndexer(); }
createIndexer
22,271
MavenIndexerWrapper (@NotNull Project project) { if (Registry.is("maven.dedicated.indexer")) { return createDedicatedIndexer(); } else { return createLegacyIndexer(project); } }
createIndexer
22,272
MavenIndexerWrapper () { if (myIndexerWrapper != null) return myIndexerWrapper; synchronized (myMultimoduleDirToConnectorMap) { if (myIndexerWrapper != null) return myIndexerWrapper; String workingDir = SystemUtils.getUserHome().getAbsolutePath(); myIndexerWrapper = new MavenIndexerWrapper(null) { @Override protected M...
createDedicatedIndexer
22,273
MavenIndices (Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; }
createMavenIndices
22,274
MavenServerConnector () { if (myIndexingConnector != null) return myIndexingConnector; synchronized (myMultimoduleDirToConnectorMap) { if (myIndexingConnector != null) return myIndexingConnector; myIndexingConnector = new MavenIndexingConnectorImpl(JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk(), "", getF...
getIndexingConnector
22,275
boolean () { try { Thread.sleep(100); return true; } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } return false; }
waitIfNotIdeaShutdown
22,276
MavenIndexerWrapper (@NotNull Project project) { String path = project.getBasePath(); if (path == null) { path = new File(".").getPath(); } String finalPath = path; if (MavenWslUtil.tryGetWslDistributionForPath(path) != null) { return new MavenIndexerWrapper(null) { @Override protected MavenIndices createMavenIndices(P...
createLegacyIndexer
22,277
MavenIndices (Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; }
createMavenIndices
22,278
MavenServerIndexer () { return new DummyIndexer(); }
create
22,279
MavenIndices (Project project) { MavenIndices indices = new MavenIndices(this, MavenSystemIndicesManager.getInstance().getIndicesDir().toFile(), project); Disposer.register(MavenDisposable.getInstance(project), indices); return indices; }
createMavenIndices
22,280
Integer () { if (Registry.is("maven.server.debug")) { try { return NetUtils.findAvailableSocketPort(); } catch (IOException e) { MavenLog.LOG.warn(e); } } return null; }
getFreeDebugPort
22,281
Sdk (Project project, MavenWorkspaceSettings settings) { String jdkForImporterName = settings.getImportingSettings().getJdkForImporter(); Sdk jdk; try { jdk = MavenUtil.getJdk(project, jdkForImporterName); } catch (ExternalSystemJdkException e) { jdk = MavenUtil.getJdk(project, MavenRunnerSettings.USE_PROJECT_JDK); Mav...
getJdk
22,282
boolean (Project project, MavenServerConnector connector, Sdk jdk, String multimoduleDirectory) { if (Registry.is("maven.server.per.idea.project")) return true; MavenDistributionsCache cache = MavenDistributionsCache.getInstance(project); MavenDistribution distribution = cache.getMavenDistribution(multimoduleDirectory)...
compatibleParameters
22,283
File () { final File root = new File(PathUtil.getJarPathForClass(MavenServerManager.class)); return new File(root.getParent(), "intellij.maven.server.eventListener"); }
getEventSpyPathForLocalBuild
22,284
MavenServerSettings (@NotNull Project project, @Nullable MavenGeneralSettings settings, @NotNull String multiModuleProjectDirectory) { if (settings == null) { settings = MavenWorkspaceSettingsComponent.getInstance(project).getSettings().getGeneralSettings(); } RemotePathTransformerFactory.Transformer transformer = Remo...
convertSettings
22,285
String () { return SyncBundle.message("maven.core.plexus.init.issue.title"); }
getTitle
22,286
String () { StringBuilder desc = new StringBuilder(SyncBundle.message("maven.core.plexus.init.issue.description")); if (myMavenVersion == null || VersionComparatorUtil.compare("3.8.5", myMavenVersion) <= 0) { desc.append("\n").append(SyncBundle.message("maven.core.plexus.init.issue.fix.downgrade", OpenMavenSettingsQuic...
getDescription
22,287
List<BuildIssueQuickFix> () { return List.of( new RestartMavenEmbeddersQuickFix(), new OpenMavenSettingsQuickFix() ); }
getQuickFixes
22,288
Navigatable (@NotNull Project project) { for (String directory : myMultimoduleDirectories) { Path extensions = Path.of(directory).resolve(".mvn").resolve("extensions.xml"); if (!extensions.toFile().isFile()) continue; if (MavenUtil.containsDeclaredExtension(extensions.toFile(), myUnresolvedExtensionId)) { return new Fi...
getNavigatable
22,289
RunProfileState (@NotNull Object target, @NotNull Object configuration, @NotNull Executor executor) { return new MavenServerCMDState(myJdk, myOptions, myDistribution, myDebugPort); }
getRunProfileState
22,290
String () { return "Local"; }
type
22,291
boolean () { return true; }
shouldKillProcessSoftly
22,292
boolean (@Nullable File mavenHome) { String version = MavenUtil.getMavenVersion(mavenHome); return StringUtil.compareVersionNumbers(version, "4") >= 0; }
isSupportedByExtension
22,293
List<File> (@NotNull MavenDistribution distribution) { final File pluginFileOrDir = new File(PathUtil.getJarPathForClass(MavenServerManager.class)); final String root = pluginFileOrDir.getParent(); final List<File> classpath = new ArrayList<>(); if (pluginFileOrDir.isDirectory()) { MavenLog.LOG.debug("collecting classp...
collectClassPathAndLibsFolder
22,294
void (@NotNull String mavenVersion, List<File> classpath, String root) { classpath.add(new File(PathUtil.getJarPathForClass(MavenId.class))); classpath.add(new File(PathUtil.getJarPathForClass(MavenServer.class))); addDir(classpath, new File(root, "maven4-server-lib"), f -> true); classpath.add(new File(root, "maven40-...
prepareClassPathForProduction
22,295
void (@NotNull String mavenVersion, List<File> classpath, String root) { BuildDependenciesCommunityRoot communityRoot = new BuildDependenciesCommunityRoot(Path.of(PathManager.getCommunityHomePath())); BundledMavenDownloader.INSTANCE.downloadMaven4LibsSync(communityRoot); classpath.add(new File(PathUtil.getJarPathForCla...
prepareClassPathForLocalRunAndUnitTests
22,296
void (List<File> classpath, File mavenHome) { addDir(classpath, new File(mavenHome, "lib"), f -> !f.getName().contains("maven-slf4j-provider")); File bootFolder = new File(mavenHome, "boot"); File[] classworldsJars = bootFolder.listFiles((dir, name) -> StringUtil.contains(name, "classworlds")); if (classworldsJars != n...
addMavenLibs
22,297
void (List<File> classpath, File dir, Predicate<File> filter) { File[] files = dir.listFiles(); if (files == null) return; for (File jar : files) { if (jar.isFile() && jar.getName().endsWith(".jar") && filter.test(jar)) { classpath.add(jar); } } }
addDir
22,298
String () { return MavenProjectBundle.message("maven.name"); }
getName
22,299
Icon () { return OpenapiIcons.RepositoryLibraryLogo; }
getIcon