db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r935700 - in /db/derby/code/trunk/java: drda/org/apache/derby/drda/ testing/org/apache/derbyTesting/functionTests/tests/derbynet/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ testing/org/apache/derbyTesting/functionTests/tes...
Date Mon, 19 Apr 2010 18:39:33 GMT
Author: kmarsden
Date: Mon Apr 19 18:39:32 2010
New Revision: 935700

URL: http://svn.apache.org/viewvc?rev=935700&view=rev
Log:
DERBY-4441 Change sysinfo to print out more specific JVM information

Contributed by lilywei at yahoo dot com
Show system properties java.runtime.version and java.fullversion with sysinfo  to give more
specific JVM information.


Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/drda/server.policy
    db/derby/code/trunk/java/drda/org/apache/derby/drda/template.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/drda/server.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/drda/server.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/drda/server.policy (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/drda/server.policy Mon Apr 19 18:39:32
2010
@@ -54,8 +54,12 @@ grant codeBase "${derby.install.url}derb
   permission java.util.PropertyPermission "user.*", "read";
   permission java.util.PropertyPermission "java.home", "read";
   permission java.util.PropertyPermission "java.class.path", "read";
+  permission java.util.PropertyPermission "java.runtime.version", "read";
+  permission java.util.PropertyPermission "java.fullversion", "read";
   permission java.lang.RuntimePermission "getProtectionDomain";
   permission java.io.FilePermission "<<ALL FILES>>", "read";
+  permission java.io.FilePermission "java.runtime.version", "read";
+  permission java.io.FilePermission "java.fullversion", "read";
 
 //
 // Permissions needed for JMX based management and monitoring, which is only
@@ -123,8 +127,12 @@ grant codeBase "${derby.install.url}derb
   permission java.util.PropertyPermission "user.*", "read";
   permission java.util.PropertyPermission "java.home", "read";
   permission java.util.PropertyPermission "java.class.path", "read";
+  permission java.util.PropertyPermission "java.runtime.version", "read";
+  permission java.util.PropertyPermission "java.fullversion", "read";
   permission java.lang.RuntimePermission "getProtectionDomain";
   permission java.io.FilePermission "<<ALL FILES>>", "read";
+  permission java.io.FilePermission "java.runtime.version", "read";
+  permission java.io.FilePermission "java.fullversion", "read";
 };
 
 
@@ -142,8 +150,12 @@ grant codeBase "${derby.install.url}derb
   permission java.util.PropertyPermission "user.*", "read";
   permission java.util.PropertyPermission "java.home", "read";
   permission java.util.PropertyPermission "java.class.path", "read";
+  permission java.util.PropertyPermission "java.runtime.version", "read";
+  permission java.util.PropertyPermission "java.fullversion", "read";
   permission java.lang.RuntimePermission "getProtectionDomain";
   permission java.io.FilePermission "<<ALL FILES>>", "read";
+  permission java.io.FilePermission "java.runtime.version", "read";
+  permission java.io.FilePermission "java.fullversion", "read";
 };
 
 grant codeBase "${derby.install.url}derbyclient.jar"
@@ -160,8 +172,12 @@ grant codeBase "${derby.install.url}derb
   permission java.util.PropertyPermission "user.*", "read";
   permission java.util.PropertyPermission "java.home", "read";
   permission java.util.PropertyPermission "java.class.path", "read";
+  permission java.util.PropertyPermission "java.runtime.version", "read";
+  permission java.util.PropertyPermission "java.fullversion", "read";
   permission java.lang.RuntimePermission "getProtectionDomain";
   permission java.io.FilePermission "<<ALL FILES>>", "read";
+  permission java.io.FilePermission "java.runtime.version", "read";
+  permission java.io.FilePermission "java.fullversion", "read";
 };
 
 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/drda/template.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/drda/template.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/drda/template.policy (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/drda/template.policy Mon Apr 19 18:39:32
2010
@@ -128,7 +128,11 @@ grant codeBase "${derby.install.url}derb
   permission java.util.PropertyPermission "user.*", "read";
   permission java.util.PropertyPermission "java.home", "read";
   permission java.util.PropertyPermission "java.class.path", "read";
+  permission java.util.PropertyPermission "java.runtime.version", "read";
+  permission java.util.PropertyPermission "java.fullversion", "read";
   permission java.lang.RuntimePermission "getProtectionDomain";
   permission java.io.FilePermission "<<ALL FILES>>", "read";
+  permission java.io.FilePermission "java.runtime.version", "read";
+  permission java.io.FilePermission "java.fullversion", "read";
 };
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy
Mon Apr 19 18:39:32 2010
@@ -49,6 +49,8 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "derby.storage.jvmInstanceId", 
       "write"; 
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -89,6 +91,8 @@ grant codeBase "${derbyTesting.codejar}d
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy
Mon Apr 19 18:39:32 2010
@@ -47,9 +47,10 @@
 //
 grant codeBase "${derbyTesting.codejar}derby.jar" {
   permission java.util.PropertyPermission "derby.*", "read";
-permission java.util.PropertyPermission "derby.storage.jvmInstanceId", 
-      "write"; 
+  permission java.util.PropertyPermission "derby.storage.jvmInstanceId", "write";
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -85,6 +86,8 @@ permission java.util.PropertyPermission 
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
Mon Apr 19 18:39:32 2010
@@ -53,6 +53,8 @@ permission java.util.PropertyPermission 
   permission java.util.PropertyPermission "sun.arch.data.model", "read";
   permission java.util.PropertyPermission "os.arch", "read";
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -134,6 +136,8 @@ permission java.util.PropertyPermission 
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
Mon Apr 19 18:39:32 2010
@@ -49,6 +49,8 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "derby.storage.jvmInstanceId", 
       "write"; 
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read, write";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read, write";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -89,6 +91,8 @@ grant codeBase "${derbyTesting.codejar}d
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read, write";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read, write";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.java
Mon Apr 19 18:39:32 2010
@@ -208,10 +208,10 @@ public class SysinfoTest extends BaseJDB
 
         Process p = execJavaCmd(SysInfoCmd);
         String s = readProcessOutput(p);
-
         s = sed(s);
-
+ 
         print("testSysinfo", s);
+  
         assertMatchingStringExists(s);
     }
 
@@ -243,8 +243,12 @@ public class SysinfoTest extends BaseJDB
                 "-p", String.valueOf(TestConfiguration.getCurrent().getPort())};
         Process p = execJavaCmd(SysInfoLocaleCmd);
         String s = readProcessOutput(p);
+        //System.out.println("before sed");
+        //System.out.println(s);
         s = sed(s);
 
+        //System.out.println("after sed");
+        //System.out.println(s);
         print("testSysinfoLocale", s);
         assertMatchingStringExists(s);
     }
@@ -260,8 +264,10 @@ public class SysinfoTest extends BaseJDB
         /**
          * Lines containing these strings will be deleted from the output before
          * asserting that output is correct.
+         * ibm jvm prints extra line for java.fullversion
          */
-        String[] sed = {"Version", "version", "Java", "OS", 
+        String[] sed = {"Version", "version", "Java", "OS",
+        		"J9VM", "JIT", "GC",
                 "[0-9*]\\.[0-9*]\\.[0-9*]","JRE - JDBC","derby.drda.traceDirectory",
                 "Unable to access Protection Domain","listing properties",
                 "Current Locale",           //Remove these because locale info is

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
Mon Apr 19 18:39:32 2010
@@ -47,12 +47,13 @@
 //
 grant codeBase "${derbyTesting.codejar}derby.jar" {
   permission java.util.PropertyPermission "derby.*", "read";
-permission java.util.PropertyPermission "derby.storage.jvmInstanceId", 
-      "write"; 
+  permission java.util.PropertyPermission "derby.storage.jvmInstanceId", "write";
   // The next two properties are used to determine if the VM is 32 or 64 bit.
   permission java.util.PropertyPermission "sun.arch.data.model", "read";
   permission java.util.PropertyPermission "os.arch", "read";
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -134,6 +135,8 @@ permission java.util.PropertyPermission 
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)
@@ -143,7 +146,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.net.SocketPermission "${derbyTesting.serverhost}", "accept,connect";
   // Need to be able to write to trace file for NetworkServerControlApiTest
   permission java.io.FilePermission "${user.dir}${/}system${/}trace${/}-", "write"; 
-    // Needed for NetworkServerMBean access (see JMX section above)
+  // Needed for NetworkServerMBean access (see JMX section above)
   permission org.apache.derby.security.SystemPermission "server", "control,monitor";
   
 };
@@ -162,6 +165,8 @@ grant codeBase "${derbyTesting.clientjar
   // the classpath.
   permission java.util.PropertyPermission "derby.*", "read";
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
 
   // DERBY-2302: derbyclient.jar needs to be able to read the user.dir property in order
to
   // do tracing in that directory. Also, it needs read/write permissions in user.dir in order

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
Mon Apr 19 18:39:32 2010
@@ -52,6 +52,8 @@ grant codeBase "${derbyTesting.codejar}d
 permission java.util.PropertyPermission "derby.storage.jvmInstanceId", 
       "write"; 
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -124,6 +126,8 @@ permission java.util.PropertyPermission 
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy
Mon Apr 19 18:39:32 2010
@@ -49,6 +49,8 @@ grant codeBase "${derbyTesting.codejar}d
 permission java.util.PropertyPermission "derby.storage.jvmInstanceId", 
       "write"; 
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -88,6 +90,8 @@ permission java.util.PropertyPermission 
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
Mon Apr 19 18:39:32 2010
@@ -53,6 +53,8 @@ permission java.util.PropertyPermission 
   permission java.util.PropertyPermission "sun.arch.data.model", "read";
   permission java.util.PropertyPermission "os.arch", "read";
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)
@@ -134,6 +136,8 @@ permission java.util.PropertyPermission 
 //
 grant codeBase "${derbyTesting.codejar}derbynet.jar" {
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
+  permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
+  permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
   
   // accept is needed for the server accepting connections
   // connect is needed for ping command (which is in the server jar)

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java?rev=935700&r1=935699&r2=935700&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/sysinfo/Main.java Mon Apr 19
18:39:32 2010
@@ -303,23 +303,49 @@ public static void getMainInfo (java.io.
 
 	localAW.println("java.specification.name: " + getJavaProperty("java.specification.name"));
 	localAW.println("java.specification.version: " + getJavaProperty("java.specification.version"));
+	printPropertyIfNotNull(localAW, "java.runtime.version");
+	printPropertyIfNotNull(localAW, "java.fullversion");
 
 
   } // end of reportJavaInfo
 
-
-
   /**
-    Return Java properties from java.lang.System. Will catch
-    SecurityExceptions and note them for displaying information.
-
-    @return the Java property value or a string capturing a
-    security exception.
+   * Print property only if not null
+   * 
+   * @param localAW This is PrintWriter to print to
+   * @param property This is system property string
    */
+  private static void printPropertyIfNotNull(java.io.PrintWriter localAW, String property)
{
+    String propertyValue = getJavaProperty(property, true);	
 
+    if (propertyValue != null) {
+        localAW.println(property + ": " + propertyValue);
+    }
+}
+  
+  /**
+   * Return Java properties from java.lang.System. Will catch
+   * SecurityExceptions and note them for displaying information.
+   * @param whichProperty This is the name of the property
+   * 
+   * @return getJavaProperty(whichProperty, false) 
+   */
   private static String getJavaProperty (final String whichProperty) {
+	  return getJavaProperty(whichProperty, false);  
+  }
+ 
+  /**
+   * Return Java properties from java.lang.System. Will catch
+   * SecurityExceptions and note them for displaying information.
+   * @param whichProperty This is the name of the property
+   * @param nullUnavailable return nothing if no such java property and nullUnavailable is
true
+   * @return the Java property value or a string capturing a
+   * security exception.
+   */
+
+  private static String getJavaProperty (final String whichProperty, boolean nullUnavailable)
{
 
-    final   String unavailable = Main.getTextMessage ("SIF01.H");
+    final   String unavailable = nullUnavailable ? null : Main.getTextMessage ("SIF01.H");
 
     try {
         String  property = (String) AccessController.doPrivileged( new PrivilegedAction()



Mime
View raw message