Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
20,000
MavenIndexHolder () { if (isDisposed) { throw new AlreadyDisposedException("Index was already disposed"); } return myIndexHolder; }
getIndexHolder
20,001
File (File parent) { return createNewDir(parent, "Index", 1000); }
createNewIndexDir
20,002
File (File parent, String prefix, int max) { synchronized (ourDirectoryLock) { for (int i = 0; i < max; i++) { String name = prefix + i; File f = new File(parent, name); if (!f.exists()) { boolean createSuccessFull = f.mkdirs(); if (createSuccessFull) { return f; } } } throw new RuntimeException("No available dir found...
createNewDir
20,003
void () { isDisposed = true; closeIndices(myIndexHolder.getIndices()); myIndexHolder = null; }
dispose
20,004
boolean () { return isDisposed; }
isDisposed
20,005
void (@NotNull List<MavenIndex> indices) { List<MavenIndex> list = new ArrayList<>(indices); for (MavenIndex each : list) { try { each.close(false); } catch (Exception e) { MavenLog.LOG.error("indices dispose error", e); } } }
closeIndices
20,006
RepositoryDiff<MavenIndex> (@NotNull MavenRepositoryInfo localRepo, @NotNull RepositoryDiffContext context, @Nullable MavenIndex currentLocalIndex) { if (currentLocalIndex != null && FileUtil.pathsEqual(localRepo.getUrl(), currentLocalIndex.getRepositoryPathOrUrl())) { return new RepositoryDiff<>(currentLocalIndex, nul...
getLocalDiff
20,007
RepositoryDiff<List<MavenIndex>> ( @NotNull Map<String, Set<String>> remoteRepositoryIdsByUrl, @NotNull List<MavenIndex> currentRemoteIndex, @NotNull RepositoryDiffContext context) { Map<String, MavenIndex> currentRemoteIndicesByUrls = currentRemoteIndex.stream() .collect(Collectors.toMap(i -> i.getRepositoryPathOrUrl(...
getRemoteDiff
20,008
void (@NotNull Project project) { try { DependencySearchService.getInstance(project).clearCache(); } catch (AlreadyDisposedException ignored) { } }
clearDependencySearchCache
20,009
MavenIndex (@NotNull String id, @NotNull String repositoryPathOrUrl, IndexKind indexKind) { return MavenSystemIndicesManager.getInstance() .getIndexForRepoSync(new MavenRepositoryInfo(id, id, repositoryPathOrUrl, indexKind)); }
createMavenIndex
20,010
List<MavenId> (Project project, String className) { if (MavenUtil.isMavenUnitTestModeEnabled()) { assert ourResultForTest != null; List<MavenId> res = ourResultForTest; ourResultForTest = null; return res; } MavenArtifactSearchDialog d = new MavenArtifactSearchDialog(project, className, true); if (!d.showAndGet()) { re...
searchForClass
20,011
List<MavenId> (Project project, Collection<MavenDomDependency> managedDependencies) { if (MavenUtil.isMavenUnitTestModeEnabled()) { assert ourResultForTest != null; List<MavenId> res = ourResultForTest; ourResultForTest = null; return res; } MavenArtifactSearchDialog d = new MavenArtifactSearchDialog(project, "", false...
searchForArtifact
20,012
void (Collection<MavenDomDependency> managedDependencies) { myManagedDependenciesMap.clear(); for (MavenDomDependency dependency : managedDependencies) { String groupId = dependency.getGroupId().getStringValue(); String artifactId = dependency.getArtifactId().getStringValue(); String version = dependency.getVersion().g...
setManagedDependencies
20,013
void (Project project, @NlsSafe String initialText, boolean classMode) { myTabbedPane = new TabbedPaneWrapper(getDisposable()); MavenArtifactSearchPanel.Listener listener = new MavenArtifactSearchPanel.Listener() { @Override public void itemSelected() { clickDefaultButton(); } @Override public void canSelectStateChange...
initComponents
20,014
void () { clickDefaultButton(); }
itemSelected
20,015
void (@NotNull MavenArtifactSearchPanel from, boolean canSelect) { myOkButtonStates.put(from, canSelect); updateOkButtonState(); }
canSelectStateChanged
20,016
void (ChangeEvent e) { updateOkButtonState(); }
stateChanged
20,017
void () { Boolean canSelect = myOkButtonStates.get(myTabbedPane.getSelectedComponent()); if (canSelect == null) canSelect = false; setOKActionEnabled(canSelect); }
updateOkButtonState
20,018
Action () { Action result = super.getOKAction(); result.putValue(Action.NAME, MavenDomBundle.message("maven.artifact.pom.search.add")); return result; }
getOKAction
20,019
JComponent () { return myTabbedPane.getComponent(); }
createCenterPanel
20,020
JComponent () { return myTabbedPane.getSelectedIndex() == 0 ? myArtifactsPanel.getSearchField() : myClassesPanel.getSearchField(); }
getPreferredFocusedComponent
20,021
String () { return "Maven.ArtifactSearchDialog"; }
getDimensionServiceKey
20,022
List<MavenId> () { return myResult; }
getResult
20,023
void () { MavenArtifactSearchPanel panel = myTabbedPane.getSelectedIndex() == 0 ? myArtifactsPanel : myClassesPanel; myResult = panel.getResult(); super.doOKAction(); }
doOKAction
20,024
List<MavenIndex> () { return myRemoteIndices; }
getRemoteIndices
20,025
List<MavenGAVIndex> () { if (myLocalIndex == null) { return ContainerUtil.filter(myRemoteIndices, idx -> idx != null); } else { ArrayList<MavenGAVIndex> result = new ArrayList<>(getRemoteIndices()); result.add(myLocalIndex); return result; } }
getGAVIndices
20,026
List<MavenIndex> () { return myIndices; }
getIndices
20,027
boolean (@NotNull Set<String> remoteUrls, @Nullable String localPath) { if (!FileUtilRt.pathsEqual(myLocalIndex != null ? myLocalIndex.getRepositoryPathOrUrl() : null, localPath)) return false; if (remoteUrls.size() != myRemoteIndices.size()) return false; for (MavenSearchIndex index : myRemoteIndices) { if (!remoteUrl...
isEquals
20,028
String () { return "MavenIndexHolder{" + myIndices + '}'; }
toString
20,029
void (MavenIndexImpl index) { Properties props = new Properties(); props.setProperty(KIND_KEY, index.getKind().toString()); props.setProperty(ID_KEY, index.getRepositoryId()); props.setProperty(PATH_OR_URL_KEY, index.getRepositoryPathOrUrl()); props.setProperty(INDEX_VERSION_KEY, CURRENT_VERSION); props.setProperty(TIM...
saveIndexProperty
20,030
MavenRepositoryInfo (Project project) { if (project.isDisposed()) return null; File repository = MavenProjectsManager.getInstance(project).getLocalRepository(); return repository == null ? null : new MavenRepositoryInfo(LOCAL_REPOSITORY_ID, LOCAL_REPOSITORY_ID, repository.getPath(), IndexKind.LOCAL); }
getLocalRepository
20,031
String (@NotNull String pathOrUrl) { pathOrUrl = pathOrUrl.trim(); pathOrUrl = FileUtil.toSystemIndependentName(pathOrUrl); while (pathOrUrl.endsWith("/")) { pathOrUrl = pathOrUrl.substring(0, pathOrUrl.length() - 1); } return pathOrUrl; }
normalizePathOrUrl
20,032
MavenIndicesManager (@NotNull Project project) { return project.getService(MavenIndicesManager.class); }
getInstance
20,033
void () { myIndexFixer.stop(); deleteIndicesDirInUnitTests(); }
dispose
20,034
void () { if (MavenUtil.isMavenUnitTestModeEnabled()) { if (!myMavenIndices.isDisposed()) { var localIndex = myMavenIndices.getIndexHolder().getLocalIndex(); if (localIndex instanceof MavenIndexImpl impl) { impl.closeAndClean(); } } Path dir = MavenSystemIndicesManager.getInstance().getIndicesDir(); try { PathKt.delete...
deleteIndicesDirInUnitTests
20,035
MavenIndexHolder () { if (myMavenIndices.isNotInit() && !ApplicationManager.getApplication().isUnitTestMode()) { myIndexUpdateManager.scheduleUpdateIndicesList(myProject, null); } return myMavenIndices.getIndexHolder(); }
getIndex
20,036
boolean () { return myMavenIndices.isIndicesInit(); }
isInit
20,037
void () { ApplicationManager.getApplication().getMessageBus().connect(this) .subscribe(MavenServerConnector.DOWNLOAD_LISTENER_TOPIC, myDownloadListener); ApplicationManager.getApplication().getMessageBus().connect(this) .subscribe(MavenIndex.INDEX_IS_BROKEN, new MavenSearchIndexListener(this)); if (ApplicationManager.g...
initListeners
20,038
void (@NotNull List<Pair<MavenProject, MavenProjectChanges>> updated, @NotNull List<MavenProject> deleted) { DependencySearchService.getInstance(myProject).clearCache(); }
projectsUpdated
20,039
void (@NotNull Pair<MavenProject, MavenProjectChanges> projectWithChanges, @Nullable NativeMavenProjectHolder nativeMavenProject) { DependencySearchService.getInstance(myProject).clearCache(); }
projectResolved
20,040
void (@NotNull Pair<MavenProject, MavenProjectChanges> projectWithChanges, @Nullable NativeMavenProjectHolder nativeMavenProject) { scheduleUpdateIndicesList(null); }
projectResolved
20,041
void (@NotNull MavenArchetype archetype) { MavenArchetypeManager.addArchetype(archetype, getUserArchetypesFile()); }
addArchetype
20,042
boolean (@NotNull String groupId) { MavenIndex localIndex = getIndex().getLocalIndex(); return localIndex != null && localIndex.hasGroupId(groupId); }
hasLocalGroupId
20,043
boolean (@Nullable String groupId, @Nullable String artifactId) { MavenIndex localIndex = getIndex().getLocalIndex(); return localIndex != null && localIndex.hasArtifactId(groupId, artifactId); }
hasLocalArtifactId
20,044
boolean (@Nullable String groupId, @Nullable String artifactId, @Nullable String version) { MavenIndex localIndex = getIndex().getLocalIndex(); return localIndex != null && localIndex.hasVersion(groupId, artifactId, version); }
hasLocalVersion
20,045
boolean (@Nullable MavenId mavenId, @NotNull File artifactFile) { if (myMavenIndices.isNotInit()) return false; try { MavenIndex localIndex = myMavenIndices.getIndexHolder().getLocalIndex(); if (localIndex == null) { return false; } if (mavenId != null) { if (mavenId.getGroupId() == null || mavenId.getArtifactId() == n...
scheduleArtifactIndexing
20,046
void () { myIndexUpdateManager.scheduleUpdateContent(myProject, IndicesContentUpdateRequest.explicit( ContainerUtil.map(myMavenIndices.getIndices(), MavenIndex::getRepository))); }
scheduleUpdateContentAll
20,047
void (@Nullable Consumer<? super List<MavenIndex>> consumer) { myIndexUpdateManager.scheduleUpdateIndicesList(myProject, consumer); }
scheduleUpdateIndicesList
20,048
Path () { return MavenSystemIndicesManager.getInstance().getIndicesDir().resolve("UserArchetypes.xml"); }
getUserArchetypesFile
20,049
void (@NotNull File file) { if (stopped.get()) return; queueToAdd.add(file); myMergingUpdateQueue.queue(new Update(this) { @Override public void run() { taskConsumer.run(); } @Override public boolean isDisposed() { return myMavenIndices.isDisposed(); } }); }
fixIndex
20,050
void () { taskConsumer.run(); }
run
20,051
boolean () { return myMavenIndices.isDisposed(); }
isDisposed
20,052
void () { stopped.set(true); }
stop
20,053
void () { MavenIndex localIndex = myMavenIndices.getIndexHolder().getLocalIndex(); if (localIndex == null) return; Set<File> addedFiles = new TreeSet<>(); Set<File> failedToAddFiles = new TreeSet<>(); synchronized (queueToAdd) { if (stopped.get()) return; if (queueToAdd.isEmpty()) return; Set<File> filesToAddNow = new ...
run
20,054
void (Set<File> added, Set<File> failedToAdd) { if (stopped.get()) return; if (!added.isEmpty() || !failedToAdd.isEmpty()) { ApplicationManager.getApplication().getMessageBus().syncPublisher(INDEXER_TOPIC).indexUpdated(added, failedToAdd); } }
fireUpdated
20,055
void (File file, String relativePath) { myManager.scheduleArtifactIndexing(null, file); }
artifactDownloaded
20,056
void (@NotNull MavenSearchIndex index) { if (index instanceof MavenUpdatableIndex) { myManager.myIndexUpdateManager.scheduleUpdateContent(myManager.myProject, IndicesContentUpdateRequest.explicit(List.of(index.getRepository()))); } }
indexIsBroken
20,057
void () { myIndexUpdateManager.waitForBackgroundTasksInTests(); }
waitForBackgroundTasksInTests
20,058
JComponent () { return myMainPanel; }
createCenterPanel
20,059
String () { String result = myUrlField.getText(); if (VirtualFileManager.extractProtocol(result) == null) { result = "http://" + result; } return result; }
getUrl
20,060
JComponent () { return myUrlField; }
getPreferredFocusedComponent
20,061
List<MavenClassSearchResult> (Project project, String pattern, int maxResult) { String patternForQuery = preparePattern(pattern); MavenIndicesManager m = MavenIndicesManager.getInstance(project); Set<MavenArtifactInfo> infos = m.getIndex() .getIndices().stream() .flatMap(i -> i.search(patternForQuery, 50).stream()) .co...
searchImpl
20,062
String (String pattern) { pattern = pattern.toLowerCase(); if (pattern.trim().isEmpty()) { return ""; } List<String> parts = StringUtil.split(pattern, "."); StringBuilder newPattern = new StringBuilder(); for (int i = 0; i < parts.size() - 1; i++) { String each = parts.get(i); newPattern.append(each.trim()); newPattern...
preparePattern
20,063
Collection<MavenClassSearchResult> (Set<MavenArtifactInfo> infos, String pattern, int maxResult) { if (pattern.isEmpty() || pattern.equals("*")) { pattern = "^/(.*)$"; } else { pattern = pattern.replace(".", "/"); int lastDot = pattern.lastIndexOf("/"); String packagePattern = lastDot == -1 ? "" : (pattern.substring(0,...
processResults
20,064
void () { myUpdatingQueue.clear(); }
dispose
20,065
void (@NotNull ProgressIndicator indicator) { try { indicator.setIndeterminate(false); doUpdateIndicesContent(project, request, new MavenProgressIndicator(null, indicator, null)); } catch (MavenProcessCanceledException ignore) { } finally { promise.complete(null); } }
run
20,066
String () { return className; }
getClassName
20,067
String () { return packageName; }
getPackageName
20,068
List<MavenArtifactSearchResult> (Project project, String pattern, int maxResult) { if (StringUtil.isEmpty(pattern)) { return Collections.emptyList(); } List<MavenRepositoryArtifactInfo> searchResults = new ArrayList<>(); DependencySearchService searchService = DependencySearchService.getInstance(project); boolean useLo...
searchImpl
20,069
boolean () { return asyncPromise.getState() != Promise.State.PENDING; }
condition
20,070
List<MavenArtifactSearchResult> (List<MavenRepositoryArtifactInfo> searchResults) { return ContainerUtil.map(searchResults, MavenArtifactSearchResult::new); }
processResults
20,071
MavenRepositoryArtifactInfo () { return myInfo; }
getSearchResults
20,072
LogMessageType (@NotNull String line) { for (LogMessageType type : LogMessageType.values()) { if (line.startsWith(type.myPrefix)) { return type; } } return null; }
determine
20,073
String (@NotNull String line) { int i = line.lastIndexOf("\r"); if (i == -1) return line; return line.substring(i + 1); }
clearProgressCarriageReturns
20,074
String (@Nullable LogMessageType type, @NotNull String line) { return type == null ? line : type.clearLine(line); }
clearLine
20,075
LogMessageType () { return myType; }
getType
20,076
String () { return myLine; }
getLine
20,077
String () { return myType == null ? myLine : "[" + myType.toString() + "] " + myLine; }
toString
20,078
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MavenLogEntry entry = (MavenLogEntry)o; return myType == entry.myType && myLine.equals(entry.myLine); }
equals
20,079
int () { return Objects.hash(myType, myLine); }
hashCode
20,080
MavenParsingContext () { return myParsingContext; }
getParsingContext
20,081
void (Consumer<? super BuildEvent> messageConsumer) { for (MavenLoggedEventParser parser : myRegisteredEvents) { parser.finish(myTaskId, messageConsumer); } }
completeParsers
20,082
boolean (String line, BuildOutputInstantReader reader, Consumer<? super BuildEvent> messageConsumer) { if (myParsingContext.getSessionEnded()) { checkErrorAfterMavenSessionEnded(line, messageConsumer); return false; } if (line == null || StringUtil.isEmptyOrSpaces(line)) { return false; } if (MavenSpyOutputParser.isSpy...
parse
20,083
void (String line, Consumer<? super BuildEvent> messageConsumer) { if (!myParsingContext.getProjectFailure()) { if (line.contains("[ERROR]")) { myParsingContext.setProjectFailure(true); messageConsumer.accept(new FinishBuildEventImpl(myTaskId, null, System.currentTimeMillis(), "", new FailureResultImpl())); } } }
checkErrorAfterMavenSessionEnded
20,084
void (@NlsSafe String line, Consumer<? super BuildEvent> messageConsumer) { List<MavenParsingContext.MavenExecutionEntry> ids = myParsingContext.getAllEntriesReversed(); for (MavenParsingContext.MavenExecutionEntry entry : ids) { if (entry.getId() == myTaskId) { return; } messageConsumer.accept(new OutputBuildEventImpl...
sendMessageToAllParents
20,085
String (@NotNull String line) { if (line.endsWith("\n")) { return line; } return line + "\n"; }
withSeparator
20,086
MavenLogEntryReader (BuildOutputInstantReader reader) { return new MavenLogEntryReader() { @Override public void pushBack() { reader.pushBack(); } @Nullable @Override public MavenLogEntry readLine() { return nextLine(reader.readLine()); } }; }
wrapReader
20,087
void () { reader.pushBack(); }
pushBack
20,088
MavenLogEntry () { return nextLine(reader.readLine()); }
readLine
20,089
ProjectSystemId () { return MavenUtil.SYSTEM_ID; }
getExternalSystemId
20,090
List<BuildOutputParser> (@NotNull ExternalSystemTaskId taskId) { throw new UnsupportedOperationException(); }
getBuildOutputParsers
20,091
MavenLogOutputParser (@NotNull MavenRunConfiguration runConfiguration, @NotNull ExternalSystemTaskId taskId, @NotNull Function<String, String> targetFileMapper) { return new MavenLogOutputParser(runConfiguration, taskId, targetFileMapper, MavenLoggedEventParser.EP_NAME.getExtensionList()); }
createMavenOutputParser
20,092
boolean (String s) { return s != null && s.startsWith(PREFIX); }
isSpyLog
20,093
void (@NotNull String spyLine, @NotNull Consumer<? super BuildEvent> messageConsumer) { String line = spyLine.substring(PREFIX.length()); try { int threadSeparatorIdx = line.indexOf('-'); if (threadSeparatorIdx < 0) { return; } int threadId; try { threadId = Integer.parseInt(line.substring(0, threadSeparatorIdx)); } ca...
processLine
20,094
void (int threadId, MavenEventType type, Map<String, String> parameters, Consumer<? super BuildEvent> messageConsumer) { switch (type) { case SESSION_STARTED -> { List<String> projectsInReactor = getProjectsInReactor(parameters); myContext.setProjectsInReactor(projectsInReactor); } case SESSION_ENDED -> doFinishSession...
parse
20,095
void (String errorLine, MavenEventType eventType, Consumer<? super BuildEvent> messageConsumer) { if (errorLine == null) return; for (MavenSpyLoggedEventParser eventParser : MavenSpyLoggedEventParser.EP_NAME.getExtensionList()) { if (eventParser.supportsType(eventType) && eventParser.processLogLine(myContext.getLastId(...
processErrorLogLine
20,096
List<String> (Map<String, String> parameters) { String joined = parameters.get("projects"); if (StringUtil.isEmptyOrSpaces(joined)) { return Collections.emptyList(); } List<String> result = new ArrayList<>(); for (String project : joined.split("&&")) { if (StringUtil.isEmptyOrSpaces(project)) { continue; } result.add(p...
getProjectsInReactor
20,097
void (int threadId, Map<String, String> parameters, Consumer<? super BuildEvent> messageConsumer) { @NlsSafe String artifactCoord = parameters.get("artifactCoord"); if (artifactCoord == null || !downloadingMap.add(artifactCoord)) { return; } MavenParsingContext.MavenExecutionEntry parent = startFakeDownloadNodeIfNotSta...
artifactDownloading
20,098
void (int threadId, Map<String, String> parameters, Consumer<? super BuildEvent> messageConsumer) { @NlsSafe String artifactCoord = parameters.get("artifactCoord"); if (artifactCoord == null) { return; } @NlsSafe String error = parameters.get("error"); if (error != null || downloadingMap.contains(artifactCoord)) { Mave...
artifactResolved
20,099
String (String artifactCoord) { return "download" + artifactCoord; }
getDownloadId