empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1231016 - /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBColumn.java
Date Fri, 13 Jan 2012 11:41:13 GMT
Author: doebele
Date: Fri Jan 13 11:41:13 2012
New Revision: 1231016

URL: http://svn.apache.org/viewvc?rev=1231016&view=rev
Log:
EMPIREDB-126
throw a DBDatabaseNotOpenException rather than a NullPointerException in DBColumn when database
is not open.

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBColumn.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBColumn.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBColumn.java?rev=1231016&r1=1231015&r2=1231016&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBColumn.java (original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBColumn.java Fri
Jan 13 11:41:13 2012
@@ -19,13 +19,14 @@
 package org.apache.empire.db;
 
 // Java
+import java.util.Set;
+
 import org.apache.empire.commons.Options;
 import org.apache.empire.data.Column;
+import org.apache.empire.db.exceptions.DatabaseNotOpenException;
 import org.apache.empire.db.expr.set.DBSetExpr;
 import org.w3c.dom.Element;
 
-import java.util.Set;
-
 
 /**
  * This is the base class for all database columns that have a physical representation.
@@ -155,6 +156,8 @@ public abstract class DBColumn extends D
         }
         // Append the name
         DBDatabaseDriver driver = getDatabase().getDriver();
+        if (driver==null)
+        	throw new DatabaseNotOpenException(getDatabase());
         if (quoteName==null)
             quoteName = driver.detectQuoteName(name);
         // Append the name



Mime
View raw message