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