Skip to content

Commit 1856ec8

Browse files
committed
Cherrypick couple of cleanup items from #121
1 parent 5d6be9b commit 1856ec8

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

jr-annotation-support/src/main/java/com/fasterxml/jackson/jr/annotationsupport/AnnotationBasedIntrospector.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ protected POJODefinition introspectDefinition()
9999
stringCtor = ctor;
100100
} else if (argType == Long.class || argType == Long.TYPE) {
101101
longCtor = ctor;
102-
} else {
103-
continue;
104102
}
105-
} else {
106-
continue;
107103
}
108104
}
109105
}
@@ -492,12 +488,7 @@ protected <ANN extends Annotation> ANN _find(AnnotatedElement elem, Class<ANN> a
492488
*/
493489

494490
protected APropBuilder _propBuilder(String name) {
495-
APropBuilder b = _props.get(name);
496-
if (b == null) {
497-
b = new APropBuilder(name);
498-
_props.put(name, b);
499-
}
500-
return b;
491+
return _props.computeIfAbsent(name,APropBuilder::new);
501492
}
502493

503494
protected void _addIgnoral(String name) {

jr-objects/src/main/java/com/fasterxml/jackson/jr/ob/impl/BeanPropertyIntrospector.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public POJODefinition pojoDefinitionForSerialization(JSONWriter w, Class<?> pojo
4747

4848
private POJODefinition _construct(Class<?> beanType, int features)
4949
{
50-
Map<String,PropBuilder> propsByName = new TreeMap<String,PropBuilder>();
50+
Map<String,PropBuilder> propsByName = new TreeMap<>();
5151
_introspect(beanType, propsByName, features);
5252

5353
Constructor<?> defaultCtor = null;
@@ -64,11 +64,7 @@ private POJODefinition _construct(Class<?> beanType, int features)
6464
stringCtor = ctor;
6565
} else if (argType == Long.class || argType == Long.TYPE) {
6666
longCtor = ctor;
67-
} else {
68-
continue;
6967
}
70-
} else {
71-
continue;
7268
}
7369
}
7470
final int len = propsByName.size();

0 commit comments

Comments
 (0)