Resolved remaining issues with [JACKSON-103]
diff --git a/release-notes/CREDITS b/release-notes/CREDITS
index ab7da11..ea0c5c7 100644
--- a/release-notes/CREDITS
+++ b/release-notes/CREDITS
@@ -220,3 +220,7 @@
* Reported [JACKSON-202]: Non-public fields not deserialized properly
with JAXB annotations
[1.3.1]
+
+Stephen Friedrich
+ * Reported additional issues with [JACKSON-203]
+ [1.3.2]
diff --git a/release-notes/VERSION b/release-notes/VERSION
index 48149c5..ec510ba 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -1,7 +1,7 @@
Version: 1.4.0
Release date:
- xx-Nov-2009
+ xx-Dec-2009
Description:
Official 1.4 release.
diff --git a/src/mapper/java/org/codehaus/jackson/map/introspect/BasicBeanDescription.java b/src/mapper/java/org/codehaus/jackson/map/introspect/BasicBeanDescription.java
index fed72ff..b8f9f4c 100644
--- a/src/mapper/java/org/codehaus/jackson/map/introspect/BasicBeanDescription.java
+++ b/src/mapper/java/org/codehaus/jackson/map/introspect/BasicBeanDescription.java
@@ -542,7 +542,7 @@
///////////////////////////////////////////////////////
*/
- protected String okNameForAnyGetter(AnnotatedMethod am, String name)
+ public String okNameForAnyGetter(AnnotatedMethod am, String name)
{
String str = okNameForIsGetter(am, name);
if (str == null) {
@@ -551,7 +551,7 @@
return str;
}
- protected String okNameForGetter(AnnotatedMethod am, String name)
+ public String okNameForGetter(AnnotatedMethod am, String name)
{
if (name.startsWith("get")) {
/* 16-Feb-2009, tatu: To handle [JACKSON-53], need to block
@@ -569,7 +569,7 @@
/* 30-Apr-2009, tatu: [JACKSON-103], need to suppress
* serialization of a cyclic (and useless) reference
*/
- if (isGroovyMeta(am)) {
+ if (isGroovyMetaClassGetter(am)) {
return null;
}
}
@@ -578,7 +578,7 @@
return null;
}
- protected String okNameForIsGetter(AnnotatedMethod am, String name)
+ public String okNameForIsGetter(AnnotatedMethod am, String name)
{
if (name.startsWith("is")) {
// plus, must return boolean...
@@ -641,7 +641,20 @@
* Similar to {@link #isCglibGetCallbacks}, need to suppress
* a cyclic reference to resolve [JACKSON-103]
*/
- protected boolean isGroovyMeta(AnnotatedMethod am)
+ protected boolean isGroovyMetaClassSetter(AnnotatedMethod am)
+ {
+ Class<?> argType = am.getParameterClass(0);
+ Package pkg = argType.getPackage();
+ if (pkg != null && pkg.getName().startsWith("groovy.lang")) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Another helper method to deal with rest of [JACKSON-103]
+ */
+ protected boolean isGroovyMetaClassGetter(AnnotatedMethod am)
{
Class<?> rt = am.getReturnType();
if (rt == null || rt.isArray()) {
@@ -673,6 +686,12 @@
if (name == null) { // plain old "set" is no good...
return null;
}
+ if ("metaClass".equals(name)) {
+ // 26-Nov-2009 [JACSON-103], need to suppress this internal groovy method
+ if (isGroovyMetaClassSetter(am)) {
+ return null;
+ }
+ }
return name;
}
return null;
@@ -682,7 +701,7 @@
* @return Null to indicate that method is not a valid accessor;
* otherwise name of the property it is accessor for
*/
- public String mangleSetterName(Annotated a, String basename)
+ protected String mangleSetterName(Annotated a, String basename)
{
return manglePropertyName(basename);
}