file_path
stringlengths 57
191
| method_name
stringlengths 2
80
| method_block
stringlengths 8
32.6k
| method_name_pointers
sequencelengths 2
2
| method_signature
stringlengths 7
4.42k
| length
int64 8
32.6k
| __index_level_0__
int64 0
516k
|
---|---|---|---|---|---|---|
../intellij-community/platform/util/ui/src/com/intellij/util/ui/UIUtil.java | haveCommonOwner | public static boolean haveCommonOwner(Component c1, Component c2) {
if (c1 == null || c2 == null) return false;
Window c1Ancestor = findWindowAncestor(c1);
Window c2Ancestor = findWindowAncestor(c2);
Set<Window> ownerSet = new HashSet<>();
Window owner = c1Ancestor;
while (owner != null && !(owner instanceof JDialog || owner instanceof JFrame)) {
ownerSet.add(owner);
owner = owner.getOwner();
}
owner = c2Ancestor;
while (owner != null && !(owner instanceof JDialog || owner instanceof JFrame)) {
if (ownerSet.contains(owner)) return true;
owner = owner.getOwner();
}
return false;
} | [
22,
37
] | public static boolean haveCommonOwner(Component c1, Component c2) | 662 | 228,302 |
../intellij-community/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateInnerClassFromUsageFix.java | doInvoke | private void doInvoke(final PsiClass aClass, final String superClassName) throws IncorrectOperationException {
PsiJavaCodeReferenceElement ref;
if (!aClass.isPhysical()) {
ref = PsiTreeUtil.findSameElementInCopy(getRefElement(), aClass.getContainingFile());
} else {
ref = getRefElement();
}
assert ref != null;
String refName = ref.getReferenceName();
LOG.assertTrue(refName != null);
PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(aClass.getProject());
PsiClass created = myKind.create(elementFactory, refName);
final PsiModifierList modifierList = created.getModifierList();
LOG.assertTrue(modifierList != null);
if (aClass.isInterface() || PsiUtil.isLocalOrAnonymousClass(aClass)) {
modifierList.setModifierProperty(PsiModifier.PACKAGE_LOCAL, true);
} else {
modifierList.setModifierProperty(PsiModifier.PRIVATE, true);
}
if (CommonJavaRefactoringUtil.isInStaticContext(ref, aClass) && !aClass.isInterface()) {
modifierList.setModifierProperty(PsiModifier.STATIC, true);
}
if (superClassName != null) {
CreateFromUsageUtils.setupSuperClassReference(created, superClassName);
}
CreateFromUsageBaseFix.setupGenericParameters(created, ref);
if (!aClass.isPhysical()) {
PsiClass add = (PsiClass)aClass.add(created);
PsiDeconstructionPattern pattern = getDeconstructionPattern(ref);
if (pattern != null) {
setupRecordFromDeconstructionPattern(add, pattern, getText());
}
}
else {
if (!FileModificationService.getInstance().preparePsiElementForWrite(aClass)) return;
WriteCommandAction.runWriteCommandAction(aClass.getProject(), getText(), null,
() -> {
PsiClass add = (PsiClass)aClass.add(created);
ref.bindToElement(add);
PsiDeconstructionPattern pattern = getDeconstructionPattern(ref);
if (pattern != null) {
setupRecordFromDeconstructionPattern(add, pattern, getText());
}
},
aClass.getContainingFile());
}
} | [
13,
21
] | private void doInvoke(final PsiClass aClass, final String superClassName) | 2,443 | 377,149 |
../intellij-community/plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/jql/psi/JqlSortKey.java | getFieldName | @NotNull
String getFieldName(); | [
18,
30
] | @NotNull
String getFieldName() | 33 | 38,961 |
../intellij-community/platform/platform-impl/src/com/intellij/ide/ui/search/PluginSearchableOptionContributor.java | processOptions | @Override
public void processOptions(@NotNull SearchableOptionProcessor processor) {
PluginManager.getVisiblePlugins(false).forEach(descriptor -> {
String pluginName = descriptor.getName();
addPluginOptions(processor, pluginName, pluginName);
String description = descriptor.getDescription();
if (description != null) {
addPluginOptions(processor, description, pluginName);
}
});
} | [
24,
38
] | @Override
public void processOptions(@NotNull SearchableOptionProcessor processor) | 432 | 306,299 |
../intellij-community/plugins/ui-designer/src/com/intellij/ide/palette/impl/PaletteComponentList.java | mouseMoved | @Override
public void mouseMoved(MouseEvent e) {
setHoverIndex(locationToIndex(e.getPoint()));
} | [
28,
38
] | @Override
public void mouseMoved(MouseEvent e) | 116 | 174,551 |
../intellij-community/plugins/maven/src/main/java/org/jetbrains/idea/maven/buildtool/MavenImportEventProcessor.java | coloredTextAvailable | @Override
public void coloredTextAvailable(@NotNull String text, @NotNull Key outputType) {
myInstantReader.append(text);
} | [
24,
44
] | @Override
public void coloredTextAvailable(@NotNull String text, @NotNull Key outputType) | 131 | 58,421 |
../intellij-community/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/ExceptionBreakpoint.java | isNotifyUncaught | private boolean isNotifyUncaught() {
return getProperties().NOTIFY_UNCAUGHT;
} | [
16,
32
] | private boolean isNotifyUncaught() | 84 | 385,366 |
../intellij-community/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java | doRefresh | private void doRefresh() {
List<WCInfo> infoList = getVcs().getWcInfosWithErrors();
boolean hasErrors = !getVcs().getSvnFileUrlMapping().getErrorRoots().isEmpty();
List<WorkingCopyFormat> supportedFormats = getSupportedFormats();
getApplication().invokeLater(() -> setWorkingCopies(infoList, hasErrors, supportedFormats), ModalityState.nonModal());
} | [
13,
22
] | private void doRefresh() | 369 | 154,258 |
../intellij-community/platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/WelcomeScreenActionsUtil.java | createCustomComponent | @Override
public @NotNull JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
String text = presentation.getText();
if (StringUtil.isEmpty(text)) {
Utils.reportEmptyTextMenuItem(getDelegate(), place);
}
LargeIconWithTextPanel panel = new LargeIconWithTextPanel();
panel.myIconButton.addActionListener(l -> performAnActionForComponent(
getDelegate(), panel.myIconButton));
return panel;
} | [
41,
62
] | @Override
public @NotNull JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) | 489 | 322,912 |
../intellij-community/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/ParameterListElement.java | deleteChildInternal | @Override
public void deleteChildInternal(@NotNull ASTNode child) {
final TreeElement oldLastNodeInsideParens = getLastNodeInsideParens();
final TreeElement oldFirstNodeInsideParens = getFirstNodeInsideParens();
if (PARAMETER_SET.contains(child.getElementType())) {
JavaSourceUtil.deleteSeparatingComma(this, child);
ensureParenthesisAroundParameterList();
}
super.deleteChildInternal(child);
// We may want to fix trailing white space processing here - there is a following possible case:
// *) this parameter list is like (arg1, <white-space-containing-line-breaks>, arg2);
// *) 'arg2' is to be removed;
// We don't want to keep trailing white space then
TreeElement newLastNodeInsideParens = getLastNodeInsideParens();
if (newLastNodeInsideParens != null && oldLastNodeInsideParens != null && newLastNodeInsideParens.getElementType() == WHITE_SPACE) {
if (oldLastNodeInsideParens.getElementType() != WHITE_SPACE) {
deleteChildInternal(newLastNodeInsideParens);
}
else {
replaceChild(newLastNodeInsideParens, (ASTNode)oldLastNodeInsideParens.clone());
}
}
final TreeElement newFirstNodeInsideParens = getFirstNodeInsideParens();
if (newFirstNodeInsideParens != null && newFirstNodeInsideParens.getElementType() == WHITE_SPACE) {
if (oldFirstNodeInsideParens == null || oldFirstNodeInsideParens.getElementType() != WHITE_SPACE) {
deleteChildInternal(newFirstNodeInsideParens);
}
else {
replaceChild(newFirstNodeInsideParens, (ASTNode)oldFirstNodeInsideParens.clone());
}
}
} | [
24,
43
] | @Override
public void deleteChildInternal(@NotNull ASTNode child) | 1,642 | 496,466 |
../intellij-community/plugins/ui-designer/src/com/intellij/uiDesigner/actions/DeleteAction.java | update | @Override
public void update(final @NotNull AnActionEvent e) {
final Presentation presentation = e.getPresentation();
CaptionSelection selection = e.getData(CaptionSelection.DATA_KEY);
if(selection == null || selection.getContainer() == null){
presentation.setVisible(false);
return;
}
presentation.setVisible(true);
if (selection.getSelection().length > 1) {
presentation.setText(!selection.isRow()
? UIDesignerBundle.message("action.delete.columns")
: UIDesignerBundle.message("action.delete.rows"));
}
else {
presentation.setText(!selection.isRow()
? UIDesignerBundle.message("action.delete.column")
: UIDesignerBundle.message("action.delete.row"));
}
int minCellCount = selection.getContainer().getGridLayoutManager().getMinCellCount();
if (selection.getContainer().getGridCellCount(selection.isRow()) - selection.getSelection().length < minCellCount) {
presentation.setEnabled(false);
}
else if (selection.getFocusedIndex() < 0) {
presentation.setEnabled(false);
}
else {
presentation.setEnabled(true);
}
} | [
24,
30
] | @Override
public void update(final @NotNull AnActionEvent e) | 1,230 | 176,528 |
../intellij-community/platform/webSymbols/gen/com/intellij/webSymbols/customElements/json/FunctionDeclaration.java | setAdditionalProperty | @JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
} | [
31,
52
] | @JsonAnySetter
public void setAdditionalProperty(String name, Object value) | 139 | 331,734 |
../intellij-community/java/java-psi-api/src/com/intellij/psi/PsiClass.java | getSupers | PsiClass @NotNull [] getSupers(); | [
21,
30
] | PsiClass @NotNull [] getSupers() | 33 | 487,728 |
../intellij-community/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/SearchEverywhereManagerImpl.java | toggleEverywhereFilter | @Override
public void toggleEverywhereFilter() {
checkIsShown();
mySearchEverywhereUI.toggleEverywhereFilter();
} | [
24,
46
] | @Override
public void toggleEverywhereFilter() | 125 | 194,581 |
../intellij-community/plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/StatEdge.java | mask | int mask(); | [
4,
8
] | int mask() | 11 | 32,469 |
../intellij-community/java/java-impl-refactorings/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java | visitMethod | @Override
public void visitMethod(@NotNull PsiMethod method) {
if (methods.contains(method)) return;
super.visitMethod(method);
} | [
28,
39
] | @Override
public void visitMethod(@NotNull PsiMethod method) | 157 | 484,255 |
../intellij-community/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertiesListImpl.java | getDocCommentText | @Override
public @NotNull String getDocCommentText() {
final Property firstProp = PsiTreeUtil.getChildOfType(this, Property.class);
// If there are no properties in the property file,
// then the whole content of the file is considered to be a doc comment
if (firstProp == null) return getText();
final PsiElement upperEdge = PropertyImpl.getEdgeOfProperty(firstProp);
final List<PsiElement> comments = PsiTreeUtil.getChildrenOfTypeAsList(this, PsiElement.class);
return comments.stream()
.takeWhile(Predicate.not(upperEdge::equals))
.map(PsiElement::getText)
.collect(Collectors.joining());
} | [
35,
52
] | @Override
public @NotNull String getDocCommentText() | 647 | 147,466 |
../intellij-community/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/utils/EquivalenceChecker.java | closableBlockExpressionsAreEquivalent | private static boolean closableBlockExpressionsAreEquivalent(GrClosableBlock closableBlock1,
GrClosableBlock closableBlock2) {
return ArrayUtil.areEqual(closableBlock1.getStatements(), closableBlock2.getStatements(), (s1, s2) -> statementsAreEquivalent(s1, s2)) &&
ArrayUtil.areEqual(closableBlock1.getParameters(), closableBlock2.getParameters(), (p1, p2) -> parametersAreEquivalent(p1, p2));
} | [
23,
60
] | private static boolean closableBlockExpressionsAreEquivalent(GrClosableBlock closableBlock1,
GrClosableBlock closableBlock2) | 475 | 162,715 |
../intellij-community/platform/util/src/com/intellij/execution/process/UnixProcessManager.java | sendSignalToProcessTree | public static boolean sendSignalToProcessTree(@NotNull Process process, int signal) {
try {
return sendSignalToProcessTree(getProcessId(process), signal);
}
catch (Exception e) {
LOG.warn("Error killing the process", e);
return false;
}
} | [
22,
45
] | public static boolean sendSignalToProcessTree(@NotNull Process process, int signal) | 274 | 241,650 |
../intellij-community/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java | findLogProviders | public static @NotNull Map<VirtualFile, VcsLogProvider> findLogProviders(@NotNull Collection<VcsRoot> roots, @NotNull Project project) {
if (roots.isEmpty()) return Collections.emptyMap();
Map<VirtualFile, VcsLogProvider> logProviders = new HashMap<>();
List<VcsLogProvider> allLogProviders = VcsLogProvider.LOG_PROVIDER_EP.getExtensionList(project);
for (VcsRoot root : roots) {
AbstractVcs vcs = root.getVcs();
VirtualFile path = root.getPath();
if (vcs == null) {
LOG.debug("Skipping invalid VCS root: " + root);
continue;
}
for (VcsLogProvider provider : allLogProviders) {
if (provider.getSupportedVcs().equals(vcs.getKeyInstanceMethod())) {
logProviders.put(path, provider);
break;
}
}
}
return logProviders;
} | [
56,
72
] | public static @NotNull Map<VirtualFile, VcsLogProvider> findLogProviders(@NotNull Collection<VcsRoot> roots, @NotNull Project project) | 832 | 278,240 |
../intellij-community/platform/platform-impl/src/com/intellij/ide/actions/PreviousOccurenceAction.java | go | @Override
protected OccurenceNavigator.OccurenceInfo go(OccurenceNavigator navigator) {
return navigator.goPreviousOccurence();
} | [
55,
57
] | @Override
protected OccurenceNavigator.OccurenceInfo go(OccurenceNavigator navigator) | 137 | 309,917 |
../intellij-community/platform/analysis-api/src/com/intellij/lang/annotation/Annotation.java | setFileLevelAnnotation | @Deprecated
public void setFileLevelAnnotation(final boolean isFileLevelAnnotation) {
myIsFileLevelAnnotation = isFileLevelAnnotation;
} | [
26,
48
] | @Deprecated
public void setFileLevelAnnotation(final boolean isFileLevelAnnotation) | 144 | 303,804 |
../intellij-community/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/CaptureTraverser.java | direct | @NotNull
public static CaptureTraverser direct() {
return DIRECT;
} | [
42,
48
] | @NotNull
public static CaptureTraverser direct() | 75 | 388,008 |
../intellij-community/java/idea-ui/src/com/intellij/util/descriptors/impl/ConfigFileImpl.java | getVirtualFile | @Override
@Nullable
public VirtualFile getVirtualFile() {
return myFilePointer.isValid() ? myFilePointer.getFile() : null;
} | [
43,
57
] | @Override
@Nullable
public VirtualFile getVirtualFile() | 134 | 361,956 |
../intellij-community/platform/util/src/com/intellij/util/io/zip/JBZipEntry.java | getInternalAttributes | public int getInternalAttributes() {
return internalAttributes;
} | [
11,
32
] | public int getInternalAttributes() | 71 | 236,918 |
../intellij-community/platform/analysis-api/src/com/intellij/codeInsight/lookup/AutoCompletionPolicy.java | getAutoCompletionPolicy | @Override
public AutoCompletionPolicy getAutoCompletionPolicy() {
return myPolicy;
} | [
42,
65
] | @Override
public AutoCompletionPolicy getAutoCompletionPolicy() | 98 | 304,572 |
../intellij-community/platform/lang-impl/src/com/intellij/refactoring/changeSignature/CallerChooserBase.java | getCallerNode | protected MemberNodeBase<M> getCallerNode(MemberNodeBase<M> node) {
return node;
} | [
28,
41
] | protected MemberNodeBase<M> getCallerNode(MemberNodeBase<M> node) | 88 | 208,164 |
../intellij-community/platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java | getDefaultExtension | @Override
public @NlsSafe @NotNull String getDefaultExtension() {
return "";
} | [
46,
65
] | @Override
public @NlsSafe @NotNull String getDefaultExtension() | 92 | 191,049 |
../intellij-community/platform/platform-impl/src/com/intellij/openapi/application/OldDirectoryCleaner.java | getColumnCount | @Override
public int getColumnCount() {
return 4;
} | [
27,
41
] | @Override
public int getColumnCount() | 71 | 324,513 |
../intellij-community/java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/OptionalConversionRule.java | wrap | private static @NotNull TypeConversionDescriptor wrap(PsiExpression context, String qualifiedName) {
if (ExpressionUtils.isNullLiteral(context)) {
return new TypeConversionDescriptor("$val$", qualifiedName + ".empty()", context);
}
if (NullabilityUtil.getExpressionNullability(context, true) == Nullability.NOT_NULL) {
return new TypeConversionDescriptor("$val$", qualifiedName + ".of($val$)", context);
}
return new TypeConversionDescriptor("$val$", qualifiedName + ".ofNullable($val$)", context);
} | [
49,
53
] | private static @NotNull TypeConversionDescriptor wrap(PsiExpression context, String qualifiedName) | 534 | 359,067 |
../intellij-community/platform/lang-impl/src/com/intellij/ide/todo/TodoTreeStructure.java | isPackagesShown | public final boolean isPackagesShown() {
return myArePackagesShown;
} | [
21,
36
] | public final boolean isPackagesShown() | 75 | 193,106 |
../intellij-community/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/MixedResultsSearcher.java | setContributorHasMore | public void setContributorHasMore(SearchEverywhereContributor<?> contributor, boolean hasMore) {
hasMoreMap.put(contributor, hasMore);
} | [
12,
33
] | public void setContributorHasMore(SearchEverywhereContributor<?> contributor, boolean hasMore) | 146 | 194,749 |
../intellij-community/plugins/devkit/devkit-core/src/dom/IdeaVersion.java | getMin | @NotNull
@Deprecated
GenericAttributeValue<String> getMin(); | [
55,
61
] | @NotNull
@Deprecated
GenericAttributeValue<String> getMin() | 64 | 157,707 |
../intellij-community/java/java-analysis-impl/src/com/siyeh/ig/bugs/ThisPassedAsArgumentVisitor.java | isPassed | public boolean isPassed() {
return passed;
} | [
15,
23
] | public boolean isPassed() | 50 | 346,703 |
../intellij-community/platform/platform-impl/src/com/intellij/ui/FilteringSpeedSearch.java | updateSelection | public void updateSelection() {
T selection = getSelection();
FilteringTree.Matching currentMatching = selection != null ? checkMatching(selection) : FilteringTree.Matching.NONE;
if (currentMatching == FilteringTree.Matching.FULL) {
return;
}
T fullMatch = findNextMatchingNode(selection, true);
if (fullMatch != null) {
select(fullMatch);
}
else if (currentMatching == FilteringTree.Matching.NONE) {
T partialMatch = findNextMatchingNode(selection, false);
if (partialMatch != null) {
select(partialMatch);
}
}
} | [
12,
27
] | public void updateSelection() | 591 | 311,511 |
../intellij-community/platform/vcs-impl/src/com/intellij/unscramble/AnnotateStackTraceAction.java | getStyle | @Override
public EditorFontType getStyle(int line, Editor editor) {
LastRevision revision = myRevisions.get(line);
return revision != null && revision.getDate().equals(myNewestDate) ? EditorFontType.BOLD : EditorFontType.PLAIN;
} | [
36,
44
] | @Override
public EditorFontType getStyle(int line, Editor editor) | 249 | 218,543 |
../intellij-community/xml/dom-openapi/src/com/intellij/util/xml/ui/DomUINavigationProvider.java | canNavigate | @Override
public boolean canNavigate(DomElement domElement) {
return findDomControl(myComponent, domElement) != null;
} | [
27,
38
] | @Override
public boolean canNavigate(DomElement domElement) | 127 | 504,977 |
../intellij-community/platform/util/concurrency/src/com/intellij/util/containers/ConcurrentBitSetImpl.java | changeWord | int changeWord(int bitIndex, @NotNull IntUnaryOperator changeWord) {
assertNonNegative(bitIndex);
int i = wordIndex(bitIndex);
synchronized (this) {
int[] newArray;
int[] oldArray = array;
int oldWord;
boolean canReuseArray = i < oldArray.length;
if (canReuseArray) {
newArray = oldArray;
oldWord = arrayRead(oldArray, i);
}
else {
newArray = ArrayUtil.realloc(oldArray, Math.max(oldArray.length * 2, i + 1));
oldWord = 0;
}
int newWord = changeWord.applyAsInt(oldWord);
ARRAY_ELEMENT.setVolatile(newArray, i, newWord);
if (!canReuseArray) {
// reassign this.array only after newArray modification to avoid leaking empty newArray
array = newArray;
}
return oldWord;
}
} | [
4,
14
] | int changeWord(int bitIndex, @NotNull IntUnaryOperator changeWord) | 813 | 230,248 |
../intellij-community/java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java | getParentMethod | private static PsiElement getParentMethod(@NotNull PsiElement element) {
final PsiElement parent = element.getParent();
final PsiMethod interfaceMethod = LambdaUtil.getFunctionalInterfaceMethod(parent);
return interfaceMethod != null ? interfaceMethod : parent;
} | [
26,
41
] | private static PsiElement getParentMethod(@NotNull PsiElement element) | 277 | 376,063 |
../intellij-community/platform/dvcs-impl/src/com/intellij/dvcs/push/PushController.java | setTarget | public void setTarget(@Nullable T target) {
myTarget = target;
} | [
12,
21
] | public void setTarget(@Nullable T target) | 74 | 242,567 |
../intellij-community/jps/jps-builders/src/org/jetbrains/jps/builders/BuildRootIndex.java | getRootFilter | @NotNull
FileFilter getRootFilter(@NotNull BuildRootDescriptor descriptor); | [
22,
35
] | @NotNull
FileFilter getRootFilter(@NotNull BuildRootDescriptor descriptor) | 77 | 340,273 |
../intellij-community/plugins/sh/core/gen/com/intellij/sh/parser/ShParser.java | arithmetic_expansion_1 | private static boolean arithmetic_expansion_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "arithmetic_expansion_1")) return false;
expression(b, l + 1, -1);
return true;
} | [
23,
45
] | private static boolean arithmetic_expansion_1(PsiBuilder b, int l) | 192 | 143,985 |
../intellij-community/platform/lang-api/src/com/intellij/ide/projectView/ProjectViewNode.java | getSortOrder | public @NotNull NodeSortOrder getSortOrder(@NotNull NodeSortSettings settings) {
return settings.isManualOrder() ? NodeSortOrder.MANUAL : NodeSortOrder.UNSPECIFIED;
} | [
30,
42
] | public @NotNull NodeSortOrder getSortOrder(@NotNull NodeSortSettings settings) | 172 | 215,380 |
../intellij-community/plugins/groovy/src/org/jetbrains/plugins/groovy/codeStyle/GrReferenceAdjuster.java | shorteningIsMeaningfully | private static <Qualifier extends PsiElement> boolean shorteningIsMeaningfully(@NotNull GrQualifiedReference<Qualifier> ref,
boolean useFqInJavadoc, boolean useFqInCode) {
if (ref instanceof GrReferenceElementImpl && ((GrReferenceElementImpl<?>)ref).isFullyQualified()) {
final GrDocComment doc = PsiTreeUtil.getParentOfType(ref, GrDocComment.class);
if (doc != null) {
if (useFqInJavadoc) return false;
}
else {
if (useFqInCode) return false;
}
}
final Qualifier qualifier = ref.getQualifier();
if (qualifier instanceof GrCodeReferenceElement) {
return true;
}
if (qualifier instanceof GrExpression) {
if (qualifier instanceof GrReferenceExpression && PsiUtil.isThisReference(qualifier)) return true;
if (qualifier instanceof GrReferenceExpression &&
PsiImplUtil.seemsToBeQualifiedClassName((GrExpression)qualifier)) {
final PsiElement resolved = ((GrReferenceExpression)qualifier).resolve();
if (resolved instanceof PsiClass || resolved instanceof PsiPackage) return true;
}
}
return false;
} | [
54,
78
] | private static <Qualifier extends PsiElement> boolean shorteningIsMeaningfully(@NotNull GrQualifiedReference<Qualifier> ref,
boolean useFqInJavadoc, boolean useFqInCode) | 1,209 | 170,986 |
../intellij-community/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/OpenTaskDialog.java | updateFields | private void updateFields() {
myTaskStateCombo.setEnabled(myUpdateState.isSelected());
} | [
13,
25
] | private void updateFields() | 94 | 39,810 |
../intellij-community/platform/lang-impl/src/com/intellij/psi/search/MappedFileTypeIndex.java | flush | @Override
public void flush() throws StorageException {
myDataController.flush();
} | [
24,
29
] | @Override
public void flush() | 91 | 204,364 |
../intellij-community/platform/code-style-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java | setFormatterOnPattern | public void setFormatterOnPattern(@Nullable Pattern formatterOnPattern) {
myFormatterOnPattern = formatterOnPattern;
} | [
12,
33
] | public void setFormatterOnPattern(@Nullable Pattern formatterOnPattern) | 124 | 277,560 |
../intellij-community/platform/ide-core/src/com/intellij/openapi/options/SearchableConfigurable.java | disposeUIResources | @Override
public void disposeUIResources() {
myConfigurable.disposeUIResources();
} | [
26,
44
] | @Override
public void disposeUIResources() | 97 | 248,443 |
../intellij-community/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyUnionType.java | getMembers | @NotNull
public Collection<PyType> getMembers() {
return Collections.unmodifiableCollection(myMembers);
} | [
37,
47
] | @NotNull
public Collection<PyType> getMembers() | 113 | 11,363 |
../intellij-community/platform/core-impl/src/com/intellij/psi/impl/source/tree/CompositePsiElement.java | acceptChildren | @Override
public void acceptChildren(@NotNull PsiElementVisitor visitor) {
PsiElement child = getFirstChild();
while (child != null) {
child.accept(visitor);
child = child.getNextSibling();
}
} | [
24,
38
] | @Override
public void acceptChildren(@NotNull PsiElementVisitor visitor) | 221 | 185,640 |
../intellij-community/platform/execution/src/com/intellij/diagnostic/logging/LogConsolePreferences.java | removeFilterListener | public void removeFilterListener(LogFilterListener l) {
myListeners.remove(l);
} | [
12,
32
] | public void removeFilterListener(LogFilterListener l) | 86 | 275,667 |
../intellij-community/python/python-psi-api/src/com/jetbrains/python/psi/impl/StubAwareComputation.java | overAstStubLike | @NotNull
public <Result> StubAwareComputation<Psi, CustomStub, Result> overAstStubLike(@NotNull Function<Psi, Result> astStubLikeComputation) {
return new StubAwareComputation<>(this, null, null, astStubLikeComputation, null);
} | [
75,
90
] | @NotNull
public <Result> StubAwareComputation<Psi, CustomStub, Result> overAstStubLike(@NotNull Function<Psi, Result> astStubLikeComputation) | 242 | 2,687 |
../intellij-community/plugins/kotlin/native/gen/org/jetbrains/kotlin/ide/konan/NativeDefinitionsParser.java | parseLight | public void parseLight(IElementType t, PsiBuilder b) {
boolean r;
b = adapt_builder_(t, b, this, null);
Marker m = enter_section_(b, 0, _COLLAPSE_, null);
r = parse_root_(t, b);
exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);
} | [
12,
22
] | public void parseLight(IElementType t, PsiBuilder b) | 253 | 82,339 |
../intellij-community/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsTypeElementImpl.java | getCanonicalText | public String getCanonicalText() {
return decorateTypeText(myTypeText);
} | [
14,
30
] | public String getCanonicalText() | 79 | 497,648 |
../intellij-community/platform/platform-api/src/com/intellij/openapi/editor/EditorModificationUtil.java | typeInStringAtCaretHonorMultipleCarets | public static void typeInStringAtCaretHonorMultipleCarets(@NotNull Editor editor, @NotNull String str, int caretShift) {
typeInStringAtCaretHonorMultipleCarets(editor, str, true, caretShift);
} | [
19,
57
] | public static void typeInStringAtCaretHonorMultipleCarets(@NotNull Editor editor, @NotNull String str, int caretShift) | 199 | 257,546 |
../intellij-community/platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/RemoteDebugConfiguration.java | getHost | @Nullable
@Attribute
public String getHost() {
return host;
} | [
39,
46
] | @Nullable
@Attribute
public String getHost() | 71 | 290,493 |
../intellij-community/platform/platform-impl/src/com/intellij/application/options/schemes/AbstractSchemeActions.java | getActionUpdateThread | @Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
} | [
49,
70
] | @Override
public @NotNull ActionUpdateThread getActionUpdateThread() | 117 | 329,449 |
../intellij-community/plugins/groovy/src/org/jetbrains/plugins/groovy/editor/GroovyReferenceCopyPasteProcessor.java | restoreReferences | @Override
protected void restoreReferences(ReferenceData @NotNull [] referenceData,
GrReferenceElement @NotNull [] refs,
@NotNull Set<? super String> imported) {
for (int i = 0; i < refs.length; i++) {
GrReferenceElement reference = refs[i];
if (reference == null) continue;
try {
PsiManager manager = reference.getManager();
ReferenceData refData = referenceData[i];
PsiClass refClass = JavaPsiFacade.getInstance(manager.getProject()).findClass(refData.qClassName, reference.getResolveScope());
if (refClass != null) {
if (refData.staticMemberName == null) {
reference.bindToElement(refClass);
imported.add(refData.qClassName);
}
else {
LOG.assertTrue(reference instanceof GrReferenceExpression);
PsiMember member = findMember(refData, refClass);
if (member != null) {
((GrReferenceExpression)reference).bindToElementViaStaticImport(member);
imported.add(StringUtil.getQualifiedName(refData.qClassName, refData.staticMemberName));
}
}
}
}
catch (IncorrectOperationException e) {
LOG.error(e);
}
}
} | [
27,
44
] | @Override
protected void restoreReferences(ReferenceData @NotNull [] referenceData,
GrReferenceElement @NotNull [] refs,
@NotNull Set<? super String> imported) | 1,305 | 173,072 |
../intellij-community/plugins/gradle/java/src/config/GradleClassFinder.java | findClass | @Override
public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
PsiClass aClass = super.findClass(qualifiedName, scope);
if (aClass == null || scope instanceof ExternalModuleBuildGlobalSearchScope || scope instanceof EverythingGlobalScope) {
return aClass;
}
PsiFile containingFile = aClass.getContainingFile();
VirtualFile file = containingFile != null ? containingFile.getVirtualFile() : null;
return file != null &&
!ProjectFileIndex.getInstance(myProject).isInContent(file) &&
!ProjectFileIndex.getInstance(myProject).isInLibrary(file) ? aClass : null;
} | [
28,
37
] | @Override
public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) | 654 | 139,791 |
../intellij-community/platform/lang-impl/src/com/intellij/util/indexing/EntityIndexingServiceImpl.java | isFromWorkspaceOnly | @Override
public boolean isFromWorkspaceOnly(@NotNull List<? extends RootsChangeRescanningInfo> indexingInfos) {
if (indexingInfos.isEmpty()) return false;
for (RootsChangeRescanningInfo info : indexingInfos) {
if (!(info instanceof WorkspaceEventRescanningInfo)) {
return false;
}
}
return true;
} | [
27,
46
] | @Override
public boolean isFromWorkspaceOnly(@NotNull List<? extends RootsChangeRescanningInfo> indexingInfos) | 338 | 197,603 |
../intellij-community/platform/util/src/com/intellij/util/io/storage/lf/RefCountingRecordsTableLF.java | getZeros | @Override
protected byte[] getZeros() {
return ZEROES;
} | [
29,
37
] | @Override
protected byte[] getZeros() | 64 | 236,723 |
../intellij-community/jps/model-api/src/org/jetbrains/jps/model/java/JavaSourceRootProperties.java | isForGeneratedSources | public boolean isForGeneratedSources() {
return myForGeneratedSources;
} | [
15,
36
] | public boolean isForGeneratedSources() | 78 | 335,742 |
../intellij-community/plugins/devkit/intellij.devkit.themes/src/ThemeJsonSchemaProviderFactory.java | getProviders | @NotNull
@Override
public List<JsonSchemaFileProvider> getProviders(@NotNull Project project) {
return Collections.singletonList(new JsonSchemaFileProvider() {
@Override
public boolean isAvailable(@NotNull VirtualFile file) {
return ThemeJsonUtil.isThemeFilename(file.getName());
}
@NotNull
@Override
public String getName() {
return DevKitThemesBundle.message("theme.json.display.name");
}
@Nullable
@Override
public VirtualFile getSchemaFile() {
return JsonSchemaProviderFactory.getResourceFile(getClass(), THEME_SCHEMA);
}
@NotNull
@Override
public SchemaType getSchemaType() {
return SchemaType.embeddedSchema;
}
});
} | [
59,
71
] | @NotNull
@Override
public List<JsonSchemaFileProvider> getProviders(@NotNull Project project) | 761 | 158,515 |
../intellij-community/platform/platform-impl/src/com/intellij/openapi/editor/actions/ToggleUseSoftWrapsInPreviewAction.java | update | @Override
public void update(@NotNull AnActionEvent e) {
Editor editor = e.getData(CommonDataKeys.EDITOR);
if (editor == null || editor.getEditorKind() != EditorKind.PREVIEW) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
super.update(e);
} | [
24,
30
] | @Override
public void update(@NotNull AnActionEvent e) | 286 | 328,189 |
../intellij-community/platform/core-impl/src/com/intellij/pom/core/impl/PomModelImpl.java | sendAfterChildrenChangedEvent | private void sendAfterChildrenChangedEvent(@NotNull PsiFile scope, int oldLength) {
if (!shouldFirePhysicalPsiEvents(scope)) {
getPsiManager().afterChange(false);
return;
}
PsiTreeChangeEventImpl event = new PsiTreeChangeEventImpl(getPsiManager());
event.setParent(scope);
event.setFile(scope);
event.setOffset(0);
event.setOldLength(oldLength);
event.setGenericChange(true);
getPsiManager().childrenChanged(event);
} | [
13,
42
] | private void sendAfterChildrenChangedEvent(@NotNull PsiFile scope, int oldLength) | 467 | 181,605 |
../intellij-community/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectConfigurationProblems.java | clearProblems | public void clearProblems() {
removeErrors(myErrors.values());
myErrors.clear();
} | [
12,
25
] | public void clearProblems() | 92 | 364,076 |
../intellij-community/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSessionContainer.java | infer | static PsiSubstitutor infer(PsiTypeParameter @NotNull [] typeParameters,
PsiParameter @NotNull [] parameters,
PsiExpression @NotNull [] arguments,
@NotNull PsiSubstitutor partialSubstitutor,
@NotNull PsiElement parent,
@NotNull ParameterTypeInferencePolicy policy,
@Nullable MethodCandidateInfo currentMethod) {
final PsiExpressionList argumentList = InferenceSession.getArgumentList(parent);
class NoContainer {
PsiSubstitutor infer(boolean prohibitCaching) {
final InferenceSession inferenceSession = new InferenceSession(typeParameters, partialSubstitutor, parent.getManager(), parent, policy);
inferenceSession.initExpressionConstraints(parameters, arguments,
currentMethod != null ? currentMethod.getElement() : null,
currentMethod != null && currentMethod.isVarargs());
return inferenceSession.performGuardedInference(parameters, arguments, parent, currentMethod, PsiSubstitutor.EMPTY,
prohibitCaching);
}
}
if (parent instanceof PsiCall) {
//overload resolution can't depend on outer call => should not traverse to top
if (//in order to avoid caching of candidates' errors on parent (!) , so check for overload resolution is left here
//But overload resolution can depend on type of lambda parameter. As it can't depend on lambda body,
//traversing down would stop at lambda level and won't take into account overloaded method
!MethodCandidateInfo.isOverloadCheck(argumentList)) {
final PsiCall topLevelCall = PsiResolveHelper.ourGraphGuard.doPreventingRecursion(parent, false,
() -> {
if (parent instanceof PsiExpression && !PsiPolyExpressionUtil.isPolyExpression((PsiExpression)parent)) {
return null;
}
return LambdaUtil.treeWalkUp(parent);
});
if (topLevelCall != null) {
InferenceSession session;
if (MethodCandidateInfo.isOverloadCheck() || !PsiDiamondType.ourDiamondGuard.currentStack().isEmpty() ||
!policy.equals(DefaultParameterTypeInferencePolicy.INSTANCE)) {
session = startTopLevelInference(topLevelCall, policy, currentMethod);
}
else {
session = CachedValuesManager.getCachedValue(topLevelCall,
() -> new CachedValueProvider.Result<>(
startTopLevelInference(topLevelCall, DefaultParameterTypeInferencePolicy.INSTANCE, null),
PsiModificationTracker.MODIFICATION_COUNT));
if (session != null) {
//reject cached top level session if it was based on wrong candidate: check nested session if candidate (it's type parameters) are the same
//such situations are avoided when overload resolution is performed (MethodCandidateInfo.isOverloadCheck above)
//but situations when client code iterates through PsiResolveHelper.getReferencedMethodCandidates or similar are impossible to guess
final Map<PsiElement, InferenceSession> sessions = session.getInferenceSessionContainer().myNestedSessions;
final InferenceSession childSession = sessions.get(parent);
if (childSession != null) {
for (PsiTypeParameter parameter : typeParameters) {
if (!childSession.getInferenceSubstitution().getSubstitutionMap().containsKey(parameter)) {
session = startTopLevelInference(topLevelCall, policy, currentMethod);
break;
}
}
}
}
}
if (session != null) {
final PsiSubstitutor childSubstitutor = inferNested(parameters, arguments, (PsiCall)parent, currentMethod, session);
if (childSubstitutor != null) return childSubstitutor;
return new NoContainer().infer(true);
}
else if (topLevelCall instanceof PsiMethodCallExpression) {
return new InferenceSession(typeParameters, partialSubstitutor, parent.getManager(), parent, policy).prepareSubstitution();
}
}
}
}
return new NoContainer().infer(false);
} | [
22,
27
] | static PsiSubstitutor infer(PsiTypeParameter @NotNull [] typeParameters,
PsiParameter @NotNull [] parameters,
PsiExpression @NotNull [] arguments,
@NotNull PsiSubstitutor partialSubstitutor,
@NotNull PsiElement parent,
@NotNull ParameterTypeInferencePolicy policy,
@Nullable MethodCandidateInfo currentMethod) | 5,103 | 496,585 |
../intellij-community/platform/platform-impl/src/com/intellij/openapi/editor/impl/ImmediatePainter.java | canRender | private static boolean canRender(final TextAttributes attributes) {
return attributes.getEffectType() != EffectType.BOXED || attributes.getEffectColor() == null;
} | [
23,
32
] | private static boolean canRender(final TextAttributes attributes) | 169 | 326,726 |
../intellij-community/platform/platform-impl/src/com/intellij/ide/browsers/WebBrowserManager.java | checkNameAndPath | static boolean checkNameAndPath(@NotNull String what, @NotNull WebBrowser browser) {
if (StringUtil.containsIgnoreCase(browser.getName(), what)) {
return true;
}
String path = browser.getPath();
if (path != null) {
String fileName = PathUtil.getFileName(path);
if (StringUtil.containsIgnoreCase(fileName, what)) return true;
String parentPath = PathUtil.getParentPath(path);
String parentPathName = PathUtil.getFileName(parentPath);
if ("bin".equals(parentPathName)) {
parentPath = PathUtil.getParentPath(parentPath);
parentPathName = PathUtil.getFileName(parentPath);
}
return StringUtil.containsIgnoreCase(parentPathName, what);
}
return false;
} | [
15,
31
] | static boolean checkNameAndPath(@NotNull String what, @NotNull WebBrowser browser) | 738 | 309,382 |
../intellij-community/platform/core-api/src/com/intellij/openapi/editor/event/BulkAwareDocumentListener.java | documentChangedNonBulk | default void documentChangedNonBulk(@NotNull DocumentEvent event) {} | [
13,
35
] | default void documentChangedNonBulk(@NotNull DocumentEvent event) | 68 | 293,057 |
../intellij-community/plugins/git4idea/src/git4idea/history/GitLogParser.java | clear | public void clear() {
myCurrentItem.setLength(0);
myResult = new ArrayList<>();
} | [
12,
17
] | public void clear() | 97 | 37,286 |
../intellij-community/plugins/ui-designer/src/com/intellij/uiDesigner/palette/Palette.java | createIntEnumProperty | private static IntroIntProperty createIntEnumProperty(
final String name,
final Method readMethod,
final Method writeMethod,
final IntEnumEditor.Pair[] pairs
) {
return new IntroIntProperty(
name,
readMethod,
writeMethod,
new IntEnumRenderer(pairs),
new IntEnumEditor(pairs), false);
} | [
32,
53
] | private static IntroIntProperty createIntEnumProperty(
final String name,
final Method readMethod,
final Method writeMethod,
final IntEnumEditor.Pair[] pairs
) | 339 | 177,409 |
../intellij-community/platform/lang-api/src/com/intellij/execution/actions/RunConfigurationProducer.java | onFirstRun | public void onFirstRun(@NotNull ConfigurationFromContext configuration, @NotNull ConfigurationContext context, @NotNull Runnable startRunnable) {
startRunnable.run();
} | [
12,
22
] | public void onFirstRun(@NotNull ConfigurationFromContext configuration, @NotNull ConfigurationContext context, @NotNull Runnable startRunnable) | 174 | 216,346 |
../intellij-community/jps/jps-builders/src/org/jetbrains/jps/javac/ExternalJavacManager.java | cleanSessions | private void cleanSessions(UUID processId) {
synchronized (mySessions) {
for (Iterator<Map.Entry<UUID, CompileSession>> it = mySessions.entrySet().iterator(); it.hasNext(); ) {
final CompileSession session = it.next().getValue();
if (processId.equals(session.getProcessId())) {
session.setDone();
it.remove();
}
}
}
} | [
13,
26
] | private void cleanSessions(UUID processId) | 383 | 342,293 |
../intellij-community/xml/impl/src/com/intellij/codeInsight/template/emmet/EmmetAbbreviationBalloon.java | textChanged | @Override
protected void textChanged(@NotNull DocumentEvent e) {
if (!isValid(customTemplateCallback)) {
balloon.hide();
return;
}
validateTemplateKey(field, balloon, field.getText(), customTemplateCallback);
} | [
31,
42
] | @Override
protected void textChanged(@NotNull DocumentEvent e) | 266 | 501,532 |
../intellij-community/platform/diff-impl/src/com/intellij/diff/impl/DiffRequestProcessor.java | getFilesToRefresh | @NotNull
@Override
public List<VirtualFile> getFilesToRefresh() {
DiffRequest request = getActiveRequest();
if (request != null) {
return request.getFilesToRefresh();
}
return Collections.emptyList();
} | [
48,
65
] | @NotNull
@Override
public List<VirtualFile> getFilesToRefresh() | 230 | 272,794 |
../intellij-community/plugins/kotlin/base/fe10/analysis/src/org/jetbrains/kotlin/idea/decompiler/navigation/MemberMatching.java | visitNullableType | @Override
public String visitNullableType(@NotNull KtNullableType nullableType, Void data) {
KtTypeElement innerType = nullableType.getInnerType();
assert innerType != null : "No inner type: " + nullableType;
return innerType.accept(this, null);
} | [
36,
53
] | @Override
public String visitNullableType(@NotNull KtNullableType nullableType, Void data) | 319 | 136,838 |
../intellij-community/java/java-analysis-impl/src/com/siyeh/ig/errorhandling/CheckedExceptionClassInspection.java | buildVisitor | @Override
public BaseInspectionVisitor buildVisitor() {
return new CheckedExceptionClassVisitor();
} | [
41,
53
] | @Override
public BaseInspectionVisitor buildVisitor() | 108 | 345,889 |
../intellij-community/platform/platform-api/src/com/intellij/ui/docking/DragSession.java | getResponse | @NotNull
DockContainer.ContentResponse getResponse(MouseEvent e); | [
41,
52
] | @NotNull
DockContainer.ContentResponse getResponse(MouseEvent e) | 67 | 253,627 |
../intellij-community/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugSession.java | removeSessionListener | void removeSessionListener(@NotNull XDebugSessionListener listener); | [
5,
26
] | void removeSessionListener(@NotNull XDebugSessionListener listener) | 68 | 259,040 |
../intellij-community/java/java-analysis-impl/src/com/siyeh/ig/psiutils/EquivalenceChecker.java | isPartialMatch | public boolean isPartialMatch() {
return myExactlyMatches == null;
} | [
15,
29
] | public boolean isPartialMatch() | 78 | 344,441 |
../intellij-community/platform/platform-api/src/com/intellij/openapi/ui/PanelWithActionsAndCloseButton.java | contentRemoved | @Override
public void contentRemoved(@NotNull ContentManagerEvent event) {
if (event.getContent().getComponent() == PanelWithActionsAndCloseButton.this) {
Disposer.dispose(PanelWithActionsAndCloseButton.this);
myContentManager.removeContentManagerListener(this);
}
} | [
30,
44
] | @Override
public void contentRemoved(@NotNull ContentManagerEvent event) | 326 | 256,373 |
../intellij-community/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesCache.java | refreshCacheAsync | private void refreshCacheAsync(final ChangesCacheFile cache, final boolean initIfEmpty,
final @Nullable RefreshResultConsumer consumer, final boolean asynch) {
try {
if (!initIfEmpty && cache.isEmpty()) {
return;
}
}
catch (IOException e) {
LOG.error(e);
return;
}
final Runnable task = () -> {
try {
final List<CommittedChangeList> list;
if (initIfEmpty && cache.isEmpty()) {
list = initCache(cache);
}
else {
list = refreshCache(cache);
}
if (consumer != null) {
consumer.receivedChanges(list);
}
}
catch(ProcessCanceledException ex) {
// ignore
}
catch (IOException e) {
LOG.error(e);
}
catch (VcsException e) {
if (consumer != null) {
consumer.receivedError(e);
}
}
};
if (asynch) {
myTaskQueue.run(task);
} else {
task.run();
}
} | [
13,
30
] | private void refreshCacheAsync(final ChangesCacheFile cache, final boolean initIfEmpty,
final @Nullable RefreshResultConsumer consumer, final boolean asynch) | 1,025 | 222,020 |
../intellij-community/java/java-impl/src/com/intellij/codeInspection/duplicateExpressions/DuplicateExpressionsInspection.java | visitExpression | @Override
public void visitExpression(@NotNull PsiExpression occurrence) {
super.visitExpression(occurrence);
if (occurrence != originalExpr &&
hashingStrategy.equals(occurrence, originalExpr) &&
canReplaceWith(occurrence, variable)) {
replaceableOccurrences.add(occurrence);
}
} | [
32,
47
] | @Override
public void visitExpression(@NotNull PsiExpression occurrence) | 382 | 369,156 |
../intellij-community/platform/core-impl/src/com/intellij/openapi/application/ex/ApplicationInfoEx.java | getDownloadUrl | @ApiStatus.ScheduledForRemoval
@Deprecated
public final @Nullable String getDownloadUrl() {
String productUrl = getProductUrl();
return productUrl != null ? productUrl + "download/" : null;
} | [
77,
91
] | @ApiStatus.ScheduledForRemoval
@Deprecated
public final @Nullable String getDownloadUrl() | 205 | 183,310 |
../intellij-community/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/ConfigurationManager.java | findConfiguration | ullable
private static Configuration findConfiguration(@NotNull Collection<? extends Configuration> configurations, Configuration configuration) {
return ContainerUtil.find(configurations, c -> {
if (configuration instanceof ReplaceConfiguration) {
return c instanceof ReplaceConfiguration &&
c.getMatchOptions().getSearchPattern().equals(configuration.getMatchOptions().getSearchPattern()) &&
c.getReplaceOptions().getReplacement().equals(configuration.getReplaceOptions().getReplacement());
}
else {
return c instanceof SearchConfiguration && c.getMatchOptions().getSearchPattern().equals(
configuration.getMatchOptions().getSearchPattern());
}
});
}
| [
41,
58
] | ullable
private static Configuration findConfiguration(@NotNull Collection<? extends Configuration> configurations, Configuration configuration) { | 746 | 270,583 |
../intellij-community/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java | isComposedTextShown | private boolean isComposedTextShown() {
return composedRangeMarker != null || inlayLeft != null || inlayRight != null;
} | [
16,
35
] | private boolean isComposedTextShown() | 130 | 325,811 |
../intellij-community/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonCodeAnalyzerImpl.java | isUpdateByTimerEnabled | synchronized boolean isUpdateByTimerEnabled() {
return myUpdateByTimerEnabled;
} | [
21,
43
] | synchronized boolean isUpdateByTimerEnabled() | 86 | 213,291 |
../intellij-community/platform/util/src/com/intellij/util/io/CompactDataInput.java | readFully | @Override
public void readFully(byte @NotNull [] b) throws IOException {
readFully(b, 0, b.length);
} | [
24,
33
] | @Override
public void readFully(byte @NotNull [] b) | 109 | 235,701 |
../intellij-community/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/jvm/transfer/TryCatchTrap.java | parameter | @Override
public @Nullable VariableDescriptor parameter() {
PsiParameter parameter = mySection.getParameter();
return parameter == null ? null : new PlainDescriptor(parameter);
} | [
50,
59
] | @Override
public @Nullable VariableDescriptor parameter() | 198 | 351,054 |
../intellij-community/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeBackgroundUtil.java | getOriginalGraphics | public static @NotNull Graphics2D getOriginalGraphics(@NotNull Graphics g) {
return g instanceof MyGraphics? ((MyGraphics)g).getDelegate() : (Graphics2D)g;
} | [
34,
53
] | public static @NotNull Graphics2D getOriginalGraphics(@NotNull Graphics g) | 163 | 322,287 |
../intellij-community/java/execution/openapi/src/com/intellij/execution/filters/ExceptionInfo.java | createExceptionInfo | private static @NotNull ExceptionInfo createExceptionInfo(String message, String exceptionName, int startOffset) {
return switch (exceptionName) {
case "java.lang.ArrayIndexOutOfBoundsException" -> new ArrayIndexOutOfBoundsExceptionInfo(startOffset, message);
case "java.lang.ArrayStoreException" -> new ArrayStoreExceptionInfo(startOffset, message);
case "java.lang.ClassCastException" -> new ClassCastExceptionInfo(startOffset, message);
case "java.lang.NullPointerException" -> new NullPointerExceptionInfo(startOffset, message);
case "java.lang.AssertionError" -> new AssertionErrorInfo(startOffset, message);
case "java.lang.ArithmeticException" -> new ArithmeticExceptionInfo(startOffset, message);
case "java.lang.NegativeArraySizeException" -> new NegativeArraySizeExceptionInfo(startOffset, message);
default -> {
ExceptionInfo info =
JetBrainsNotNullInstrumentationExceptionInfo.tryCreate(startOffset, exceptionName, message);
yield info != null ? info : new ExceptionInfo(startOffset, exceptionName, message);
}
};
} | [
38,
57
] | private static @NotNull ExceptionInfo createExceptionInfo(String message, String exceptionName, int startOffset) | 1,117 | 382,447 |
../intellij-community/java/java-impl/src/com/intellij/codeInsight/generation/GenerateMembersUtil.java | copyModifiers | private static void copyModifiers(@NotNull PsiModifierList sourceModifierList,
@NotNull PsiModifierList targetModifierList) {
VisibilityUtil.setVisibility(targetModifierList, VisibilityUtil.getVisibilityModifier(sourceModifierList));
} | [
20,
33
] | private static void copyModifiers(@NotNull PsiModifierList sourceModifierList,
@NotNull PsiModifierList targetModifierList) | 277 | 378,113 |
../intellij-community/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/CommonDataflow.java | computeValue | @Contract("null -> null")
public static Object computeValue(@Nullable PsiExpression expression) {
PsiExpression expressionToAnalyze = PsiUtil.skipParenthesizedExprDown(expression);
if (expressionToAnalyze == null) return null;
Object computed = ExpressionUtils.computeConstantExpression(expressionToAnalyze);
if (computed != null) return computed;
return getDfType(expressionToAnalyze).getConstantOfType(Object.class);
} | [
49,
61
] | @Contract("null -> null")
public static Object computeValue(@Nullable PsiExpression expression) | 444 | 350,316 |
../intellij-community/platform/platform-impl/src/com/intellij/ui/tree/ui/DefaultTreeUI.java | isAutoExpandAllowed | private static boolean isAutoExpandAllowed(@NotNull JTree tree, @NotNull Object node) {
Function<Object, Boolean> filter = ClientProperty.get(tree, AUTO_EXPAND_FILTER);
if (filter != null) {
return !filter.apply(node);
}
else if (node instanceof AbstractTreeNode<?> treeNode) {
return treeNode.isAutoExpandAllowed();
}
else {
return true;
}
} | [
23,
42
] | private static boolean isAutoExpandAllowed(@NotNull JTree tree, @NotNull Object node) | 390 | 312,572 |
../intellij-community/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XDebuggerInstanceTreeCreator.java | errorOccurred | @Override
public void errorOccurred(@NotNull String errorMessage) {
} | [
32,
45
] | @Override
public void errorOccurred(@NotNull String errorMessage) | 90 | 261,082 |
../intellij-community/platform/platform-impl/src/com/intellij/ide/actionMacro/ActionMacro.java | playBack | @Override
public void playBack(DataContext context) {
} | [
26,
34
] | @Override
public void playBack(DataContext context) | 63 | 309,189 |
../intellij-community/platform/platform-api/src/com/intellij/ide/OccurenceNavigator.java | hasNextOccurence | boolean hasNextOccurence(); | [
8,
24
] | boolean hasNextOccurence() | 27 | 249,065 |
../intellij-community/xml/impl/src/com/intellij/application/options/GenerationCodeStylePanel.java | apply | @Override
public void apply(@NotNull CodeStyleSettings settings) throws ConfigurationException {
myCommenterForm.apply(settings);
} | [
24,
29
] | @Override
public void apply(@NotNull CodeStyleSettings settings) | 139 | 501,373 |
../intellij-community/platform/code-style-api/src/com/intellij/psi/codeStyle/CodeStyleSettingsManager.java | getStateModificationCount | @Override
public long getStateModificationCount() {
return enumSettings().stream()
.mapToLong(settings -> settings.getModificationTracker().getModificationCount())
.sum();
} | [
24,
49
] | @Override
public long getStateModificationCount() | 231 | 277,357 |