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 rh...@apache.org on 2008/01/28 18:01:38 UTC
svn commit: r615953 -
/db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/PropertyFileVTI.java
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)
{