aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/com/healthmarketscience/jackcess/TestUtil.java
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2024-02-08 03:00:28 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2024-02-08 03:00:28 +0000
commit22bf8a8642c84fc500f5c66ef59de1f7211f93a3 (patch)
treecfe24fb10166143833b360da38be7f0bc03300a7 /src/test/java/com/healthmarketscience/jackcess/TestUtil.java
parent672387c5a4499e6c104a1c09dc845a5cdb6c62f1 (diff)
downloadjackcess-22bf8a8642c84fc500f5c66ef59de1f7211f93a3.tar.gz
jackcess-22bf8a8642c84fc500f5c66ef59de1f7211f93a3.zip
cleanup some compiler warnings, thanks Markus Spann
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1407 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com/healthmarketscience/jackcess/TestUtil.java')
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/TestUtil.java37
1 files changed, 8 insertions, 29 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/TestUtil.java b/src/test/java/com/healthmarketscience/jackcess/TestUtil.java
index 97139b8..fae1fa0 100644
--- a/src/test/java/com/healthmarketscience/jackcess/TestUtil.java
+++ b/src/test/java/com/healthmarketscience/jackcess/TestUtil.java
@@ -16,14 +16,7 @@ limitations under the License.
package com.healthmarketscience.jackcess;
-import java.io.DataInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
+import java.io.*;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
@@ -31,24 +24,13 @@ import java.nio.charset.Charset;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.TimeZone;
-
-import static com.healthmarketscience.jackcess.Database.*;
+import java.util.*;
+import java.util.stream.StreamSupport;
+
+import com.healthmarketscience.jackcess.Database.FileFormat;
import com.healthmarketscience.jackcess.complex.ComplexValueForeignKey;
-import com.healthmarketscience.jackcess.impl.ByteUtil;
-import com.healthmarketscience.jackcess.impl.DatabaseImpl;
-import com.healthmarketscience.jackcess.impl.IndexData;
-import com.healthmarketscience.jackcess.impl.IndexImpl;
-import com.healthmarketscience.jackcess.impl.JetFormatTest;
+import com.healthmarketscience.jackcess.impl.*;
import com.healthmarketscience.jackcess.impl.JetFormatTest.TestDB;
-import com.healthmarketscience.jackcess.impl.RowIdImpl;
-import com.healthmarketscience.jackcess.impl.RowImpl;
import com.healthmarketscience.jackcess.util.MemFileChannel;
import org.junit.Assert;
@@ -264,11 +246,8 @@ public class TestUtil
}
public static int countRows(Table table) throws Exception {
- int rtn = 0;
- for(Map<String, Object> row : CursorBuilder.createCursor(table)) {
- rtn++;
- }
- return rtn;
+ Cursor cursor = CursorBuilder.createCursor(table);
+ return (int) StreamSupport.stream(cursor.spliterator(), false).count();
}
public static void assertTable(