Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
269,600
void () { processed.set(true); }
run
269,601
void (String action, Object element) { if (addReadyCallbacks.get() != null) { addReadyCallbacks.get().run(); addReadyCallbacks.set(null); } if (element.equals(new NodeElement("ide"))) { disposeRequested.set(true); //noinspection SSBasedInspection getBuilder().dispose(); } }
onElementAction
269,602
void (TreeModelEvent e) { updates.get().append("changed parent").append(e.getTreePath()).append(" children=").append(Arrays.asList(e.getChildren())) .append("\n"); }
treeNodesChanged
269,603
void (TreeModelEvent e) { updates.get().append("inserted=").append(e.getTreePath()).append("\n"); }
treeNodesInserted
269,604
void (TreeModelEvent e) { updates.get().append("removed=").append(e.getTreePath()).append("\n"); }
treeNodesRemoved
269,605
void (TreeModelEvent e) { updates.get().append("structureChanged=").append(e.getTreePath()).append("\n"); }
treeStructureChanged
269,606
void (String action, Object element) { NodeElement stopElement = new NodeElement("com"); if (cancelled.get()) { myCancelRequest = new AssertionError("Not supposed to update after element=" + stopElement); return; } if (element.equals(stopElement) && action.equals("getChildren")) { cancelled.set(true); getBuilder().canc...
onElementAction
269,607
void (Runnable onDone) { getMyBuilder().select(new Object[] {new NodeElement("intellij"), new NodeElement("fabrique")}, onDone); }
run
269,608
void (Runnable onDone) { getMyBuilder().expand(new Object[] {new NodeElement("intellij"), new NodeElement("fabrique")}, onDone); }
run
269,609
Object[] () { if (super.getChildElements().length == 0) { addChild(new Level(this, myLevel + 1)); } return super.getChildElements(); }
getChildElements
269,610
void (final TreeAction action) { final int[] notifyCount = new int[1]; final boolean[] done = new boolean[1]; invokeLaterIfNeeded(() -> action.run(() -> { notifyCount[0]++; done[0] = true; })); new WaitFor(2000) { @Override protected boolean condition() { return done[0] && getMyBuilder().getUi().isReady(); } }; assertT...
assertCallbackOnce
269,611
boolean () { return done[0] && getMyBuilder().getUi().isReady(); }
condition
269,612
boolean () { return queued.get(); }
condition
269,613
void (final NodeElement[] elements, final int index, final ProgressIndicator indicator, final ActionCallback callback) { if (indicator.isCanceled()) { callback.setRejected(); return; } if (index >= elements.length) { callback.setDone(); return; } getBuilder().expand(elements[index], () -> expandNext(elements, index + 1...
expandNext
269,614
void (final Node node, final int start, final int end, final @Nullable Runnable eachRunnable, final @Nullable Runnable endRunnable) { UIUtil.invokeAndWaitIfNeeded(() -> { for (int i = start; i <= end; i++) { Node eachFile = node.addChild("File " + i); myAutoExpand.add(eachFile.getElement()); eachFile.addChild("message ...
buildSiblings
269,615
void (final Runnable action, final String interruptAction, final Object interruptElement, final Interruption interruption) { myElementUpdate.clear(); final boolean[] wasInterrupted = new boolean[]{false}; myElementUpdateHook = new ElementUpdateHook() { @Override public void onElementAction(String action, Object element...
runAndInterrupt
269,616
void (String action, Object element) { boolean toInterrupt = element.equals(interruptElement) && action.equals(interruptAction); if (wasInterrupted[0]) { if (myCancelRequest == null) { getBuilder().getUi().getStatus(); final String message = "Not supposed to be update after interruption request: action=" + action + " e...
onElementAction
269,617
void (String action, Object element) { if (new NodeElement("apple").equals(element) && "getChildren".equals(action)) { Objects.requireNonNull(getBuilder().getUpdater()) .addSubtreeToUpdate(new TreeUpdatePass(Objects.requireNonNull(findNode("ibm", false))).setUpdateStamp(1)); Objects.requireNonNull(getBuilder().getUpdat...
onElementAction
269,618
int (NodeDescriptor<?> o1, NodeDescriptor<?> o2) { return invert[0] ? AlphaComparator.INSTANCE.compare(o2, o1) : AlphaComparator.INSTANCE.compare(o1, o2); }
compare
269,619
boolean (Object element) { return !element.equals(intellij); }
isValid
269,620
int (NodeDescriptor o1, NodeDescriptor o2) { boolean isParent1 = myStructure._getChildElements(o1.getElement(), false).length > 0; boolean isParent2 = myStructure._getChildElements(o2.getElement(), false).length > 0; int result = AlphaComparator.INSTANCE.compare(o1, o2); if (isParent1) { result -= 1000; } if (isParent2...
compare
269,621
boolean (NodeElement element) { return !invalid.contains(element); }
isValid
269,622
void (String action, Object element) { if (!element.toString().equals(actionElement.toString())) return; Runnable runnable = () -> { myReadyRequest = true; Disposer.dispose(getBuilder()); }; if (actionAction.equals(action)) { if (getBuilder().getUi().isPassthroughMode()) { runnable.run(); } else { //noinspection SSBase...
onElementAction
269,623
boolean () { return getBuilder().getUi() == null; }
condition
269,624
void () { try { runSafe(); } catch (Exception e) { throw new RuntimeException(e); } }
run
269,625
void () { //todo }
testSelectionGoesToParentWhenOnlyChildMoved2
269,626
void () { //todo }
testQueryStructureWhenExpand
269,627
void () { // doesn't make sense since pass-through mode is always serial, it doesn't queue for updates }
testMoveElementToAdjacentEmptyParentWithSmartExpandAndSerialUpdateSubtrees
269,628
void () { //todo }
testElementMove1
269,629
void () { //todo }
testClear
269,630
void () { // doesn't make sense in pass-through mode }
testDoubleCancelUpdate
269,631
void () { // doesn't make sense in pass-through mode }
testNoExtraJTreeModelUpdate
269,632
void () { // doesn't make sense in pass-through mode }
testSelectWhenUpdatesArePending
269,633
void () { // doesn't make sense in pass-through mode }
testBigTreeUpdate
269,634
void () { String v1 = "0.0.1"; String v2 = "0.0.1"; assertEquals("Version is not equal", 0, compareVersions(v1, v2)); }
testEqual
269,635
void () { String v1 = "0.0.2"; String v2 = "0.0.1"; assertTrue("Version 1 is not great than Version 2", compareVersions(v1, v2) > 0); }
testGreat
269,636
void () { String v1 = "0.0.1"; String v2 = "0.0.2"; assertTrue("Version 1 is not less than Version 2", compareVersions(v1, v2) < 0); }
testLess
269,637
void () { String v1 = "0.0.2.0"; String v2 = "0.0.1.0"; assertTrue("Version 1 is not great than Version 2", compareVersions(v1, v2) > 0); }
testGreatDiff
269,638
void () { String v1 = "0.0.1.1"; String v2 = "0.0.2.0"; assertTrue("Version 1 is not less than Version 2", compareVersions(v1, v2) < 0); }
testLessDiff
269,639
void () { assertEquals(0, compareVersions("1.0.0", "1.0")); assertEquals(0, compareVersions("1.0.0", "1")); assertEquals(0, compareVersions("1.0.0", "1.0.")); assertEquals(0, compareVersions("1.0.0", "1.")); assertEquals(0, compareVersions("1.0.", "1.0.0")); assertEquals(0, compareVersions("1.", "1.0.0")); assertEquals...
testDifferentNumberOfParts
269,640
void () { String v1 = "0.0.1a"; String v2 = "0.0.2"; assertTrue("Version 1 is not less than Version 2", compareVersions(v1, v2) < 0); }
testWord
269,641
void () { String serverVer = "1.0.10"; String userVer = "1.0.9"; assertTrue("Server version is not great than user version", compareVersions(serverVer, userVer) > 0); }
testNewest
269,642
void () { assertTrue(compareVersions("3.6.2", "3.7") < 0); assertTrue(compareVersions("3.7.1", "3.13.4") < 0); }
testJira
269,643
void () { ascending("0.1.2", "0.1.11", "0.1.11-2", "1.0.0-alpha", "1.0.0-alpha.1", "1.0.0-beta", "1.0.0-beta.2", "1.0.0-beta.11", "1.0.0-rc.1", "1.0.0"); }
testSemVer
269,644
void () { ascending("3.1 Beta", "3.1 Beta 2", "3.1", "3.1.1.134.1462", "3.4.Beta.135.1", "3.4.135.21", "4.0 Beta 139.3", "4.0 Beta 139.58", "4.0.12", "4.1 141.4 EAP", "4.1 141.39 EAP", "4.5 141.82"); ascending("4.1", "142.175 v4.5", "142.175 v4.5.1"); }
testPythonPlugin
269,645
void () { assertTrue(compareVersions("7.1.0.20150520", "7.1.0.20150501") > 0); }
testRubyPlugin
269,646
void () { assertTrue(compareVersions("1.3.3.16-14.1", "1.3.3.15-14.1") > 0); }
testScalaPlugin
269,647
void () { assertTrue(compareVersions("1.1beta16", "1.1beta8") > 0); assertTrue(compareVersions("1.5.0.142-beta2", "1.5.0.142-beta1") > 0); }
testBashPlugin
269,648
void () { ascending("1.3-M2", "1.3.0-rc"); ascending("1.3-M2", "1.3.0-dev"); }
testKotlinPlugin
269,649
int (String v1, String v2) { return VersionComparatorUtil.compare(v1, v2); }
compareVersions
269,650
void (String... versions) { assertTrue(versions.length > 1); for (int i = 0; i < versions.length - 1; i++) { assertTrue(versions[i] + " is greater then " + versions[i + 1], compareVersions(versions[i], versions[i + 1]) < 0); } }
ascending
269,651
String () { return PlatformTestUtil.getPlatformTestDataPath() + "plugins/sort"; }
getTestDataPath
269,652
void () { assertCompatible("145.2", null, null); assertCompatible("145.2.2", null, null); assertCompatible("145.2", "145", null); assertCompatible("145.2", null, "146"); assertCompatible("145.2.2", "145", null); assertCompatible("145.2.2", null, "146"); assertIncompatible("145.2", null, "145"); assertIncompatible("145....
compatibilityBranchBased
269,653
void () { TriConsumer<String, String, String> checkCompatibility = (String ideVersion, String sinceBuild, String untilBuild) -> { boolean ignoreCompatibility = PluginManagerCore.isIgnoreCompatibility; try { assertIncompatible(ideVersion, sinceBuild, untilBuild); PluginManagerCore.isIgnoreCompatibility = true; assertCom...
ignoredCompatibility
269,654
void () { assertCompatible("145.10", "144.*", null); assertIncompatible("145.10", "145.*", null); assertIncompatible("145.10", "146.*", null); assertIncompatible("145.10", null, "144.*"); assertCompatible("145.10", null, "145.*"); assertCompatible("145.10", null, "146.*"); assertCompatible("145.10.1", null, "145.*"); a...
compatibilityBranchBasedStar
269,655
void () { assertIncompatible("145.SNAPSHOT", "146", null); assertIncompatible("145.2.SNAPSHOT", "145.3", null); assertCompatible("145.SNAPSHOT", "145.2", null); assertCompatible("145.SNAPSHOT", null, "146"); assertIncompatible("145.SNAPSHOT", null, "145"); assertIncompatible("145.SNAPSHOT", null, "144"); assertIncompat...
compatibilitySnapshots
269,656
void () { assertEquals(SystemInfo.isWindows, checkCompatibility("com.intellij.platform.windows")); assertEquals(SystemInfo.isMac, checkCompatibility("com.intellij.platform.mac")); assertEquals(SystemInfo.isLinux, checkCompatibility("com.intellij.platform.linux")); assertEquals(SystemInfo.isFreeBSD, checkCompatibility("...
compatibilityPlatform
269,657
void () { assertConvertsTo(null, null); assertConvertsTo("145", "145"); assertConvertsTo("145.999", "145.999"); assertConvertsTo("145.9999", "145.*"); assertConvertsTo("145.99999", "145.*"); assertConvertsTo("145.9999.1", "145.9999.1"); assertConvertsTo("145.1000", "145.1000"); assertConvertsTo("145.10000", "145.*"); a...
convertExplicitBigNumberInUntilBuildToStar
269,658
void () { var pluginsPath = Path.of(PlatformTestUtil.getPlatformTestDataPath(), "plugins", "withModules"); var descriptorBundled = loadDescriptorInTest(pluginsPath, true); var pluginSet = new PluginSetBuilder(Set.of(descriptorBundled)).createPluginSetWithEnabledModulesMap(); var moduleId = PluginId.getId("foo.bar"); va...
testModulePluginIdContract
269,659
void () { var pluginsPath = Path.of(PlatformTestUtil.getPlatformTestDataPath(), "plugins", "updatedBundled"); var bundled = loadDescriptorInTest(pluginsPath.resolve("bundled"), true); var updated = loadDescriptorInTest(pluginsPath.resolve("updated")); var expectedPluginId = updated.getPluginId(); assertEquals(expectedP...
testIdentifyPreInstalledPlugins
269,660
void (PluginId expectedPluginId, IdeaPluginDescriptorImpl... descriptors) { var loadingResult = createPluginLoadingResult(); loadingResult.addAll(List.of(descriptors)); assertTrue("Plugin should be pre installed", loadingResult.shadowedBundledIds.contains(expectedPluginId)); }
assertPluginPreInstalled
269,661
void (String untilBuild, String result) { assertEquals(result, PluginManager.convertExplicitBigNumberInUntilBuildToStar(untilBuild)); }
assertConvertsTo
269,662
void (String ideVersion, @Nullable String sinceBuild, @Nullable String untilBuild) { assertNotNull(checkCompatibility(ideVersion, sinceBuild, untilBuild)); }
assertIncompatible
269,663
boolean (String platformId) { IdeaPluginDependency platformDependencyMock = EasyMock.niceMock(IdeaPluginDependency.class); expect(platformDependencyMock.getPluginId()).andReturn(PluginId.getId(platformId)); replay(platformDependencyMock); IdeaPluginDescriptor mock = EasyMock.niceMock(IdeaPluginDescriptor.class); expect...
checkCompatibility
269,664
void (String ideVersion, @Nullable String sinceBuild, @Nullable String untilBuild) { assertNull(checkCompatibility(ideVersion, sinceBuild, untilBuild)); }
assertCompatible
269,665
boolean () { return false; }
isFlat
269,666
boolean (@NotNull RawPluginDescriptor readInto, @NotNull ReadModuleContext readContext, @NotNull DataLoader dataLoader, @Nullable String base, @NotNull String relativePath) { throw new UnsupportedOperationException(); }
loadXIncludeReference
269,667
RawPluginDescriptor (@NotNull ReadModuleContext readContext, @NotNull DataLoader dataLoader, @NotNull String relativePath, @Nullable RawPluginDescriptor readInto) { for (var child : root.children) { if (child.name.equals("config-file-idea-plugin")) { var url = Objects.requireNonNull(child.getAttributeValue("url")); if ...
resolvePath
269,668
RawPluginDescriptor (@NotNull ReadModuleContext readContext, @NotNull DataLoader dataLoader, @NotNull String path, @Nullable RawPluginDescriptor readInto) { if (autoGenerateModuleDescriptor.get() && path.startsWith("intellij.")) { var element = moduleMap.get(path); if (element != null) { try { return XmlReader.readModu...
resolveModuleFile
269,669
String (IdeaPluginDescriptorImpl @NotNull [] descriptors) { // place breakpoint in PluginManagerCore#loadDescriptors before sorting var sb = new StringBuilder("<root>"); Function<String, String> escape = s -> { return s.equals("com.intellij") || s.startsWith("com.intellij.modules.") ? s : "-" + s.replace(".", "-") + "-...
dumpDescriptors
269,670
void () { assertEquals("name", PorterStemmerUtil.stem("names")); assertEquals("j2ee", PorterStemmerUtil.stem("j2ee")); assertEquals("keyword1", PorterStemmerUtil.stem("keyword1")); assertEquals("initi", PorterStemmerUtil.stem("initializer")); assertEquals("initi", PorterStemmerUtil.stem("initialization")); assertEquals...
test
269,671
boolean (Configurable configurable) { String displayName = configurable.getDisplayName(); return displayName.equals("parent") || displayName.equals("1st.child") || displayName.equals("2nd.child") || displayName.equals("2nd.child.1"); }
isIncluded
269,672
void (StringBuilder sb, String name, String value) { sb.append(' ').append(name).append('=').append('"').append(value).append('"'); }
append
269,673
void (@NotNull List<ConfigurableEP<Configurable>> configurableEPs, @Nullable ConfigurableFilter filter, @NotNull List<Node> expectedTopLevelNodes) { List<Configurable> list = ConfigurableExtensionPointUtil.buildConfigurablesList(configurableEPs, filter); assertEquals(expectedTopLevelNodes.size(), list.size()); for (int...
matchStructures
269,674
void (@NotNull Configurable configurable, @NotNull Node node) { if (configurable instanceof SearchableConfigurable searchableConfigurable) { assertEquals(node.getId(), searchableConfigurable.getId()); List<Configurable> children = Collections.emptyList(); if (configurable instanceof Configurable.Composite composite) { ...
matchNodesDeeply
269,675
List<Node> (Configurable... configurables) { Map<String, List<Configurable>> map = ConfigurableExtensionPointUtil.groupConfigurables(Arrays.asList(configurables)); List<Node> children = new ArrayList<>(); for (Map.Entry<String, List<Configurable>> entry : new TreeMap<>(map).entrySet()) { children.add(node(entry.getKey(...
build
269,676
Node (List<Configurable> configurables, boolean optimize) { Registry.get("ide.settings.replace.group.with.single.configurable").setValue(optimize); return node((Configurable)ConfigurableExtensionPointUtil.getConfigurableGroup(configurables, null)); }
node
269,677
Node (Configurable configurable) { SearchableConfigurable sc = (SearchableConfigurable)configurable; if (configurable instanceof Configurable.Composite composite) { return node(sc.getId(), Arrays.asList(composite.getConfigurables())); } return node(sc.getId()); }
node
269,678
Node (String id, Node... children) { return new Node(id, Arrays.asList(children)); }
node
269,679
Node (String id, List<Configurable> configurables) { List<Node> children = new ArrayList<>(); for (Configurable configurable : configurables) { children.add(node(configurable)); } return new Node(id, children); }
node
269,680
String () { return myId; }
getId
269,681
List<Node> () { return myChildren; }
getChildren
269,682
boolean (Object object) { if (object instanceof Node node) { if (node.myId == null ? myId == null : node.myId.equals(myId)) { return node.myChildren.equals(myChildren); } } return false; }
equals
269,683
String () { StringBuilder sb = new StringBuilder(myId); int count = myChildren.size(); if (count > 0) { sb.append(" with ").append(count).append(" child"); if (count > 1) sb.append("ren"); } return sb.toString(); }
toString
269,684
void () { final Element element = new Element("temp"); new HighlightSeverity(HighlightSeverity.ERROR.myName, 500).writeExternal(element); HighlightSeverity newSeverity = new HighlightSeverity(element); assertEquals(500, newSeverity.myVal); }
testSeveritiesMigration
269,685
void () { ActionManagerImpl actionManager = (ActionManagerImpl)ActionManager.getInstance(); AnActionEvent event1 = new AnActionEvent(null, DataContext.EMPTY_CONTEXT, ActionPlaces.UNKNOWN, new Presentation(), actionManager, 0); AnActionEvent event2 = new AnActionEvent(null, SimpleDataContext.getProjectContext(getProject...
testActionsUpdateMethods
269,686
boolean (@NotNull String category, @NotNull String message, Throwable t) { myLoggedWarnings.add(message); return super.processWarn(category, message, t); }
processWarn
269,687
void () { AnAction action1 = new AnAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { } }; AnAction action2 = ActionManager.getInstance().getAction(IdeActions.ACTION_DELETE); JPanel component = new JPanel(); action1.registerCustomShortcutSet(action2.getShortcutSet(), component); assertWarningS...
testActionCanChangeShortcut
269,688
void (@NotNull AnActionEvent e) { }
actionPerformed
269,689
void () { AnAction action1 = ActionManager.getInstance().getAction(IdeActions.ACTION_COPY); AnAction action2 = ActionManager.getInstance().getAction(IdeActions.ACTION_DELETE); JPanel component = new JPanel(); action1.registerCustomShortcutSet(action2.getShortcutSet(), component); assertWarningShown(true); }
testGlobalActionCantChangeShortcut1
269,690
void () { AnAction action = ActionManager.getInstance().getAction(IdeActions.ACTION_COPY); JPanel component = new JPanel(); action.registerCustomShortcutSet(CustomShortcutSet.EMPTY, component); assertWarningShown(true); }
testGlobalActionCantChangeShortcut2
269,691
void (boolean isExpected) { boolean hasWarning = ContainerUtil.exists(myLoggedWarnings, message -> message.contains(MARKER)); if (hasWarning != isExpected) { fail(myLoggedWarnings.toString()); } }
assertWarningShown
269,692
String () { return PlatformTestUtil.getPlatformTestDataPath() + "fileEditorManager"; }
getTestDataPath
269,693
void () { testTabPlacement(SwingConstants.TOP, true); testTabPlacement(SwingConstants.TOP, false); }
testSwitcherPanelWithTabs
269,694
void () { testTabPlacement(UISettings.TABS_NONE, true); testTabPlacement(UISettings.TABS_NONE, false); }
testSwitcherPanelWithoutTabs
269,695
void (int tabPlacement, boolean goForward) { UISettings.getInstance().getState().setEditorTabPlacement(tabPlacement); manager.openFile(getFile("/src/1.txt"), true); manager.openFile(getFile("/src/2.txt"), true); manager.openFile(getFile("/src/3.txt"), true); List<?> filesToShow = Switcher.SwitcherPanel.getFilesToShowFo...
testTabPlacement
269,696
void () { ActionManagerImpl mgr = (ActionManagerImpl)ActionManager.getInstance(); Set<String> ids = mgr.getActionIds(); List<String> failed = new ArrayList<>(); for (String id : ids) { if (KNOWN_FALSE_POSITIVES.contains(id)) continue; AnAction action = mgr.getActionOrStub(id); if (action == null) fail("Can't find actio...
testActionsPresentations
269,697
boolean (@Nullable String text) { if (text == null) return true; if (text.contains("{")) return false; // MessageFormat template if (text.contains("<")) return false; // HTML return true; } }
isValidText
269,698
void () { assertEquals(FileTemplatesScheme.DEFAULT, myTemplateManager.getCurrentScheme()); FileTemplate template = myTemplateManager.getTemplate(TEST_TEMPLATE_TXT); assertEquals(HI_THERE, template.getText()); String newText = "good bye"; template.setText(newText); assertEquals(newText, myTemplateManager.getTemplate(TES...
testSchemas
269,699
void () { Project defaultProject = ProjectManager.getInstance().getDefaultProject(); assertNull(FileTemplateManager.getInstance(defaultProject).getProjectScheme()); }
testDefaultProject