Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
19,700 | void (boolean entering, @NotNull Object modalEntity) { if (entering) { suspend(); } else { resume(); } } | beforeModalityStateChanged |
19,701 | void () { if (mySuspendCounter.incrementAndGet() == 1) { super.suspend(); } } | suspend |
19,702 | void () { int c = mySuspendCounter.decrementAndGet(); if (c <= 0) { if (c < 0) { mySuspendCounter.set(0); // todo ask build team to investigate why MavenSetupProjectTest `test project import` failed with that error if (!ApplicationManager.getApplication().isUnitTestMode()) { LOG.warn("Invalid suspend counter state", ne... | resume |
19,703 | List<VirtualFile> (Project project) { return MavenProjectsManager.getInstance(project).getGeneralSettings().getEffectiveSettingsFiles(); } | getSettingsFiles |
19,704 | boolean (Collection<MavenProject> mavenProjects) { Iterator<MavenProject> itr = mavenProjects.iterator(); if (!itr.hasNext()) return true; String groupId = itr.next().getMavenId().getGroupId(); while (itr.hasNext()) { MavenProject mavenProject = itr.next(); if (!Objects.equals(groupId, mavenProject.getMavenId().getGrou... | allGroupsEqual |
19,705 | boolean (Collection<MavenProject> mavenProjects) { Set<String> exitingGroups = new HashSet<>(); for (MavenProject mavenProject : mavenProjects) { if (!exitingGroups.add(mavenProject.getMavenId().getGroupId())) { return false; } } return true; } | allGroupsAreDifferent |
19,706 | void (MavenProjectsManager manager, Map<MavenProject, Integer> res, List<MavenProject> rootProjects, int depth) { MavenProject[] rootProjectArray = rootProjects.toArray(new MavenProject[0]); Arrays.sort(rootProjectArray, new MavenProjectComparator()); for (MavenProject project : rootProjectArray) { if (!res.containsKey... | doBuildProjectTree |
19,707 | int (MavenProject o1, MavenProject o2) { MavenId id1 = o1.getMavenId(); MavenId id2 = o2.getMavenId(); int res = Comparing.compare(id1.getGroupId(), id2.getGroupId()); if (res != 0) return res; res = Comparing.compare(id1.getArtifactId(), id2.getArtifactId()); if (res != 0) return res; res = Comparing.compare(id1.getVe... | compare |
19,708 | void (@NotNull Project project, @NotNull MavenProjectsManager projectsManager) { project.getService(MavenHighlightingUpdater.class).install(projectsManager); } | install |
19,709 | void (@NotNull Project project) { project.getService(MavenHighlightingUpdater.class).schedule(null); } | rehighlight |
19,710 | boolean (@NotNull VirtualFile f) { try { if (null != indicator) { indicator.checkCanceled(); indicator.setText2(f.getPresentableUrl()); } if (f.isDirectory()) { if (lookForNested) { f.refresh(false, false); } else { return false; } } else { if (MavenUtil.isPomFile(f)) { result.add(Pair.create(f.getParent(), f)); } } } ... | visitFile |
19,711 | List<VirtualFile> (@NotNull List<VirtualFile> pomFiles) { if (pomFiles.size() < 2) return pomFiles; List<VirtualFile> originalPoms = new ArrayList<>(); for (VirtualFile file : pomFiles) { if (file.getName().equals(MavenConstants.POM_XML)) { return Collections.singletonList(file); } if (MavenUtil.isPomFileName(file.getN... | getOriginalPoms |
19,712 | Element (final VirtualFile file, @Nullable final ErrorHandler handler) { Application app = ApplicationManager.getApplication(); if (app == null || app.isDisposed()) { return null; } String text = ReadAction.compute(() -> { if (!file.isValid()) return null; try { return VfsUtilCore.loadText(file); } catch (IOException e... | read |
19,713 | Element (byte[] bytes, @Nullable ErrorHandler handler) { return doRead(CharsetToolkit.bytesToString(bytes, EncodingRegistry.getInstance().getDefaultCharset()), handler); } | read |
19,714 | Element (String text, final ErrorHandler handler) { final LinkedList<Element> stack = new LinkedList<>(); final Element[] result = {null}; XmlBuilderDriver driver = new XmlBuilderDriver(text); XmlBuilder builder = new XmlBuilder() { @Override public void doctype(@Nullable CharSequence publicId, @Nullable CharSequence s... | doRead |
19,715 | void (@Nullable CharSequence publicId, @Nullable CharSequence systemId, int startOffset, int endOffset) { } | doctype |
19,716 | ProcessingOrder (CharSequence localName, String namespace, int startoffset, int endoffset, int headerEndOffset) { String name = localName.toString(); if (StringUtil.isEmptyOrSpaces(name)) return ProcessingOrder.TAGS; Element newElement; try { newElement = new Element(name); } catch (IllegalNameException e) { newElement... | startTag |
19,717 | void (CharSequence localName, String namespace, int startoffset, int endoffset) { String name = localName.toString(); if (StringUtil.isEmptyOrSpaces(name)) return; for (Iterator<Element> itr = stack.descendingIterator(); itr.hasNext(); ) { Element element = itr.next(); if (element.getName().equals(name)) { while (stack... | endTag |
19,718 | void (CharSequence text, CharSequence physical, int startoffset, int endoffset) { stack.getLast().addContent(JDOMUtil.legalizeText(text.toString())); } | textElement |
19,719 | void (CharSequence name, CharSequence value, int startoffset, int endoffset) { } | attribute |
19,720 | void (CharSequence ref, int startOffset, int endOffset) { } | entityRef |
19,721 | void (@NotNull String message, int startOffset, int endOffset) { if (handler != null) handler.onSyntaxError(); } | error |
19,722 | Element (@Nullable Element element, String path) { int i = 0; while (element != null) { int dot = path.indexOf('.', i); if (dot == -1) { return element.getChild(path.substring(i)); } element = element.getChild(path.substring(i, dot)); i = dot + 1; } return null; } | findChildByPath |
19,723 | String (@Nullable Element element, String path, String defaultValue) { Element child = findChildByPath(element, path); if (child == null) return defaultValue; String childValue = child.getTextTrim(); return childValue.isEmpty() ? defaultValue : childValue; } | findChildValueByPath |
19,724 | String (@Nullable Element element, String path) { return findChildValueByPath(element, path, null); } | findChildValueByPath |
19,725 | boolean (@Nullable Element element, String path) { return findChildByPath(element, path) != null; } | hasChildByPath |
19,726 | List<Element> (@Nullable Element element, String path, String subPath) { return collectChildren(findChildByPath(element, path), subPath); } | findChildrenByPath |
19,727 | List<String> (@Nullable Element element, String path, String childrenName) { List<String> result = new ArrayList<>(); for (Element each : findChildrenByPath(element, path, childrenName)) { String value = each.getTextTrim(); if (!value.isEmpty()) { result.add(value); } } return result; } | findChildrenValuesByPath |
19,728 | List<Element> (@Nullable Element container, String subPath) { if (container == null) return Collections.emptyList(); int firstDot = subPath.indexOf('.'); if (firstDot == -1) { return container.getChildren(subPath); } String childName = subPath.substring(0, firstDot); String pathInChild = subPath.substring(firstDot + 1)... | collectChildren |
19,729 | FileTemplateGroupDescriptor () { FileTemplateGroupDescriptor group = new FileTemplateGroupDescriptor("Maven", RepositoryLibraryLogo); //NON-NLS group.addTemplate(new FileTemplateDescriptor(MAVEN_PROJECT_XML_TEMPLATE, RepositoryLibraryLogo)); group.addTemplate(new FileTemplateDescriptor(MAVEN_SETTINGS_XML_TEMPLATE, Repo... | getFileTemplatesDescriptor |
19,730 | boolean () { return !appendModuleName || canRealModuleNameBeHidden(); } | shouldShowModuleName |
19,731 | void (@NotNull PresentationData data) { super.updateImpl(data); if (appendModuleName) { if (!canRealModuleNameBeHidden()) { data.addText("[" + myModuleShortName + "]", REGULAR_BOLD_ATTRIBUTES); } } else { List<ColoredFragment> fragments = data.getColoredText(); ColoredFragment fragment = fragments.iterator().next(); da... | updateImpl |
19,732 | boolean (@NotNull PsiFile psiFile) { VirtualFile virtualFile = psiFile.getOriginalFile().getVirtualFile(); do { if (virtualFile == null) return true; if (virtualFile.getName().equals("archetype-resources")) { if (virtualFile.getPath().endsWith("src/main/resources/archetype-resources")) { return false; } } virtualFile =... | shouldHighlight |
19,733 | MavenPluginInfo (File localRepository, MavenId mavenId) { Path file = getArtifactNioPath(localRepository, mavenId.getGroupId(), mavenId.getArtifactId(), mavenId.getVersion(), "jar"); MavenPluginInfo result = ourPluginInfoCache.get(file); if (result == null) { result = createPluginDocument(file); ourPluginInfoCache.put(... | readPluginInfo |
19,734 | boolean (File localRepository, MavenId id) { return hasArtifactFile(localRepository, id, "jar"); } | hasArtifactFile |
19,735 | boolean (File localRepository, MavenId id, String type) { return Files.exists(getArtifactFile(localRepository, id, type)); } | hasArtifactFile |
19,736 | Path (File localRepository, MavenId id, String type) { return getArtifactNioPath(localRepository, id.getGroupId(), id.getArtifactId(), id.getVersion(), type); } | getArtifactFile |
19,737 | Path (File localRepository, MavenId id) { return getArtifactNioPath(localRepository, id.getGroupId(), id.getArtifactId(), id.getVersion(), "pom"); } | getArtifactFile |
19,738 | boolean (@Nullable String groupId1, @Nullable String artifactId1, @Nullable String groupId2, @Nullable String artifactId2) { if (artifactId1 == null) return false; if (!artifactId1.equals(artifactId2)) return false; if (groupId1 != null) { for (String group : DEFAULT_GROUPS) { if (groupId1.equals(group)) { groupId1 = n... | isPluginIdEquals |
19,739 | Path (File localRepository, String groupId, String artifactId, String version, String type) { Path dir = null; if (StringUtil.isEmpty(groupId)) { for (String each : DEFAULT_GROUPS) { dir = getArtifactDirectory(localRepository, each, artifactId); if (Files.exists(dir)) break; } } else { dir = getArtifactDirectory(localR... | getArtifactNioPath |
19,740 | String (String name) { if (null == name) return ""; return Sanitize_nameKt.sanitizeFileName(name, null, false, null); } | sanitizeFileName |
19,741 | Path (File localRepository, String groupId, String artifactId) { String relativePath = StringUtil.replace(groupId, ".", File.separator) + File.separator + artifactId; return localRepository.toPath().resolve(relativePath); } | getArtifactDirectory |
19,742 | String (Path pluginDir) { List<String> versions = new ArrayList<>(); try (Stream<Path> children = Files.list(pluginDir)) { children.forEach(path -> { if (Files.isDirectory(path)) { versions.add(path.getFileName().toString()); } }); } catch (NoSuchFileException e) { return ""; } catch (Exception e) { MavenLog.LOG.warn(e... | resolveVersion |
19,743 | MavenPluginInfo (Path file) { try { if (!Files.exists(file)) return null; try (ZipFile jar = new ZipFile(file.toFile())) { ZipEntry entry = jar.getEntry(MAVEN_PLUGIN_DESCRIPTOR); if (entry == null) { MavenLog.LOG.info(IndicesBundle.message("repository.plugin.corrupt", file)); return null; } try (InputStream is = jar.ge... | createPluginDocument |
19,744 | Icon (@NotNull VirtualFile file, @Iconable.IconFlags int flags, @Nullable Project project) { if (project == null) return null; MavenProject mavenProject = MavenProjectsManager.getInstance(project).findProject(file); if (mavenProject != null) { if (MavenProjectsManager.getInstance(project).isIgnored(mavenProject)) { ret... | getIcon |
19,745 | List<String> (final String string, final String delim) { final List<String> tokens = new ArrayList<>(); for (StringTokenizer tokenizer = new StringTokenizer(string, delim); tokenizer.hasMoreTokens(); ) { tokens.add(tokenizer.nextToken()); } return tokens; } | tokenize |
19,746 | String (final Collection<String> list, final char delim) { final StringBuilder buffer = new StringBuilder(); for (String goal : list) { if (buffer.length() != 0) { buffer.append(delim); } buffer.append(goal); } return buffer.toString(); } | detokenize |
19,747 | String (final Collection<String> masks) { final StringBuilder patterns = new StringBuilder(); for (String mask : masks) { if (patterns.length() != 0) { patterns.append('|'); } patterns.append(PatternUtil.convertToRegex(mask)); } return patterns.toString(); } | translateMasks |
19,748 | void (String text) { myText = text; } | setText |
19,749 | String () { return myText; } | getText |
19,750 | void (String text) { myText2 = text; } | setText2 |
19,751 | String () { return myText2; } | getText2 |
19,752 | void (double fraction) { myFraction = fraction; } | setFraction |
19,753 | double () { return myFraction; } | getFraction |
19,754 | void (@Nullable ProgressIndicator indicator) { if (myProject == null) return; // should we also wait for non-project process like MavenIndicesManager activities? if (indicator instanceof ProgressIndicatorEx) { myProject.getService(MavenProgressTracker.class).add(indicator); ((ProgressIndicatorEx)indicator).addStateDele... | maybeTrackIndicator |
19,755 | void () { myProject.getService(MavenProgressTracker.class).add(indicator); } | start |
19,756 | void () { myProject.getService(MavenProgressTracker.class).remove(indicator); } | stop |
19,757 | void () { try { myProject.getService(MavenProgressTracker.class).remove(indicator); } catch (AlreadyDisposedException ignore) { } } | cancel |
19,758 | void () { while (hasMavenProgressRunning()) { final Object lock = new Object(); synchronized (lock) { try { lock.wait(100); } catch (InterruptedException ignore) { } } } } | waitForProgressCompletion |
19,759 | void () { synchronized (myLock) { if (!myIndicators.isEmpty()) { throw new AssertionError("Not finished tasks:\n" + StringUtil.join(myIndicators, ProgressIndicator::getText, "\n-----")); } } } | assertProgressTasksCompleted |
19,760 | void (@Nullable ProgressIndicator indicator) { synchronized (myLock) { myIndicators.add(indicator); } } | add |
19,761 | void (@Nullable ProgressIndicator indicator) { synchronized (myLock) { myIndicators.remove(indicator); } } | remove |
19,762 | boolean () { synchronized (myLock) { myIndicators.removeIf(indicator -> !indicator.isRunning()); return !myIndicators.isEmpty(); } } | hasMavenProgressRunning |
19,763 | void () { synchronized (myLock) { myIndicators.clear(); } } | dispose |
19,764 | boolean (@NotNull Project project, @NotNull VirtualFile file) { return FileTypeRegistry.getInstance().isFileOfType(file, XmlFileType.INSTANCE) && FileUtil.namesEqual(file.getName(), MavenConstants.POM_XML); } | describes |
19,765 | boolean () { return Registry.is("maven.preimport.project") && !ApplicationManager.getApplication().isUnitTestMode() && !ApplicationManager.getApplication().isHeadlessEnvironment(); } | enablePreimport |
19,766 | boolean () { return Registry.is("maven.preimport.only"); } | enablePreimportOnly |
19,767 | void (Project p, Runnable r) { invokeLater(p, ModalityState.defaultModalityState(), r); } | invokeLater |
19,768 | void (final Project p, final ModalityState state, final Runnable r) { startTestRunnable(r); ApplicationManager.getApplication().invokeLater(() -> { runAndFinishTestRunnable(r); }, state, p.getDisposed()); } | invokeLater |
19,769 | void (Runnable r) { if (!ApplicationManager.getApplication().isUnitTestMode()) return; synchronized (runnables) { runnables.add(r); } } | startTestRunnable |
19,770 | void (Runnable r) { if (!ApplicationManager.getApplication().isUnitTestMode()) { r.run(); return; } try { r.run(); } finally { synchronized (runnables) { runnables.remove(r); } } } | runAndFinishTestRunnable |
19,771 | boolean () { synchronized (runnables) { return runnables.isEmpty(); } } | noUncompletedRunnables |
19,772 | void () { synchronized (runnables) { runnables.clear(); } } | cleanAllRunnables |
19,773 | List<Runnable> () { List<Runnable> result; synchronized (runnables) { result = new ArrayList<>(runnables); } return result; } | getUncompletedRunnables |
19,774 | void (@NotNull Project p, @NotNull Runnable r) { invokeAndWait(p, ModalityState.defaultModalityState(), r); } | invokeAndWait |
19,775 | void (final Project p, final ModalityState state, @NotNull Runnable r) { startTestRunnable(r); ApplicationManager.getApplication().invokeAndWait(DisposeAwareRunnable.create(() -> runAndFinishTestRunnable(r), p), state); } | invokeAndWait |
19,776 | void (@NotNull Project p, @NotNull Runnable r) { startTestRunnable(r); if (ApplicationManager.getApplication().isWriteAccessAllowed()) { runAndFinishTestRunnable(r); } else if (ApplicationManager.getApplication().isDispatchThread()) { ApplicationManager.getApplication().runWriteAction(r); } else { ApplicationManager.ge... | invokeAndWaitWriteAction |
19,777 | void (@NotNull Project project, @NotNull Runnable r) { startTestRunnable(r); if (DumbService.isDumbAware(r)) { runAndFinishTestRunnable(r); } else { DumbService.getInstance(project).runWhenSmart(DisposeAwareRunnable.create(() -> runAndFinishTestRunnable(r), project)); } } | runDumbAware |
19,778 | void (@NotNull Project project, @NotNull Runnable runnable) { if (project.isDisposed()) { return; } if (project.isInitialized()) { runDumbAware(project, runnable); } else { startTestRunnable(runnable); StartupManager.getInstance(project).runAfterOpened(() -> runAndFinishTestRunnable(runnable)); } } | runWhenInitialized |
19,779 | boolean () { return LaterInvocator.isInModalContext(); } | isInModalContext |
19,780 | void (Project project, @NlsContexts.NotificationTitle String title, Throwable e) { MavenLog.LOG.warn(title, e); Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, e.getMessage(), NotificationType.ERROR), project); } | showError |
19,781 | void (Project project, @NlsContexts.NotificationTitle String title, @NlsContexts.NotificationContent String message) { MavenLog.LOG.warn(title); Notifications.Bus.notify(new Notification(MAVEN_NOTIFICATION_GROUP, title, message, NotificationType.ERROR), project); } | showError |
19,782 | VirtualFile (@NotNull VirtualFile file) { VirtualFile baseDir = file.isDirectory() || file.getParent() == null ? file : file.getParent(); VirtualFile dir = baseDir; do { VirtualFile child = dir.findChild(".mvn"); if (child != null && child.isDirectory()) { if (MavenLog.LOG.isTraceEnabled()) { MavenLog.LOG.trace("found ... | getVFileBaseDir |
19,783 | VirtualFile (VirtualFile pomFile) { if (pomFile == null) return null; VirtualFile parent = pomFile.getParent(); if (parent == null || !parent.isValid()) return null; return parent.findChild(MavenConstants.PROFILES_XML); } | findProfilesXmlFile |
19,784 | File (VirtualFile pomFile) { if (pomFile == null) return null; VirtualFile parent = pomFile.getParent(); if (parent == null) return null; return new File(parent.getPath(), MavenConstants.PROFILES_XML); } | getProfilesXmlIoFile |
19,785 | List<String> (List<? extends VirtualFile> files) { return ContainerUtil.map(files, file -> file.getPath()); } | collectPaths |
19,786 | List<VirtualFile> (Collection<? extends MavenProject> projects) { return ContainerUtil.map(projects, project -> project.getFile()); } | collectFiles |
19,787 | String (URL url) { return "<img src=\"" + url + "\"> "; } | formatHtmlImage |
19,788 | boolean (String relativeName, List<Pattern> includes, List<Pattern> excludes) { boolean result = false; for (Pattern each : includes) { if (each.matcher(relativeName).matches()) { result = true; break; } } if (!result) return false; for (Pattern each : excludes) { if (each.matcher(relativeName).matches()) return false;... | isIncluded |
19,789 | void (@NotNull ProgressIndicator i) { try { task.run(new MavenProgressIndicator(null, i, null)); } catch (MavenProcessCanceledException | ProcessCanceledException e) { canceledEx[0] = e; } catch (RuntimeException e) { runtimeEx[0] = e; } catch (Error e) { errorEx[0] = e; } } | run |
19,790 | MavenTaskHandler (@NotNull Project project, @NotNull @NlsContexts.Command String title, boolean cancellable, @NotNull MavenTask task) { MavenProjectsManager manager = MavenProjectsManager.getInstanceIfCreated(project); Supplier<MavenSyncConsole> syncConsoleSupplier = manager == null ? null : () -> manager.getSyncConsol... | runInBackground |
19,791 | void () { try { future.get(); } catch (InterruptedException | ExecutionException e) { MavenLog.LOG.error(e); } } | waitFor |
19,792 | void (@NotNull ProgressIndicator i) { indicator.setIndicator(i); handler.waitFor(); } | run |
19,793 | File (@Nullable String overrideMavenHome) { if (!isEmptyOrSpaces(overrideMavenHome)) { return MavenUtil.getMavenHomeFile(staticOrBundled(resolveMavenHomeType(overrideMavenHome))); } String m2home = System.getenv(ENV_M2_HOME); if (!isEmptyOrSpaces(m2home)) { final File homeFromEnv = new File(m2home); if (isValidMavenHom... | resolveMavenHomeDirectory |
19,794 | List<MavenHomeType> () { List<MavenHomeType> result = new ArrayList<>(); String m2home = System.getenv(ENV_M2_HOME); if (!isEmptyOrSpaces(m2home)) { final File homeFromEnv = new File(m2home); if (isValidMavenHome(homeFromEnv)) { result.add(new MavenInSpecificPath(m2home)); } } String mavenHome = System.getenv("MAVEN_HO... | getSystemMavenHomeVariants |
19,795 | void (@NotNull String mavenVersion, @NotNull SimpleJavaParameters params) { if (VersionComparatorUtil.compare(mavenVersion, "3.0.2") < 0) { MavenLog.LOG.warn("Maven version less than 3.0.2 are not correctly displayed in Build Window"); return; } String listenerPath = MavenServerManager.getInstance().getMavenEventListen... | addEventListener |
19,796 | File () { final File symlinkDir = new File("/usr/share/maven"); if (isValidMavenHome(symlinkDir)) { return symlinkDir; } // well, try to search final File dir = new File("/usr/share/java"); final String[] list = dir.list(); if (list == null || list.length == 0) { return null; } String home = null; final String prefix =... | fromMacSystemJavaTools |
19,797 | File () { final File brewDir = new File("/usr/local/Cellar/maven"); final String[] list = brewDir.list(); if (list == null || list.length == 0) { return null; } if (list.length > 1) { Arrays.sort(list, (o1, o2) -> compareVersionNumbers(o2, o1)); } final File file = new File(brewDir, list[0] + "/libexec"); return isVali... | fromBrew |
19,798 | boolean (@Nullable String str) { return str == null || str.length() == 0 || str.trim().length() == 0; } | isEmptyOrSpaces |
19,799 | boolean (@Nullable File home) { if (home == null) return false; return getMavenConfFile(home).exists(); } | isValidMavenHome |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.