mirror of https://github.com/apache/lucene.git
SOLR-13841: Added 'JsonProperty' to forbidden APIs
This commit is contained in:
parent
5df9a51cbf
commit
11fd8d630a
|
@ -55,3 +55,7 @@ com.google.common.base.Preconditions#checkNotNull(java.lang.Object,java.lang.Obj
|
|||
@defaultMessage Use methods in java.util.Comparator instead
|
||||
com.google.common.collect.Ordering
|
||||
|
||||
@defaultMessage Use org.apache.solr.common.annotation.JsonProperty instead
|
||||
com.fasterxml.jackson.annotation.JsonProperty
|
||||
|
||||
|
||||
|
|
|
@ -171,14 +171,13 @@ public class AnnotatedApi extends Api implements PermissionNameProvider {
|
|||
final Command command;
|
||||
final Method method;
|
||||
final Object obj;
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
ObjectMapper mapper = SolrJacksonAnnotationInspector.createObjectMapper();
|
||||
int paramsCount;
|
||||
Class c;
|
||||
boolean isWrappedInPayloadObj = false;
|
||||
|
||||
|
||||
Cmd(Command command, Object obj, Method method) {
|
||||
mapper.setAnnotationIntrospector(SolrJacksonAnnotationInspector.INSTANCE);
|
||||
if (Modifier.isPublic(method.getModifiers())) {
|
||||
this.command = command;
|
||||
this.obj = obj;
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.solr.util;
|
|||
|
||||
import com.fasterxml.jackson.core.Version;
|
||||
import com.fasterxml.jackson.databind.AnnotationIntrospector;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.PropertyName;
|
||||
import com.fasterxml.jackson.databind.introspect.Annotated;
|
||||
import com.fasterxml.jackson.databind.introspect.AnnotatedField;
|
||||
|
@ -86,4 +87,9 @@ public class SolrJacksonAnnotationInspector extends AnnotationIntrospector {
|
|||
return findNameForSerialization(a);
|
||||
}
|
||||
|
||||
public static ObjectMapper createObjectMapper(){
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setAnnotationIntrospector(INSTANCE);
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue