Skip to content

Commit

Permalink
Fixed #1248
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 23, 2016
1 parent ebadfd2 commit 67813ca
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 5 deletions.
4 changes: 4 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,7 @@ Tom Mack (tommack@github)
Nick Babcock (nickbabcock)
* Reported #1225: `JsonMappingException` should override getProcessor()
(2.7.5)

Andrew Joseph (apjoseph@github)
* Reported #1248: `Annotated` returns raw type in place of Generic Type in 2.7.x
(2.7.5)
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Project: jackson-databind
(contributed by Eric S)
#1231: `@JsonSerialize(as=superType)` behavior disallowed in 2.7.4
(reported by Mark W)
#1248: `Annotated` returns raw type in place of Generic Type in 2.7.x
(reported by Andrew J, apjoseph@github)

2.7.4 (29-Apr-2016)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ public final JavaType getType(TypeBindings bogus) {
}

/**
* Full generic type of the annotated element; definition
* of what exactly this means depends on sub-class.
* JDK declared generic type of the annotated element; definition
* of what exactly this means depends on sub-class. Note that such type
* can not be reliably resolved without {@link TypeResolutionContext}, and
* as a result use of this method was deprecated in Jackson 2.7: see
* {@link #getType} for replacement.
*
* @deprecated Since 2.7 should instead use {@link #getType()}. To be removed from 2.8
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public boolean hasAnnotation(Class<?> acls) {
public boolean hasOneOf(Class<? extends Annotation>[] annoClasses) {
return _classAnnotations().hasOneOf(annoClasses);
}

@Override
public Class<?> getRawType() {
return _class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public AnnotatedConstructor withAnnotations(AnnotationMap ann) {
public JavaType getType() {
return _typeContext.resolveType(getRawType());
}

@Override
public Class<?> getRawType() {
return _constructor.getDeclaringClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public Class<?> getRawType() {
return _field.getType();
}

@Deprecated
@Override
public Type getGenericType() {
return _field.getGenericType();
}

@Override
public JavaType getType() {
return _typeContext.resolveType(_field.getGenericType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public JavaType getType() {
return _typeContext.resolveType(_method.getGenericReturnType());
}

@Deprecated
@Override
public Type getGenericType() {
return _method.getGenericReturnType();
}

/**
* For methods, this returns declared return type, which is only
* useful with getters (setters do not usually return anything;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public Class<?> getRawType() {

@Override
public JavaType getType() {
return _typeContext.resolveType(_type);
return _type;
}

/*
Expand Down

0 comments on commit 67813ca

Please sign in to comment.