sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1354705 - /sqoop/trunk/src/java/org/apache/sqoop/ConnFactory.java
Date Wed, 27 Jun 2012 20:12:34 GMT
Author: blee
Date: Wed Jun 27 20:12:33 2012
New Revision: 1354705

URL: http://svn.apache.org/viewvc?rev=1354705&view=rev
Log:
SQOOP-510  Improve the error message for bad connector files

Modified:
    sqoop/trunk/src/java/org/apache/sqoop/ConnFactory.java

Modified: sqoop/trunk/src/java/org/apache/sqoop/ConnFactory.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/org/apache/sqoop/ConnFactory.java?rev=1354705&r1=1354704&r2=1354705&view=diff
==============================================================================
--- sqoop/trunk/src/java/org/apache/sqoop/ConnFactory.java (original)
+++ sqoop/trunk/src/java/org/apache/sqoop/ConnFactory.java Wed Jun 27 20:12:33 2012
@@ -149,6 +149,10 @@ public class ConnFactory {
       String line;
       while ((line = r.readLine()) != null) {
         int separator = line.indexOf('=');
+        if (separator == -1) {
+          throw new IOException("the content of connector file must be "
+              + "in form of key=value");
+        }
         String key = line.substring(0, separator).trim();
         String value = line.substring(separator + 1).trim();
         props.setProperty(key, value);



Mime
View raw message