Our custom ReflectionConverter implementation doesn't actually derive from ReflectionConverter. It does something very similar, but it implements Converter directly as it does many other things beside this.

What's relevant here is that my custom reflection converter tolerates elements that are unknown. In contrast, XStream chokes if it encounters an element that makes no sense there. This is where I need to be able to do getField and catch an exception. So I still request that you kindly consider applying this patch.

Exception in thread "main" com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: No such field jenkins.FooTest.z
---- Debugging information ----
field               : z
class               : jenkins.FooTest
required-type       : jenkins.FooTest
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /jenkins.FooTest/z
line number         : 1
version             : null
-------------------------------
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.determineType(AbstractReflectionConverter.java:453)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:294)
	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:234)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061)
	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:916)
	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:907)
	at jenkins.FooTest.main(FooTest.java:13)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to