db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r615953 - /db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java
Date Mon, 28 Jan 2008 17:01:38 GMT
Author: rhillegas
Date: Mon Jan 28 09:01:36 2008
New Revision: 615953

URL: http://svn.apache.org/viewvc?rev=615953&view=rev
Log:
DERBY-3129: Improve vti which parses property files - don't choke on lines which don't have
an = in them as occurs in the message properties for DRDA in 10.2 and 10.3.

Modified:
    db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java

Modified: db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java?rev=615953&r1=615952&r2=615953&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java
(original)
+++ db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java
Mon Jan 28 09:01:36 2008
@@ -124,8 +124,16 @@
         int         equalsIdx = nextLine.indexOf( '=' );
 
         try {
-            newRow[ PROPERTY_KEY ] = nextLine.substring( 0, equalsIdx );
-            newRow[ PROPERTY_VALUE ] = nextLine.substring( equalsIdx, nextLine.length() );
+            if ( equalsIdx >= 0 )
+            {
+                newRow[ PROPERTY_KEY ] = nextLine.substring( 0, equalsIdx );
+                newRow[ PROPERTY_VALUE ] = nextLine.substring( equalsIdx, nextLine.length()
);
+            }
+            else
+            {
+                newRow[ PROPERTY_KEY ] = nextLine;
+                newRow[ PROPERTY_VALUE ] = "";
+            }
         }
         catch (Throwable t)
         {



Mime
View raw message