Skip to content

Commit

Permalink
minor comments cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 8, 2016
1 parent eb5007b commit d71de54
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,9 @@ protected void addBeanProps(DeserializationContext ctxt,
// 25-Sep-2014, tatu: No point in finding constructor parameters for abstract types
// (since they are never used anyway)
if (isConcrete && propDef.hasConstructorParameter()) {
/* [JACKSON-700] If property is passed via constructor parameter, we must
* handle things in special way. Not sure what is the most optimal way...
* for now, let's just call a (new) method in builder, which does nothing.
/* If property is passed via constructor parameter, we must
* handle things in special way. Not sure what is the most optimal way...
* for now, let's just call a (new) method in builder, which does nothing.
*/
// but let's call a method just to allow custom builders to be aware...
final String name = propDef.getName();
Expand Down Expand Up @@ -707,6 +707,7 @@ protected SettableBeanProperty constructSettableProperty(DeserializationContext
{
// need to ensure method is callable (for non-public)
AnnotatedMember mutator = propDef.getNonConstructorMutator();

if (ctxt.canOverrideAccessModifiers()) {
mutator.fixAccess(ctxt.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS));
}
Expand All @@ -720,24 +721,22 @@ protected SettableBeanProperty constructSettableProperty(DeserializationContext
property = property.withType(type);
}

/* First: does the Method specify the deserializer to use?
* If so, let's use it.
*/
// First: does the Method specify the deserializer to use? If so, let's use it.
JsonDeserializer<Object> propDeser = findDeserializerFromAnnotation(ctxt, mutator);
type = modifyTypeByAnnotation(ctxt, mutator, type);
TypeDeserializer typeDeser = type.getTypeHandler();
SettableBeanProperty prop;
if (mutator instanceof AnnotatedMethod) {
prop = new MethodProperty(propDef, type, typeDeser,
beanDesc.getClassAnnotations(), (AnnotatedMethod) mutator);
beanDesc.getClassAnnotations(), (AnnotatedMethod) mutator);
} else {
prop = new FieldProperty(propDef, type, typeDeser,
beanDesc.getClassAnnotations(), (AnnotatedField) mutator);
}
if (propDeser != null) {
prop = prop.withValueDeserializer(propDeser);
}
// [JACKSON-235]: need to retain name of managed forward references:
// need to retain name of managed forward references:
AnnotationIntrospector.ReferenceProperty ref = propDef.findReferenceType();
if (ref != null && ref.isManagedReference()) {
prop.setManagedReferenceName(ref.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) t
continue;
}
}
/* As per [JACKSON-313], things marked as ignorable should not be
* passed to any setter
*/
if (_ignorableProps != null && _ignorableProps.contains(propName)) {
// Things marked as ignorable should not be passed to any setter
if ((_ignorableProps != null) && _ignorableProps.contains(propName)) {
p.skipChildren();
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static class MyNoArgException extends Exception
/**********************************************************
*/

final ObjectMapper MAPPER = new ObjectMapper();
private final ObjectMapper MAPPER = new ObjectMapper();

public void testIOException() throws IOException
{
Expand All @@ -61,7 +61,6 @@ public void testIOException() throws IOException
assertEquals(ioe.getMessage(), result.getMessage());
}

// As per [JACKSON-377]
public void testWithCreator() throws IOException
{
final String MSG = "the message";
Expand All @@ -74,7 +73,6 @@ public void testWithCreator() throws IOException
assertEquals(result.getFoo(), result.stuff.get("foo"));
}

// [JACKSON-388]
public void testWithNullMessage() throws IOException
{
final ObjectMapper mapper = new ObjectMapper();
Expand All @@ -98,7 +96,7 @@ public void testJDK7SuppressionProperty() throws IOException
assertNotNull(exc);
}

// [Issue#381]
// [databind#381]
public void testSingleValueArrayDeserialization() throws Exception {
final ObjectMapper mapper = new ObjectMapper();
mapper.enable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
Expand Down

0 comments on commit d71de54

Please sign in to comment.