openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r644177 - in /openjpa: branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Date Thu, 03 Apr 2008 05:52:39 GMT
Author: fancy
Date: Wed Apr  2 22:52:38 2008
New Revision: 644177

URL: http://svn.apache.org/viewvc?rev=644177&view=rev
Log:
OPENJPA-555 MappingTool got NullPointerException in DB2Dictionary.isDB2ZOSV8xOrLater() 

Modified:
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=644177&r1=644176&r2=644177&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Wed Apr  2 22:52:38 2008
@@ -359,7 +359,8 @@
 
     public boolean isDB2UDBV82OrLater() {
         boolean match = false;
-        if ((databaseProductVersion.indexOf("SQL") != -1
+        if (databaseProductName != null &&
+            (databaseProductVersion.indexOf("SQL") != -1
             || databaseProductName.indexOf("DB2/") != -1)
             && ((maj == 8 && min >= 2) || (maj >= 9)))
             match = true;
@@ -368,7 +369,8 @@
 
     public boolean isDB2ZOSV8xOrLater() {
        boolean match = false;
-       if ((databaseProductVersion.indexOf("DSN") != -1
+       if (databaseProductName != null &&
+           (databaseProductVersion.indexOf("DSN") != -1
            || databaseProductName.indexOf("DB2/") == -1)
            && maj >= 8)
            match = true;
@@ -377,7 +379,8 @@
 
     public boolean isDB2ISeriesV5R3OrEarlier() {
        boolean match = false;
-       if (databaseProductName.indexOf("AS") != -1
+       if (databaseProductName != null &&
+           databaseProductName.indexOf("AS") != -1
            && ((maj == 5 && min <=3) || maj < 5))
            match = true;
        return match;
@@ -385,7 +388,8 @@
 
     public boolean isDB2ISeriesV5R4OrLater() {
        boolean match = false;
-       if (databaseProductName.indexOf("AS") != -1
+       if (databaseProductName != null &&
+           databaseProductName.indexOf("AS") != -1
            && (maj >=6 || (maj == 5 && min >=4)))
            match = true;
       return match;
@@ -393,9 +397,10 @@
 
     public boolean isDB2UDBV81OrEarlier() {
         boolean match = false;
-        if ((databaseProductVersion.indexOf("SQL") != -1 
-           || databaseProductName.indexOf("DB2/") != -1) &&
-           ((maj == 8 && min <= 1) || maj < 8))
+        if (databaseProductName != null &&
+            (databaseProductVersion.indexOf("SQL") != -1 
+            || databaseProductName.indexOf("DB2/") != -1) &&
+            ((maj == 8 && min <= 1) || maj < 8))
             match = true;
         return match;
     }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=644177&r1=644176&r2=644177&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Wed Apr  2 22:52:38 2008
@@ -390,7 +390,8 @@
 
     public boolean isDB2UDBV82OrLater() {
         boolean match = false;
-        if ((databaseProductVersion.indexOf("SQL") != -1
+        if (databaseProductName != null &&
+            (databaseProductVersion.indexOf("SQL") != -1
             || databaseProductName.indexOf("DB2/") != -1)
             && ((maj == 8 && min >= 2) || (maj >= 9)))
             match = true;
@@ -399,7 +400,8 @@
 
     public boolean isDB2ZOSV8xOrLater() {
        boolean match = false;
-       if ((databaseProductVersion.indexOf("DSN") != -1
+       if (databaseProductName != null &&
+           (databaseProductVersion.indexOf("DSN") != -1
            || databaseProductName.indexOf("DB2/") == -1)
            && maj >= 8)
            match = true;
@@ -408,7 +410,8 @@
 
     public boolean isDB2ISeriesV5R3OrEarlier() {
        boolean match = false;
-       if (databaseProductName.indexOf("AS") != -1
+       if (databaseProductName != null &&
+           databaseProductName.indexOf("AS") != -1
            && ((maj == 5 && min <=3) || maj < 5))
            match = true;
        return match;
@@ -416,7 +419,8 @@
 
     public boolean isDB2ISeriesV5R4OrLater() {
        boolean match = false;
-       if (databaseProductName.indexOf("AS") != -1
+       if (databaseProductName != null &&
+           databaseProductName.indexOf("AS") != -1
            && (maj >=6 || (maj == 5 && min >=4)))
            match = true;
       return match;
@@ -424,9 +428,10 @@
 
     public boolean isDB2UDBV81OrEarlier() {
         boolean match = false;
-        if ((databaseProductVersion.indexOf("SQL") != -1 
-           || databaseProductName.indexOf("DB2/") != -1) &&
-           ((maj == 8 && min <= 1) || maj < 8))
+        if (databaseProductName != null &&
+            (databaseProductVersion.indexOf("SQL") != -1 
+            || databaseProductName.indexOf("DB2/") != -1) &&
+            ((maj == 8 && min <= 1) || maj < 8))
             match = true;
         return match;
     }



Mime
View raw message