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)val...
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 = createControll...
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 f...
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(...
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 JB...
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 = ((Ja...
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 < el...
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(), b...
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 Rectangl...
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 -...
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...
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 inst...
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()) { ret...
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<Lis...
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 instanceo...
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.findEle...
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 ...
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 = re...
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 TerminatorStreamCallImp...
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).getCano...
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