Skip to content

Commit cbf71a3

Browse files
authored
Minor term renaming (primary creator -> default creator) in var names, comments (#4739)
1 parent fb79454 commit cbf71a3

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -656,22 +656,22 @@ protected void _addCreators(Map<String, POJOPropertyBuilder> props)
656656
List<PotentialCreator> constructors = _collectCreators(_classDef.getConstructors());
657657
List<PotentialCreator> factories = _collectCreators(_classDef.getFactoryMethods());
658658

659-
// Then find what is the Primary Constructor (if one exists for type):
659+
// Then find what is the Default Constructor (if one exists for type):
660660
// for Java Records and potentially other types too ("data classes"):
661661
// Needs to be done early to get implicit names populated
662-
final PotentialCreator primary;
662+
final PotentialCreator defaultCreator;
663663
if (_isRecordType) {
664-
primary = JDK14Util.findCanonicalRecordConstructor(_config, _classDef, constructors);
664+
defaultCreator = JDK14Util.findCanonicalRecordConstructor(_config, _classDef, constructors);
665665
} else {
666-
primary = _annotationIntrospector.findDefaultCreator(_config, _classDef,
666+
defaultCreator = _annotationIntrospector.findDefaultCreator(_config, _classDef,
667667
constructors, factories);
668668
}
669669
// Next: remove creators marked as explicitly disabled
670670
_removeDisabledCreators(constructors);
671671
_removeDisabledCreators(factories);
672672

673673
// And then remove non-annotated static methods that do not look like factories
674-
_removeNonFactoryStaticMethods(factories, primary);
674+
_removeNonFactoryStaticMethods(factories, defaultCreator);
675675

676676
// and use annotations to find explicitly chosen Creators
677677
if (_useAnnotations) { // can't have explicit ones without Annotation introspection
@@ -686,21 +686,21 @@ protected void _addCreators(Map<String, POJOPropertyBuilder> props)
686686
// for ones with explicitly-named ({@code @JsonProperty}) parameters
687687
if (!creators.hasPropertiesBased()) {
688688
// only discover constructor Creators?
689-
_addCreatorsWithAnnotatedNames(creators, constructors, primary);
689+
_addCreatorsWithAnnotatedNames(creators, constructors, defaultCreator);
690690
}
691691

692692
// But if no annotation-based Creators found, find/use Primary Creator
693693
// detected earlier, if any
694-
if (primary != null) {
694+
if (defaultCreator != null) {
695695
if (!creators.hasPropertiesBased()) {
696696
// ... but only process if still included as a candidate
697-
if (constructors.remove(primary)
698-
|| factories.remove(primary)) {
697+
if (constructors.remove(defaultCreator)
698+
|| factories.remove(defaultCreator)) {
699699
// But wait! Could be delegating
700-
if (_isDelegatingConstructor(primary)) {
701-
creators.addExplicitDelegating(primary);
700+
if (_isDelegatingConstructor(defaultCreator)) {
701+
creators.addExplicitDelegating(defaultCreator);
702702
} else {
703-
creators.setPropertiesBased(_config, primary, "Primary");
703+
creators.setPropertiesBased(_config, defaultCreator, "Primary");
704704
}
705705
}
706706
}
@@ -799,7 +799,7 @@ private void _removeNonVisibleCreators(List<PotentialCreator> ctors)
799799
}
800800

801801
private void _removeNonFactoryStaticMethods(List<PotentialCreator> ctors,
802-
PotentialCreator canonical)
802+
PotentialCreator defaultCreator)
803803
{
804804
final Class<?> rawType = _type.getRawClass();
805805
Iterator<PotentialCreator> it = ctors.iterator();
@@ -810,7 +810,7 @@ private void _removeNonFactoryStaticMethods(List<PotentialCreator> ctors,
810810
continue;
811811
}
812812
// Do not trim canonical either
813-
if (canonical == ctor) {
813+
if (defaultCreator == ctor) {
814814
continue;
815815
}
816816
// Copied from `BasicBeanDescription.isFactoryMethod()`

0 commit comments

Comments
 (0)