Skip to content

Commit

Permalink
Fix #79
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 25, 2016
1 parent ed93704 commit 1781258
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ NOTE: Annotations module will never contain changes in patch versions,

2.8.0 (not yet released)

#79: Change `@JsonTypeInfo.defaultImpl` default value to deprecate `JsonTypeInfo.None.class`
#83: Add `@JsonEnumDefaultValue` for indicating default enum choice if no real match found
(suggested by Alejandro R)

Expand Down
27 changes: 15 additions & 12 deletions src/main/java/com/fasterxml/jackson/annotation/JsonTypeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,21 @@ public enum As {
*<p>
* There are certain special values that indicate alternate behavior:
*<ul>
* <li>{@link None} means "there is no default implementation" (in which
* <li>{@link java.lang.Void} means that objects with unmappable (or missing)
* type are to be mapped to null references.
* For backwards compatibility (2.5 and below), value of
* <code>com.fasterxml.jackson.databind.annotation.NoClass</code> is also allowed
* for such usage.
* </li>
* <li>Placeholder value of {@link JsonTypeInfo} (that is, this annotation type
* itself} means "there is no default implementation" (in which
* case an error results from unmappable type).
* With Jackson 2.5 and above, {@link JsonTypeInfo} itself will also be
* accepted to mean "no default implementation specified"
* <li><code>com.fasterxml.jackson.databind.annotation.NoClass</code> means that
* objects with unmappable (or missing) type are to be mapped to null references.
* With Jackson 2.5, {@link java.lang.Void} may also be used to indicate this
* behavior
* For backwards compatibility with earlier versions (2.5 and below),
* value of {@link JsonTypeInfo.None} may also be used.
* </li>
* </ul>
*<p>
* TODO: change default value to be {@link JsonTypeInfo}.class in 2.6
*/
public Class<?> defaultImpl() default None.class;
public Class<?> defaultImpl() default JsonTypeInfo.class;

/**
* Property that defines whether type identifier value will be passed
Expand All @@ -276,7 +278,7 @@ public enum As {
public boolean visible() default false;

// 19-Dec-2014, tatu: Was hoping to implement for 2.5, but didn't quite make it.
// Hope for better luck with 2.6.
// Hope for better luck with 2.8 or later
/**
* Property that defines whether type serializer is allowed to omit writing
* of type id, in case that value written has type same as {@link #defaultImpl()}.
Expand All @@ -298,7 +300,8 @@ public enum As {
* annotation property, to indicate that there is no default implementation
* specified.
*
* @deprecated Since 2.5, use {@link java.lang.Void} instead.
* @deprecated Since 2.5, use any Annotation type (such as {@link JsonTypeInfo},
* if such behavior is needed; this is rarely necessary.
*/
@Deprecated
public abstract static class None { }
Expand Down

0 comments on commit 1781258

Please sign in to comment.