Re: GWT CustomFieldSerializer Recursivity
Sounds good. Once I saw where the white list .gwt.rpc was getting built this made more sense. Its probably splitting hairs optimizing for that recursion :) On Sunday, January 6, 2013 4:30:32 AM UTC-8, Thomas Broyer wrote: > > > > On Wednesday, January 2, 2013 6:39:47 PM UTC+1, Thomas Broyer wrote: >> >> >> >> On Wednesday, January 2, 2013 6:16:36 PM UTC+1, Brandon Donnelson wrote: >>> >>> Good point, but I don't think that's it. I walked the code several >>> finding the loop on it self here: >>> http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java&q=SerializabilityUtil%20package:google-web-toolkit%5C.googlecode%5C.com&l=870 >> >> >> That indeed looks strange (I haven't looked closely at the code though). >> > > I looked a bit more at it and there's actually nothing that strange here. > One could say the code could be better optimized but that's it. > This method is used to generate a "signature" for a type that will change > whenever its serialization changes. When a type has no > CustomFieldSerializer, its fields are used; otherwise, because we cannot > tell which fields will be serialized, the signature for the type is the > signature for its CustomFieldSerializer. That's the reason for the > recursive call. It's not expected then that the CustomFieldSerializer > itself has a CustomFieldSerializer. If you want to make it better, then add > a boolean argument to the method to tell whether a CustomFieldSerializer > should be used or not (or maybe split the method in two), so that when > computing the signature for the CustomFieldSerializer we don't look for the > CustomFieldSerializer's CustomFieldSerializer. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/qWnY84yIuRUJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT CustomFieldSerializer Recursivity
On Wednesday, January 2, 2013 6:39:47 PM UTC+1, Thomas Broyer wrote: > > > > On Wednesday, January 2, 2013 6:16:36 PM UTC+1, Brandon Donnelson wrote: >> >> Good point, but I don't think that's it. I walked the code several >> finding the loop on it self here: >> http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java&q=SerializabilityUtil%20package:google-web-toolkit%5C.googlecode%5C.com&l=870 > > > That indeed looks strange (I haven't looked closely at the code though). > I looked a bit more at it and there's actually nothing that strange here. One could say the code could be better optimized but that's it. This method is used to generate a "signature" for a type that will change whenever its serialization changes. When a type has no CustomFieldSerializer, its fields are used; otherwise, because we cannot tell which fields will be serialized, the signature for the type is the signature for its CustomFieldSerializer. That's the reason for the recursive call. It's not expected then that the CustomFieldSerializer itself has a CustomFieldSerializer. If you want to make it better, then add a boolean argument to the method to tell whether a CustomFieldSerializer should be used or not (or maybe split the method in two), so that when computing the signature for the CustomFieldSerializer we don't look for the CustomFieldSerializer's CustomFieldSerializer. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/5PvdRqtiRvkJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT CustomFieldSerializer Recursivity
On Wednesday, January 2, 2013 6:16:36 PM UTC+1, Brandon Donnelson wrote: > > Good point, but I don't think that's it. I walked the code several finding > the loop on it self here: > http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java&q=SerializabilityUtil%20package:google-web-toolkit%5C.googlecode%5C.com&l=870 That indeed looks strange (I haven't looked closely at the code though). > and the second time around it gets reset here: > http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java&q=SerializabilityUtil%20package:google-web-toolkit%5C.googlecode%5C.com&l=376 I don't see anything strange or wrong here. > I don't have the *_CustomFieldSerializer in the translatable path either > That's a mistake: the *_CustomFieldSerializer is used both on client and server side. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/JuPMSInqSrkJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT CustomFieldSerializer Recursivity
Good point, but I don't think that's it. I walked the code several finding the loop on it self here: http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java&q=SerializabilityUtil%20package:google-web-toolkit%5C.googlecode%5C.com&l=870 and the second time around it gets reset here: http://code.google.com/searchframe#T04cSGC7sWI/trunk/user/src/com/google/gwt/user/server/rpc/impl/SerializabilityUtil.java&q=SerializabilityUtil%20package:google-web-toolkit%5C.googlecode%5C.com&l=376 I don't have the *_CustomFieldSerializer in the translatable path either so it wouldn't be able to sent over the wire. But this I've found is only half of the recipe and just checking the signature. So I'm looking at the generator or serialization oracle. Brandon On Wednesday, January 2, 2013 7:38:36 AM UTC-8, Colin Alworth wrote: > > It looks like it thinks you are sending the CustomFieldSerializer itself > over the wire, so wants to find a serializer serializer... The extra > prefixed package name "com.google.gwt.user.client.rpc.core" indicates that > it wasn't able to find your field serializer in the normal package where it > should be - consider knocking off that part and just make a com.googlecode. > objectify.impl.ref.StdRef_CustomFieldSerializer with the appropriate > static methods. > > In my brief re-read, I'm not seeing anywhere where the serializer gets > passed in as a class to find another serializer for it - this fits with my > previous experience where you just create a serializer and let RPC invoke > it, no questions asked. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/vo66cUkmZZwJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT CustomFieldSerializer Recursivity
It looks like it thinks you are sending the CustomFieldSerializer itself over the wire, so wants to find a serializer serializer... The extra prefixed package name "com.google.gwt.user.client.rpc.core" indicates that it wasn't able to find your field serializer in the normal package where it should be - consider knocking off that part and just make a com.googlecode. objectify.impl.ref.StdRef_CustomFieldSerializer with the appropriate static methods. In my brief re-read, I'm not seeing anywhere where the serializer gets passed in as a class to find another serializer for it - this fits with my previous experience where you just create a serializer and let RPC invoke it, no questions asked. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/tJjbxzgYxeUJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
GWT CustomFieldSerializer Recursivity
I've been trying to work on a custom serializer but I've not been able to get it to work. So I've been investigating com.google.gwt.user.server.rpc.impl.SerializabilityUtil. What I'm seeing is a strange recursive loop that looks odd to me. I can register a custom field serializer on next to the class or in the rpc core class and both produce the same result. But for this example I'll show the serializer looks like in the loop in rpc core. class com.google.gwt.user.client.rpc.core.com.googlecode.objectify.impl.ref.StdRef_CustomFieldSerializer - finds the serializer on this iteration class com.google.gwt.user.client.rpc.core.com.googlecode.objectify.impl.ref.StdRef_CustomFieldSerializer_CustomFieldSerializer - but on this one it looks for this and sets the mapping in this var to null in this map classServerCustomSerializerCache During the second time it clears the setting in the cache too, which doesn't make sense to me. During the second time it sets the mapped serializer in this var to null, classServerCustomSerializerCache. Any idea if this is to be expected? While I see it finds my custom field serializer in the code, I get stumped wondering why the code behaves as it does. Well anyway, my goal is to get the custom field serializer white listed, but I can't seem to get it registered. Brandon Donnelson http://c.gwt-examples.com -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/kZpLkEcYI4kJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.