diff --git a/.idea/inspectionProfiles/2_Inconsistent_Constructs.xml b/.idea/inspectionProfiles/2_Inconsistent_Constructs.xml
index afc0e0ce4f..280e0ea944 100644
--- a/.idea/inspectionProfiles/2_Inconsistent_Constructs.xml
+++ b/.idea/inspectionProfiles/2_Inconsistent_Constructs.xml
@@ -986,7 +986,7 @@
-
+
@@ -1745,7 +1745,7 @@
-
+
diff --git a/.idea/inspectionProfiles/IDE.xml b/.idea/inspectionProfiles/IDE.xml
index 90f5cc58ca..d2a00068ce 100644
--- a/.idea/inspectionProfiles/IDE.xml
+++ b/.idea/inspectionProfiles/IDE.xml
@@ -764,6 +764,7 @@
+
diff --git a/eclipse-collections-code-generator/src/main/java/org/eclipse/collections/codegenerator/ErrorListener.java b/eclipse-collections-code-generator/src/main/java/org/eclipse/collections/codegenerator/ErrorListener.java
index 7f148b2b2c..b8dad32012 100644
--- a/eclipse-collections-code-generator/src/main/java/org/eclipse/collections/codegenerator/ErrorListener.java
+++ b/eclipse-collections-code-generator/src/main/java/org/eclipse/collections/codegenerator/ErrorListener.java
@@ -10,6 +10,7 @@
package org.eclipse.collections.codegenerator;
+@FunctionalInterface
public interface ErrorListener
{
void error(String string);
diff --git a/eclipse-collections-testutils/src/main/java/org/eclipse/collections/impl/test/Verify.java b/eclipse-collections-testutils/src/main/java/org/eclipse/collections/impl/test/Verify.java
index 8c4a332b7a..0d656ea558 100644
--- a/eclipse-collections-testutils/src/main/java/org/eclipse/collections/impl/test/Verify.java
+++ b/eclipse-collections-testutils/src/main/java/org/eclipse/collections/impl/test/Verify.java
@@ -281,19 +281,19 @@ public static void assertEmpty(String mutableMapIterableName, MutableMapIterable
{
Assert.fail(mutableMapIterableName + " should be empty; actual size:<" + Iterate.sizeOf(actualMutableMapIterable) + '>');
}
- if (actualMutableMapIterable.size() != 0)
+ if (!actualMutableMapIterable.isEmpty())
{
Assert.fail(mutableMapIterableName + " should be empty; actual size:<" + actualMutableMapIterable.size() + '>');
}
- if (actualMutableMapIterable.keySet().size() != 0)
+ if (!actualMutableMapIterable.keySet().isEmpty())
{
Assert.fail(mutableMapIterableName + " should be empty; actual size:<" + actualMutableMapIterable.keySet().size() + '>');
}
- if (actualMutableMapIterable.values().size() != 0)
+ if (!actualMutableMapIterable.values().isEmpty())
{
Assert.fail(mutableMapIterableName + " should be empty; actual size:<" + actualMutableMapIterable.values().size() + '>');
}
- if (actualMutableMapIterable.entrySet().size() != 0)
+ if (!actualMutableMapIterable.entrySet().isEmpty())
{
Assert.fail(mutableMapIterableName + " should be empty; actual size:<" + actualMutableMapIterable.entrySet().size() + '>');
}
@@ -322,6 +322,7 @@ public static void assertEmpty(PrimitiveIterable primitiveIterable)
/**
* Assert that the given {@link PrimitiveIterable} is empty.
*/
+ @SuppressWarnings("SizeReplaceableByIsEmpty")
public static void assertEmpty(String iterableName, PrimitiveIterable primitiveIterable)
{
try
@@ -489,6 +490,7 @@ public static void assertEmpty(Multimap, ?> actualMultimap)
/**
* Assert that the given {@link Multimap} is empty.
*/
+ @SuppressWarnings("SizeReplaceableByIsEmpty")
public static void assertEmpty(String multimapName, Multimap, ?> actualMultimap)
{
try
@@ -511,23 +513,23 @@ public static void assertEmpty(String multimapName, Multimap, ?> actualMultima
{
Assert.fail(multimapName + " should be empty; actual size:<" + actualMultimap.size() + '>');
}
- if (actualMultimap.keyBag().size() != 0)
+ if (!actualMultimap.keyBag().isEmpty())
{
Assert.fail(multimapName + " should be empty; actual size:<" + actualMultimap.keyBag().size() + '>');
}
- if (actualMultimap.keysView().size() != 0)
+ if (!actualMultimap.keysView().isEmpty())
{
Assert.fail(multimapName + " should be empty; actual size:<" + actualMultimap.keysView().size() + '>');
}
- if (actualMultimap.valuesView().size() != 0)
+ if (!actualMultimap.valuesView().isEmpty())
{
Assert.fail(multimapName + " should be empty; actual size:<" + actualMultimap.valuesView().size() + '>');
}
- if (actualMultimap.keyValuePairsView().size() != 0)
+ if (!actualMultimap.keyValuePairsView().isEmpty())
{
Assert.fail(multimapName + " should be empty; actual size:<" + actualMultimap.keyValuePairsView().size() + '>');
}
- if (actualMultimap.keyMultiValuePairsView().size() != 0)
+ if (!actualMultimap.keyMultiValuePairsView().isEmpty())
{
Assert.fail(multimapName + " should be empty; actual size:<" + actualMultimap.keyMultiValuePairsView().size() + '>');
}
@@ -541,6 +543,7 @@ public static void assertEmpty(String multimapName, Multimap, ?> actualMultima
/**
* Assert that the given {@link Map} is empty.
*/
+ @SuppressWarnings("SizeReplaceableByIsEmpty")
public static void assertEmpty(String mapName, Map, ?> actualMap)
{
try
@@ -555,15 +558,15 @@ public static void assertEmpty(String mapName, Map, ?> actualMap)
{
Assert.fail(mapName + " should be empty; actual size:<" + actualMap.size() + '>');
}
- if (actualMap.keySet().size() != 0)
+ if (!actualMap.keySet().isEmpty())
{
Assert.fail(mapName + " should be empty; actual size:<" + actualMap.keySet().size() + '>');
}
- if (actualMap.values().size() != 0)
+ if (!actualMap.values().isEmpty())
{
Assert.fail(mapName + " should be empty; actual size:<" + actualMap.values().size() + '>');
}
- if (actualMap.entrySet().size() != 0)
+ if (!actualMap.entrySet().isEmpty())
{
Assert.fail(mapName + " should be empty; actual size:<" + actualMap.entrySet().size() + '>');
}
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/factory/StringPredicates.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/factory/StringPredicates.java
index bea0b63156..ae1c59b20a 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/factory/StringPredicates.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/factory/StringPredicates.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -202,7 +202,7 @@ private static class Empty extends Predicates
@Override
public boolean accept(String anObject)
{
- return anObject != null && anObject.length() == 0;
+ return anObject != null && anObject.isEmpty();
}
@Override
@@ -219,7 +219,7 @@ private static class NotEmpty extends Predicates
@Override
public boolean accept(String anObject)
{
- return anObject != null && anObject.length() > 0;
+ return anObject != null && !anObject.isEmpty();
}
@Override
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction.java
index a738a851fd..e83cc7c4e5 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A functional interface that can be represented by a Lambda that can throw a CheckedException.
*/
+@FunctionalInterface
public interface ThrowingFunction extends Serializable
{
@SuppressWarnings("ProhibitedExceptionDeclared")
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction0.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction0.java
index f4361a4242..19c6d294fb 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction0.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction0.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A functional interface that can be represented by a Lambda that can throw a CheckedException.
*/
+@FunctionalInterface
public interface ThrowingFunction0 extends Serializable
{
@SuppressWarnings("ProhibitedExceptionDeclared")
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction2.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction2.java
index 07af1ec1af..3d908e3733 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction2.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/checked/ThrowingFunction2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A functional interface that can be represented by a Lambda that can throw a CheckedException.
*/
+@FunctionalInterface
public interface ThrowingFunction2 extends Serializable
{
@SuppressWarnings("ProhibitedExceptionDeclared")
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CharFunction.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CharFunction.java
index 2a70dc7ef2..78eb5ac022 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CharFunction.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CharFunction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -19,6 +19,7 @@
*
* @deprecated since 3.0. Use {@link CharToCharFunction} instead.
*/
+@FunctionalInterface
@Deprecated
public interface CharFunction
extends Serializable
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CodePointFunction.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CodePointFunction.java
index 59f3d34be2..db2d5d228f 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CodePointFunction.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/function/primitive/CodePointFunction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A CharFunction can be used to convert one character to another.
*/
+@FunctionalInterface
public interface CodePointFunction
extends Serializable
{
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/CodePointPredicate.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/CodePointPredicate.java
index 545e7dab34..18a003a418 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/CodePointPredicate.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/CodePointPredicate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A Predicate that accepts an int value
*/
+@FunctionalInterface
public interface CodePointPredicate
extends Serializable
{
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate.java
index 5447d068e9..46649b5f5e 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A functional interface that can be represented by a Lambda that can throw a CheckedException.
*/
+@FunctionalInterface
public interface ThrowingPredicate extends Serializable
{
@SuppressWarnings("ProhibitedExceptionDeclared")
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate2.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate2.java
index 1033b37043..d8b9abdf15 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate2.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/checked/ThrowingPredicate2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A functional interface that can be represented by a Lambda that can throw a CheckedException.
*/
+@FunctionalInterface
public interface ThrowingPredicate2 extends Serializable
{
@SuppressWarnings("ProhibitedExceptionDeclared")
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/primitive/CharPredicate.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/primitive/CharPredicate.java
index dbc28f29c2..661ade7dfb 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/primitive/CharPredicate.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/predicate/primitive/CharPredicate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -17,6 +17,7 @@
*
* @deprecated since 3.0. Use {@link org.eclipse.collections.api.block.predicate.primitive.CharPredicate} instead.
*/
+@FunctionalInterface
@Deprecated
public interface CharPredicate
extends Serializable
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure.java
index ef87a6d7fd..56a6aea97b 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A functional interface that can be represented by a Lambda that can throw a CheckedException.
*/
+@FunctionalInterface
public interface ThrowingProcedure extends Serializable
{
@SuppressWarnings("ProhibitedExceptionDeclared")
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure2.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure2.java
index 7ec4443862..6d624ccbfb 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure2.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/checked/ThrowingProcedure2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* A functional interface that can be represented by a Lambda that can throw a CheckedException.
*/
+@FunctionalInterface
public interface ThrowingProcedure2 extends Serializable
{
@SuppressWarnings("ProhibitedExceptionDeclared")
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CharProcedure.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CharProcedure.java
index 6c756d1052..aa5524663f 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CharProcedure.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CharProcedure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -13,6 +13,7 @@
/**
* @deprecated since 3.0 use {@link org.eclipse.collections.api.block.procedure.primitive.CharProcedure}
*/
+@FunctionalInterface
@Deprecated
public interface CharProcedure
{
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CodePointProcedure.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CodePointProcedure.java
index 5c6e8899ec..f2f96ae541 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CodePointProcedure.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/CodePointProcedure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -10,6 +10,7 @@
package org.eclipse.collections.impl.block.procedure.primitive;
+@FunctionalInterface
public interface CodePointProcedure
{
void value(int codePoint);
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntIntProcedure.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntIntProcedure.java
index 947c536895..919c92a4ab 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntIntProcedure.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntIntProcedure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -18,6 +18,7 @@
*
* @deprecated since 3.0 use {@link org.eclipse.collections.api.block.procedure.primitive.IntIntProcedure}
*/
+@FunctionalInterface
@Deprecated
public interface IntIntProcedure extends Serializable
{
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntObjectProcedure.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntObjectProcedure.java
index 42e1165485..18f245d14e 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntObjectProcedure.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntObjectProcedure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -13,6 +13,7 @@
/**
* @deprecated since 3.0 use {@link org.eclipse.collections.api.block.procedure.primitive.IntObjectProcedure}
*/
+@FunctionalInterface
@Deprecated
public interface IntObjectProcedure
{
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedure.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedure.java
index 3c407aa396..d2b1b38fef 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedure.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -13,6 +13,7 @@
/**
* @deprecated since 3.0 use {@link org.eclipse.collections.api.block.procedure.primitive.IntProcedure}
*/
+@FunctionalInterface
@Deprecated
public interface IntProcedure
{
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedureWithInt.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedureWithInt.java
index 23e870b5ef..bad62fdd67 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedureWithInt.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/block/procedure/primitive/IntProcedureWithInt.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -18,6 +18,7 @@
*
* @deprecated since 1.2 use {@link IntIntProcedure}
*/
+@FunctionalInterface
@Deprecated
public interface IntProcedureWithInt extends Serializable
{
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ObjectIntProcedureFactory.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ObjectIntProcedureFactory.java
index da60914cb2..43adc7f5ae 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ObjectIntProcedureFactory.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ObjectIntProcedureFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -15,6 +15,7 @@
/**
* ObjectIntProcedureFactory is used by parallel iterators as a factory for stateful ObjectIntProcedure instances.
*/
+@FunctionalInterface
public interface ObjectIntProcedureFactory>
{
T create();
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ProcedureFactory.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ProcedureFactory.java
index e5aceadce4..47fc760f7c 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ProcedureFactory.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/parallel/ProcedureFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -12,6 +12,7 @@
import org.eclipse.collections.api.block.procedure.Procedure;
+@FunctionalInterface
public interface ProcedureFactory>
{
T create();
diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/StringIterate.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/StringIterate.java
index 29f302ff64..1762952166 100644
--- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/StringIterate.java
+++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/StringIterate.java
@@ -1061,7 +1061,7 @@ public static String getFirstToken(String value, String separator)
public static boolean isEmpty(String string)
{
- return string == null || string.length() == 0;
+ return string == null || string.isEmpty();
}
public static boolean isEmptyOrWhitespace(String string)
diff --git a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapLargeStressTest.java b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapLargeStressTest.java
index 1c3421cd99..527318e67b 100644
--- a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapLargeStressTest.java
+++ b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapLargeStressTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -311,7 +311,7 @@ public void ecRemove()
{
newMap.remove(this.ecIntKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (newMap.notEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
@@ -328,7 +328,7 @@ public void jdkRemove()
{
newMap.remove(this.jdkIntKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (!newMap.isEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
@@ -345,7 +345,7 @@ public void kolobokeRemove()
{
newMap.remove(this.kolobokeIntKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (!newMap.isEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
diff --git a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapSmallStressTest.java b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapSmallStressTest.java
index 5fc9bd5d6e..1b7f7c5ab7 100644
--- a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapSmallStressTest.java
+++ b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/IntIntMapSmallStressTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -319,7 +319,7 @@ public void ecRemove()
{
newMap.remove(this.ecIntKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (newMap.notEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
@@ -336,7 +336,7 @@ public void jdkRemove()
{
newMap.remove(this.jdkIntKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (!newMap.isEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
@@ -353,7 +353,7 @@ public void kolobokeRemove()
{
newMap.remove(this.kolobokeIntKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (!newMap.isEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
diff --git a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapLargeStressTest.java b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapLargeStressTest.java
index c2a4c7a526..b65c8d5784 100644
--- a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapLargeStressTest.java
+++ b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapLargeStressTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -229,7 +229,7 @@ public void ecRemove()
{
newMap.remove(this.ecLongKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (newMap.notEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
@@ -246,7 +246,7 @@ public void kolobokeRemove()
{
newMap.remove(this.kolobokeLongKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (!newMap.isEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
diff --git a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapSmallStressTest.java b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapSmallStressTest.java
index 4b180de253..9a48f7268a 100644
--- a/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapSmallStressTest.java
+++ b/jmh-tests/src/main/java/org/eclipse/collections/impl/jmh/LongLongMapSmallStressTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -235,7 +235,7 @@ public void ecRemove()
{
newMap.remove(this.ecLongKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (newMap.notEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
@@ -252,7 +252,7 @@ public void kolobokeRemove()
{
newMap.remove(this.kolobokeLongKeysForMap[i]);
}
- if (newMap.size() != 0)
+ if (!newMap.isEmpty())
{
throw new AssertionError("size is " + newMap.size());
}
diff --git a/unit-tests-java8/src/test/java/org/eclipse/collections/test/domain/A.java b/unit-tests-java8/src/test/java/org/eclipse/collections/test/domain/A.java
index da5cd66433..fd377a0998 100644
--- a/unit-tests-java8/src/test/java/org/eclipse/collections/test/domain/A.java
+++ b/unit-tests-java8/src/test/java/org/eclipse/collections/test/domain/A.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -10,6 +10,7 @@
package org.eclipse.collections.test.domain;
+@FunctionalInterface
public interface A extends Comparable
{
double getDoubleValue();
diff --git a/unit-tests/src/test/java/org/eclipse/collections/impl/list/immutable/AbstractImmutableListTestCase.java b/unit-tests/src/test/java/org/eclipse/collections/impl/list/immutable/AbstractImmutableListTestCase.java
index b9eaab4cbd..33c467f498 100644
--- a/unit-tests/src/test/java/org/eclipse/collections/impl/list/immutable/AbstractImmutableListTestCase.java
+++ b/unit-tests/src/test/java/org/eclipse/collections/impl/list/immutable/AbstractImmutableListTestCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Goldman Sachs and others.
+ * Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
@@ -578,7 +578,7 @@ public void drop()
MutableList mutableList = Lists.mutable.ofAll(immutableList);
Assert.assertEquals(mutableList.drop(1), immutableList.drop(1));
- if (mutableList.size() > 0)
+ if (mutableList.notEmpty())
{
Assert.assertEquals(
mutableList.drop(mutableList.size() - 1),