Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
23,400 | void (@NotNull TraceContainer listener) { myTraceContainers.add(listener); listener.addSelectionListener(mySelectionListener); Disposer.register(this, listener); } | register |
23,401 | void (@NotNull List<TraceElement> values, @NotNull PropagationDirection direction) { highlightAll(values); propagate(values, direction); } | highlightingChanged |
23,402 | void (@NotNull List<TraceElement> values, @NotNull PropagationDirection direction) { if (direction.equals(PropagationDirection.BACKWARD)) { propagateBackward(values); } else { propagateForward(values); } } | propagate |
23,403 | void (@NotNull List<TraceElement> values) { if (myNextListener == null) return; final List<TraceElement> nextValues = values.stream().flatMap(x -> getNextValues(x).stream()).collect(Collectors.toList()); myNextListener.highlightingChanged(nextValues, PropagationDirection.FORWARD); } | propagateForward |
23,404 | void (@NotNull List<TraceElement> values) { if (myPrevListener == null) return; final List<TraceElement> prevValues = values.stream().flatMap(x -> getPrevValues(x).stream()).collect(Collectors.toList()); myPrevListener.highlightingChanged(prevValues, PropagationDirection.BACKWARD); } | propagateBackward |
23,405 | void (@NotNull List<TraceElement> values) { for (final TraceContainer listener : myTraceContainers) { listener.highlight(values); } } | highlightAll |
23,406 | void (@NotNull List<TraceElement> values) { for (final TraceContainer listener : myTraceContainers) { listener.select(values); } } | selectAll |
23,407 | boolean () { return myNextListener != null && myNextListener.isSelectionExists(PropagationDirection.FORWARD); } | selectionExistsForward |
23,408 | boolean () { return myPrevListener != null && myPrevListener.isSelectionExists(PropagationDirection.BACKWARD); } | selectionExistsBackward |
23,409 | void (@NotNull final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { myHaveLink = false; myLink.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); XDebuggerTreeNode node = (XDebuggerTreeNode)value; node.appendToComponent(this); setIcon(node.getIcon()); Rectangle treeVisibleRect = tree.getParent() instanceof JViewport ? ((JViewport)tree.getParent()).getViewRect() : tree.getVisibleRect(); int rowX = getNodeRowX(tree, row) + tree.getInsets().left; if (myHaveLink) { setupLinkDimensions(treeVisibleRect, rowX); } else { int visibleRectRightX = treeVisibleRect.x + treeVisibleRect.width; int notFittingWidth = rowX + super.getPreferredSize().width - visibleRectRightX; if (node instanceof XValueNodeImpl && notFittingWidth > 0) { // text does not fit visible area - show link String rawValue = DebuggerUIUtil.getNodeRawValue((XValueNodeImpl)node); if (!StringUtil.isEmpty(rawValue) && tree.isShowing()) { Point treeRightSideOnScreen = new Point(visibleRectRightX, 0); SwingUtilities.convertPointToScreen(treeRightSideOnScreen, tree); Rectangle screen = ScreenUtil.getScreenRectangle(treeRightSideOnScreen); // text may fit the screen in ExpandableItemsHandler if (screen.x + screen.width < treeRightSideOnScreen.x + notFittingWidth) { myLongTextLink.setupComponent(rawValue, ((XDebuggerTree)tree).getProject()); append(myLongTextLink.getLinkText(), myLongTextLink.getTextAttributes(), myLongTextLink); setupLinkDimensions(treeVisibleRect, rowX); myLinkWidth = 0; } } } } putClientProperty(ExpandableItemsHandler.RENDERER_DISABLED, myHaveLink); } | customizeCellRenderer |
23,410 | void (Rectangle treeVisibleRect, int rowX) { Dimension linkSize = myLink.getPreferredSize(); myLinkWidth = linkSize.width; myLinkOffset = Math.min(super.getPreferredSize().width, treeVisibleRect.x + treeVisibleRect.width - myLinkWidth - rowX); } | setupLinkDimensions |
23,411 | void (@NotNull String fragment, @NotNull SimpleTextAttributes attributes, Object tag) { if (tag instanceof XDebuggerTreeNodeHyperlink && ((XDebuggerTreeNodeHyperlink)tag).alwaysOnScreen()) { myHaveLink = true; myLink.append(fragment, attributes, tag); } else { super.append(fragment, attributes, tag); } } | append |
23,412 | void (Graphics2D g) { if (myHaveLink) { useSafely(g.create(0, 0, myLinkOffset, g.getClipBounds().height), textGraphics -> super.doPaint(textGraphics)); g.translate(myLinkOffset, 0); myLink.setHeight(getHeight()); myLink.doPaint(g); g.translate(-myLinkOffset, 0); } else { super.doPaint(g); } } | doPaint |
23,413 | Dimension () { Dimension size = super.getPreferredSize(); if (myHaveLink) { size.width += myLinkWidth; } return size; } | getPreferredSize |
23,414 | Object (int x) { if (myHaveLink) { return myLink.getFragmentTagAt(x - myLinkOffset); } return super.getFragmentTagAt(x); } | getFragmentTagAt |
23,415 | void (@NotNull JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {} | customizeCellRenderer |
23,416 | void (Graphics2D g) { super.doPaint(g); } | doPaint |
23,417 | int () { return myHeight; } | getHeight |
23,418 | boolean () { return true; } | alwaysOnScreen |
23,419 | void (MouseEvent event) { DebuggerUIUtil.showValuePopup(new ImmediateFullValueEvaluator(myText), event, myProject, null); event.consume(); } | onClick |
23,420 | void () { ApplicationManager.getApplication().invokeLater(() -> close(CLOSE_EXIT_CODE)); } | sessionStopped |
23,421 | String () { return "#com.intellij.debugger.streams.ui.EvaluationAwareTraceWindow"; } | getDimensionServiceKey |
23,422 | void (@NotNull ResolvedTracingResult resolvedTrace, @NotNull EvaluationContextImpl context) { if (Disposer.isDisposed(myDisposable)) { return; } final ResolvedStreamChain chain = resolvedTrace.getResolvedChain(); assert chain.length() == myTabContents.size(); final List<TraceControllerImpl> controllers = createControllers(resolvedTrace); if (controllers.isEmpty()) return; final List<TraceElement> trace = controllers.get(0).getTrace(); final CollectionTree tree = new CollectionTree(trace, context); final CollectionView sourceView = new CollectionView(tree); controllers.get(0).register(sourceView); myTabContents.get(0).setContent(sourceView, BorderLayout.CENTER); for (int i = 1; i < myTabContents.size(); i++) { if (i == myTabContents.size() - 1 && (resolvedTrace.exceptionThrown() || resolvedTrace.getSourceChain().getTerminationCall().getResultType().equals(JavaTypes.INSTANCE.getVOID()))) { break; } final MyPlaceholder tab = myTabContents.get(i); final TraceController previous = controllers.get(i - 1); final TraceController current = controllers.get(i); final StreamTracesMappingView view = new StreamTracesMappingView(context, previous, current); tab.setContent(view, BorderLayout.CENTER); } final TraceElement result = resolvedTrace.getResult(); final MyPlaceholder resultTab = myTabContents.get(myTabContents.size() - 1); if (resolvedTrace.exceptionThrown()) { JBLabel label = new JBLabel(StreamDebuggerBundle.message("tab.content.exception.thrown"), SwingConstants.CENTER); resultTab.setContent(label, BorderLayout.CENTER); setTitle(StreamDebuggerBundle.message("stream.debugger.dialog.with.exception.title")); final ExceptionView exceptionView = new ExceptionView(context, result); Disposer.register(myDisposable, exceptionView); myTabsPane.insertTab(StreamDebuggerBundle.message("exception.tab.name"), AllIcons.Nodes.ErrorIntroduction, exceptionView, "", 0); myTabsPane.setSelectedIndex(0); } else if (resolvedTrace.getSourceChain().getTerminationCall().getResultType().equals(JavaTypes.INSTANCE.getVOID())) { JBLabel label = new JBLabel(StreamDebuggerBundle.message("tab.content.no.result"), SwingConstants.CENTER); resultTab.setContent(label, BorderLayout.CENTER); } final FlatView flatView = new FlatView(controllers, context); myFlatContent.setContent(flatView, BorderLayout.CENTER); myCenterPane.revalidate(); myCenterPane.repaint(); } | setTrace |
23,423 | void (@NotNull @Nls String reason) { StreamEx.of(myTabContents).prepend(myFlatContent) .forEach(x -> x.setContent(new JBLabel(reason, SwingConstants.CENTER), BorderLayout.CENTER)); } | setFailMessage |
23,424 | JComponent () { return myCenterPane; } | createCenterPanel |
23,425 | List<TraceControllerImpl> (@NotNull ResolvedTracingResult resolvedResult) { List<TraceControllerImpl> controllers = new ArrayList<>(); final ResolvedStreamChain chain = resolvedResult.getResolvedChain(); final List<ResolvedStreamCall.Intermediate> intermediateCalls = chain.getIntermediateCalls(); final NextAwareState firstState = intermediateCalls.isEmpty() ? chain.getTerminator().getStateBefore() : intermediateCalls.get(0).getStateBefore(); final TraceControllerImpl firstController = new TraceControllerImpl(firstState); controllers.add(firstController); TraceControllerImpl prevController = firstController; for (final ResolvedStreamCall.Intermediate intermediate : intermediateCalls) { final PrevAwareState after = intermediate.getStateAfter(); final TraceControllerImpl controller = new TraceControllerImpl(after); prevController.setNextController(controller); controller.setPreviousController(prevController); prevController = controller; controllers.add(controller); } final ResolvedStreamCall.Terminator terminator = chain.getTerminator(); final IntermediateState afterTerminationState = terminator.getStateAfter(); if (afterTerminationState != null && !terminator.getCall().getResultType().equals(JavaTypes.INSTANCE.getVOID())) { final TraceControllerImpl terminationController = new TraceControllerImpl(afterTerminationState); terminationController.setPreviousController(prevController); prevController.setNextController(terminationController); controllers.add(terminationController); } controllers.forEach(x -> Disposer.register(myDisposable, x)); return controllers; } | createControllers |
23,426 | void (@NotNull MyCenterPane pane, @NotNull MyMode mode) { pane.getLayout().show(pane, mode.name()); PropertiesComponent.getInstance().setValue(IS_FLAT_MODE_PROPERTY, MyMode.FLAT.equals(mode)); } | updateWindowMode |
23,427 | String (@NotNull MyMode currentState) { return MyMode.SPLIT.equals(currentState) ? StreamDebuggerBundle.message("stream.debugger.dialog.flat.mode.button") : StreamDebuggerBundle.message("stream.debugger.dialog.split.mode.button"); } | getButtonText |
23,428 | void (ActionEvent e) { final JButton button = getButton(this); if (button != null) { myMode = toggleMode(myMode); button.setText(getButtonText(myMode)); } updateWindowMode(myCenterPane, myMode); } | doAction |
23,429 | MyMode (@NotNull MyMode mode) { return MyMode.FLAT.equals(mode) ? MyMode.SPLIT : MyMode.FLAT; } | toggleMode |
23,430 | JBCardLayout () { return (JBCardLayout)super.getLayout(); } | getLayout |
23,431 | JLabel (@NotNull CollectionTree tree) { final JLabel label = new JBLabel(String.valueOf(tree.getItemsCount()), SwingConstants.CENTER); label.setForeground(JBColor.GRAY); final Font oldFont = label.getFont(); label.setFont(oldFont.deriveFont(oldFont.getSize() - JBUIScale.scale(1.f))); label.setBorder(JBUI.Borders.empty(3, 0)); return label; } | createDefaultLabel |
23,432 | void () { } | dispose |
23,433 | void (@NotNull List<TraceElement> elements) { myInstancesTree.highlight(elements); } | highlight |
23,434 | void (@NotNull List<TraceElement> elements) { myInstancesTree.select(elements); } | select |
23,435 | void (@NotNull ValuesSelectionListener listener) { myInstancesTree.addSelectionListener(listener); } | addSelectionListener |
23,436 | boolean () { return myInstancesTree.highlightedExists(); } | highlightedExists |
23,437 | CollectionTree () { return myInstancesTree; } | getInstancesTree |
23,438 | void (@NotNull List<T> options, @NotNull CallBack<T> callBack) { final DefaultListModel<T> model = new DefaultListModel<>(); int maxOffset = -1; for (final T option : options) { model.addElement(option); maxOffset = Math.max(maxOffset, option.rangeStream().mapToInt(TextRange::getEndOffset).max().orElse(-1)); } final JBList<T> list = new JBList<>(model); list.setCellRenderer(new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); //noinspection unchecked setText(((T)value).getText()); return this; } }); list.addListSelectionListener(e -> { final T selectedValue = list.getSelectedValue(); if (selectedValue == null) return; dropHighlighters(); selectedValue.rangeStream().forEach(x -> { final RangeHighlighter highlighter = myEditor.getMarkupModel() .addRangeHighlighter(x.getStartOffset(), x.getEndOffset(), HIGHLIGHT_LAYER, myAttributes, HighlighterTargetArea.EXACT_RANGE); myRangeHighlighters.add(highlighter); }); }); final JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list) .setTitle(StreamDebuggerBundle.message("multiple.chains.popup.title")) .setMovable(true) .setResizable(false) .setRequestFocus(true) .setItemChosenCallback(() -> callBack.chosen(list.getSelectedValue())) .addListener(new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { dropHighlighters(); } }) .createPopup(); if (maxOffset != -1) { myEditor.getCaretModel().moveToOffset(maxOffset); } popup.showInBestPositionFor(myEditor); } | show |
23,439 | Component (JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); //noinspection unchecked setText(((T)value).getText()); return this; } | getListCellRendererComponent |
23,440 | void (@NotNull LightweightWindowEvent event) { dropHighlighters(); } | onClosed |
23,441 | void () { myRangeHighlighters.forEach(RangeMarker::dispose); myRangeHighlighters.clear(); } | dropHighlighters |
23,442 | String () { final Value value = getValue(); if (value == null) { return "value"; } if (value instanceof ObjectReference) { return super.calcValueName(); } return value.type().name(); } | calcValueName |
23,443 | void (@NotNull RestorableStateNode node, @NotNull String name) { final TreePath path = node.getPath(); if (path.getPathCount() == 2) { ApplicationManager.getApplication().invokeLater(() -> expandPath(path)); removeTreeListener(this); } } | nodeLoaded |
23,444 | void (@NotNull RestorableStateNode node, @NotNull String name) { final XDebuggerTreeListener listener = this; if (node instanceof XValueContainerNode) { final XValueContainer container = ((XValueContainerNode<?>)node).getValueContainer(); if (container instanceof JavaValue) { final ValueDescriptorImpl descriptor = ((JavaValue)container).getDescriptor(); evaluationContext.getDebugProcess().getManagerThread().schedule(new DebuggerCommandImpl() { @Override protected void action() { final Value value = descriptor.getValue(); ApplicationManager.getApplication().invokeLater(() -> { final Object key = value == null ? NULL_MARKER : value; List<TraceElement> elements = key2TraceElements.get(key); final int nextIndex = key2Index.getOrDefault(key, -1) + 1; if (elements != null && nextIndex < elements.size()) { final TraceElement element = elements.get(nextIndex); myValue2Path.put(element, node.getPath()); myPath2Value.put(node.getPath(), element); key2Index.put(key, nextIndex); } if (myPath2Value.size() == traceElements.size()) { CollectionTree.this.removeTreeListener(listener); ApplicationManager.getApplication().invokeLater(CollectionTree.this::repaint); } }); } }); } } } | nodeLoaded |
23,445 | void () { final Value value = descriptor.getValue(); ApplicationManager.getApplication().invokeLater(() -> { final Object key = value == null ? NULL_MARKER : value; List<TraceElement> elements = key2TraceElements.get(key); final int nextIndex = key2Index.getOrDefault(key, -1) + 1; if (elements != null && nextIndex < elements.size()) { final TraceElement element = elements.get(nextIndex); myValue2Path.put(element, node.getPath()); myPath2Value.put(node.getPath(), element); key2Index.put(key, nextIndex); } if (myPath2Value.size() == traceElements.size()) { CollectionTree.this.removeTreeListener(listener); ApplicationManager.getApplication().invokeLater(CollectionTree.this::repaint); } }); } | action |
23,446 | boolean () { return true; } | isFileColorsEnabled |
23,447 | Color (@NotNull TreePath path) { if (isPathHighlighted(path)) { final Color background = UIUtil.getTreeSelectionBackground(true); return COLORS_CACHE.computeIfAbsent(background.getRGB(), rgb -> new JBColor( new Color(background.getRed(), background.getGreen(), background.getBlue(), 75), new Color(background.getRed(), background.getGreen(), background.getBlue(), 100))); } return UIUtil.getTreeBackground(); } | getFileColorForPath |
23,448 | void () { myIgnoreInternalSelectionEvents = true; super.clearSelection(); myIgnoreInternalSelectionEvents = false; } | clearSelection |
23,449 | Rectangle (@NotNull TraceElement element) { final TreePath path = myValue2Path.get(element); return path == null ? null : getPathBounds(path); } | getRectByValue |
23,450 | void (@NotNull List<TraceElement> elements) { clearSelection(); highlightValues(elements); tryScrollTo(elements); updatePresentation(); } | highlight |
23,451 | void (@NotNull List<TraceElement> elements) { final TreePath[] paths = elements.stream().map(myValue2Path::get).toArray(TreePath[]::new); select(paths); highlightValues(elements); if (paths.length > 0) { scrollPathToVisible(paths[0]); } updatePresentation(); } | select |
23,452 | void (@NotNull ValuesSelectionListener listener) { // TODO: dispose? mySelectionDispatcher.addListener(listener); } | addSelectionListener |
23,453 | boolean () { return !isSelectionEmpty() || !myHighlighted.isEmpty(); } | highlightedExists |
23,454 | int () { return myItemsCount; } | getItemsCount |
23,455 | void (@NotNull PaintingListener listener) { myPaintingDispatcher.addListener(listener); } | addPaintingListener |
23,456 | void (Graphics g) { super.paintComponent(g); myPaintingDispatcher.getMulticaster().componentPainted(); } | paintComponent |
23,457 | void (TreePath @NotNull [] paths) { if (myIgnoreExternalSelectionEvents) { return; } myIgnoreInternalSelectionEvents = true; getSelectionModel().setSelectionPaths(paths); myIgnoreInternalSelectionEvents = false; } | select |
23,458 | void (List<TraceElement> selectedItems) { myIgnoreExternalSelectionEvents = true; mySelectionDispatcher.getMulticaster().selectionChanged(selectedItems); myIgnoreExternalSelectionEvents = false; } | fireSelectionChanged |
23,459 | void (@NotNull List<TraceElement> elements) { final int[] rows = elements.stream().map(myValue2Path::get).filter(Objects::nonNull).mapToInt(this::getRowForPath).sorted().toArray(); if (rows.length == 0) { return; } if (isShowing()) { final Rectangle bestVisibleArea = optimizeRowsCountInVisibleRect(rows); final Rectangle visibleRect = getVisibleRect(); final boolean notVisibleHighlightedRowExists = Arrays .stream(rows) .anyMatch(x -> !visibleRect.intersects(getRowBounds(x))); if (notVisibleHighlightedRowExists) { scrollRectToVisible(bestVisibleArea); } } else { // Use slow path if component hidden scrollPathToVisible(getPathForRow(rows[0])); } } | tryScrollTo |
23,460 | Rectangle (int @NotNull [] rows) { // a simple scan-line algorithm to find an optimal subset of visible rows (maximum) final Rectangle visibleRect = getVisibleRect(); final int height = visibleRect.height; class Result { private int top = 0; private int bot = 0; @Contract(pure = true) private int count() { return bot - top; } } int topIndex = 0; int bottomIndex = 1; Rectangle rowBounds = getRowBounds(rows[topIndex]); if (rowBounds == null) return visibleRect; int topY = rowBounds.y; final Result result = new Result(); while (bottomIndex < rows.length) { final int nextY = getRowBounds(rows[bottomIndex]).y; while (nextY - topY > height) { topIndex++; rowBounds = getRowBounds(rows[topIndex]); if (rowBounds == null) return visibleRect; topY = rowBounds.y; } if (bottomIndex - topIndex > result.count()) { result.top = topIndex; result.bot = bottomIndex; } bottomIndex++; } int y = getRowBounds(rows[result.top]).y; if (y > visibleRect.y) { final Rectangle botBounds = getRowBounds(rows[result.bot]); y = botBounds.y + botBounds.height - visibleRect.height; } return new Rectangle(visibleRect.x, y, visibleRect.width, height); } | optimizeRowsCountInVisibleRect |
23,461 | int () { return bot - top; } | count |
23,462 | void (@NotNull List<TraceElement> elements) { myHighlighted = elements.stream().map(myValue2Path::get).collect(Collectors.toSet()); } | highlightValues |
23,463 | void () { revalidate(); repaint(); } | updatePresentation |
23,464 | boolean (@NotNull TraceElement traceElement) { final TreePath path = myValue2Path.get(traceElement); return path != null && isPathHighlighted(path); } | isHighlighted |
23,465 | boolean (@NotNull TreePath path) { return myHighlighted.contains(path) || isPathSelected(path); } | isPathHighlighted |
23,466 | void (@NotNull XCompositeNode node) { final XValueChildrenList children = new XValueChildrenList(); for (final Value value : myValues) { final PrimitiveValueDescriptor valueDescriptor = new PrimitiveValueDescriptor(myProject, value); children.add(new InstanceJavaValue(valueDescriptor, myEvaluationContext, myNodeManager)); } node.addChildren(children, true); } | computeChildren |
23,467 | void (@NotNull XValueNode node, @NotNull XValuePlace place) { node.setPresentation(null, "", "", true); } | computePresentation |
23,468 | DebuggerTreeNodeImpl (final NodeDescriptor descriptor, EvaluationContext evaluationContext) { return new DebuggerTreeNodeImpl(null, descriptor); } | createNode |
23,469 | DebuggerTreeNodeImpl (MessageDescriptor descriptor) { return new DebuggerTreeNodeImpl(null, descriptor); } | createMessageNode |
23,470 | DebuggerTreeNodeImpl (String message) { return new DebuggerTreeNodeImpl(null, new MessageDescriptor(message)); } | createMessageNode |
23,471 | TreePath (@NotNull TreePath path) { TreePath current = path; while (current != null && !myPath2Value.containsKey(current)) { current = current.getParentPath(); } return current != null ? current : path; } | getTopPath |
23,472 | Object (@NotNull TraceElement element) { final Value value = element.getValue(); return value == null ? NULL_MARKER : value; } | extractKey |
23,473 | PsiElement (@NotNull PsiElement element) { PsiElement result = PsiTreeUtil.skipSiblingsForward(element, PsiWhiteSpace.class); if (result == null) { result = PsiTreeUtil.skipSiblingsBackward(element, PsiWhiteSpace.class); if (result == null) { result = element; } } return result; } | ignoreWhiteSpaces |
23,474 | boolean (@NotNull PsiMethodCallExpression expression) { return isIntermediateStreamCall(expression) || isProducerStreamCall(expression) || isTerminationStreamCall(expression); } | isStreamCall |
23,475 | boolean (@NotNull PsiMethodCallExpression expression) { final PsiMethod method = expression.resolveMethod(); return (method != null && method.hasModifierProperty(PsiModifier.STATIC)) || checkStreamCall(expression, false, true); } | isProducerStreamCall |
23,476 | boolean (@NotNull PsiMethodCallExpression expression) { return checkStreamCall(expression, true, true); } | isIntermediateStreamCall |
23,477 | boolean (@NotNull PsiMethodCallExpression expression) { return checkStreamCall(expression, true, false); } | isTerminationStreamCall |
23,478 | boolean (@NotNull PsiMethodCallExpression expression, boolean mustReceiverBeStream, boolean mustResultBeStream) { final PsiMethod method = expression.resolveMethod(); if (method != null && mustResultBeStream == isStreamType(expression.getType())) { final PsiElement methodClass = method.getParent(); if (methodClass instanceof PsiClass) { if (mustReceiverBeStream && method.hasModifier(JvmModifier.STATIC)) return false; return mustReceiverBeStream == isStreamType((PsiClass)methodClass); } } return false; } | checkStreamCall |
23,479 | boolean (@Nullable PsiType psiType) { return InheritanceUtil.isInheritor(psiType, CommonClassNames.JAVA_UTIL_STREAM_BASE_STREAM); } | isStreamType |
23,480 | boolean (@Nullable PsiClass psiClass) { return InheritanceUtil.isInheritor(psiClass, CommonClassNames.JAVA_UTIL_STREAM_BASE_STREAM); } | isStreamType |
23,481 | boolean (@NotNull PsiElement startElement) { PsiElement current = getLatestElementInCurrentScope(PsiUtil.ignoreWhiteSpaces(startElement)); MyStreamChainExistenceChecker existenceChecker = new MyStreamChainExistenceChecker(); while (current != null) { current.accept(existenceChecker); if (existenceChecker.found()) { return true; } current = toUpperLevel(current); } return false; } | isChainExists |
23,482 | List<StreamChain> (@NotNull PsiElement startElement) { final MyChainCollectorVisitor visitor = new MyChainCollectorVisitor(); PsiElement current = getLatestElementInCurrentScope(PsiUtil.ignoreWhiteSpaces(startElement)); while (current != null) { current.accept(visitor); current = toUpperLevel(current); } final List<List<PsiMethodCallExpression>> chains = visitor.getPsiChains(); return buildChains(chains, startElement); } | build |
23,483 | PsiElement (@NotNull PsiElement element) { element = element.getParent(); while (element != null && !(element instanceof PsiLambdaExpression) && !(element instanceof PsiAnonymousClass)) { element = element.getParent(); } return getLatestElementInCurrentScope(element); } | toUpperLevel |
23,484 | PsiElement (@Nullable PsiElement element) { PsiElement current = element; while (current != null) { final PsiElement parent = current.getParent(); if (parent instanceof PsiModifiableCodeBlock || parent instanceof PsiLambdaExpression || parent instanceof PsiStatement) { break; } current = parent; } return current; } | getLatestElementInCurrentScope |
23,485 | List<StreamChain> (@NotNull List<List<PsiMethodCallExpression>> chains, @NotNull PsiElement context) { return ContainerUtil.map(chains, x -> myChainTransformer.transform(x, context)); } | buildChains |
23,486 | void (@NotNull PsiMethodCallExpression expression) { if (myFound) return; super.visitMethodCallExpression(expression); if (!myFound && myDetector.isTerminationCall(expression)) { myFound = true; } } | visitMethodCallExpression |
23,487 | void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); if (!myPreviousCalls.containsKey(expression) && myDetector.isStreamCall(expression)) { updateCallTree(expression); } } | visitMethodCallExpression |
23,488 | void (@NotNull PsiMethodCallExpression expression) { if (myDetector.isTerminationCall(expression)) { myTerminationCalls.add(expression); } final PsiElement parent = expression.getParent(); if (!(parent instanceof PsiReferenceExpression)) return; final PsiElement parentCall = parent.getParent(); if (parentCall instanceof PsiMethodCallExpression parentCallExpression && myDetector.isStreamCall((PsiMethodCallExpression)parentCall)) { myPreviousCalls.put(parentCallExpression, expression); updateCallTree(parentCallExpression); } } | updateCallTree |
23,489 | void (@NotNull PsiCodeBlock block) { } | visitCodeBlock |
23,490 | void (@NotNull PsiLambdaExpression expression) { } | visitLambdaExpression |
23,491 | PsiElement (@NotNull XDebugSession session) { final XSourcePosition position = session.getCurrentPosition(); if (position == null) return null; int offset = position.getOffset(); final VirtualFile file = position.getFile(); if (file.isValid() && 0 <= offset && offset < file.getLength()) { return DebuggerUtilsEx.findElementAt(PsiManager.getInstance(session.getProject()).findFile(file), offset); } return null; } | getNearestElementToBreakpoint |
23,492 | StreamChain (@NotNull List<PsiMethodCallExpression> streamExpressions, @NotNull PsiElement context) { final PsiMethodCallExpression firstCall = streamExpressions.get(0); final PsiExpression qualifierExpression = firstCall.getMethodExpression().getQualifierExpression(); final PsiType qualifierType = qualifierExpression == null ? null : qualifierExpression.getType(); final GenericType typeAfterQualifier = qualifierType == null ? getGenericTypeOfThis(qualifierExpression) : JavaTypes.INSTANCE.fromStreamPsiType(qualifierType); final QualifierExpressionImpl qualifier = qualifierExpression == null ? new QualifierExpressionImpl("", TextRange.EMPTY_RANGE, typeAfterQualifier) : new QualifierExpressionImpl(qualifierExpression.getText(), qualifierExpression.getTextRange(), typeAfterQualifier); final List<IntermediateStreamCall> intermediateCalls = createIntermediateCalls(typeAfterQualifier, streamExpressions.subList(0, streamExpressions.size() - 1)); final GenericType typeBefore = intermediateCalls.isEmpty() ? qualifier.getTypeAfter() : intermediateCalls.get(intermediateCalls.size() - 1).getTypeAfter(); final TerminatorStreamCall terminationCall = createTerminationCall(typeBefore, streamExpressions.get(streamExpressions.size() - 1)); return new StreamChainImpl(qualifier, intermediateCalls, terminationCall, context); } | transform |
23,493 | GenericType (PsiExpression expression) { final PsiClass klass = ClassUtils.getContainingClass(expression); return klass == null ? JavaTypes.INSTANCE.getANY() : JavaTypes.INSTANCE.fromPsiClass(klass); } | getGenericTypeOfThis |
23,494 | List<IntermediateStreamCall> (@NotNull GenericType producerAfterType, @NotNull List<PsiMethodCallExpression> expressions) { final List<IntermediateStreamCall> result = new ArrayList<>(); GenericType typeBefore = producerAfterType; for (final PsiMethodCallExpression callExpression : expressions) { final String name = resolveMethodName(callExpression); final List<CallArgument> args = resolveArguments(callExpression); final GenericType type = resolveType(callExpression); result.add(new IntermediateStreamCallImpl(name, args, typeBefore, type, callExpression.getTextRange())); typeBefore = type; } return result; } | createIntermediateCalls |
23,495 | TerminatorStreamCall (@NotNull GenericType typeBefore, @NotNull PsiMethodCallExpression expression) { final String name = resolveMethodName(expression); final List<CallArgument> args = resolveArguments(expression); final GenericType resultType = resolveTerminationCallType(expression); return new TerminatorStreamCallImpl(name, args, typeBefore, resultType, expression.getTextRange()); } | createTerminationCall |
23,496 | List<CallArgument> (@NotNull PsiMethodCallExpression methodCall) { final PsiExpressionList list = methodCall.getArgumentList(); return StreamEx.of(list.getExpressions()) .zipWith(StreamEx.of(list.getExpressionTypes()), (expression, type) -> new CallArgumentImpl(GenericsUtil.getVariableTypeByExpressionType(type).getCanonicalText(), expression.getText())) .collect(Collectors.toList()); } | resolveArguments |
23,497 | String (@NotNull PsiMethodCallExpression methodCall) { final String name = methodCall.getMethodExpression().getReferenceName(); Objects.requireNonNull(name, "Method reference must be not null" + methodCall.getText()); return name; } | resolveMethodName |
23,498 | PsiType (@NotNull PsiMethodCallExpression expression) { final PsiType returnType = expression.getType(); Objects.requireNonNull(returnType, "Method return type must be not null" + expression.getText()); return returnType; } | extractType |
23,499 | GenericType (@NotNull PsiMethodCallExpression call) { return JavaTypes.INSTANCE.fromStreamPsiType(extractType(call)); } | resolveType |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.