Skip to content

Commit 64ce4cf

Browse files
cowtowncoderShounaks
authored andcommitted
Cherrypick couple of cleanup items from FasterXML#121
1 parent 8d4f96f commit 64ce4cf

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
@@ -48,7 +48,7 @@ public POJODefinition pojoDefinitionForSerialization(JSONWriter w, Class<?> pojo
4848

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

5454
Constructor<?> defaultCtor = null;
@@ -65,11 +65,7 @@ private POJODefinition _construct(Class<?> beanType, int features)
6565
stringCtor = ctor;
6666
} else if (argType == Long.class || argType == Long.TYPE) {
6767
longCtor = ctor;
68-
} else {
69-
continue;
7068
}
71-
} else {
72-
continue;
7369
}
7470
}
7571
final int len = propsByName.size();

0 commit comments

Comments
 (0)