XStream
  1. XStream
  2. XSTR-431

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

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Rico Neubauer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: