Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
41,400
String () { return JavaI18nBundle.message("inconsistent.bundle.report.inconsistent.properties.ends"); }
getPresentableName
41,401
void (BidirectionalMap<PropertiesFile, PropertiesFile> parents, List<? extends PropertiesFile> files, Map<PropertiesFile, Set<String>> keysUpToParent, Map<PropertiesFile, Map<String, String>> propertiesFilesNamesMaps, InspectionManager manager, RefManager refManager, ProblemDescriptionsProcessor processor) { for (Prope...
check
41,402
String () { return "REPORT_MISSING_TRANSLATIONS"; }
getName
41,403
String () { return JavaI18nBundle.message("inconsistent.bundle.report.missing.translations"); }
getPresentableName
41,404
void (BidirectionalMap<PropertiesFile, PropertiesFile> parents, List<? extends PropertiesFile> files, Map<PropertiesFile, Set<String>> keysUpToParent, Map<PropertiesFile, Map<String, String>> propertiesFilesNamesMaps, InspectionManager manager, RefManager refManager, ProblemDescriptionsProcessor processor) { for (Prope...
check
41,405
String () { return "REPORT_INCONSISTENT_PROPERTIES_PLACEHOLDERS"; }
getName
41,406
String () { return JavaI18nBundle.message("inconsistent.bundle.report.inconsistent.properties.placeholders"); }
getPresentableName
41,407
void (BidirectionalMap<PropertiesFile, PropertiesFile> parents, List<? extends PropertiesFile> files, Map<PropertiesFile, Set<String>> keysUpToParent, Map<PropertiesFile, Map<String, String>> propertiesFilesNamesMaps, InspectionManager manager, RefManager refManager, ProblemDescriptionsProcessor processor) { for (Prope...
check
41,408
String (String propertyKey, String propertyValue, String paramsString) { I18nizedTextGenerator textGenerator = myResourceBundleManager.getI18nizedTextGenerator(); if (textGenerator != null) { return textGenerator.getI18nizedConcatenationText(propertyKey, paramsString, getPropertiesFile(), null); } String templateName =...
getI18NText
41,409
String () { return "i18nInBatch"; }
getDimensionServiceKey
41,410
JComponent () { myPropertiesFile = new ComboBox<>(); SwingUtilities.invokeLater(() -> { ReadAction.nonBlocking(() -> myResourceBundleManager != null ? myResourceBundleManager.suggestPropertiesFiles(myContextModules) : I18nUtil.defaultSuggestPropertiesFiles(myProject, myContextModules)) .finishOnUiThread(ModalityState.s...
createNorthPanel
41,411
void (ActionEvent e) { PropertiesFile propertiesFile = getPropertiesFile(); if (propertiesFile != null) { List<I18nizedPropertyData<D>> pairs = myKeyValuePairs; ReadAction.nonBlocking(() -> { List<I18nizedPropertyData<D>> result = new ArrayList<>(); for (I18nizedPropertyData<D> data : pairs) { result.add(data.changeKey...
actionPerformed
41,412
boolean () { return JavaI18nizeQuickFixDialog.showResourceBundleTextField(myResourceBundleManager.getTemplateName(), myProject) || JavaI18nizeQuickFixDialog.showResourceBundleTextField(myResourceBundleManager.getConcatenationTemplateName(), myProject); }
hasResourceBundleInTemplate
41,413
PropertiesFile () { Object selectedItem = myPropertiesFile.getSelectedItem(); if (selectedItem == null) return null; String path = FileUtil.toSystemIndependentName((String)selectedItem); VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(path); return virtualFile != null ? PropertiesImplUtil.getProp...
getPropertiesFile
41,414
JComponent () { Splitter splitter = new JBSplitter(true); myUsagePreviewPanel = new UsagePreviewPanel(myProject, new UsageViewPresentation()); myTable = new JBTable(new MyKeyValueModel()); DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); renderer.putClientProperty("html.disable", Boolean.TRUE); myTab...
createCenterPanel
41,415
void (AnActionButton button) { TableUtil.removeSelectedItems(myTable); myTable.repaint(); updateUsagePreview(myTable); }
run
41,416
void (@NotNull AnActionEvent e) { TableUtil.stopEditing(myTable); List<Pair<Integer, I18nizedPropertyData<D>>> selection = getSelectedDataWithIndices(); boolean mark = shouldMarkAsNonNls(selection); for (Pair<Integer, I18nizedPropertyData<D>> dataWithIndex : selection) { myKeyValuePairs.set(dataWithIndex.first, dataWit...
actionPerformed
41,417
void (@NotNull AnActionEvent e) { List<Pair<Integer, I18nizedPropertyData<D>>> selection = getSelectedDataWithIndices(); e.getPresentation().setEnabled(!selection.isEmpty()); e.getPresentation().setText(shouldMarkAsNonNls(selection) ? JavaI18nBundle.message("action.text.mark.as.nonnls") : JavaI18nBundle.message("action...
updateButton
41,418
ActionUpdateThread () { // getSelectedDataWithIndices() is used which queries swing return ActionUpdateThread.EDT; }
getActionUpdateThread
41,419
boolean (List<Pair<Integer, I18nizedPropertyData<D>>> selection) { return !ContainerUtil.and(selection, data -> data.second.markAsNonNls()); }
shouldMarkAsNonNls
41,420
void (JBTable table) { int index = table.getSelectionModel().getLeadSelectionIndex(); if (index != -1 && index < myKeyValuePairs.size()) { myUsagePreviewPanel.updateLayout(myUsagePreviewProvider.apply(myKeyValuePairs.get(index).contextData())); } else { myUsagePreviewPanel.updateLayout(null); } }
updateUsagePreview
41,421
void () { TableUtil.stopEditing(myTable); PropertiesComponent.getInstance(myProject).setValue(LAST_USED_PROPERTIES_FILE, (String)myPropertiesFile.getSelectedItem()); PropertiesComponent.getInstance(myProject).setValue(LAST_USED_CONTEXT, getContextString()); if (myRBEditorTextField != null) { myRBEditorTextField.addCurr...
doOKAction
41,422
String () { return myContextModules.stream().map(Module::getName).min(Comparator.naturalOrder()).orElse(null); }
getContextString
41,423
void () { Disposer.dispose(myUsagePreviewPanel); super.dispose(); }
dispose
41,424
ResourceBundleManager (@NotNull Project project, @NotNull Set<PsiFile> contextFiles) { ResourceBundleManager bundleManager = null; try { bundleManager = ResourceBundleManager.getManager(contextFiles, project); LOG.assertTrue(bundleManager != null); } catch (ResourceBundleManager.ResourceBundleNotFoundException e) { LOG...
getResourceBundleManager
41,425
int () { return myKeyValuePairs.size(); }
getRowCount
41,426
String (int column) { return column == 0 ? JavaI18nBundle.message("key.column.name") : JavaI18nBundle.message("value.column.name"); }
getColumnName
41,427
int () { return 2; }
getColumnCount
41,428
boolean (int rowIndex, int columnIndex) { return columnIndex == 0 && 0 <= rowIndex && rowIndex < myKeyValuePairs.size() && !myKeyValuePairs.get(rowIndex).markAsNonNls(); }
isCellEditable
41,429
Object (int rowIndex, int columnIndex) { I18nizedPropertyData<?> data = myKeyValuePairs.get(rowIndex); if (columnIndex == 0) { return data.markAsNonNls() ? "will be marked as NonNls" : data.key(); } return data.value(); }
getValueAt
41,430
void (Object aValue, int rowIndex, int columnIndex) { if (columnIndex == 0) { I18nizedPropertyData<D> bean = myKeyValuePairs.get(rowIndex); myKeyValuePairs.set(rowIndex, bean.changeKey((String)aValue)); } }
setValueAt
41,431
void (int idx) { myKeyValuePairs.remove(idx); }
removeRow
41,432
I18nizedPropertyData<D> (@NotNull String newKey) { return new I18nizedPropertyData<>(newKey, value, contextData, markAsNonNls); }
changeKey
41,433
I18nizedPropertyData<D> (boolean markAsNonNls) { return new I18nizedPropertyData<>(key, value, contextData, markAsNonNls); }
setMarkAsNonNls
41,434
PsiElementVisitor (@NotNull final ProblemsHolder holder, final boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitReferenceExpression(final @NotNull PsiReferenceExpression expression) { visitExpression(expression); } @Override public void visitLiteralExpression(@NotNull PsiLiteralExpress...
buildVisitor
41,435
void (final @NotNull PsiReferenceExpression expression) { visitExpression(expression); }
visitReferenceExpression
41,436
void (@NotNull PsiLiteralExpression expression) { checkStringLiteralExpression(expression, holder, isOnTheFly); }
visitLiteralExpression
41,437
String () { return "DuplicateStringLiteralInspection"; }
getShortName
41,438
List<PsiLiteralExpression> (@NotNull StringLiteralSearchQuery query, @NotNull Project project) { final GlobalSearchScope scope = GlobalSearchScope.projectScope(project); final List<String> words = ContainerUtil.filter(StringUtil.getWordsInStringLongestFirst(query.stringToFind), s -> s.length() >= query.minStringLength)...
findDuplicateLiterals
41,439
boolean (VirtualFile f) { FileViewProvider viewProvider = PsiManager.getInstance(project).findViewProvider(f); // important: skip non-java files with given word in literal (IDEA-126201) if (viewProvider == null || viewProvider.getPsi(JavaLanguage.INSTANCE) == null) return true; PsiFile psiFile = viewProvider.getPsi(vie...
process
41,440
List<PsiLiteralExpression> (@NotNull String stringToFind, boolean ignorePropertyKeys, @NotNull PsiFile file) { ProgressManager.checkCanceled(); CharSequence text = file.getViewProvider().getContents(); StringSearcher searcher = new StringSearcher(stringToFind, true, true); List<PsiLiteralExpression> foundExpr = new Sma...
findDuplicateLiteralsInFile
41,441
void (@NotNull final PsiLiteralExpression originalExpression, @NotNull ProblemsHolder holder, final boolean isOnTheFly) { PsiExpression[] foundExpr = getDuplicateLiterals(holder.getProject(), originalExpression, isOnTheFly); if (foundExpr.length == 0) return; Set<PsiClass> classes = new HashSet<>(); for (PsiElement aCl...
checkStringLiteralExpression
41,442
boolean (@NotNull PsiLiteralExpression expression, boolean ignorePropertyKeys) { if (ignorePropertyKeys && JavaI18nUtil.mustBePropertyKey(expression, null)) return false; return !SuppressManager.isSuppressedInspectionName(expression); }
shouldCheck
41,443
void (PsiExpression @NotNull [] foundExpr, @NotNull PsiLiteralExpression originalExpression, @NotNull Collection<? super LocalQuickFix> fixes) { for (PsiExpression expr : foundExpr) { if (expr == originalExpression) continue; PsiElement parent = expr.getParent(); if (parent instanceof PsiField field) { if (field.getIni...
createReplaceFixes
41,444
OptPane () { return pane( number("MIN_STRING_LENGTH", JavaI18nBundle.message("inspection.duplicates.option"), 1, 10_000), checkbox("IGNORE_PROPERTY_KEYS", JavaI18nBundle.message("inspection.duplicates.option.report.propertykey.expressions")) ); }
getOptionsPane
41,445
void (@NotNull Project project, PsiExpression element) { PsiExpression[] literalExpressions = getDuplicateLiteralsUnderProgress(element); if (literalExpressions == null) return; introduceConstant(literalExpressions, project); }
doIntroduce
41,446
Presentation (@NotNull ActionContext context, @NotNull PsiLiteralExpression element) { return Presentation.of(myText); }
getPresentation
41,447
void (@NotNull ActionContext context, @NotNull PsiLiteralExpression literal, @NotNull ModPsiUpdater updater) { final PsiField myConstant = myConst.getElement(); if (myConstant == null) return; final PsiExpression initializer = myConstant.getInitializer(); if (!(initializer instanceof PsiLiteralExpression)) { return; } ...
invoke
41,448
String () { return JavaI18nBundle.message("inspection.duplicates.replace.family.quickfix"); }
getFamilyName
41,449
boolean () { return false; }
startInWriteAction
41,450
void (@NotNull Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { PsiExpression[] literalExpressions = getDuplicateLiteralsUnderProgress(startElement); if (literalExpressions == null) return; Usage[] usages = Stream.of(literalExpressions) .map(UsageInfo::new) .ma...
invoke
41,451
String () { return "String literal: '" + ((PsiLiteralExpression)startElement).getValue() + "'"; }
getPresentableText
41,452
String () { return getFamilyName(); }
getText
41,453
String () { return JavaI18nBundle.message("inspection.duplicates.navigate.to.occurrences"); }
getFamilyName
41,454
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { final PsiElement element = previewDescriptor.getPsiElement(); if (element instanceof PsiLiteralExpression literal) { final PsiExpression[] duplicates = getDuplicateLiterals(project, literal, true); if (duplicates.length < 10...
generatePreview
41,455
record (@NotNull String stringToFind, boolean ignorePropertyKeys, int minStringLength, boolean isOnFlySearch) { }
StringLiteralSearchQuery
41,456
void (PsiExpression @NotNull [] expressions, @NotNull Project project) { new IntroduceConstantHandler() { @Override protected OccurrenceManager createOccurrenceManager(PsiExpression selectedExpr, PsiClass parentClass) { return new BaseOccurrenceManager(occurrence -> true) { @Override protected PsiExpression @NotNull []...
introduceConstant
41,457
OccurrenceManager (PsiExpression selectedExpr, PsiClass parentClass) { return new BaseOccurrenceManager(occurrence -> true) { @Override protected PsiExpression @NotNull [] defaultOccurrences() { return expressions; } @Override protected PsiExpression @NotNull [] findOccurrences() { return expressions; } }; }
createOccurrenceManager
41,458
void (@NotNull final PsiReferenceRegistrar registrar) { final PsiReferenceProvider filePathReferenceProvider = new FilePathReferenceProvider() { @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull String text, int offset, boolean soft) { PsiReference[] references = sup...
registerReferenceProviders
41,459
boolean (Object element, PsiElement context) { return !JavaI18nUtil.mustBePropertyKey((PsiLiteralExpression) context, null); }
isAcceptable
41,460
boolean (Class hintClass) { return true; }
isClassAcceptable
41,461
void (@NotNull final PsiReferenceRegistrar registrar) { final JavaClassListReferenceProvider classListProvider = new JavaClassListReferenceProvider(); registrar.registerReferenceProvider(xmlAttributeValue(), classListProvider, PsiReferenceRegistrar.LOWER_PRIORITY); registrar.registerReferenceProvider(xmlTag(), classLis...
registerReferenceProviders
41,462
boolean (PsiElement element) { if (PsiUtil.isJavaToken(element, JavaTokenType.STRING_LITERAL)) { PsiReference[] references = element.getParent().getReferences(); return ContainerUtil.findInstance(references, PropertyReference.class) != null; } return element instanceof IProperty; }
canInlineElement
41,463
void (final Project project, Editor editor, PsiElement psiElement) { if (!(psiElement instanceof IProperty property)) return; final String propertyValue = property.getValue(); if (propertyValue == null) return; final List<PsiElement> occurrences = Collections.synchronizedList(new ArrayList<>()); final Collection<PsiFil...
inlineElement
41,464
String (PsiElement element) { return getRefactoringName(); }
getActionName
41,465
void (PsiElement element, String text, boolean useRename, int offset, TextRange rangeToCheck, Splitter splitter) { myText = text; splitter.split(myText, rangeToCheck, this); }
consumeToken
41,466
List<String> () { return myTokenTexts; }
getTokenTexts
41,467
void (TextRange range) { myTokenTexts.add(range.substring(myText)); }
consume
41,468
void () { doTest("hello\\nworld", "hello", "world"); }
testEscapeSequences
41,469
void () { doTest("\\nhello\\nworld\\n", "hello", "world"); }
testEscapeSequences2
41,470
void (final String text, final String... expected) { TokenCollector collector = new TokenCollector(); LiteralExpressionTokenizer.processTextWithEscapeSequences(null, text, collector); assertOrderedEquals(collector.getTokenTexts(), expected); }
doTest
41,471
String () { return PluginPathManager.getPluginHomePathRelative("java-i18n") + "/testData/inspections/spellchecker"; }
getBasePath
41,472
LightProjectDescriptor () { return JAVA_21; }
getProjectDescriptor
41,473
void () { doTest(); }
testCorrectJava
41,474
void () { doTest(); }
testTypoInJava
41,475
void () { doTest(); }
testVarArg
41,476
void () { doTest(); }
testJapanese
41,477
void () { doTest(); }
testClassName
41,478
void () { doTest(); }
testFieldName
41,479
void () { doTest(); }
testMethodName
41,480
void () { doTest();}
testConstructorIgnored
41,481
void () { doTest(); }
testLocalVariableName
41,482
void () { doTest(); }
testDocComment
41,483
void () { doTest(); }
testStringLiteral
41,484
void () { doTest(); }
testStringLiteralEscaping
41,485
void () { doTest(); }
testSuppressions
41,486
void () { doTest(); }
testMethodReturnTypeWithNonNls
41,487
void () { doTest(); }
testMethodReturnTypeWithNonNlsReturnsLiteral
41,488
void () { doTest(); }
testNonNlsField
41,489
void () { doTest(); }
testNonNlsField2
41,490
void () { doTest(); }
testNonNlsLocalVariable
41,491
void () { doTest(); }
testNonNlsLocalVariableAndComment
41,492
void () { doTest(); }
testFieldComment
41,493
void () { doTest(); }
testDoNotCheckDerivedNames
41,494
void () { doTest(); }
testSkipDateTime
41,495
void () { myFixture.enableInspections(SpellcheckerInspectionTestCase.getInspectionTools()); myFixture.testHighlighting(false, false, true, getTestName(false) + ".java"); }
doTest
41,496
String () { return PluginPathManager.getPluginHomePath("java-i18n") + "/testData/suppression"; }
getTestDataPath
41,497
void () { doTest(); }
testClassName
41,498
void () { doTest(); }
testStringLiteral
41,499
void () { doSingleTest(getTestName(false) + ".java"); }
doTest