[Git][java-team/csvjdbc][master] 4 commits: Added Headline to debian/maven.rules

Mechtilde Stehmann gitlab at salsa.debian.org
Sun Dec 22 17:55:11 GMT 2019



Mechtilde Stehmann pushed to branch master at Debian Java Maintainers / csvjdbc


Commits:
cb3d027f by Mechtilde at 2019-12-22T17:34:52Z
Added Headline to debian/maven.rules

- - - - -
4ab79722 by Mechtilde at 2019-12-22T17:35:07Z
New upstream version 1.0.36+ds
- - - - -
935b2ec9 by Mechtilde at 2019-12-22T17:35:16Z
Update upstream source from tag 'upstream/1.0.36+ds'

Update to upstream version '1.0.36+ds'
with Debian dir 8f99bd8af766efb3fbf5d7c0d3b3c947cdff68e3
- - - - -
2dffff08 by Mechtilde at 2019-12-22T17:49:44Z
Prepared for release: debian/changelog

- - - - -


10 changed files:

- .travis.yml
- build/build.xml
- debian/changelog
- debian/maven.rules
- pom.xml
- src/main/java/org/relique/io/FileSetInputStream.java
- src/main/java/org/relique/jdbc/csv/CsvConnection.java
- src/test/java/org/relique/jdbc/csv/TestFileSetInputStream.java
- + src/testdata/petr-333-444.csv
- + src/testdata/petr-555-666.csv


Changes:

=====================================
.travis.yml
=====================================
@@ -1,2 +1,4 @@
 language: java
-install: mvn install -DskipTests=true -Dgpg.skip=true
+jdk:
+  - openjdk8
+install: mvn install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true


=====================================
build/build.xml
=====================================
@@ -36,7 +36,7 @@
   <!-- =================================================================== -->
   <property name="TALK" value="false" />
   <property name="name" value="csvjdbc"/>
-  <property name="rel" value="1.0-35"/>
+  <property name="rel" value="1.0-36"/>
   <property name="rel.name" value="${name}-${rel}"/>
   <property name="build.dir" value="../build"/>
   <property name="src.dir" value="../src"/>


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+csvjdbc (1.0.36+ds-1) unstable; urgency=medium
+
+  [ Mechtilde ]
+  * [cb3d027] Added Headline to debian/maven.rules
+  * [4ab7972] New upstream version 1.0.36+ds
+
+ -- Mechtilde Stehmann <mechtilde at debian.org>  Sun, 22 Dec 2019 18:49:34 +0100
+
 csvjdbc (1.0.35+ds-1) unstable; urgency=medium
 
   [ Christopher Hoskin ]


=====================================
debian/maven.rules
=====================================
@@ -1,3 +1,3 @@
-
+#[groupID] [artifactID] [type] [version] [classifier] [scope]
 junit junit jar s/4\..*/4.x/ * *
 net.sourceforge.csvjdbc csvjdbc jar s/.*/debian/ * *


=====================================
pom.xml
=====================================
@@ -3,7 +3,7 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>net.sourceforge.csvjdbc</groupId>
   <artifactId>csvjdbc</artifactId>
-  <version>1.0.35</version>
+  <version>1.0.36</version>
   <packaging>jar</packaging>
   <name>CsvJdbc</name>
   <description>a Java JDBC driver for reading comma-separated-value files</description>
@@ -18,7 +18,7 @@
 
   <scm>
     <connection>scm:git:ssh://git.code.sf.net/p/csvjdbc/code</connection>
-    <tag>csvjdbc-1.0.35</tag>
+    <tag>csvjdbc-1.0.36</tag>
     <url>http://sourceforge.net/p/csvjdbc/_list/git</url>
   </scm>
 
@@ -72,7 +72,12 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.9.1</version>
+        <version>3.1.1</version>
+        <configuration>
+          <additionalOptions>
+            <additionalOption>-Xdoclint:none</additionalOption>
+          </additionalOptions>
+        </configuration>
         <executions>
           <execution>
             <id>attach-javadocs</id>


=====================================
src/main/java/org/relique/io/FileSetInputStream.java
=====================================
@@ -222,6 +222,13 @@ public class FileSetInputStream extends InputStream
 				doingTail = true;
 				return readFromTail();
 			}
+			if (lookahead == -1 && ch != '\n' && ch != -1)
+			{
+				// If last line of file does not end with a newline,
+				// then add a newline, so prepended fields for the
+				// next file begin on a new line.
+				lookahead = '\n';
+			}
 		}
 		else
 		{


=====================================
src/main/java/org/relique/jdbc/csv/CsvConnection.java
=====================================
@@ -305,6 +305,14 @@ public class CsvConnection implements Connection
 		if (info.getProperty(CsvDriver.SEPARATOR) != null)
 		{
 			separator = info.getProperty(CsvDriver.SEPARATOR);
+
+			// Tab character is a commonly used separator.
+			// Accept tab expanded to two characters '\\' and '\t'. This
+			// occurs if user types properties into a GUI text field,
+			// instead of writing them as Java source code.
+			if (separator.equals("\\t"))
+				separator = "\t";
+
 			if (separator.length() == 0)
 				throw new SQLException(CsvResources.getString("invalid") + " " + CsvDriver.SEPARATOR + ": " + separator);
 		}


=====================================
src/test/java/org/relique/jdbc/csv/TestFileSetInputStream.java
=====================================
@@ -19,6 +19,7 @@
 
 package org.relique.jdbc.csv;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -217,6 +218,39 @@ public class TestFileSetInputStream
 				inputTest.close();
 		}
 	}
+
+	@Test
+	public void testGlueAsLeadingLastLineNoNewline() throws IOException
+	{
+		BufferedReader inputTest = null;
+
+		try
+		{
+			String separator = ",";
+
+			// Test CSV files with no '\n' on last line
+			inputTest = new BufferedReader(new InputStreamReader(
+				new FileSetInputStream(filePath,
+						"petr-([0-9]{3})-([0-9]{3}).csv", new String[] {
+								"part1", "part2" }, separator, true, true, null, 0)));
+
+			String lineTest = inputTest.readLine();
+			while (lineTest != null)
+			{
+				// Files have no special characters, so we can simply split on separator
+				String []columns = lineTest.split(separator);
+				// CSV file contains two columns, plus two extra columns from filename
+				int expectedColumns = 4;
+				assertEquals("Expected number of columns", expectedColumns, columns.length);
+				lineTest = inputTest.readLine();
+			}
+		}
+		finally
+		{
+			if (inputTest != null)
+				inputTest.close();
+		}
+	}
 	
 	@Test
 	public void testFileSetInputStreamClose() throws IOException


=====================================
src/testdata/petr-333-444.csv
=====================================
@@ -0,0 +1,3 @@
+column1,column2
+abc,def
+ghi,jkl
\ No newline at end of file


=====================================
src/testdata/petr-555-666.csv
=====================================
@@ -0,0 +1,3 @@
+column1,column2
+mno,qrs
+tuv,wxy
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/java-team/csvjdbc/compare/9ff7f94711720fb0d32ffb1f246a6e269b6e72a4...2dffff08dd96e59c0594cd9546f500d70279f3c1

-- 
View it on GitLab: https://salsa.debian.org/java-team/csvjdbc/compare/9ff7f94711720fb0d32ffb1f246a6e269b6e72a4...2dffff08dd96e59c0594cd9546f500d70279f3c1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20191222/f872273a/attachment.html>


More information about the pkg-java-commits mailing list