private static boolean isGABuild ( ) { boolean result = true ; final Properties props = new Properties ( ) ; AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { @ Override public Object run ( ) { try { final File version = new File ( getInstallDir ( ) , "lib/versions/WebSphereApplicationServer.properties" ) ; Reader r = new InputStreamReader ( new FileInputStream ( version ) , "UTF-8" ) ; props . load ( r ) ; r . close ( ) ; } catch ( IOException e ) { // ignore because we fail safe. Returning true will result in a GA suitable schema } return null ; } } ) ; String v = props . getProperty ( "com.ibm.websphere.productVersion" ) ; if ( v != null ) { int index = v . indexOf ( ' ' ) ; if ( index != - 1 ) { try { int major = Integer . parseInt ( v . substring ( 0 , index ) ) ; if ( major > 2012 ) { result = false ; } } catch ( NumberFormatException nfe ) { // ignore because we fail safe. True for this hides stuff } } } return result ; }
Work out whether we should generate the schema for a GA build or not .