Skip to content

Commit

Permalink
Minor fix related to #792, may help (but not necessarily fully solve)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 13, 2015
1 parent 340439a commit ba20f65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Project: jackson-databind
#785: Add handlings for classes which are available in `Thread.currentThread().getContextClassLoader()`
(contributed by Charles A)
- Fix handling of Enums wrt JSON Schema, when 'toString()' used for serialization
- Minor improvement to handling of implicit names for Creator parameters

2.5.3 (24-Apr-2015)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ protected void _addCreators()
*/
protected void _addCreatorParam(AnnotatedParameter param)
{
// JDK 8, paranamer can give implicit name
// JDK 8, paranamer, Scala can give implicit name
String impl = _annotationIntrospector.findImplicitPropertyName(param);
if (impl == null) {
impl = "";
Expand All @@ -488,17 +488,12 @@ protected void _addCreatorParam(AnnotatedParameter param)
// shouldn't need to worry about @JsonIgnore, since creators only added
// if so annotated

/* 14-Apr-2014, tatu: Not ideal, since we should not start with explicit name, ever;
* but with current set up we also can not just use empty name.
* This will cause failure for [#323] until we figure out a better way to handle
* the problem; possibly by creating a placeholder container for "anonymous"
* creator parameters.
/* 13-May-2015, tatu: We should try to start with implicit name, similar to how
* fields and methods work; but unlike those, we don't necessarily have
* implicit name to use (pre-Java8 at least). So:
*/
POJOPropertyBuilder prop = expl ? _property(pn) : _property(impl);
// should use this (or similar) instead:
// POJOPropertyBuilder prop = _property(impl);
POJOPropertyBuilder prop = (expl && impl.isEmpty()) ? _property(pn) : _property(impl);
prop.addCtor(param, pn, expl, true, false);

_creatorProperties.add(prop);
}

Expand Down Expand Up @@ -745,6 +740,7 @@ protected void _renameProperties()
POJOPropertyBuilder prop = entry.getValue();

Collection<PropertyName> l = prop.findExplicitNames();

// no explicit names? Implicit one is fine as is
if (l.isEmpty()) {
continue;
Expand Down

0 comments on commit ba20f65

Please sign in to comment.