Skip to content

Commit

Permalink
Merge branch '2.16' into 3647-
Browse files Browse the repository at this point in the history
  • Loading branch information
JooHyukKim committed Aug 19, 2023
2 parents df49aae + 7f85d4a commit 01097c0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ AnnotatedMethodMap collect(TypeFactory typeFactory, TypeResolutionContext tc,
try {
// And with that, we can generate it appropriately
Method m = Object.class.getDeclaredMethod(k.getName());
if (m != null) {
MethodBuilder b = entry.getValue();
b.annotations = collectDefaultAnnotations(b.annotations,
m.getDeclaredAnnotations());
b.method = m;
}
MethodBuilder b = entry.getValue();
b.annotations = collectDefaultAnnotations(b.annotations,
m.getDeclaredAnnotations());
b.method = m;
} catch (Exception e) { }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,9 +1311,8 @@ protected Object findFilterId(SerializationConfig config, BeanDescription beanDe
protected boolean usesStaticTyping(SerializationConfig config,
BeanDescription beanDesc, TypeSerializer typeSer)
{
/* 16-Aug-2010, tatu: If there is a (value) type serializer, we cannot force
* static typing; that would make it impossible to handle expected subtypes
*/
// 16-Aug-2010, tatu: If there is a (value) type serializer, we cannot force
// static typing; that would make it impossible to handle expected subtypes
if (typeSer != null) {
return false;
}
Expand All @@ -1324,22 +1323,4 @@ protected boolean usesStaticTyping(SerializationConfig config,
}
return config.isEnabled(MapperFeature.USE_STATIC_TYPING);
}

// Commented out in 2.9
/*
protected Class<?> _verifyAsClass(Object src, String methodName, Class<?> noneClass)
{
if (src == null) {
return null;
}
if (!(src instanceof Class)) {
throw new IllegalStateException("AnnotationIntrospector."+methodName+"() returned value of type "+src.getClass().getName()+": expected type JsonSerializer or Class<JsonSerializer> instead");
}
Class<?> cls = (Class<?>) src;
if (cls == noneClass || ClassUtil.isBogusClass(cls)) {
return null;
}
return cls;
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ public static boolean hasGetterSignature(Method m)
return false;
}
// Must take no args
Class<?>[] pts = m.getParameterTypes();
if (pts != null && pts.length != 0) {
if (m.getParameterTypes().length != 0) {
return false;
}
// Can't be a void method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public void setLenient(boolean enabled) {
@Override // since 2.7
public boolean isLenient() {
// default is, I believe, true
return (_lenient == null) || _lenient.booleanValue();
return (_lenient == null) || _lenient;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,11 @@ public void serialize(JsonGenerator gen) throws IOException
{
Object n = segment.get(ptr);
if (n instanceof Double) {
gen.writeNumber(((Double) n).doubleValue());
gen.writeNumber((Double) n);
} else if (n instanceof BigDecimal) {
gen.writeNumber((BigDecimal) n);
} else if (n instanceof Float) {
gen.writeNumber(((Float) n).floatValue());
gen.writeNumber((Float) n);
} else if (n == null) {
gen.writeNull();
} else if (n instanceof String) {
Expand Down Expand Up @@ -745,17 +745,15 @@ public void writeStartObject(Object forValue) throws IOException
{
_writeContext.writeValue();
_appendStartMarker(JsonToken.START_OBJECT);
JsonWriteContext ctxt = _writeContext.createChildObjectContext(forValue);
_writeContext = ctxt;
_writeContext = _writeContext.createChildObjectContext(forValue);
}

@Override // since 2.10.1
public void writeStartObject(Object forValue, int size) throws IOException
{
_writeContext.writeValue();
_appendStartMarker(JsonToken.START_OBJECT);
JsonWriteContext ctxt = _writeContext.createChildObjectContext(forValue);
_writeContext = ctxt;
_writeContext = _writeContext.createChildObjectContext(forValue);
}

@Override
Expand Down Expand Up @@ -2182,8 +2180,7 @@ public int rawType(int index)
if (index > 0) {
l >>= (index << 2);
}
int ix = ((int) l) & 0xF;
return ix;
return ((int) l) & 0xF;
}

public Object get(int index) {
Expand Down

0 comments on commit 01097c0

Please sign in to comment.