Skip to content

Commit

Permalink
Fix for #73
Browse files Browse the repository at this point in the history
  • Loading branch information
christophercurrie committed Apr 30, 2013
1 parent 6f21222 commit 19e0e55
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,23 @@ class ScalaPropertiesCollector(config: MapperConfig[_],
}

private def _isPropertyHandled(m: AnnotatedMethod): Boolean = {
def _findNameForSerialization(a: Annotated) =
Option(_annotationIntrospector).optMap { ai =>
if (forSerialization) ai.findNameForSerialization(a) else ai.findNameForDeserialization(a)
}

def _okNameForSerialization(m: AnnotatedMethod) =
if (forSerialization) {
Option(BeanUtil.okNameForRegularGetter(m, m.getName)).orElse(Option(BeanUtil.okNameForIsGetter(m, m.getName)))
}
else {
Option(BeanUtil.okNameForMutator(m, m.getName))
}

val name = _findNameForSerialization(m).map(_.getSimpleName).orElse(_okNameForSerialization(m))

_properties.asScala.exists {
case (_, p) => m.equals(p.getGetter) || m.equals(p.getSetter) || m.equals(p.getMutator)
case (n, p) => (name.map { _ == n } getOrElse false) || m.equals(p.getGetter) || m.equals(p.getSetter) || m.equals(p.getMutator)
}
}

Expand Down

0 comments on commit 19e0e55

Please sign in to comment.