Skip to content

Commit

Permalink
Update release notes wrt #4061
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 26, 2023
1 parent 3579be0 commit 39c4f1f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -1684,3 +1684,8 @@ Jason Laber (jlaber@github)
Andreas Zahnen (azahnen@github)
* Reported #4078: `java.desktop` module is no longer optional
(2.16.0)
Omar Aloraini (ooraini@github)
* Requested #4061: Add JsonTypeInfo.Id.SIMPLE_NAME which defaults type id
to `Class.getSimpleName()`
(2.16.0)
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Project: jackson-databind
#4056: Provide the "ObjectMapper.treeToValue(TreeNode, TypeReference)" method
(contributed by @fantasy0v0)
#4060: Expose `NativeImageUtil.isRunningInNativeImage()` method
#4061: Add JsonTypeInfo.Id.SIMPLE_NAME which defaults type id to `Class.getSimpleName()`
(requested by Omar A)
(contributed by Joo-Hyuk K)
#4071: Impossible to deserialize custom `Throwable` sub-classes that do not
have single-String constructors
(reported by @PasKal)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package com.fasterxml.jackson.databind.jsontype.impl;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DatabindContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.MapperFeature;

import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.cfg.MapperConfig;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;

/**
* {@link com.fasterxml.jackson.databind.jsontype.TypeIdResolver} implementation
* that converts between (JSON) Strings and simple Java class names.
*
* that converts using explicitly (annotation-) specified type names
* and maps to implementation classes; or, in absence of annotated type name,
* defaults to simple {@link Class} names (obtained with {@link Class#getSimpleName()}.
* Basically same as {@link TypeNameIdResolver} except for default to "simple"
* and not "full" class name.
*
* @since 2.16
*/
public class SimpleNameIdResolver
Expand Down Expand Up @@ -161,10 +161,6 @@ protected JavaType _typeFromId(String id) {
if (_caseInsensitive) {
id = id.toLowerCase();
}
// Now: if no type is found, should we try to locate it by
// some other means? (specifically, if in same package as base type,
// could just try Class.forName)
// For now let's not add any such workarounds; can add if need be
return _idToType.get(id);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

/**
* {@link com.fasterxml.jackson.databind.jsontype.TypeIdResolver} implementation
* that converts uses explicitly specified (by annotation) type names
* that converts using explicitly (annotation-) specified type names
* and maps to implementation classes; or, in absence of annotated type name,
* defaults to fully-qualified {@link Class} names.
* defaults to fully-qualified {@link Class} names (obtained with {@link Class#getName()}
*/
public class TypeNameIdResolver extends TypeIdResolverBase
{
Expand Down

0 comments on commit 39c4f1f

Please sign in to comment.