XStream

xStream unable to use Sun14ReflectionProvider with SAP VM

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2.2
  • Fix Version/s: 1.3
  • Component/s: Core
  • Labels:
    None
  • JDK version and platform:
    SAP AG 5.1.0717

Description

Hi,
There is a VM from SAP, which is not
The XStream Library includes code that checks the Vendor name of the VM
und depending on that, different reflection providers are used.

In class com.thoughtworks.xstream.core.JVM (example for sun):
private static boolean isSun() {
return System.getProperty("java.vm.vendor").indexOf("Sun") != -1;
}
or comparable demands in the same class for VMs of IBM, HP and others.
private boolean canUseSun14ReflectionProvider() {
return (isSun() || isApple() || isHPUX() || isIBM() || isBlackdown() || isBEAWithUnsafeSupport() || isHitachi()) && is14() && loadClass "sun.misc.Unsafe") != null;
}

The SAP JVM will not be identified from this check and as a result, a the PureJavaReflectionProvider is used, which does not support all features.

adding a check for "SAP AG" results in the Sun14ReflectionProvider being used without problems, so imho this can be easily and safely added.

For your information, here what the System-Properties return:
VM-Version: 5.1.0717
VM-Vendor: SAP AG

Issue Links

Activity

Hide
Joerg Schaible added a comment -

Hi Rico,

is there any chance to get a copy of this JVM? It seems currently not available as download, at least not here: https://www.sdn.sap.com/irj/sdn/downloads?rid=/library/uuid/da699d27-0b01-0010-99b0-f11458f31ef2. Since we do some highly unportable stuff in enhanced mode, we'd like to make our tests. E.g. for JRockit support BEA itself provided patches.

  • Jörg
Show
Joerg Schaible added a comment - Hi Rico, is there any chance to get a copy of this JVM? It seems currently not available as download, at least not here: https://www.sdn.sap.com/irj/sdn/downloads?rid=/library/uuid/da699d27-0b01-0010-99b0-f11458f31ef2. Since we do some highly unportable stuff in enhanced mode, we'd like to make our tests. E.g. for JRockit support BEA itself provided patches.
  • Jörg
Hide
Norbert Kuck added a comment -

Hi Joerg,

it seems that it is currently a little difficult to download a copy of the VM (mainly because it is delivered as part of the application server), but I could provide you with a prerelease copy of just the VM itself directly from SAP development. I have sent you a mail explaining the details.

Greetings - Norbert

Show
Norbert Kuck added a comment - Hi Joerg, it seems that it is currently a little difficult to download a copy of the VM (mainly because it is delivered as part of the application server), but I could provide you with a prerelease copy of just the VM itself directly from SAP development. I have sent you a mail explaining the details. Greetings - Norbert
Hide
Joerg Schaible added a comment -

Verified (thanks to Norbert Kuck by SAP). Works fine. Directly supported now in head revision.

Show
Joerg Schaible added a comment - Verified (thanks to Norbert Kuck by SAP). Works fine. Directly supported now in head revision.
Hide
Rico Neubauer added a comment -

Thanks Jörg and Norbert

Show
Rico Neubauer added a comment - Thanks Jörg and Norbert
Hide
Joerg Schaible added a comment -

Closing issues before next release.

Show
Joerg Schaible added a comment - Closing issues before next release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: