Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
12,400
|
void () { doTest(); }
|
testValueSealedInterface
|
12,401
|
void (LocalInspectionTool inspection) { final HighlightDisplayKey displayKey = HighlightDisplayKey.find(inspection.getShortName()); final InspectionProfileImpl currentProfile = ProjectInspectionProfileManager.getInstance(getProject()).getCurrentProfile(); currentProfile.setErrorLevel(displayKey, HighlightDisplayLevel.WARNING, getProject()); }
|
setWarningLevel
|
12,402
|
LightProjectDescriptor () { return LombokTestUtil.LOMBOK_NEW_DESCRIPTOR; }
|
getProjectDescriptor
|
12,403
|
void () { doTest("/plugins/lombok/testData/highlighting/" + getTestName(false) + ".java", true, false); }
|
doTest
|
12,404
|
LightProjectDescriptor () { return LombokTestUtil.LOMBOK_DESCRIPTOR; }
|
getProjectDescriptor
|
12,405
|
void () { @Language("JAVA") final String text = """ @lombok.Builder public class Test { private int someInt; public static void main(String[] args) { Test test = Test.builder().someInt<caret>(1).build(); System.out.println(test); }}"""; PsiFile file = myFixture.addFileToProject("Test.java", text); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); PsiElement[] elements = ShowImplementationsTestUtil.getImplementations(); assertNotNull(elements); assertEquals(1, elements.length); assertTrue(elements[0] instanceof PsiField); final String newText = ImplementationViewComponent.getNewText(elements[0]); assertEquals(" private int someInt;", newText); }
|
testFromCompletionForBuilder
|
12,406
|
void (String[] args) { Test test = Test.builder().someInt<caret>(1).build(); System.out.println(test); }
|
main
|
12,407
|
void () { @Language("JAVA") final String text = """ @lombok.Data public class Test { private String someString; public static void main(String[] args) { Test test = new Test(); test.setSomeString<caret>("Hello")); }}"""; PsiFile file = myFixture.addFileToProject("Test.java", text); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); PsiElement[] elements = ShowImplementationsTestUtil.getImplementations(); assertNotNull(elements); assertEquals(1, elements.length); assertTrue(elements[0] instanceof PsiField); final String newText = ImplementationViewComponent.getNewText(elements[0]); assertEquals(" private String someString;", newText); }
|
testFromCompletionForData
|
12,408
|
void (String[] args) { Test test = new Test(); test.setSomeString<caret>("Hello")); }
|
main
|
12,409
|
boolean (@Nullable String currentVersion, @Nullable String otherVersion) { try { return StringUtil.compareVersionNumbers(currentVersion, otherVersion) < 0; } catch (NumberFormatException e) { Logger.getInstance(Version.class).info("Unable to parse lombok version: " + currentVersion); return false; } }
|
isLessThan
|
12,410
|
String (@Nullable OrderEntry orderEntry) { String result = null; if (orderEntry != null) { final String presentableName = orderEntry.getPresentableName(); final Matcher matcher = VERSION_PATTERN.matcher(presentableName); if (matcher.find()) { result = matcher.group(2); } } return result; }
|
parseLombokVersion
|
12,411
|
String (@NotNull PsiAnnotation psiAnnotation) { return getLevelVisibility(psiAnnotation, "value"); }
|
getMethodModifier
|
12,412
|
String (@NotNull PsiAnnotation psiAnnotation) { return getLevelVisibility(psiAnnotation, "access"); }
|
getAccessVisibility
|
12,413
|
String (@NotNull PsiAnnotation psiAnnotation) { return getLevelVisibility(psiAnnotation, "level"); }
|
getLevelVisibility
|
12,414
|
String (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameter) { return convertAccessLevelToJavaModifier(PsiAnnotationUtil.getEnumAnnotationValue(psiAnnotation, parameter, ACCESS_LEVEL_PUBLIC)); }
|
getLevelVisibility
|
12,415
|
String (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameter) { final String annotationValue = PsiAnnotationUtil.getEnumAnnotationValue(psiAnnotation, parameter, NULL_DEFAULT); return NULL_DEFAULT.equals(annotationValue) ? null : VALUE_ACCESS_LEVEL_MAP.get(annotationValue); }
|
getAccessLevel
|
12,416
|
boolean (@NotNull PsiAnnotation psiAnnotation) { return null != getLevelVisibility(psiAnnotation); }
|
isLevelVisible
|
12,417
|
Iterable<String> (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameterName) { Collection<String> oldOnX = getOldOnX(psiAnnotation, parameterName); Collection<String> newOnX = getNewOnX(psiAnnotation, parameterName + "_"); return ContainerUtil.concat(oldOnX, newOnX); }
|
getOnX
|
12,418
|
Collection<String> (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameterName) { PsiAnnotationMemberValue onXValue = psiAnnotation.hasAttribute(parameterName) ? psiAnnotation.findAttributeValue(parameterName) : null; if (!(onXValue instanceof PsiAnnotation)) { return Collections.emptyList(); } Collection<PsiAnnotation> annotations = PsiAnnotationUtil.getAnnotationValues((PsiAnnotation)onXValue, "value", PsiAnnotation.class); return collectAnnotationStrings(annotations); }
|
getOldOnX
|
12,419
|
Collection<String> (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameterName) { if (psiAnnotation.hasAttribute(parameterName)) { final Collection<PsiAnnotation> annotations = PsiAnnotationUtil.getAnnotationValues(psiAnnotation, parameterName, PsiAnnotation.class); return collectAnnotationStrings(annotations); } return Collections.emptyList(); }
|
getNewOnX
|
12,420
|
Collection<String> (Collection<PsiAnnotation> annotations) { Collection<String> annotationStrings = new ArrayList<>(); for (PsiAnnotation annotation : annotations) { final String annotationQualifiedName = annotation.getQualifiedName(); if (!StringUtil.isEmptyOrSpaces(annotationQualifiedName)) { PsiAnnotationParameterList params = annotation.getParameterList(); annotationStrings.add(annotationQualifiedName + params.getText()); } } return annotationStrings; }
|
collectAnnotationStrings
|
12,421
|
String (String value) { if (null == value || value.isEmpty()) { return PsiModifier.PUBLIC; } if (ACCESS_LEVEL_MODULE.equals(value)) { return PsiModifier.PACKAGE_LOCAL; } if (ACCESS_LEVEL_NONE.equals(value)) { return null; } return VALUE_ACCESS_LEVEL_MAP.get(value); }
|
convertAccessLevelToJavaModifier
|
12,422
|
PsiAnnotation (@NotNull PsiModifierListOwner psiModifierListOwner, String annotationClassName) { Optional<String> value = convertModifierToLombokAccessLevel(psiModifierListOwner); return PsiAnnotationUtil.createPsiAnnotation(psiModifierListOwner, value.orElse(""), annotationClassName); }
|
createAnnotationWithAccessLevel
|
12,423
|
Optional<String> (@NotNull PsiModifierListOwner psiModifierListOwner) { final PsiModifierList modifierList = psiModifierListOwner.getModifierList(); if (null != modifierList) { final int accessLevelCode = PsiUtil.getAccessLevel(modifierList); final String accessLevel = ACCESS_LEVEL_MAP.get(accessLevelCode); if (null != accessLevel && !ACCESS_LEVEL_PUBLIC.equals(accessLevel)) { return Optional.of(LombokClassNames.ACCESS_LEVEL + "." + accessLevel); } } return Optional.empty(); }
|
convertModifierToLombokAccessLevel
|
12,424
|
boolean (@NotNull Collection<PsiMethod> classMethods, @NotNull String methodName, int paramCount) { return classMethods.stream() .filter(m -> methodName.equals(m.getName())) .anyMatch(m -> acceptedParameterCount(m, paramCount)); }
|
hasMethodByName
|
12,425
|
boolean (@NotNull Collection<PsiMethod> classMethods, @NotNull String methodName, int paramCount) { return classMethods.stream() .filter(m -> methodName.equalsIgnoreCase(m.getName())) .anyMatch(m -> acceptedParameterCount(m, paramCount)); }
|
hasSimilarMethod
|
12,426
|
boolean (@NotNull PsiMethod classMethod, int methodArgCount) { int minArgs = classMethod.getParameterList().getParametersCount(); int maxArgs = minArgs; if (classMethod.isVarArgs()) { minArgs--; maxArgs = Integer.MAX_VALUE; } return !(methodArgCount < minArgs || methodArgCount > maxArgs); }
|
acceptedParameterCount
|
12,427
|
Collection<PsiMethod> (@NotNull PsiClass psiClass) { if (psiClass instanceof PsiExtensibleClass) { return new ArrayList<>(((PsiExtensibleClass) psiClass).getOwnMethods()); } else { return filterPsiElements(psiClass, PsiMethod.class); } }
|
collectClassMethodsIntern
|
12,428
|
Collection<PsiField> (@NotNull PsiClass psiClass) { if (psiClass instanceof PsiExtensibleClass) { return ((PsiExtensibleClass) psiClass).getOwnFields(); } else { return filterPsiElements(psiClass, PsiField.class); } }
|
collectClassFieldsIntern
|
12,429
|
Collection<PsiClass> (@NotNull PsiClass psiClass) { if (psiClass instanceof PsiExtensibleClass) { return ((PsiExtensibleClass) psiClass).getOwnInnerClasses(); } else { return filterPsiElements(psiClass, PsiClass.class); } }
|
collectInnerClassesIntern
|
12,430
|
Collection<PsiMember> (@NotNull PsiClass psiClass) { return Arrays.stream(psiClass.getChildren()).filter(e -> e instanceof PsiField || e instanceof PsiMethod).map(PsiMember.class::cast).collect(Collectors.toList()); }
|
collectClassMemberIntern
|
12,431
|
Collection<PsiMethod> (@NotNull PsiClass psiClass) { final Collection<PsiMethod> psiMethods = collectClassMethodsIntern(psiClass); return ContainerUtil.filter(psiMethods, PsiMethod::isConstructor); }
|
collectClassConstructorIntern
|
12,432
|
Collection<PsiMethod> (@NotNull PsiClass psiClass) { final Collection<PsiMethod> psiMethods = collectClassMethodsIntern(psiClass); return ContainerUtil.filter(psiMethods, psiMethod -> psiMethod.hasModifierProperty(PsiModifier.STATIC)); }
|
collectClassStaticMethodsIntern
|
12,433
|
boolean (@NotNull final PsiClass psiClass) { final PsiClass superClass = psiClass.getSuperClass(); return (null != superClass && !CommonClassNames.JAVA_LANG_OBJECT.equals(superClass.getQualifiedName()) || !superTypesIsEmptyOrObjectOnly(psiClass)); }
|
hasSuperClass
|
12,434
|
boolean (@NotNull final PsiClass psiClass) { // It returns abstract classes, but also Object. final PsiClassType[] superTypes = psiClass.getSuperTypes(); return superTypes.length != 1 || CommonClassNames.JAVA_LANG_OBJECT.equals(superTypes[0].getCanonicalText()); }
|
superTypesIsEmptyOrObjectOnly
|
12,435
|
PsiClassType (@NotNull PsiClass psiClass) { final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(psiClass.getProject()); if (psiClass.hasTypeParameters()) { PsiType[] wildcardTypes = new PsiType[psiClass.getTypeParameters().length]; Arrays.fill(wildcardTypes, PsiWildcardType.createUnbounded(psiClass.getManager())); return elementFactory.createType(psiClass, wildcardTypes); } return elementFactory.createType(psiClass); }
|
getWildcardClassType
|
12,436
|
PsiClassType (@NotNull PsiClass psiClass) { final PsiElementFactory factory = JavaPsiFacade.getElementFactory(psiClass.getProject()); if (psiClass.hasTypeParameters()) { final PsiType[] psiTypes = Stream.of(psiClass.getTypeParameters()).map(factory::createType).toArray(PsiType[]::new); return factory.createType(psiClass, psiTypes); } else { return factory.createType(psiClass); } }
|
getTypeWithGenerics
|
12,437
|
Optional<PsiClass> (@NotNull PsiClass psiClass, @NotNull String className) { Collection<PsiClass> innerClasses = collectInnerClassesIntern(psiClass); return innerClasses.stream().filter(innerClass -> className.equals(innerClass.getName())).findAny(); }
|
getInnerClassInternByName
|
12,438
|
Collection<String> (Collection<? extends PsiMember> psiMembers) { return psiMembers.stream().map(PsiMember::getName).collect(Collectors.toSet()); }
|
getNames
|
12,439
|
PsiType (@NotNull PsiType psiType, @NotNull PsiManager psiManager) { return extractOneElementType(psiType, psiManager, CommonClassNames.JAVA_LANG_ITERABLE, 0); }
|
extractOneElementType
|
12,440
|
PsiType (@NotNull PsiType psiType, @NotNull PsiManager psiManager, final String superClass, final int paramIndex) { PsiType oneElementType = substituteTypeParameter(psiType, superClass, paramIndex); if (null == oneElementType) { oneElementType = getJavaLangObject(psiManager); } return oneElementType; }
|
extractOneElementType
|
12,441
|
PsiType (@NotNull PsiType psiType, String superClass, int paramIndex) { PsiType oneElementType = PsiUtil.substituteTypeParameter(psiType, superClass, paramIndex, true); if (oneElementType instanceof PsiWildcardType) { oneElementType = ((PsiWildcardType) oneElementType).getBound(); } return oneElementType; }
|
substituteTypeParameter
|
12,442
|
PsiType (@NotNull PsiType psiType, @NotNull PsiManager psiManager) { return extractAllElementType(psiType, psiManager, CommonClassNames.JAVA_LANG_ITERABLE, 0); }
|
extractAllElementType
|
12,443
|
PsiType (@NotNull PsiType psiType, @NotNull PsiManager psiManager, final String superClass, final int paramIndex) { PsiType oneElementType = substituteTypeParameter(psiType, superClass, paramIndex); if (null == oneElementType || Comparing.equal(getJavaLangObject(psiManager), oneElementType)) { return PsiWildcardType.createUnbounded(psiManager); } else { return PsiWildcardType.createExtends(psiManager, oneElementType); } }
|
extractAllElementType
|
12,444
|
PsiClassType (@NotNull PsiManager psiManager) { return PsiType.getJavaLangObject(psiManager, GlobalSearchScope.allScope(psiManager.getProject())); }
|
getJavaLangObject
|
12,445
|
PsiType (@NotNull PsiManager psiManager, final String collectionQualifiedName, PsiType @NotNull... psiTypes) { final Project project = psiManager.getProject(); final GlobalSearchScope globalsearchscope = GlobalSearchScope.allScope(project); final JavaPsiFacade facade = JavaPsiFacade.getInstance(project); final PsiClass genericClass = facade.findClass(collectionQualifiedName, globalsearchscope); if (null != genericClass) { return JavaPsiFacade.getElementFactory(project).createType(genericClass, psiTypes); } else { return getJavaLangObject(psiManager); } }
|
createCollectionType
|
12,446
|
String (@NotNull PsiType psiType) { final PsiClass psiFieldClass = PsiUtil.resolveClassInType(psiType); return psiFieldClass != null ? psiFieldClass.getQualifiedName() : null; }
|
getQualifiedName
|
12,447
|
boolean (@NotNull Project project) { if (project.isDefault() || !project.isInitialized()) { return false; } ThreadingAssertions.assertReadAccess(); return JavaLibraryUtil.hasLibraryJar(project, "org.projectlombok:lombok") || detectLombokJarsSlow(project); }
|
hasLombokLibrary
|
12,448
|
boolean (@Nullable Module module) { return JavaLibraryUtil.hasLibraryClass(module, LombokClassNames.GETTER); }
|
hasLombokClasses
|
12,449
|
boolean (Project project) { // it is required for JARs attached directly from disk // or via build systems that do not supply Maven coordinates properly via LibraryWithMavenCoordinatesProperties return CachedValuesManager.getManager(project).getCachedValue(project, () -> { OrderEnumerator orderEnumerator = OrderEnumerator.orderEntries(project); Ref<Boolean> exists = new Ref<>(false); orderEnumerator.recursively() .forEachLibrary(library -> { VirtualFile[] libraryFiles = library.getFiles(OrderRootType.CLASSES); JarFileSystem jarFileSystem = JarFileSystem.getInstance(); for (VirtualFile libraryFile : libraryFiles) { if (libraryFile.getFileSystem() != jarFileSystem) continue; // look into every JAR for top level package entry if (libraryFile.findChild("lombok") != null) { exists.set(true); return false; } } return true; }); return Result.create(exists.get(), ProjectRootManager.getInstance(project)); }); }
|
detectLombokJarsSlow
|
12,450
|
String (@NotNull Project project) { return CachedValuesManager.getManager(project).getCachedValue(project, () -> { String lombokVersion = null; try { lombokVersion = ReadAction.nonBlocking(() -> getLombokVersionInternal(project)).executeSynchronously(); } catch (ProcessCanceledException e) { throw e; } catch (Throwable e) { Logger.getInstance(LombokLibraryUtil.class).error(e); } return new Result<>(StringUtil.notNullize(lombokVersion), ProjectRootManager.getInstance(project)); }); }
|
getLombokVersionCached
|
12,451
|
PsiAnnotation (@NotNull PsiModifierListOwner psiModifierListOwner, String annotationClassName) { return createPsiAnnotation(psiModifierListOwner, "", annotationClassName); }
|
createPsiAnnotation
|
12,452
|
PsiAnnotation (@NotNull PsiModifierListOwner psiModifierListOwner, @Nullable String value, String annotationClassName) { final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(psiModifierListOwner.getProject()); final PsiClass psiClass = PsiTreeUtil.getParentOfType(psiModifierListOwner, PsiClass.class); final String valueString = StringUtil.isNotEmpty(value) ? "(" + value + ")" : ""; return elementFactory.createAnnotationFromText("@" + annotationClassName + valueString, psiClass); }
|
createPsiAnnotation
|
12,453
|
boolean (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameter) { return null != psiAnnotation.findDeclaredAttributeValue(parameter); }
|
hasDeclaredProperty
|
12,454
|
boolean (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameter, boolean defaultValue) { final Boolean result = psiAnnotation.hasAttribute(parameter) ? AnnotationUtil.getBooleanAttributeValue(psiAnnotation, parameter) : null; return result == null ? defaultValue : result; }
|
getBooleanAnnotationValue
|
12,455
|
String (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameter, @NotNull String defaultValue) { final String result = AnnotationUtil.getDeclaredStringAttributeValue(psiAnnotation, parameter); return result != null ? result : defaultValue; }
|
getStringAnnotationValue
|
12,456
|
String (@NotNull PsiAnnotation psiAnnotation, @NotNull String attributeName, @NotNull String defaultValue) { PsiAnnotationMemberValue attrValue = psiAnnotation.findDeclaredAttributeValue(attributeName); String result = attrValue != null ? resolveElementValue(attrValue, String.class) : null; return result != null ? result : defaultValue; }
|
getEnumAnnotationValue
|
12,457
|
int (@NotNull PsiAnnotation psiAnnotation, @NotNull String attributeName, int defaultValue) { PsiAnnotationMemberValue attrValue = psiAnnotation.findDeclaredAttributeValue(attributeName); PsiConstantEvaluationHelper evaluationHelper = JavaPsiFacade.getInstance(psiAnnotation.getProject()).getConstantEvaluationHelper(); Object result = evaluationHelper.computeConstantExpression(attrValue); return result instanceof Number ? ((Number) result).intValue() : defaultValue; }
|
getIntAnnotationValue
|
12,458
|
Boolean (@NotNull PsiAnnotation psiAnnotation, @NotNull String parameter) { PsiAnnotationMemberValue attributeValue = psiAnnotation.findDeclaredAttributeValue(parameter); final JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(psiAnnotation.getProject()); Object constValue = javaPsiFacade.getConstantEvaluationHelper().computeConstantExpression(attributeValue); return constValue instanceof Boolean ? (Boolean) constValue : null; }
|
getDeclaredBooleanAnnotationValue
|
12,459
|
PsiAnnotation (@NotNull PsiModifierListOwner psiModifierListOwner, @NotNull String annotationFQN) { return psiModifierListOwner.getAnnotation(annotationFQN); }
|
findAnnotation
|
12,460
|
PsiAnnotation (@NotNull PsiModifierListOwner psiModifierListOwner, String @NotNull ... annotationFQNs) { for (String annotationFQN : annotationFQNs) { PsiAnnotation annotation = psiModifierListOwner.getAnnotation(annotationFQN); if (annotation != null) { return annotation; } } return null; }
|
findAnnotation
|
12,461
|
boolean (@NotNull PsiModifierListOwner psiModifierListOwner, @NotNull String annotationFQN) { return psiModifierListOwner.hasAnnotation(annotationFQN); }
|
isAnnotatedWith
|
12,462
|
boolean (@NotNull PsiModifierListOwner psiModifierListOwner, String annotationTypeName) { return !isAnnotatedWith(psiModifierListOwner, annotationTypeName); }
|
isNotAnnotatedWith
|
12,463
|
boolean (@NotNull PsiModifierListOwner psiModifierListOwner, String @NotNull ... annotationTypes) { return null != findAnnotation(psiModifierListOwner, annotationTypes); }
|
isAnnotatedWith
|
12,464
|
boolean (@NotNull PsiModifierListOwner psiModifierListOwner, String @NotNull ... annotationTypes) { return !isAnnotatedWith(psiModifierListOwner, annotationTypes); }
|
isNotAnnotatedWith
|
12,465
|
List<PsiAnnotation> (@NotNull PsiModifierListOwner listOwner, @NotNull Collection<String> annotationNames) { if (annotationNames.isEmpty()) { return Collections.emptyList(); } List<PsiAnnotation> result = new ArrayList<>(); for (PsiAnnotation annotation : listOwner.getAnnotations()) { if (ContainerUtil.exists(annotationNames, annotation::hasQualifiedName)) { result.add(annotation); } } return result; }
|
findAllAnnotations
|
12,466
|
String (@NotNull PsiAnnotation psiAnnotation) { PsiJavaCodeReferenceElement referenceElement = psiAnnotation.getNameReferenceElement(); return StringUtil.notNullize(null == referenceElement ? null : referenceElement.getReferenceName()); }
|
getShortNameOf
|
12,467
|
boolean (@NotNull PsiModifierListOwner modifierListOwner, @NotNull Collection<String> annotationNames) { for (PsiAnnotation psiAnnotation : modifierListOwner.getAnnotations()) { final String shortName = getShortNameOf(psiAnnotation); if (annotationNames.contains(shortName)) { return true; } } return false; }
|
checkAnnotationsSimpleNameExistsIn
|
12,468
|
PsiAnnotation (@NotNull PsiModifierListOwner psiModifierListOwner, String @NotNull ... annotationFQNs) { if (annotationFQNs.length > 0) { Collection<String> possibleShortNames = ContainerUtil.map(annotationFQNs, StringUtil::getShortName); for (PsiAnnotation psiAnnotation : psiModifierListOwner.getAnnotations()) { String shortNameOfAnnotation = getShortNameOf(psiAnnotation); if(possibleShortNames.contains(shortNameOfAnnotation)) { return psiAnnotation; } } } return null; }
|
findAnnotationByShortNameOnly
|
12,469
|
boolean (@NotNull PsiAnnotation psiAnnotation, String @NotNull ... annotationFQNs) { return ContainerUtil.or(annotationFQNs, psiAnnotation::hasQualifiedName); }
|
checkAnnotationHasOneOfFQNs
|
12,470
|
boolean ( @NotNull PsiMethod method, @NonNls @Nullable String containingClassName, @Nullable PsiType returnType, @NonNls @Nullable String methodName, @Nullable List<PsiType> parameterTypes) { final String name = method.getName(); if (methodName != null && !methodName.equals(name)) { return false; } if (parameterTypes != null) { final PsiParameterList parameterList = method.getParameterList(); if (parameterList.getParametersCount() != parameterTypes.size()) { return false; } final PsiParameter[] parameters = parameterList.getParameters(); for (int i = 0; i < parameters.length; i++) { final PsiType type = parameters[i].getType(); final PsiType parameterType = parameterTypes.get(i); if (PsiTypes.nullType().equals(parameterType)) { continue; } if (parameterType != null && !typesAreEquivalent(type, parameterType)) { return false; } } } if (returnType != null) { final PsiType methodReturnType = method.getReturnType(); if (!typesAreEquivalent(returnType, methodReturnType)) { return false; } } if (containingClassName != null) { final PsiClass containingClass = method.getContainingClass(); return InheritanceUtil.isInheritor(containingClass, containingClassName); } return true; }
|
methodMatches
|
12,471
|
boolean ( @Nullable PsiType type1, @Nullable PsiType type2) { if (type1 == null) { return type2 == null; } if (type2 == null) { return false; } final String type1Text = type1.getCanonicalText(); final String type2Text = type2.getCanonicalText(); return type1Text.equals(type2Text); }
|
typesAreEquivalent
|
12,472
|
List<String> () { if(!ReadAction.nonBlocking(() -> LombokLibraryUtil.hasLombokLibrary(myProject)).executeSynchronously()) { return Collections.emptyList(); } List<String> result = new ArrayList<>(); final String lombokVersion = LombokLibraryUtil.getLombokVersionCached(myProject); if (ProjectSettings.isEnabled(myProject, ProjectSettings.IS_LOMBOK_JPS_FIX_ENABLED) && Version.isLessThan(lombokVersion, Version.LAST_LOMBOK_VERSION_WITH_JPS_FIX)) { result.add("-Djps.track.ap.dependencies=false"); } return result; }
|
getVMArguments
|
12,473
|
boolean (@Nullable String annotationFQN, @NotNull String annotationParameterName) { return LombokClassNames.ACCESSORS.equals(annotationFQN) || LombokClassNames.EQUALS_AND_HASHCODE.equals(annotationFQN) && ("callSuper".equals(annotationParameterName) || "of".equals(annotationParameterName)); }
|
ignoreAnnotationParam
|
12,474
|
Set<String> (@NotNull PsiModifierList modifierList, @NotNull final Set<String> modifiers) { // skip if no lombok library is present if (!hasLombokLibrary(modifierList.getProject())) { return modifiers; } // make copy of original modifiers Set<String> result = new HashSet<>(modifiers); // Loop through all available processors and give all of them a chance to respond for (ModifierProcessor processor : Holder.modifierProcessors) { if (processor.isSupported(modifierList)) { processor.transformModifiers(modifierList, result); } } return result; }
|
transformModifiers
|
12,475
|
boolean (@NotNull PsiTypeElement typeElement) { return hasLombokLibrary(typeElement.getProject()) && ValProcessor.canInferType(typeElement); }
|
canInferType
|
12,476
|
boolean (@NotNull PsiField field) { return PsiAnnotationSearchUtil.isAnnotatedWith(field, LombokClassNames.BUILDER_DEFAULT); }
|
fieldInitializerMightBeChanged
|
12,477
|
PsiType (@NotNull PsiTypeElement typeElement) { return hasLombokLibrary(typeElement.getProject()) ? ValProcessor.inferType(typeElement) : null; }
|
inferType
|
12,478
|
List<PsiExtensionMethod> (@NotNull PsiClass aClass, @NotNull String nameHint, @NotNull PsiElement context) { if (!hasLombokLibrary(context.getProject())) { return Collections.emptyList(); } return ExtensionMethodsHelper.getExtensionMethods(aClass, nameHint, context); }
|
getExtensionMethods
|
12,479
|
boolean (@NotNull PsiElement element) { return checkUsage(element, EnumSet.of(LombokPsiElementUsage.READ, LombokPsiElementUsage.WRITE, LombokPsiElementUsage.READ_WRITE)); }
|
isImplicitUsage
|
12,480
|
boolean (@NotNull PsiElement element) { return checkUsage(element, EnumSet.of(LombokPsiElementUsage.READ, LombokPsiElementUsage.READ_WRITE)); }
|
isImplicitRead
|
12,481
|
boolean (@NotNull PsiElement element) { return checkUsage(element, EnumSet.of(LombokPsiElementUsage.WRITE, LombokPsiElementUsage.READ_WRITE)); }
|
isImplicitWrite
|
12,482
|
boolean (@NotNull PsiElement element, EnumSet<LombokPsiElementUsage> elementUsages) { if (element instanceof PsiField psiField) { if (isUsedByLombokAnnotations(psiField, psiField, elementUsages) || isUsedByLombokAnnotations(psiField, psiField.getContainingClass(), elementUsages)) { return true; } } return false; }
|
checkUsage
|
12,483
|
boolean (@NotNull PsiField psiField, @Nullable PsiModifierListOwner modifierListOwner, EnumSet<LombokPsiElementUsage> elementUsages) { if (null != modifierListOwner) { for (PsiAnnotation psiAnnotation : modifierListOwner.getAnnotations()) { for (Processor processor : LombokProcessorManager.getProcessors(psiAnnotation)) { final LombokPsiElementUsage psiElementUsage = processor.checkFieldUsage(psiField, psiAnnotation); if (elementUsages.contains(psiElementUsage)) { return true; } } } } return false; }
|
isUsedByLombokAnnotations
|
12,484
|
List<String> (@NotNull Nullability nullability) { if (nullability == Nullability.NOT_NULL) { return Collections.singletonList("lombok.NonNull"); } return Collections.emptyList(); }
|
getNullabilityAnnotations
|
12,485
|
void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) { PsiElement psiElement = parameters.getPosition().getParent(); if (psiElement instanceof LombokConfigProperty) { final String configPropertyKey = StringUtil.notNullize(LombokConfigPsiUtil.getKey((LombokConfigProperty)psiElement)); if (booleanOptions.contains(configPropertyKey)) { resultSet.addElement(LookupElementBuilder.create("true")); resultSet.addElement(LookupElementBuilder.create("false")); } else if (flagUsageOptions.contains(configPropertyKey)) { resultSet.addElement(LookupElementBuilder.create("WARNING")); resultSet.addElement(LookupElementBuilder.create("ERROR")); } else if (flagUsageAllowable.contains(configPropertyKey)) { resultSet.addElement(LookupElementBuilder.create("ALLOW")); resultSet.addElement(LookupElementBuilder.create("WARNING")); } else if (LOMBOK_EQUALS_AND_HASH_CODE_CALL_SUPER.equals(configPropertyKey) || LOMBOK_TOSTRING_CALL_SUPER.equals(configPropertyKey)) { resultSet.addElement(LookupElementBuilder.create("CALL")); resultSet.addElement(LookupElementBuilder.create("SKIP")); resultSet.addElement(LookupElementBuilder.create("WARN")); } else if (LOMBOK_ACCESSORS_JAVA_BEANS_SPEC_CAPITALIZATION.equals(configPropertyKey)) { resultSet.addElement(LookupElementBuilder.create("BASIC")); resultSet.addElement(LookupElementBuilder.create("BEANSPEC")); } else if (LOMBOK_ADD_NULL_ANNOTATIONS.equals(configPropertyKey)) { for (LombokNullAnnotationLibraryDefned library : LombokNullAnnotationLibraryDefned.values()) { resultSet.addElement(LookupElementBuilder.create(library.getKey())); } resultSet.addElement(LookupElementBuilder.create("CUSTOM:[TYPE_USE:]nonnull.annotation.type:nullable.annotation.type")); } } }
|
addCompletions
|
12,486
|
void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) { for (String contribution : allOptions) { resultSet.addElement(LookupElementBuilder.create(contribution)); } }
|
addCompletions
|
12,487
|
Lexer (Project project) { return new LombokConfigLexerAdapter(); }
|
createLexer
|
12,488
|
TokenSet () { return LombokConfigParserTokenSets.COMMENTS; }
|
getCommentTokens
|
12,489
|
TokenSet () { return TokenSet.EMPTY; }
|
getStringLiteralElements
|
12,490
|
PsiParser (final Project project) { return new LombokConfigParser(); }
|
createParser
|
12,491
|
IFileElementType () { return FILE; }
|
getFileNodeType
|
12,492
|
PsiFile (@NotNull FileViewProvider viewProvider) { return new LombokConfigFile(viewProvider); }
|
createFile
|
12,493
|
PsiElement (ASTNode node) { return LombokConfigTypes.Factory.createElement(node); }
|
createElement
|
12,494
|
String () { return "#"; }
|
getLineCommentPrefix
|
12,495
|
String () { return ""; }
|
getBlockCommentPrefix
|
12,496
|
String () { return null; }
|
getBlockCommentSuffix
|
12,497
|
String () { return null; }
|
getCommentedBlockCommentPrefix
|
12,498
|
String () { return null; }
|
getCommentedBlockCommentSuffix
|
12,499
|
Lexer () { return new LombokConfigLexerAdapter(); }
|
getHighlightingLexer
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.