We have had bug reports from customers claiming that XStream did not work properly for them if they used SAP's own Java VM. We have been able to track this down to the code in XStream where the Java VM vendor is checked.
Please add the SAP JVM to the list of VMS that can use a Sun14 reflection provider. The implementation of SAP JVM is very close to the Sun VM and it is therefore safe to assume that implementation specific tricks using reflection and sun.misc.Unsafe that work on the Sun VM will also work on SAP JVM. Our tests have confirmed that so far.
The SAP JVM reports java.vm.vendor as 'SAP AG'.
Specifically, we would suggest that in the class com.thoughtworks.xstream.core.JVM the following method be added:
private static boolean isSAP() {
return System.getProperty("java.vm.vendor").indexOf("SAP AG") != -1;
}
and that in the method canUseSun14ReflectionProvider() an appropriate "|| isSAP()" be added.
I close this issue as duplicate. Although it is probably that your proposed changes are enough, we cannot be sure. See my comments at the duplicate
XSTR-431. Since you're employee from SAP you might be able to help to resolve this completely. Thanks a lot.