You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2011/07/04 11:11:02 UTC

svn commit: r1142591 - /db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java

Author: kahatlen
Date: Mon Jul  4 09:11:02 2011
New Revision: 1142591

URL: http://svn.apache.org/viewvc?rev=1142591&view=rev
Log:
DERBY-5310: PropertySetter prints warning when building with JDK 7

Make PropertySetter recognize "Oracle Corporation" in java.vendor.

Modified:
    db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java

Modified: db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java?rev=1142591&r1=1142590&r2=1142591&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyPreBuild/PropertySetter.java Mon Jul  4 09:11:02 2011
@@ -122,6 +122,7 @@ public class PropertySetter extends Task
     private static  final   String  JDK_APPLE = "Apple ";
     private static  final   String  JDK_IBM = "IBM Corporation";
     private static  final   String  JDK_SUN = "Sun Microsystems Inc.";
+    private static  final   String  JDK_ORACLE = "Oracle Corporation";
 
     private static  final   String  APPLE_CLASSES_DIR = "Classes";
     private static  final   String  APPLE_COMMANDS_DIR = "Commands";
@@ -305,7 +306,7 @@ public class PropertySetter extends Task
 
             if (  jdkVendor.startsWith( JDK_APPLE ) ) { setForAppleJDKs(); }
             else if ( usingIBMjdk( jdkVendor ) ) { setForIbmJDKs(); }
-            else if ( JDK_SUN.equals( jdkVendor ) ) { setForSunJDKs(); }
+            else if ( usingOracleJDK( jdkVendor ) ) { setForOracleJDKs(); }
             else {
                 // We don't know anything about this vendor. Print a warning
                 // message and try to continue.
@@ -400,17 +401,17 @@ public class PropertySetter extends Task
     
     /////////////////////////////////////////////////////////////////////////
     //
-    //  SET PROPERTIES FOR Sun JDKs
+    //  SET PROPERTIES FOR Oracle JDKs
     //
     /////////////////////////////////////////////////////////////////////////
 
     /**
      * <p>
-     * Set the properties needed to compile using the Sun JDKs. This
+     * Set the properties needed to compile using the Oracle JDKs. This
      * has been tested on Linux and SunOS.
      * </p>
      */
-    private void    setForSunJDKs()
+    private void setForOracleJDKs()
         throws Exception
     {
         setForMostJDKsJARInspection("1.4", "1.5", "1.6");
@@ -1180,7 +1181,15 @@ public class PropertySetter extends Task
     {
         return JDK_IBM.equals( jdkVendor );
     }
-    
+
+    /**
+     * Return true if we are using an Oracle JDK.
+     */
+    private static boolean usingOracleJDK(String vendor)
+    {
+        return JDK_SUN.equals(vendor) || JDK_ORACLE.equals(vendor);
+    }
+
     /**
      * <p>
      * Get a property value. Returns null if the property is not set.