Some Java vendor have less than six characters.
-----------------------------------------------

                 Key: GERONIMO-6199
                 URL: https://issues.apache.org/jira/browse/GERONIMO-6199
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: JVM-compatibility
            Reporter: Ingo Proetel
            Priority: Minor


The static initializer code in 
'org.apache.geronimo.system.properties.JvmVendor' assumes that the content of 
the 'java.vm.vendor' has at least six characters otherise the initialization 
will fail. (This issue came up before in GERONIMO-4209.)

The following code could fix this issue:

String fullVendorName = getFullName();
boolean bApache = (fullVendorName.length() >= 6) &&  
fullVendorName.substring(0, 6).equalsIgnoreCase("Apache"); // aka. Apache 
Harmony
boolean bIBM = (fullVendorName.length() >= 3) &&  fullVendorName.substring(0, 
3).equalsIgnoreCase("IBM"); // aka. IBM, but not IBM Hybrid
boolean bSun = !bIBM && !bApache; // default all others to Sun
boolean bHP = (fullVendorName.length() >= 6) &&   fullVendorName.substring(0, 
6).equalsIgnoreCase("Hewlet"); // aka. Hewlett-Packard Company
boolean bIBMHybrid = false;


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to