Skip to content

Commit

Permalink
Further tweak for FasterXML#1248
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 25, 2016
1 parent 67813ca commit 1e5d349
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ public AnnotatedMethod withAnnotations(AnnotationMap ann) {
return new AnnotatedMethod(_typeContext, _method, ann, _paramAnnotations);
}

/*
/*****************************************************
/* Annotated impl
/*****************************************************
*/

@Override
public Method getAnnotated() { return _method; }
Expand All @@ -90,12 +85,6 @@ 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 All @@ -106,6 +95,18 @@ public Class<?> getRawType() {
return _method.getReturnType();
}

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

/*
/*****************************************************
/* AnnotatedWithParams
/*****************************************************
*/

@Override
public final Object call() throws Exception {
return _method.invoke(null);
Expand All @@ -127,6 +128,27 @@ public final Object call1(Object arg) throws Exception {
/********************************************************
*/

@Override
public int getParameterCount() {
return getRawParameterTypes().length;
}

@Override
public Class<?> getRawParameterType(int index)
{
Class<?>[] types = getRawParameterTypes();
return (index >= types.length) ? null : types[index];
}

@Override
public JavaType getParameterType(int index) {
Type[] types = _method.getGenericParameterTypes();
if (index >= types.length) {
return null;
}
return _typeContext.resolveType(types[index]);
}

@Override
public Class<?> getDeclaringClass() { return _method.getDeclaringClass(); }

Expand Down Expand Up @@ -167,11 +189,6 @@ public Object getValue(Object pojo) throws IllegalArgumentException
/*****************************************************
*/

@Override
public int getParameterCount() {
return getRawParameterTypes().length;
}

public String getFullName() {
return getDeclaringClass().getName() + "#" + getName() + "("
+getParameterCount()+" params)";
Expand All @@ -189,22 +206,6 @@ public Type[] getGenericParameterTypes() {
return _method.getGenericParameterTypes();
}

@Override
public Class<?> getRawParameterType(int index)
{
Class<?>[] types = getRawParameterTypes();
return (index >= types.length) ? null : types[index];
}

@Override
public JavaType getParameterType(int index) {
Type[] types = _method.getGenericParameterTypes();
if (index >= types.length) {
return null;
}
return _typeContext.resolveType(types[index]);
}

public Class<?> getRawReturnType() {
return _method.getReturnType();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public final class AnnotatedParameter
/**********************************************************
*/

public AnnotatedParameter(AnnotatedWithParams owner, JavaType type, AnnotationMap annotations,
int index)
public AnnotatedParameter(AnnotatedWithParams owner, JavaType type,
AnnotationMap annotations, int index)
{
super((owner == null) ? null : owner.getTypeContext(), annotations);
_owner = owner;
Expand Down Expand Up @@ -91,6 +91,12 @@ public JavaType getType() {
return _type;
}

@Deprecated
@Override
public Type getGenericType() {
return _owner.getGenericParameterType(_index);
}

/*
/**********************************************************
/* AnnotatedMember extras
Expand Down

0 comments on commit 1e5d349

Please sign in to comment.