You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2011/08/08 10:36:57 UTC

svn commit: r1154867 - /incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/TSVInput.java

Author: andy
Date: Mon Aug  8 08:36:57 2011
New Revision: 1154867

URL: http://svn.apache.org/viewvc?rev=1154867&view=rev
Log:
JENA-88

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/TSVInput.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/TSVInput.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/TSVInput.java?rev=1154867&r1=1154866&r2=1154867&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/TSVInput.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/com/hp/hpl/jena/sparql/resultset/TSVInput.java Mon Aug  8 08:36:57 2011
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package com.hp.hpl.jena.sparql.resultset;
 
 import java.io.BufferedReader;
@@ -41,7 +59,7 @@ public class TSVInput {
         try {
         	while ( ( str = reader.readLine() ) != null ) {
         		line++;
-        		String[] tokens = pattern.split(str);
+        		String[] tokens = pattern.split(str,-1);
         		if ( first ) {
         			for ( String token : tokens ) {
                 		if ( token.startsWith("?") ) 
@@ -53,8 +71,6 @@ public class TSVInput {
                 	first = false;
         		} else {
         			int num_tokens = tokens.length;
-        			if ( str.endsWith("\t") )
-        				num_tokens += 1;
         	        if ( num_tokens != vars.size() ) {
         	        	 throw new ARQException(String.format("Line %d has %d values instead of %d.", line, num_tokens, vars.size()));
         	        }