Juan Hernandez has submitted this change and it was merged. Change subject: restapi: Don't use inner classes in LinkBuilder ......................................................................
restapi: Don't use inner classes in LinkBuilder We use anonymous classes in a rather unusual way in the LinkBuilder. We do the follwing: whatever.setBody(new Body(){{setType(type);}}); Instead of this: Body body = new Body(); body.setType(type); whatever.setBody(body); The former is probably nicer syntax, but it has the side effect of introducing a synthetic field in the anonymous subclass of Body that the compiler generates automatically. This synthetic field is a reference to the outer LinkHelper class. When Jackson tries to convert this object to JSON it finds the synthetic field, and tries to serialize it as well. This fails because the LinkHelper class doesn't have a suitable constructor. The net effect is an error when the server tries to return an error message to the user. The solution is to avoid completely the anonymous classes, and thus the synthetic fields. Change-Id: I10e0ecb68b3e0d412de486c3a38dbefa3c4dd9d2 Bug-Url: https://bugzilla.redhat.com/1093755 Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com> --- M backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/rsdl/RsdlBuilder.java 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: Ravi Nori: Looks good to me, but someone else must approve Juan Hernandez: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/27380 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10e0ecb68b3e0d412de486c3a38dbefa3c4dd9d2 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Ori Liel <ol...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches