Skip to content

Commit 1af5bed

Browse files
committed
Minor javadoc improvement wrt #5063
1 parent 470f4e9 commit 1af5bed

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/main/java/com/fasterxml/jackson/databind/Module.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public abstract class Module
5353
* instances are considered to be of same type, for purpose of preventing
5454
* multiple registrations of "same type of" module
5555
* (see {@link com.fasterxml.jackson.databind.MapperFeature#IGNORE_DUPLICATE_MODULE_REGISTRATIONS})
56-
* If `null` is returned, every instance is considered unique.
56+
* If {@code null} is returned, every instance is considered unique.
5757
* If non-null value is returned, equality of id Objects is used to check whether
5858
* modules should be considered to be "of same type"
5959
*<p>

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ protected ObjectMapper(ObjectMapper src, JsonFactory factory)
658658
if (reg == null) {
659659
_registeredModuleTypes = null;
660660
} else {
661-
_registeredModuleTypes = new LinkedHashSet<Object>(reg);
661+
_registeredModuleTypes = new LinkedHashSet<>(reg);
662662
}
663663
}
664664

@@ -896,7 +896,7 @@ public ObjectMapper registerModule(Module module)
896896
if (_registeredModuleTypes == null) {
897897
// plus let's keep them in order too, easier to debug or expose
898898
// in registration order if that matter
899-
_registeredModuleTypes = new LinkedHashSet<Object>();
899+
_registeredModuleTypes = new LinkedHashSet<>();
900900
}
901901
// try adding; if already had it, should skip
902902
if (!_registeredModuleTypes.add(typeId)) {

src/main/java/com/fasterxml/jackson/databind/module/SimpleModule.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,28 @@
1515
import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
1616

1717
/**
18-
* Vanilla {@link com.fasterxml.jackson.databind.Module} implementation that allows registration
19-
* of serializers and deserializers, bean serializer
18+
* Simple {@link com.fasterxml.jackson.databind.Module} implementation that allows
19+
* registration of serializers and deserializers, serializer
2020
* and deserializer modifiers, registration of subtypes and mix-ins
2121
* as well as some other commonly
2222
* needed aspects (addition of custom {@link AbstractTypeResolver}s,
2323
* {@link com.fasterxml.jackson.databind.deser.ValueInstantiator}s).
2424
* <p>
2525
* NOTE: that [de]serializers are registered as "default" [de]serializers.
2626
* As a result, they will have lower priority than the ones indicated through annotations on
27-
* both Class and property-associated annotations -- for example,
27+
* both {@code Class} and property-associated annotations -- for example,
2828
* {@link com.fasterxml.jackson.databind.annotation.JsonDeserialize}.<br>
29-
* In cases where both module-based [de]serializers and annotation-based [de]serializers are registered,
30-
* the [de]serializer specified by the annotation will take precedence.
29+
* In cases where both module-based [de]serializers and annotation-based
30+
* [de]serializers are registered, the [de]serializer specified by annotations
31+
* will take precedence.
3132
*<p>
3233
* NOTE: although it is not expected that sub-types should need to
3334
* override {@link #setupModule(SetupContext)} method, if they choose
3435
* to do so they MUST call {@code super.setupModule(context);}
3536
* to ensure that registration works as expected.
3637
*<p>
3738
* WARNING: when registering {@link JsonSerializer}s and {@link JsonDeserializer}s,
38-
* only type erased {@code Class} is compared: this means that usually you should
39+
* only type-erased {@code Class} is compared: this means that usually you should
3940
* NOT use this implementation for registering structured types such as
4041
* {@link java.util.Collection}s or {@link java.util.Map}s: this because parametric
4142
* type information will not be considered and you may end up having "wrong" handler
@@ -229,7 +230,7 @@ public SimpleModule(String name, Version version,
229230
@Override
230231
public Object getTypeId()
231232
{
232-
// 07-Jun-2021, tatu: [databind#3110] Return Type Id if name was
233+
// 07-Jun-2021, tatu: [databind#3110] Return name as Type Id if name was
233234
// explicitly given
234235
if (_hasExplicitName) {
235236
return _name;
@@ -243,7 +244,8 @@ public Object getTypeId()
243244
return _name;
244245
}
245246
// And for what it is worth, this should usually do the same and we could
246-
// in fact always just return `_name`. But leaving as-is for now.
247+
// in fact always just return `_name`. But leaving as-is for now:
248+
// will essentially return {@code getClass().getName()}.
247249
return super.getTypeId();
248250
}
249251

0 commit comments

Comments
 (0)