[Git][java-team/libfastutil-java][master] 10 commits: New upstream version 8.5.9+dfsg
Pierre Gruet (@pgt)
gitlab at salsa.debian.org
Sat Oct 1 23:31:36 BST 2022
Pierre Gruet pushed to branch master at Debian Java Maintainers / libfastutil-java
Commits:
5c05a300 by Pierre Gruet at 2022-09-30T22:14:32+02:00
New upstream version 8.5.9+dfsg
- - - - -
3596b127 by Pierre Gruet at 2022-09-30T22:14:36+02:00
Update upstream source from tag 'upstream/8.5.9+dfsg'
Update to upstream version '8.5.9+dfsg'
with Debian dir 3c65d11f84a5d1585edd05f2422aa16af6653d40
- - - - -
607650bc by Pierre Gruet at 2022-09-30T22:16:00+02:00
Raising Standards version to 4.6.1 (no change)
- - - - -
fa92ac45 by Pierre Gruet at 2022-09-30T22:16:21+02:00
Updating changelog
- - - - -
1345256d by Pierre Gruet at 2022-09-30T22:42:22+02:00
Correcting mismatch Lintian overrides
- - - - -
964f9309 by Pierre Gruet at 2022-10-01T14:05:16+02:00
Running unit tests at build time
- - - - -
cc4a1a9c by Pierre Gruet at 2022-10-01T14:05:37+02:00
Fixing an overflow of Long in the tests
- - - - -
4710e6f7 by Pierre Gruet at 2022-10-01T14:45:14+02:00
Updating changelog
- - - - -
cc7023fe by Pierre Gruet at 2022-10-01T15:41:46+02:00
Moving the javadoc build after the tests
- - - - -
eeb00301 by Pierre Gruet at 2022-10-01T15:42:04+02:00
Upload to unstable
- - - - -
25 changed files:
- .settings/org.eclipse.jdt.core.prefs
- CHANGES
- TODO
- build.properties
- debian/changelog
- debian/control
- debian/libfastutil-java-doc.lintian-overrides
- + debian/patches/long_overflow.patch
- + debian/patches/series
- + debian/patches/test_classpath.patch
- debian/rules
- drv/ArrayFIFOQueue.drv
- drv/BinIO.drv
- drv/BinIOFragment.drv
- drv/HeapIndirectPriorityQueue.drv
- src/it/unimi/dsi/fastutil/Arrays.java
- src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java
- src/overview.html
- test/it/unimi/dsi/fastutil/ArraysTest.java
- test/it/unimi/dsi/fastutil/BigArraysTest.java
- test/it/unimi/dsi/fastutil/ints/AbstractInt2IntMapTest.java
- test/it/unimi/dsi/fastutil/ints/IntArrayFIFOQueueTest.java
- test/it/unimi/dsi/fastutil/io/BinIOTest.java
- test/it/unimi/dsi/fastutil/objects/Reference2ReferenceArrayMapTest.java
- test/it/unimi/dsi/fastutil/objects/ReferenceArraySetTest.java
Changes:
=====================================
.settings/org.eclipse.jdt.core.prefs
=====================================
@@ -24,7 +24,7 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
=====================================
CHANGES
=====================================
@@ -1,3 +1,15 @@
+8.5.9
+
+- Using BinIO to save arrays with a memory footprint larger than 2^31
+ bytes would have thrown an exception. Thanks to Sebastian Nagel for
+ reporting this bug.
+
+- The capacity of pre-sized array FIFO queues was one element less than
+ necessary to avoid resizing at the given expected size.
+
+- Arrays.ensureOffsetLength() could not work properly due to an
+ integer overflow. Thanks to Alex Herbert for fixing this bug.
+
8.5.8
- Fixed erroneous switch to Java 9.
=====================================
TODO
=====================================
@@ -1,3 +1,4 @@
+- Buffer bulk methods with index to get rid of mapped buffer duplication
- Loops in sorting for big arrays should use real indices, not get/set
- Check that binary insertion sort is maybe better
- radix sort for big arrays
=====================================
build.properties
=====================================
@@ -3,7 +3,7 @@ javadoc.base=/usr/share/javadoc
build.sysclasspath=ignore
-version=8.5.8
+version=8.5.9
dist=dist
src=src
=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+libfastutil-java (8.5.9+dfsg-1) unstable; urgency=medium
+
+ * New upstream version 8.5.9+dfsg
+ * Raising Standards version to 4.6.1 (no change)
+ * Correcting mismatched Lintian overrides after a change in their syntax
+ * Running unit tests at build time, previously they were ignored
+ * Fixing an overflow of Long in the tests
+ * Moving the javadoc build after running the tests
+
+ -- Pierre Gruet <pgt at debian.org> Sat, 01 Oct 2022 15:41:52 +0200
+
libfastutil-java (8.5.8+dfsg-1) unstable; urgency=medium
* New upstream version 8.5.8+dfsg
=====================================
debian/control
=====================================
@@ -6,11 +6,14 @@ Uploaders: Andreas Tille <tille at debian.org>,
Section: java
Priority: optional
Build-Depends: debhelper-compat (= 13),
- javahelper,
- default-jdk,
ant,
+ ant-optional <!nocheck>,
+ default-jdk,
+ javahelper,
+ junit4 <!nocheck>,
+ libhamcrest-java <!nocheck>,
maven-repo-helper
-Standards-Version: 4.6.0
+Standards-Version: 4.6.1
Rules-Requires-Root: no
Vcs-Browser: https://salsa.debian.org/java-team/libfastutil-java
Vcs-Git: https://salsa.debian.org/java-team/libfastutil-java.git
=====================================
debian/libfastutil-java-doc.lintian-overrides
=====================================
@@ -1,4 +1,4 @@
# It would be too complicated to remove the javascript that is included in
# javadocs, see the discussion on Debian Java mailing list starting at
# https://lists.debian.org/debian-java/2018/06/msg00020.html.
-embedded-javascript-library usr/share/doc/libfastutil-java/jquery/*
+embedded-javascript-library please use * [usr/share/doc/libfastutil-java/jquery/*]
=====================================
debian/patches/long_overflow.patch
=====================================
@@ -0,0 +1,16 @@
+Description: Dividing Long.MAX_VALUE by 2 as some tiny long will be added to
+ it, in order to avoid being back to negative long values.
+Author: Pierre Gruet <pgt at debian.org>
+Forwarded: sebastiano.vigna at unimi.it
+Last-Update: 2022-10-01
+
+--- a/test/it/unimi/dsi/fastutil/BigArraysTest.java
++++ b/test/it/unimi/dsi/fastutil/BigArraysTest.java
+@@ -70,6 +70,6 @@
+
+ @Test(expected = ArrayIndexOutOfBoundsException.class)
+ public void testEnsureOffSetLength() {
+- BigArrays.ensureOffsetLength(42, Long.MAX_VALUE, 10);
++ BigArrays.ensureOffsetLength(42, Long.MAX_VALUE / 2, 10);
+ }
+ }
=====================================
debian/patches/series
=====================================
@@ -0,0 +1,2 @@
+test_classpath.patch
+long_overflow.patch
=====================================
debian/patches/test_classpath.patch
=====================================
@@ -0,0 +1,28 @@
+Description: putting paths to junit and hamcrest jars into build.xml
+Author: Pierre Gruet <pgt at debian.org>
+Forwarded: not-needed
+Last-Update: 2022-09-30
+
+--- a/build.xml
++++ b/build.xml
+@@ -241,7 +241,7 @@
+ debug="on"
+ deprecation="on"
+ optimize="on"
+- classpath="lib/junit-4.13.jar:lib"
++ classpath="/usr/share/java/junit4.jar"
+ destdir="${build}"
+ memoryMaximumSize="2G"
+ fork="yes"
+@@ -298,8 +298,9 @@
+ <junit printsummary="yes" fork="yes" haltonfailure="off" haltonerror="off">
+ <classpath location="${build}"/>
+ <classpath location="${src}"/>
+- <classpath location="lib/junit-4.13.jar"/>
+- <classpath location="lib/hamcrest-all-1.3.jar"/>
++ <classpath location="/usr/share/java/ant-junit.jar"/>
++ <classpath location="/usr/share/java/junit4.jar"/>
++ <classpath location="/usr/share/java/hamcrest-all.jar"/>
+ <jvmarg value="-Xmx3G" />
+
+ <assertions><enable/></assertions>
=====================================
debian/rules
=====================================
@@ -35,9 +35,17 @@ override_dh_auto_build:
# make sources TEST=1 # will compile behavioral and speed tests into the classes
# make sources ASSERTS=1 # will compile assertions into the classes
ant jar
- ant javadoc
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ ant -Duser.name debian junit
+endif
override_mh_installpoms:
# generating the pom file with the version of the package
ant pom
mh_installpoms
+
+execute_before_jh_installjavadoc:
+ # Generating the javadoc before installing it
+ ant javadoc
=====================================
drv/ArrayFIFOQueue.drv
=====================================
@@ -57,13 +57,19 @@ public class ARRAY_FIFO_QUEUE KEY_GENERIC implements PRIORITY_QUEUE KEY_GENERIC,
protected transient int end;
/** Creates a new empty queue with given capacity.
+ *
+ * @implNote Because of inner limitations of the JVM, the initial
+ * capacity cannot exceed {@link it.unimi.dsi.fastutil.Arrays#MAX_ARRAY_SIZE} − 1.
*
* @param capacity the initial capacity of this queue.
*/
SUPPRESS_WARNINGS_KEY_UNCHECKED
public ARRAY_FIFO_QUEUE(final int capacity) {
+ if (capacity > it.unimi.dsi.fastutil.Arrays.MAX_ARRAY_SIZE - 1) throw new IllegalArgumentException("Initial capacity (" + capacity + ") exceeds " + (it.unimi.dsi.fastutil.Arrays.MAX_ARRAY_SIZE - 1));
if (capacity < 0) throw new IllegalArgumentException("Initial capacity (" + capacity + ") is negative");
- array = KEY_GENERIC_ARRAY_CAST new KEY_TYPE[Math.max(1, capacity)]; // Never build a queue with zero-sized backing array.
+ // We never build a queue with a zero-sized backing array; moreover, to
+ // avoid resizing at the given capacity we need one additional element..
+ array = KEY_GENERIC_ARRAY_CAST new KEY_TYPE[Math.max(1, capacity + 1)];
length = array.length;
}
=====================================
drv/BinIO.drv
=====================================
@@ -75,7 +75,7 @@ import it.unimi.dsi.fastutil.floats.*;
* also include a workaround for <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6478546">bug #6478546</a>.
*
* <p>The store methods with a specified byte order are particularly useful when writing
- * data that is intended to be {@linkplain mapped into memory it.unimi.dsi.fastutil.ints.IntMappedBigList},
+ * data that is intended to be {@linkplain it.unimi.dsi.fastutil.ints.IntMappedBigList mapped into memory},
* as using the {@linkplain ByteOrder#nativeOrder() native order} enhances performances significantly.
*
* @since 4.4
=====================================
drv/BinIOFragment.drv
=====================================
@@ -390,7 +390,7 @@ public static int LOAD_KEYS(final ReadableByteChannel channel, final ByteOrder b
int read = 0;
for (;;) {
byteBuffer.clear();
- byteBuffer.limit(Math.min(buffer.capacity(), length << MAPPED_BIG_LIST.LOG2_BYTES));
+ byteBuffer.limit((int)Math.min(buffer.capacity(), (long)length << MAPPED_BIG_LIST.LOG2_BYTES));
int r = channel.read(byteBuffer);
if (r <= 0) return read;
r >>>= MAPPED_BIG_LIST.LOG2_BYTES;
=====================================
drv/HeapIndirectPriorityQueue.drv
=====================================
@@ -51,9 +51,6 @@ public class HEAP_INDIRECT_PRIORITY_QUEUE KEY_GENERIC extends HEAP_SEMI_INDIRECT
*/
public HEAP_INDIRECT_PRIORITY_QUEUE(KEY_GENERIC_TYPE[] refArray, int capacity, KEY_COMPARATOR KEY_SUPER_GENERIC c) {
super(refArray, capacity, c);
- if (capacity > 0) this.heap = new int[capacity];
-
- this.c = c;
this.inv = new int[refArray.length];
Arrays.fill(inv, -1);
=====================================
src/it/unimi/dsi/fastutil/Arrays.java
=====================================
@@ -96,7 +96,7 @@ public class Arrays {
// When Java 9 becomes the minimum, use Objects#checkFromIndexSize, as that can be an intrinsic
if (offset < 0) throw new ArrayIndexOutOfBoundsException("Offset (" + offset + ") is negative");
if (length < 0) throw new IllegalArgumentException("Length (" + length + ") is negative");
- if (offset + length > arrayLength) throw new ArrayIndexOutOfBoundsException("Last index (" + (offset + length) + ") is greater than array length (" + arrayLength + ")");
+ if (length > arrayLength - offset) throw new ArrayIndexOutOfBoundsException("Last index (" + ((long)offset + length) + ") is greater than array length (" + arrayLength + ")");
}
/**
=====================================
src/it/unimi/dsi/fastutil/io/InspectableFileCachedInputStream.java
=====================================
@@ -189,7 +189,6 @@ public class InspectableFileCachedInputStream extends MeasurableInputStream impl
overflowFile.delete();
}
- @SuppressWarnings("deprecation")
@Override
protected void finalize() throws Throwable {
try {
=====================================
src/overview.html
=====================================
@@ -88,7 +88,7 @@
The {@link it.unimi.dsi.fastutil.io.BinIO} and {@link it.unimi.dsi.fastutil.io.TextIO} static
containers contain dozens of methods that make it possible to load and save quickly
(big) arrays to disks, to adapt binary and text file to iterators, and so on.
- Classes such as {@link it.unimi.dsi.fastutil.ints.MappedIntBigList} make it possible
+ Classes such as {@link it.unimi.dsi.fastutil.ints.IntMappedBigList} make it possible
to map into memory large file of primitive types and access them as {@linkplain it.unimi.dsi.fastutil.BigList big lists}.
<h1>More on type-specific classes</h1>
@@ -999,6 +999,12 @@ BinIO.storeObject(s, "foo"); // This method call will save s in the file named "
TextIO.storeInts(s.intIterator(), "foo.txt"); // This method call will save the content of s in ASCII
i = TextIO.asIntIterator("foo.txt"); // This iterator will parse the file and return the integers therein
</pre>
+ <p>You can also store data (of any size) in native format and access it via memory mapping:
+ <pre>
+BinIO.storeLongs(l, "foo", ByteOrder.nativeOrder()); // This method call will save the (big) array of longs l in the file named "foo" in native order
+c = FileChannel.open(new File("foo").toPath());
+m = LongMappedBigList.map(c); // Now you can access the data in l via memory mapping
+ </pre>
<p>Support for Java 8 primitive streams is included for primitive collections (e.g. {@code intStream}),
which will work in terms of primitives instead of boxing to wrapper types like the regular {@code stream} would do:
<pre>
=====================================
test/it/unimi/dsi/fastutil/ArraysTest.java
=====================================
@@ -142,4 +142,8 @@ public class ArraysTest {
testParallelQuickSort(t);
}
+ @Test(expected = ArrayIndexOutOfBoundsException.class)
+ public void testEnsureOffSetLength() {
+ Arrays.ensureOffsetLength(42, Integer.MAX_VALUE, 10);
+ }
}
=====================================
test/it/unimi/dsi/fastutil/BigArraysTest.java
=====================================
@@ -67,4 +67,9 @@ public class BigArraysTest {
// Never completes!
longList.ensureCapacity(2);
}
+
+ @Test(expected = ArrayIndexOutOfBoundsException.class)
+ public void testEnsureOffSetLength() {
+ BigArrays.ensureOffsetLength(42, Long.MAX_VALUE, 10);
+ }
}
=====================================
test/it/unimi/dsi/fastutil/ints/AbstractInt2IntMapTest.java
=====================================
@@ -46,8 +46,8 @@ public class AbstractInt2IntMapTest extends Int2IntMapGenericTest<AbstractInt2In
private final IntList keys = new IntArrayList();
private final IntList values = new IntArrayList();
@Override
- public int get(int key) {
- int index = keys.indexOf(key);
+ public int get(final int key) {
+ final int index = keys.indexOf(key);
if (index == -1) {
return defaultReturnValue();
}
@@ -58,8 +58,8 @@ public class AbstractInt2IntMapTest extends Int2IntMapGenericTest<AbstractInt2In
return keys.size();
}
@Override
- public int put(int key, int value) {
- int index = keys.indexOf(key);
+ public int put(final int key, final int value) {
+ final int index = keys.indexOf(key);
if (index == -1) {
keys.add(key);
values.add(value);
@@ -68,8 +68,8 @@ public class AbstractInt2IntMapTest extends Int2IntMapGenericTest<AbstractInt2In
return values.set(index, value);
}
@Override
- public int remove(int key) {
- int index = keys.indexOf(key);
+ public int remove(final int key) {
+ final int index = keys.indexOf(key);
if (index == -1) {
return defaultReturnValue();
}
@@ -123,11 +123,10 @@ public class AbstractInt2IntMapTest extends Int2IntMapGenericTest<AbstractInt2In
}
@Override
- public int get(int key) {
+ public int get(final int key) {
return -1;
}
- @SuppressWarnings("unchecked")
@Override
public ObjectSet<Entry> int2IntEntrySet() {
return ObjectSets.EMPTY_SET;
@@ -148,7 +147,7 @@ public class AbstractInt2IntMapTest extends Int2IntMapGenericTest<AbstractInt2In
}
@Override
- public int get(int key) {
+ public int get(final int key) {
return key == 0 ? 0 : -1;
}
=====================================
test/it/unimi/dsi/fastutil/ints/IntArrayFIFOQueueTest.java
=====================================
@@ -95,7 +95,7 @@ public class IntArrayFIFOQueueTest {
@Test
public void testWrap() {
- IntArrayFIFOQueue q = new IntArrayFIFOQueue(30);
+ final IntArrayFIFOQueue q = new IntArrayFIFOQueue(30);
for(int i = 0; i < 20; i++) {
q.enqueue(i);
assertEquals(i, q.lastInt());
@@ -162,23 +162,34 @@ public class IntArrayFIFOQueueTest {
@SuppressWarnings("deprecation")
@Test
public void testImmediateReduce() {
- IntArrayFIFOQueue q = new IntArrayFIFOQueue();
+ final IntArrayFIFOQueue q = new IntArrayFIFOQueue();
q.enqueue(0);
q.dequeue();
}
@SuppressWarnings("deprecation")
- private static final void assertSameQueue(IntArrayFIFOQueue a, IntArrayFIFOQueue b) {
+ private static final void assertSameQueue(final IntArrayFIFOQueue a, final IntArrayFIFOQueue b) {
assertEquals(a.size(), b.size());
while(! a.isEmpty() && ! b.isEmpty()) assertEquals(a.dequeue(), b.dequeue());
assertEquals(Boolean.valueOf(a.isEmpty()) , Boolean.valueOf(b.isEmpty()));
}
+ @Test
+ public void testExactlyFull() {
+ final IntArrayFIFOQueue q = new IntArrayFIFOQueue(10);
+ for (int i = 0; i < 10; i++) {
+ q.enqueue(i);
+ assertEquals(i, q.lastInt());
+ }
+
+ assertEquals(0, q.dequeueInt());
+ }
+
@Test
public void testSerialization() throws IOException, ClassNotFoundException {
- File temp = File.createTempFile(IntArrayFIFOQueueTest.class.getSimpleName() + "-", "-test");
+ final File temp = File.createTempFile(IntArrayFIFOQueueTest.class.getSimpleName() + "-", "-test");
temp.deleteOnExit();
- IntArrayFIFOQueue q = new IntArrayFIFOQueue();
+ final IntArrayFIFOQueue q = new IntArrayFIFOQueue();
BinIO.storeObject(q, temp);
assertSameQueue(q, (IntArrayFIFOQueue)BinIO.loadObject(temp));
=====================================
test/it/unimi/dsi/fastutil/io/BinIOTest.java
=====================================
@@ -52,6 +52,7 @@ import it.unimi.dsi.fastutil.bytes.ByteIterators;
import it.unimi.dsi.fastutil.doubles.DoubleBigArrays;
import it.unimi.dsi.fastutil.doubles.DoubleIterator;
import it.unimi.dsi.fastutil.doubles.DoubleIterators;
+import it.unimi.dsi.fastutil.longs.LongMappedBigList;
public class BinIOTest {
@@ -59,8 +60,8 @@ public class BinIOTest {
static final byte[] LARGE = new byte[1024 * 1024 + 42];
static {
- for(int i = SMALL.length; i-- != 0;) SMALL[i] = (byte)i;
- for(int i = LARGE.length; i-- != 0;) LARGE[i] = (byte)i;
+ for (int i = SMALL.length; i-- != 0;) SMALL[i] = (byte)i;
+ for (int i = LARGE.length; i-- != 0;) LARGE[i] = (byte)i;
}
public void testBytes(final byte[] a) throws IOException {
@@ -69,15 +70,27 @@ public class BinIOTest {
final byte[] aShifted = new byte[a.length + 1];
System.arraycopy(a, 0, aShifted, 1, a.length);
- for(int i = 0; i < 6; i++) {
+ for (int i = 0; i < 6; i++) {
file.delete();
- switch(i) {
- case 0: BinIO.storeBytes(a, file); break;
- case 1: BinIO.storeBytes(a, (DataOutput)new DataOutputStream(new FileOutputStream(file))); break;
- case 2: BinIO.storeBytes(a, new FileOutputStream(file)); break;
- case 3: BinIO.storeBytes(aShifted, 1, a.length, file); break;
- case 4: BinIO.storeBytes(aShifted, 1, a.length, (DataOutput)new DataOutputStream(new FileOutputStream(file))); break;
- case 5: BinIO.storeBytes(aShifted, 1, a.length, new FileOutputStream(file)); break;
+ switch (i) {
+ case 0:
+ BinIO.storeBytes(a, file);
+ break;
+ case 1:
+ BinIO.storeBytes(a, (DataOutput)new DataOutputStream(new FileOutputStream(file)));
+ break;
+ case 2:
+ BinIO.storeBytes(a, new FileOutputStream(file));
+ break;
+ case 3:
+ BinIO.storeBytes(aShifted, 1, a.length, file);
+ break;
+ case 4:
+ BinIO.storeBytes(aShifted, 1, a.length, (DataOutput)new DataOutputStream(new FileOutputStream(file)));
+ break;
+ case 5:
+ BinIO.storeBytes(aShifted, 1, a.length, new FileOutputStream(file));
+ break;
}
assertArrayEquals(a, BinIO.loadBytes(file));
@@ -144,15 +157,27 @@ public class BinIOTest {
final byte[][] aShifted = ByteBigArrays.newBigArray(length + 1);
copy(a, 0, aShifted, 1, length);
- for(int i = 0; i < 6; i++) {
+ for (int i = 0; i < 6; i++) {
file.delete();
- switch(i) {
- case 0: BinIO.storeBytes(a, file); break;
- case 1: BinIO.storeBytes(a, (DataOutput)new DataOutputStream(new FileOutputStream(file))); break;
- case 2: BinIO.storeBytes(a, new FileOutputStream(file)); break;
- case 3: BinIO.storeBytes(aShifted, 1, length, file); break;
- case 4: BinIO.storeBytes(aShifted, 1, length, (DataOutput)new DataOutputStream(new FileOutputStream(file))); break;
- case 5: BinIO.storeBytes(aShifted, 1, length, new FileOutputStream(file)); break;
+ switch (i) {
+ case 0:
+ BinIO.storeBytes(a, file);
+ break;
+ case 1:
+ BinIO.storeBytes(a, (DataOutput)new DataOutputStream(new FileOutputStream(file)));
+ break;
+ case 2:
+ BinIO.storeBytes(a, new FileOutputStream(file));
+ break;
+ case 3:
+ BinIO.storeBytes(aShifted, 1, length, file);
+ break;
+ case 4:
+ BinIO.storeBytes(aShifted, 1, length, (DataOutput)new DataOutputStream(new FileOutputStream(file)));
+ break;
+ case 5:
+ BinIO.storeBytes(aShifted, 1, length, new FileOutputStream(file));
+ break;
}
assertArrayEquals(a, BinIO.loadBytesBig(file));
@@ -202,22 +227,22 @@ public class BinIOTest {
final File file = File.createTempFile(getClass().getSimpleName(), "dump");
file.deleteOnExit();
final DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
- for(int i = 0; i < 100; i++) dos.writeDouble(i);
+ for (int i = 0; i < 100; i++) dos.writeDouble(i);
dos.close();
DoubleIterator di = BinIO.asDoubleIterator(file);
- for(int i = 0; i < 100; i++) assertEquals(i, di.nextDouble(), 0.);
+ for (int i = 0; i < 100; i++) assertEquals(i, di.nextDouble(), 0.);
assertFalse(di.hasNext());
di = BinIO.asDoubleIterator(file);
- for(int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; i++) {
assertTrue(di.hasNext());
assertEquals(i, di.nextDouble(), 0.);
}
di = BinIO.asDoubleIterator(file);
int s = 1;
- for(int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; i++) {
assertEquals(Math.min(s, 100 - i), di.skip(s));
i += s;
if (i >= 100) break;
@@ -227,7 +252,7 @@ public class BinIOTest {
di = BinIO.asDoubleIterator(file);
s = 1;
- for(int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; i++) {
if (s > 100 - i) break;
assertTrue(di.hasNext());
assertEquals(Math.min(s, 100 - i), di.skip(s));
@@ -247,7 +272,7 @@ public class BinIOTest {
public void testInts(final int[] a) throws IOException {
final File file = File.createTempFile(getClass().getSimpleName(), "dump");
file.deleteOnExit();
- for(int i = 0; i < a.length; i++) a[i] = i;
+ for (int i = 0; i < a.length; i++) a[i] = i;
BinIO.storeInts(a, file);
assertArrayEquals(a, BinIO.loadInts(file));
}
@@ -426,224 +451,232 @@ public class BinIOTest {
public void testNioDataWrappersBooleans() throws IOException {
final File file = File.createTempFile(getClass().getSimpleName(), "dump");
file.deleteOnExit();
- for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES,
- BinIO.BUFFER_SIZE / Double.BYTES + 100, BinIO.BUFFER_SIZE, 10000 }) {
- final int size2 = size / 2, size34 = 3 * size / 4;
- final SplittableRandom r = new SplittableRandom(0);
- final boolean[] d = new boolean[size];
- final boolean[] e = new boolean[size];
- for (int i = 0; i < size; i++) d[i] = r.nextBoolean();
-
- BinIO.storeBooleans(d, file);
- assertArrayEquals(d, BinIO.loadBooleans(file));
- BinIO.storeBooleans(d, file.toString());
- assertArrayEquals(d, BinIO.loadBooleans(file));
- BinIO.storeBooleans(BooleanIterators.wrap(d), file);
- assertArrayEquals(d, BinIO.loadBooleans(file));
- BinIO.storeBooleans(BooleanIterators.wrap(d), file.toString());
- assertArrayEquals(d, BinIO.loadBooleans(file));
-
- DataInputStream dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size, BinIO.loadBooleans(dis, e));
- assertArrayEquals(d, e);
- dis.close();
-
- dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size, BinIO.loadBooleans(dis, new boolean[size * 2]));
- dis.close();
-
- DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
- BinIO.storeBooleans(d, size2, size34 - size2, dos);
- assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file));
- dos.close();
-
- BinIO.storeBooleans(d, file);
-
- dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size, BinIO.loadBooleans(dis, new boolean[size * 3], size, 2 * size));
- dis.close();
-
- assertEquals(size, BinIO.loadBooleans(file, new boolean[size * 3], size, 2 * size));
-
- dos = new DataOutputStream(new FileOutputStream(file));
- BinIO.storeBooleans(BooleanIterators.wrap(d), dos);
- assertArrayEquals(d, BinIO.loadBooleans(file));
- dos.close();
-
- BinIO.storeBooleans(BooleanIterators.wrap(d), file);
- assertArrayEquals(d, BinIO.loadBooleans(file));
-
- BinIO.storeBooleans(BooleanIterators.wrap(d), file.toString());
- assertArrayEquals(d, BinIO.loadBooleans(file));
-
- dos = new DataOutputStream(new FileOutputStream(file));
- BinIO.storeBooleans(d, dos);
- assertArrayEquals(d, BinIO.loadBooleans(file));
- dos.close();
-
- dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size34 - size2, BinIO.loadBooleans(dis, e, size2, size34 - size2));
- for (int i = size2; i < size34; i++) assertEquals(d[i - size2], e[i]);
- dis.close();
-
- dis = new DataInputStream(new FileInputStream(file));
- BooleanIterator di = BinIO.asBooleanIterator(dis);
- for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
- assertFalse(Integer.toString(size), di.hasNext());
- dis.close();
+ for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES, BinIO.BUFFER_SIZE / Double.BYTES + 100,
+ BinIO.BUFFER_SIZE, 10000 }) {
+ final int size2 = size / 2, size34 = 3 * size / 4;
+ final SplittableRandom r = new SplittableRandom(0);
+ final boolean[] d = new boolean[size];
+ final boolean[] e = new boolean[size];
+ for (int i = 0; i < size; i++) d[i] = r.nextBoolean();
+
+ BinIO.storeBooleans(d, file);
+ assertArrayEquals(d, BinIO.loadBooleans(file));
+ BinIO.storeBooleans(d, file.toString());
+ assertArrayEquals(d, BinIO.loadBooleans(file));
+ BinIO.storeBooleans(BooleanIterators.wrap(d), file);
+ assertArrayEquals(d, BinIO.loadBooleans(file));
+ BinIO.storeBooleans(BooleanIterators.wrap(d), file.toString());
+ assertArrayEquals(d, BinIO.loadBooleans(file));
+
+ DataInputStream dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size, BinIO.loadBooleans(dis, e));
+ assertArrayEquals(d, e);
+ dis.close();
- di = BinIO.asBooleanIterator(file);
- for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
- assertFalse(Integer.toString(size), di.hasNext());
+ dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size, BinIO.loadBooleans(dis, new boolean[size * 2]));
+ dis.close();
- di = BinIO.asBooleanIterator(file.toString());
- for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
- assertFalse(Integer.toString(size), di.hasNext());
+ DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
+ BinIO.storeBooleans(d, size2, size34 - size2, dos);
+ assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file));
+ dos.close();
- di = BinIO.asBooleanIterable(file).iterator();
- for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
- assertFalse(Integer.toString(size), di.hasNext());
+ BinIO.storeBooleans(d, file);
- di = BinIO.asBooleanIterable(file.toString()).iterator();
- for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
- assertFalse(Integer.toString(size), di.hasNext());
+ dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size, BinIO.loadBooleans(dis, new boolean[size * 3], size, 2 * size));
+ dis.close();
- di = BinIO.asBooleanIterator(file);
- for (int i = 0; i < size; i++) {
- assertTrue(di.hasNext());
- assertEquals(d[i], di.nextBoolean());
- }
+ assertEquals(size, BinIO.loadBooleans(file, new boolean[size * 3], size, 2 * size));
- di = BinIO.asBooleanIterator(file);
- int s = 1;
- for (int i = 0; i < size; i++) {
- assertEquals(Math.min(s, size - i), di.skip(s));
- i += s;
- if (i >= size) break;
- assertEquals(d[i], di.nextBoolean());
- s *= 2;
- }
+ dos = new DataOutputStream(new FileOutputStream(file));
+ BinIO.storeBooleans(BooleanIterators.wrap(d), dos);
+ assertArrayEquals(d, BinIO.loadBooleans(file));
+ dos.close();
- di = BinIO.asBooleanIterator(file);
- s = 1;
- for (int i = 0; i < size; i++) {
- if (s > size - i) break;
- assertTrue(di.hasNext());
- assertEquals(Math.min(s, size - i), di.skip(s));
- i += s;
- if (i >= size) {
- assertFalse(di.hasNext());
- break;
- }
- assertTrue(di.hasNext());
- assertTrue(di.hasNext()); // To increase coverage
- assertEquals(d[i], di.nextBoolean());
- s *= 2;
- }
- }
- }
+ BinIO.storeBooleans(BooleanIterators.wrap(d), file);
+ assertArrayEquals(d, BinIO.loadBooleans(file));
- @SuppressWarnings("boxing")
- @Test
- public void testNioBigBooleans() throws IOException {
- final File file = File.createTempFile(getClass().getSimpleName(), "dump");
- file.deleteOnExit();
- for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES,
- BinIO.BUFFER_SIZE / Double.BYTES + 100, BinIO.BUFFER_SIZE, 10000 }) {
- final int size2 = size / 2, size34 = 3 * size / 4;
- final SplittableRandom r = new SplittableRandom(0);
- final boolean[] d = new boolean[size];
- for (int i = 0; i < size; i++) d[i] = r.nextBoolean();
- final boolean[][] dd = BigArrays.wrap(d);
-
- BinIO.storeBooleans(dd, file);
- assertArrayEquals(d, BinIO.loadBooleans(file));
- BinIO.storeBooleans(dd, file.toString());
- assertArrayEquals(d, BinIO.loadBooleans(file.toString()));
- assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file)));
-
- final boolean[] e = new boolean[size];
- assertEquals(size - size2, BinIO.loadBooleans(file, e, size2, size - size2));
- for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2]);
- assertEquals(size - size2, BinIO.loadBooleans(file.toString(), e, size2, size - size2));
- for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2]);
-
- final boolean[] h = new boolean[size2];
- assertEquals(size2, BinIO.loadBooleans(file, h));
- for (int i = 0; i < size2; i++) assertEquals(h[i], d[i]);
- assertEquals(size2, BinIO.loadBooleans(file.toString(), h));
- for (int i = 0; i < size2; i++) assertEquals(h[i], d[i]);
-
- final boolean[][] ee = BooleanBigArrays.newBigArray(length(dd));
- final boolean[][] hh = BigArrays.wrap(h);
-
- DataInputStream dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size, BinIO.loadBooleans(dis, ee));
- assertTrue(BigArrays.equals(dd, ee));
- dis.close();
+ BinIO.storeBooleans(BooleanIterators.wrap(d), file.toString());
+ assertArrayEquals(d, BinIO.loadBooleans(file));
- dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size, BinIO.loadBooleans(dis, BooleanBigArrays.newBigArray(size * 3)));
- dis.close();
+ dos = new DataOutputStream(new FileOutputStream(file));
+ BinIO.storeBooleans(d, dos);
+ assertArrayEquals(d, BinIO.loadBooleans(file));
+ dos.close();
- dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size, BinIO.loadBooleans(dis, BooleanBigArrays.newBigArray(size * 3), size, 2 * size));
- dis.close();
+ dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size34 - size2, BinIO.loadBooleans(dis, e, size2, size34 - size2));
+ for (int i = size2; i < size34; i++) assertEquals(d[i - size2], e[i]);
+ dis.close();
- dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size2, BinIO.loadBooleans(dis, hh));
- for (int i = 0; i < size2; i++) assertEquals(h[i], get(hh, i));
- dis.close();
+ dis = new DataInputStream(new FileInputStream(file));
+ BooleanIterator di = BinIO.asBooleanIterator(dis);
+ for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
+ assertFalse(Integer.toString(size), di.hasNext());
+ dis.close();
- dis = new DataInputStream(new FileInputStream(file));
- assertEquals(size34 - size2, BinIO.loadBooleans(dis, ee, size2, size34 - size2));
- for (int i = size2; i < size34 - size2; i++) assertEquals(d[i - size2], get(ee, i));
- dis.close();
+ di = BinIO.asBooleanIterator(file);
+ for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
+ assertFalse(Integer.toString(size), di.hasNext());
- assertEquals(size, BinIO.loadBooleans(file, ee, 0, size));
- assertTrue(BigArrays.equals(dd, ee));
- assertEquals(size, BinIO.loadBooleans(file, ee));
- assertTrue(BigArrays.equals(dd, ee));
- assertEquals(size, BinIO.loadBooleans(file.toString(), ee, 0, size));
- assertTrue(BigArrays.equals(dd, ee));
- assertEquals(size, BinIO.loadBooleans(file.toString(), ee));
- assertTrue(BigArrays.equals(dd, ee));
- assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file)));
- assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file.toString())));
+ di = BinIO.asBooleanIterator(file.toString());
+ for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
+ assertFalse(Integer.toString(size), di.hasNext());
- assertEquals(size - size2, BinIO.loadBooleans(file, ee, size2, size - size2));
- for (int i = size2; i < size; i++) assertEquals(get(ee, i), get(dd, i - size2));
+ di = BinIO.asBooleanIterable(file).iterator();
+ for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
+ assertFalse(Integer.toString(size), di.hasNext());
- assertEquals(size34 - size2, BinIO.loadBooleans(file, ee, size2, size34 - size2));
- for (int i = size2; i < size34; i++) assertEquals(get(ee, i), get(dd, i - size2));
+ di = BinIO.asBooleanIterable(file.toString()).iterator();
+ for (int i = 0; i < size; i++) assertEquals(d[i], di.nextBoolean());
+ assertFalse(Integer.toString(size), di.hasNext());
- BinIO.storeBooleans(dd, size2, size - size2, file);
- assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
- BinIO.storeBooleans(dd, size2, size - size2, file.toString());
- assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
+ di = BinIO.asBooleanIterator(file);
+ for (int i = 0; i < size; i++) {
+ assertTrue(di.hasNext());
+ assertEquals(d[i], di.nextBoolean());
+ }
- BinIO.storeBooleans(dd, size2, size34 - size2, file);
- assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file));
+ di = BinIO.asBooleanIterator(file);
+ int s = 1;
+ for (int i = 0; i < size; i++) {
+ assertEquals(Math.min(s, size - i), di.skip(s));
+ i += s;
+ if (i >= size) break;
+ assertEquals(d[i], di.nextBoolean());
+ s *= 2;
+ }
- BinIO.storeBooleans(d, size2, size - size2, file);
- assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
- BinIO.storeBooleans(d, size2, size - size2, file.toString());
- assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
+ di = BinIO.asBooleanIterator(file);
+ s = 1;
+ for (int i = 0; i < size; i++) {
+ if (s > size - i) break;
+ assertTrue(di.hasNext());
+ assertEquals(Math.min(s, size - i), di.skip(s));
+ i += s;
+ if (i >= size) {
+ assertFalse(di.hasNext());
+ break;
+ }
+ assertTrue(di.hasNext());
+ assertTrue(di.hasNext()); // To increase coverage
+ assertEquals(d[i], di.nextBoolean());
+ s *= 2;
+ }
+ }
+ }
+
+ @SuppressWarnings("boxing")
+ @Test
+ public void testNioBigBooleans() throws IOException {
+ final File file = File.createTempFile(getClass().getSimpleName(), "dump");
+ file.deleteOnExit();
+ for (final int size : new int[] { 100, BinIO.BUFFER_SIZE / Double.BYTES, BinIO.BUFFER_SIZE / Double.BYTES + 100,
+ BinIO.BUFFER_SIZE, 10000 }) {
+ final int size2 = size / 2, size34 = 3 * size / 4;
+ final SplittableRandom r = new SplittableRandom(0);
+ final boolean[] d = new boolean[size];
+ for (int i = 0; i < size; i++) d[i] = r.nextBoolean();
+ final boolean[][] dd = BigArrays.wrap(d);
+
+ BinIO.storeBooleans(dd, file);
+ assertArrayEquals(d, BinIO.loadBooleans(file));
+ BinIO.storeBooleans(dd, file.toString());
+ assertArrayEquals(d, BinIO.loadBooleans(file.toString()));
+ assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file)));
+
+ final boolean[] e = new boolean[size];
+ assertEquals(size - size2, BinIO.loadBooleans(file, e, size2, size - size2));
+ for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2]);
+ assertEquals(size - size2, BinIO.loadBooleans(file.toString(), e, size2, size - size2));
+ for (int i = size2; i < size; i++) assertEquals(e[i], d[i - size2]);
+
+ final boolean[] h = new boolean[size2];
+ assertEquals(size2, BinIO.loadBooleans(file, h));
+ for (int i = 0; i < size2; i++) assertEquals(h[i], d[i]);
+ assertEquals(size2, BinIO.loadBooleans(file.toString(), h));
+ for (int i = 0; i < size2; i++) assertEquals(h[i], d[i]);
+
+ final boolean[][] ee = BooleanBigArrays.newBigArray(length(dd));
+ final boolean[][] hh = BigArrays.wrap(h);
+
+ DataInputStream dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size, BinIO.loadBooleans(dis, ee));
+ assertTrue(BigArrays.equals(dd, ee));
+ dis.close();
+
+ dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size, BinIO.loadBooleans(dis, BooleanBigArrays.newBigArray(size * 3)));
+ dis.close();
+
+ dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size, BinIO.loadBooleans(dis, BooleanBigArrays.newBigArray(size * 3), size, 2 * size));
+ dis.close();
- BinIO.storeBooleans(d, size2, size34 - size2, file);
- assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file));
+ dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size2, BinIO.loadBooleans(dis, hh));
+ for (int i = 0; i < size2; i++) assertEquals(h[i], get(hh, i));
+ dis.close();
- DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
- BinIO.storeBooleans(dd, dos);
- dos.close();
- assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file)));
+ dis = new DataInputStream(new FileInputStream(file));
+ assertEquals(size34 - size2, BinIO.loadBooleans(dis, ee, size2, size34 - size2));
+ for (int i = size2; i < size34 - size2; i++) assertEquals(d[i - size2], get(ee, i));
+ dis.close();
- dos = new DataOutputStream(new FileOutputStream(file));
- BinIO.storeBooleans(dd, size2, size34 - size2, dos);
- dos.close();
- assertTrue(BigArrays.equals(BigArrays.copy(dd, size2, size34 - size2), BinIO.loadBooleansBig(file)));
+ assertEquals(size, BinIO.loadBooleans(file, ee, 0, size));
+ assertTrue(BigArrays.equals(dd, ee));
+ assertEquals(size, BinIO.loadBooleans(file, ee));
+ assertTrue(BigArrays.equals(dd, ee));
+ assertEquals(size, BinIO.loadBooleans(file.toString(), ee, 0, size));
+ assertTrue(BigArrays.equals(dd, ee));
+ assertEquals(size, BinIO.loadBooleans(file.toString(), ee));
+ assertTrue(BigArrays.equals(dd, ee));
+ assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file)));
+ assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file.toString())));
+
+ assertEquals(size - size2, BinIO.loadBooleans(file, ee, size2, size - size2));
+ for (int i = size2; i < size; i++) assertEquals(get(ee, i), get(dd, i - size2));
+
+ assertEquals(size34 - size2, BinIO.loadBooleans(file, ee, size2, size34 - size2));
+ for (int i = size2; i < size34; i++) assertEquals(get(ee, i), get(dd, i - size2));
+
+ BinIO.storeBooleans(dd, size2, size - size2, file);
+ assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
+ BinIO.storeBooleans(dd, size2, size - size2, file.toString());
+ assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
+
+ BinIO.storeBooleans(dd, size2, size34 - size2, file);
+ assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file));
+
+ BinIO.storeBooleans(d, size2, size - size2, file);
+ assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
+ BinIO.storeBooleans(d, size2, size - size2, file.toString());
+ assertArrayEquals(Arrays.copyOfRange(d, size2, size), BinIO.loadBooleans(file));
+
+ BinIO.storeBooleans(d, size2, size34 - size2, file);
+ assertArrayEquals(Arrays.copyOfRange(d, size2, size34), BinIO.loadBooleans(file));
+
+ DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
+ BinIO.storeBooleans(dd, dos);
+ dos.close();
+ assertTrue(BigArrays.equals(dd, BinIO.loadBooleansBig(file)));
+
+ dos = new DataOutputStream(new FileOutputStream(file));
+ BinIO.storeBooleans(dd, size2, size34 - size2, dos);
+ dos.close();
+ assertTrue(BigArrays.equals(BigArrays.copy(dd, size2, size34 - size2), BinIO.loadBooleansBig(file)));
- }
+ }
}
-}
\ No newline at end of file
+ @Test
+ public void testNioLarge() throws IOException {
+ final File file = File.createTempFile(getClass().getSimpleName(), "dump");
+ file.deleteOnExit();
+ BinIO.storeLongs(new long[(int)(((1L << 31) + 1024) >> LongMappedBigList.LOG2_BYTES)], file);
+ final long[] longs = BinIO.loadLongs(file);
+ for (final long element : longs) assertEquals(0, element);
+ }
+}
=====================================
test/it/unimi/dsi/fastutil/objects/Reference2ReferenceArrayMapTest.java
=====================================
@@ -31,7 +31,6 @@ import org.junit.Test;
import it.unimi.dsi.fastutil.io.BinIO;
- at SuppressWarnings("deprecation")
public class Reference2ReferenceArrayMapTest {
@Test
=====================================
test/it/unimi/dsi/fastutil/objects/ReferenceArraySetTest.java
=====================================
@@ -30,7 +30,6 @@ import org.junit.Test;
import it.unimi.dsi.fastutil.io.BinIO;
- at SuppressWarnings("deprecation")
public class ReferenceArraySetTest {
@Test
View it on GitLab: https://salsa.debian.org/java-team/libfastutil-java/-/compare/116d7271c9aad4b16157b00e2632841b144f56ea...eeb00301b05924ba3361596cff7ea8d92e97af6e
--
View it on GitLab: https://salsa.debian.org/java-team/libfastutil-java/-/compare/116d7271c9aad4b16157b00e2632841b144f56ea...eeb00301b05924ba3361596cff7ea8d92e97af6e
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/20221001/f2d1e67c/attachment.htm>
More information about the pkg-java-commits
mailing list