Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
11,900
|
List<IntentionAction> () { final Editor editor = getEditor(); final PsiFile file = getFile(); CodeInsightTestFixtureImpl.instantiateAndRun(file, editor, new int[0], false); return CodeInsightTestFixtureImpl.getAvailableIntentions(editor, file); }
|
getAvailableActions
|
11,901
|
AnAction () { return new LombokSetterAction(); }
|
getAction
|
11,902
|
String () { return super.getBasePath() + "/action/lombok/setter"; }
|
getBasePath
|
11,903
|
AnAction () { return new LombokGetterAction(); }
|
getAction
|
11,904
|
String () { return super.getBasePath() + "/action/lombok/getter"; }
|
getBasePath
|
11,905
|
AnAction () { return new LombokLoggerAction(); }
|
getAction
|
11,906
|
String () { return super.getBasePath() + "/action/lombok/log"; }
|
getBasePath
|
11,907
|
void (TestDialog newValue) { try { // TestDialogManager.setTestDialog(newValue); IntelliJ>=2020.3 callPerReflection("com.intellij.openapi.ui.TestDialogManager", newValue); } catch (Exception ignore) { try { // Messages.setTestDialog(newValue); IntelliJ<=2020.2 callPerReflection("com.intellij.openapi.ui.Messages", newValue); } catch (Exception ignore2) { fail("No supported DialogManager classes found!"); } } }
|
setTestDialog
|
11,908
|
AnAction () { return new DelombokValueAction(); }
|
getAction
|
11,909
|
String () { return super.getBasePath() + "/action/delombok/value"; }
|
getBasePath
|
11,910
|
AnAction () { return new DelombokEqualsAndHashCodeAction(); }
|
getAction
|
11,911
|
String () { return super.getBasePath() + "/action/delombok/equalsandhashcode"; }
|
getBasePath
|
11,912
|
AnAction () { return new DelombokGetterAction(); }
|
getAction
|
11,913
|
String () { return super.getBasePath() + "/action/delombok/getter"; }
|
getBasePath
|
11,914
|
AnAction () { return new DelombokSuperBuilderAction(); }
|
getAction
|
11,915
|
String () { return super.getBasePath() + "/action/delombok/superbuilder"; }
|
getBasePath
|
11,916
|
AnAction () { return new DelombokFieldNameConstantsAction(); }
|
getAction
|
11,917
|
String () { return super.getBasePath() + "/action/delombok/fieldnameconstants"; }
|
getBasePath
|
11,918
|
AnAction () { return new DelombokToStringAction(); }
|
getAction
|
11,919
|
String () { return super.getBasePath() + "/action/delombok/tostring"; }
|
getBasePath
|
11,920
|
AnAction () { return new DelombokSetterAction(); }
|
getAction
|
11,921
|
String () { return super.getBasePath() + "/action/delombok/setter"; }
|
getBasePath
|
11,922
|
AnAction () { return new DelombokLoggerAction(); }
|
getAction
|
11,923
|
String () { return super.getBasePath() + "/action/delombok/log"; }
|
getBasePath
|
11,924
|
AnAction () { return new DelombokUtilityClassAction(); }
|
getAction
|
11,925
|
String () { return super.getBasePath() + "/action/delombok/utilityclass"; }
|
getBasePath
|
11,926
|
AnAction () { return new DelombokDataAction(); }
|
getAction
|
11,927
|
String () { return super.getBasePath() + "/action/delombok/data"; }
|
getBasePath
|
11,928
|
AnAction () { return new DelombokBuilderAction(); }
|
getAction
|
11,929
|
String () { return super.getBasePath() + "/action/delombok/builder"; }
|
getBasePath
|
11,930
|
AnAction () { return new DelombokDelegateAction(); }
|
getAction
|
11,931
|
String () { return super.getBasePath() + "/action/delombok/delegate"; }
|
getBasePath
|
11,932
|
void () { myFixture.configureByText("Main.java", """ @lombok.Data public class Main { private String someString<caret>; public static void main(String[] args) { final Main main = new Main(); main.setSomeString("Hello World"); System.out.println(main.getSomeString()); } } """); myFixture.renameElementAtCaretUsingHandler("someString2"); myFixture.checkHighlighting(); }
|
testFieldRename
|
11,933
|
void (String[] args) { final Main main = new Main(); main.setSomeString("Hello World"); System.out.println(main.getSomeString()); }
|
main
|
11,934
|
LightProjectDescriptor () { return LombokTestUtil.LOMBOK_DESCRIPTOR; }
|
getProjectDescriptor
|
11,935
|
void () { configureFromFileText("Test.java", """ import lombok.experimental.ExtensionMethod; @ExtensionMethod({Extensions.class}) public class ExtensionMethodDfa { public String test() { String iAmNull = "hELlO, WORlD!".toTitle<caret>Case(); } } class Extensions { public static String toTitleCase(String in) { if (in.isEmpty()) return in; return "" + Character.toTitleCase(in.charAt(0)) + in.substring(1).toLowerCase(Locale.ROOT); } } """); PsiElement element = GotoDeclarationAction.findTargetElement(getProject(), getEditor(), getEditor().getCaretModel().getOffset()); assertTrue(element instanceof PsiMethod); assertEquals("Extensions", ((PsiMethod)element).getContainingClass().getQualifiedName()); }
|
testExtensionMethod
|
11,936
|
String () { String iAmNull = "hELlO, WORlD!".toTitle<caret>Case(); }
|
test
|
11,937
|
String (String in) { if (in.isEmpty()) return in; return "" + Character.toTitleCase(in.charAt(0)) + in.substring(1).toLowerCase(Locale.ROOT); }
|
toTitleCase
|
11,938
|
String () { return super.getBasePath() + "/action/intellij"; }
|
getBasePath
|
11,939
|
void () { final String testName = getTestName(true); loadToPsiFile("/performance/" + testName + "/lombok.config"); final PsiFile psiFile = loadToPsiFile("/performance/" + testName + "/HugeClass.java"); PlatformTestUtil.startPerformanceTest(getTestName(false), 500, () -> { type(' '); PsiDocumentManager.getInstance(getProject()).commitDocument(getEditor().getDocument()); ((PsiJavaFileImpl)psiFile).getClasses()[0].getFields()[0].hasModifierProperty(PsiModifier.FINAL); backspace(); PsiDocumentManager.getInstance(getProject()).commitDocument(getEditor().getDocument()); ((PsiJavaFileImpl)psiFile).getClasses()[0].getFields()[0].hasModifierProperty(PsiModifier.FINAL); }).assertTiming(); }
|
testFieldDefaults
|
11,940
|
void () { LightPlatformCodeInsightTestCase.backspace(getEditor(), getProject()); }
|
backspace
|
11,941
|
void (char c) { LightPlatformCodeInsightTestCase.type(c, getEditor(), getProject()); }
|
type
|
11,942
|
void () { PlatformTestUtil.startPerformanceTest("300 unrelated methods", 60000, () -> { StringBuilder text = new StringBuilder("import lombok.Getter; import lombok.Setter; @interface Tolerate{} class Foo {"); for (int i = 0; i < 200; i++) { text.append("@Getter @Setter int bar").append(i).append(";"); } for (int i = 0; i < 200; i++) { text.append("@Tolerate public void m").append(i).append("(){int i = getBar").append(i).append("();}"); } for (int i = 0; i < 200; i++) { text.append("@Tolerate public void s").append(i).append("(){setBar").append(i).append("(0);}"); } text.append("}"); myFixture.configureByText("Foo.java", text.toString()); myFixture.checkHighlighting(); }) .assertTiming(); }
|
testGeneratedCode
|
11,943
|
void () { PlatformTestUtil.startPerformanceTest("200 unrelated methods", 20000, () -> { StringBuilder text = new StringBuilder("import lombok.Getter; import lombok.Setter; @interface Tolerate{} class Foo {"); for (int i = 0; i < 200; i++) { text.append("@Getter @Setter int bar").append(i).append(";"); } text.append("}"); myFixture.addClass(text.toString()); StringBuilder barText = new StringBuilder("class Bar {void m(Foo foo){"); for (int i = 0; i < 200; i++) { barText.append("foo.setBar").append(i).append("(0);\n"); } barText.append("}}"); myFixture.configureByText("Bar.java", barText.toString()); myFixture.checkHighlighting(); }) .assertTiming(); }
|
testGeneratedCodeThroughStubs
|
11,944
|
void () { StringBuilder classText = new StringBuilder(); for (int i = 0; i < 200; i++) { classText.append(""" @lombok.Data @lombok.EqualsAndHashCode @lombok.ToString """); classText.append("class SomeClass").append(i).append("{\n"); for (int j = 0; j < 30; j++) { classText.append("String bar").append(j).append(";\n"); } if (i > 0) { for (int j = 0; j < 30; j++) { classText.append(""" String getFoo%1$d_%2$d(SomeClass%1$d bar) { return bar.getBar%2$d() + bar.toString() + bar.hashCode(); } """.formatted(i - 1, j)); } } classText.append("}"); } PlatformTestUtil.startPerformanceTest("@Data/@EqualsAndHashCode/@ToString performance", 30000, () -> { myFixture.configureByText("Bar.java", classText.toString()); myFixture.checkHighlighting(); }) .assertTiming(); }
|
testDataPerformance
|
11,945
|
void () { TestApplicationManager.getInstance(); discovery = new ConfigDiscovery() { @Override protected FileBasedIndex getFileBasedIndex() { return fileBasedIndex; } @Override protected @NotNull Collection<String> discoverPropertyWithCache(@NotNull ConfigKey configKey, @NotNull PsiFile psiFile) { return super.discoverProperty(configKey, psiFile); } }; when(psiFile.getProject()).thenReturn(project); when(psiClass.getContainingFile()).thenReturn(psiFile); when(psiFile.getOriginalFile()).thenReturn(psiFile); when(psiFile.getVirtualFile()).thenReturn(virtualFile); when(virtualFile.getParent()).thenReturn(parentVirtualFile); when(parentVirtualFile.getParent()).thenReturn(parentParVirtualFile); when(parentParVirtualFile.getParent()).thenReturn(parentParParVirtualFile); when(parentParParVirtualFile.getParent()).thenReturn(parentParParParVirtualFile); }
|
setUp
|
11,946
|
FileBasedIndex () { return fileBasedIndex; }
|
getFileBasedIndex
|
11,947
|
Collection<String> (@NotNull ConfigKey configKey, @NotNull PsiFile psiFile) { return super.discoverProperty(configKey, psiFile); }
|
discoverPropertyWithCache
|
11,948
|
void () { final String property = discovery.getStringLombokConfigProperty(ConfigKey.ACCESSORS_CHAIN, psiClass); assertNotNull(property); assertEquals(ConfigKey.ACCESSORS_CHAIN.getConfigDefaultValue(), property); }
|
testDefaultStringConfigProperties
|
11,949
|
void () { final ConfigKey configKey = ConfigKey.ACCESSORS_CHAIN; when(fileBasedIndex.getValues(eq(LombokConfigIndex.NAME), eq(configKey), isA(GlobalSearchScope.class))) .thenReturn(makeValue(EXPECTED_VALUE)); final String property = discovery.getStringLombokConfigProperty(configKey, psiClass); assertNotNull(property); assertEquals(EXPECTED_VALUE, property); }
|
testStringConfigPropertySameDirectory
|
11,950
|
void () { final ConfigKey configKey = ConfigKey.ACCESSORS_CHAIN; when(fileBasedIndex.getValues(eq(LombokConfigIndex.NAME), eq(configKey), isA(GlobalSearchScope.class))) .thenReturn(makeValue(EXPECTED_VALUE)); final String property = discovery.getStringLombokConfigProperty(configKey, psiClass); assertNotNull(property); assertEquals(EXPECTED_VALUE, property); }
|
testStringConfigPropertySubDirectory
|
11,951
|
void () { final ConfigKey configKey = ConfigKey.ACCESSORS_CHAIN; final String property = discovery.getStringLombokConfigProperty(configKey, psiClass); assertNotNull(property); assertEquals(configKey.getConfigDefaultValue(), property); }
|
testStringConfigPropertySubDirectoryStopBubbling
|
11,952
|
void () { final ConfigKey configKey = ConfigKey.ACCESSORS_PREFIX; when(fileBasedIndex.getValues(eq(LombokConfigIndex.NAME), eq(configKey), any(GlobalSearchScope.class))) .thenReturn(makeValue("+_d;"), Collections.emptyList(), makeValue("-a;+cc"), makeValue("+a;+b")); final Collection<String> properties = discovery.getMultipleValueLombokConfigProperty(configKey, psiClass); assertThat(properties, hasItems("b", "cc", "_d")); }
|
testMultipleStringConfigProperty
|
11,953
|
List<ConfigValue> (String value) { return Collections.singletonList(new ConfigValue(value, false)); }
|
makeValue
|
11,954
|
void () { final ConfigKey configKey = ConfigKey.ACCESSORS_PREFIX; when(fileBasedIndex.getValues(eq(LombokConfigIndex.NAME), eq(configKey), isA(GlobalSearchScope.class))) .thenReturn(makeValue("+_d;")); final Collection<String> properties = discovery.getMultipleValueLombokConfigProperty(configKey, psiClass); assertThat(properties, hasItems("_d")); }
|
testMultipleStringConfigPropertyWithStopBubbling
|
11,955
|
LightProjectDescriptor () { return LombokTestUtil.LOMBOK_NEW_DESCRIPTOR; }
|
getProjectDescriptor
|
11,956
|
void () { final Collection<UsageInfo> usages = loadTestClass(); assertUsages(usages, "findUsageGetterSetter.setBar", "findUsageGetterSetter.getBar"); }
|
testFindUsageGetterSetter
|
11,957
|
void () { final Collection<UsageInfo> usages = loadTestClass(); assertUsages(usages, "findUsageAccessors.setBar", "findUsageAccessors.getBar"); }
|
testFindUsageAccessors
|
11,958
|
void () { final Collection<UsageInfo> usages = loadTestClass(); assertUsages(usages, "findUsageWither.withBar", "findUsageWither.getBar"); }
|
testFindUsageWither
|
11,959
|
void () { final Collection<UsageInfo> usages = loadTestClass(); assertUsages(usages, "findUsageWitherRecord.withBar", "findUsageWitherRecord.bar"); }
|
testFindUsageWitherRecord
|
11,960
|
void () { final Collection<UsageInfo> usages = loadTestClass(); assertUsages(usages, "FindUsageBuilder.builder().bar", "findUsageBuilder.getBar"); }
|
testFindUsageBuilder
|
11,961
|
void () { final Collection<UsageInfo> usages = loadTestClass(); assertUsages(usages, "FindUsageBuilderRecord.builder().bar", "findUsageBuilderRecord.bar"); }
|
testFindUsageBuilderRecord
|
11,962
|
void () { final Collection<UsageInfo> usages = loadTestClass(); assertUsages(usages, "FindUsageSingularBuilder.builder().bar", "FindUsageSingularBuilder.builder().bars", "FindUsageSingularBuilder.builder().clearBars", "findUsageBuilder.getBars"); }
|
testFindUsageSingularBuilder
|
11,963
|
void () { myFixture.configureByFile(getTestName(false) + ".java"); PsiClass aClass = myFixture.findClass("Apple"); JavaClassFindUsagesOptions options = new JavaClassFindUsagesOptions(getProject()); options.isFieldsUsages=true; options.isMethodsUsages=true; options.isUsages=true; CommonProcessors.CollectProcessor<UsageInfo> processor = new CommonProcessors.CollectProcessor<>(); FindUsagesManager findUsagesManager = ((FindManagerImpl)FindManager.getInstance(aClass.getProject())).getFindUsagesManager(); FindUsagesHandler handler = findUsagesManager.getFindUsagesHandler(aClass, false); assertNotNull(handler); handler.processElementUsages(aClass, processor, options); Collection<UsageInfo> usages = processor.getResults(); assertEmpty(StringUtil.join(usages, u -> u.getElement().getText() , ","), usages); }
|
testFieldUsages
|
11,964
|
void (Collection<UsageInfo> usages, String... usageTexts) { assertEquals(usageTexts.length, usages.size()); List<UsageInfo> sortedUsages = new ArrayList<>(usages); sortedUsages.sort(UsageInfo::compareToByStartOffset); for (int i = 0; i < usageTexts.length; i++) { assertEquals(usageTexts[i], sortedUsages.get(i).getElement().getText().replaceAll("\\s*", "")); } }
|
assertUsages
|
11,965
|
Collection<UsageInfo> () { return myFixture.testFindUsages(getTestName(false) + ".java"); }
|
loadTestClass
|
11,966
|
String () { return super.getBasePath() + "/usage/"; }
|
getBasePath
|
11,967
|
LightProjectDescriptor () { return LombokTestUtil.LOMBOK_NEW_DESCRIPTOR; }
|
getProjectDescriptor
|
11,968
|
String () { return "/plugins/lombok/testData/highlights"; }
|
getBasePath
|
11,969
|
InspectionProfileEntry () { return null; }
|
getInspection
|
11,970
|
String () { return super.getBasePath() + "/builderDefault"; }
|
getBasePath
|
11,971
|
void () { doTest(); }
|
testBuilderDefaultHighlighting
|
11,972
|
String () { return super.getBasePath() + "/staticConstructor"; }
|
getBasePath
|
11,973
|
void () { doTest(); }
|
testDataDto
|
11,974
|
void () { doTest(); }
|
testValueDto
|
11,975
|
String () { return super.getBasePath() + "/sneakyThrows"; }
|
getBasePath
|
11,976
|
void () { doTest(); }
|
testSneakThrowsDoesntCatchCaughtException
|
11,977
|
void () { doTest(); }
|
testSneakThrowsDoesntCatchCaughtExceptionNested
|
11,978
|
String () { return super.getBasePath() + "/with"; }
|
getBasePath
|
11,979
|
void () { doTest(); }
|
testWithOnRecord
|
11,980
|
void () { myFixture.configureByText(JavaFileType.INSTANCE, """ import lombok.Data; @Data<caret> public class ClassWithDataExtendsObject { private String str; } """); assertFalse("Annotate class by '@EqualsAndHashCode' QuickFix should NOT be present", hasActionWithText()); }
|
testClassWithDataExtendsObject
|
11,981
|
void () { myFixture.configureByText(JavaFileType.INSTANCE, """ static class SomeClassA { private int i; } @lombok.Data<caret> public class ClassWithDataExtendsAnotherClass extends SomeClassA { private String str; } """); assertTrue("Annotate class by '@EqualsAndHashCode' QuickFix should be present", hasActionWithText()); }
|
testClassWithDataExtendsAnotherClass
|
11,982
|
boolean () { myFixture.enableInspections(LombokInspection.class); final Editor editor = getEditor(); final PsiFile file = getFile(); CodeInsightTestFixtureImpl.instantiateAndRun(file, editor, new int[0], false); final List<IntentionAction> availableActions = CodeInsightTestFixtureImpl.getAvailableIntentions(editor, file); return ContainerUtil.exists(availableActions, action -> action.getText().contains("'@EqualsAndHashCode'")); }
|
hasActionWithText
|
11,983
|
String () { return super.getBasePath() + "/" + TEST_DATA_INSPECTION_DIRECTORY + "/synchronized"; }
|
getBasePath
|
11,984
|
InspectionProfileEntry () { return new LombokInspection(); }
|
getInspection
|
11,985
|
LightProjectDescriptor () { return LombokTestUtil.LOMBOK_NEW_DESCRIPTOR; }
|
getProjectDescriptor
|
11,986
|
void () { doTest(); }
|
testSynchronizedTest
|
11,987
|
void () { doTest(); }
|
testSynchronizedTypeErrors
|
11,988
|
String () { return PathManager.getCommunityHomePath() + "/plugins/lombok/testData"; }
|
getTestDataPath
|
11,989
|
String () { return "/inspection/lombokGetterMayBeUsed/" + getTestName(false) + ".java"; }
|
getFilePath
|
11,990
|
void () { doTest(getFilePath(), true, false); }
|
doTest
|
11,991
|
void () { doTest(); }
|
testNoLibrary
|
11,992
|
String () { return super.getBasePath() + "/" + TEST_DATA_INSPECTION_DIRECTORY + "/cleanup"; }
|
getBasePath
|
11,993
|
InspectionProfileEntry () { return new LombokInspection(); }
|
getInspection
|
11,994
|
void () { doTest(); }
|
testCleanupExample
|
11,995
|
void () { doTest(); }
|
testCleanupEmptyValue
|
11,996
|
void () { doTest(); }
|
testCleanupWithoutInitializer
|
11,997
|
void () { doTest(); }
|
testCleanupWrongElement
|
11,998
|
void () { doTest(); }
|
testCleanupWrongValue
|
11,999
|
LightProjectDescriptor () { return LombokTestUtil.LOMBOK_NEW_DESCRIPTOR; }
|
getProjectDescriptor
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.