jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/Constants.java
changeset 34463 c269a10aca11
parent 34044 4c5494af1359
child 39799 2847de5336f2
equal deleted inserted replaced
34462:ce5b18ce2ed5 34463:c269a10aca11
   200 
   200 
   201     /**
   201     /**
   202      * FEATURE_SECURE_PROCESSING (FSP) is true by default
   202      * FEATURE_SECURE_PROCESSING (FSP) is true by default
   203      */
   203      */
   204     public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
   204     public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL;
   205 
       
   206     /**
       
   207      * Check if we're in jdk8 or above
       
   208      */
       
   209     public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
       
   210 
   205 
   211     //
   206     //
   212     // Implementation limits: corresponding System Properties of the above
   207     // Implementation limits: corresponding System Properties of the above
   213     // API properties
   208     // API properties
   214     //
   209     //
   854     public static Enumeration getXercesProperties() {
   849     public static Enumeration getXercesProperties() {
   855         return fgXercesProperties.length > 0
   850         return fgXercesProperties.length > 0
   856         ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
   851         ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
   857     } // getXercesProperties():Enumeration
   852     } // getXercesProperties():Enumeration
   858 
   853 
   859     /*
       
   860      * Check the major version of the current JDK against that specified
       
   861      * in the parameter
       
   862      *
       
   863      * In JDK9 the java version string was changed to comply with JEP-223
       
   864      * so this method was modified to handle that new format as well
       
   865      *
       
   866      * @param compareTo a JDK major version to be compared to
       
   867      * @return true if the current major version is the same or above
       
   868      * that represented by the parameter
       
   869      */
       
   870     public static boolean isJavaVersionAtLeast(int compareTo) {
       
   871         String javaVersion = SecuritySupport.getSystemProperty("java.version");
       
   872         javaVersion = (javaVersion.matches("[1-9][0-9]*(\\.(0|[1-9][0-9]*))*\\-.*")) ?
       
   873                           javaVersion.split("-|\\.")[0] :
       
   874                           javaVersion.split("\\.", 3)[1];
       
   875         return Integer.parseInt(javaVersion) >= compareTo;
       
   876     }
       
   877 
       
   878     //
   854     //
   879     // Classes
   855     // Classes
   880     //
   856     //
   881 
   857 
   882     /**
   858     /**