Skip to content

Commit

Permalink
Cherrypick couple of cleanup items from #121
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 23, 2024
1 parent 5d6be9b commit 1856ec8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ protected POJODefinition introspectDefinition()
stringCtor = ctor;
} else if (argType == Long.class || argType == Long.TYPE) {
longCtor = ctor;
} else {
continue;
}
} else {
continue;
}
}
}
Expand Down Expand Up @@ -492,12 +488,7 @@ protected <ANN extends Annotation> ANN _find(AnnotatedElement elem, Class<ANN> a
*/

protected APropBuilder _propBuilder(String name) {
APropBuilder b = _props.get(name);
if (b == null) {
b = new APropBuilder(name);
_props.put(name, b);
}
return b;
return _props.computeIfAbsent(name,APropBuilder::new);
}

protected void _addIgnoral(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public POJODefinition pojoDefinitionForSerialization(JSONWriter w, Class<?> pojo

private POJODefinition _construct(Class<?> beanType, int features)
{
Map<String,PropBuilder> propsByName = new TreeMap<String,PropBuilder>();
Map<String,PropBuilder> propsByName = new TreeMap<>();
_introspect(beanType, propsByName, features);

Constructor<?> defaultCtor = null;
Expand All @@ -64,11 +64,7 @@ private POJODefinition _construct(Class<?> beanType, int features)
stringCtor = ctor;
} else if (argType == Long.class || argType == Long.TYPE) {
longCtor = ctor;
} else {
continue;
}
} else {
continue;
}
}
final int len = propsByName.size();
Expand Down

0 comments on commit 1856ec8

Please sign in to comment.