From 1456b3c5011bc6ea36e5f58f0e329b501ecfaabc Mon Sep 17 00:00:00 2001 From: Martin Thompson Date: Fri, 24 Aug 2018 16:29:14 +0100 Subject: [PATCH] [Java] Java 11 compile issues. --- .../src/main/java/org/agrona/collections/ObjectHashSet.java | 1 + .../java/org/agrona/collections/ObjectHashSetIntegerTest.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/agrona/src/main/java/org/agrona/collections/ObjectHashSet.java b/agrona/src/main/java/org/agrona/collections/ObjectHashSet.java index ea2e98e32..3a1f13e32 100644 --- a/agrona/src/main/java/org/agrona/collections/ObjectHashSet.java +++ b/agrona/src/main/java/org/agrona/collections/ObjectHashSet.java @@ -530,6 +530,7 @@ public T1[] toArray(final T1[] into) { arrayCopy[size] = null; } + return arrayCopy; } diff --git a/agrona/src/test/java/org/agrona/collections/ObjectHashSetIntegerTest.java b/agrona/src/test/java/org/agrona/collections/ObjectHashSetIntegerTest.java index 230520a5d..7b10cfac9 100644 --- a/agrona/src/test/java/org/agrona/collections/ObjectHashSetIntegerTest.java +++ b/agrona/src/test/java/org/agrona/collections/ObjectHashSetIntegerTest.java @@ -333,8 +333,8 @@ public void reducesSizeWhenElementRemoved() @Test(expected = NullPointerException.class) public void toArrayThrowsNullPointerExceptionForNullArgument() { - //noinspection ConstantConditions - testSet.toArray(null); + final Integer[] into = null; + testSet.toArray(into); } @Test