From 78d47d4d098ab814a7a00a0b1c81646b27f050cf Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Sat, 14 Nov 2015 20:38:02 +0000 Subject: [PATCH] [COLLECTIONS-580] Clarify class javadoc of utils that only unsafe classes are serializable anymore. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1714362 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/collections4/ClosureUtils.java | 10 ++++++++-- .../org/apache/commons/collections4/FactoryUtils.java | 10 ++++++++-- .../apache/commons/collections4/TransformerUtils.java | 9 ++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/ClosureUtils.java b/src/main/java/org/apache/commons/collections4/ClosureUtils.java index b339a1a0e..fd09abe71 100644 --- a/src/main/java/org/apache/commons/collections4/ClosureUtils.java +++ b/src/main/java/org/apache/commons/collections4/ClosureUtils.java @@ -37,7 +37,6 @@ import org.apache.commons.collections4.functors.WhileClosure; *
  • Invoker - invokes a method on the input object *
  • For - repeatedly calls a closure for a fixed number of times *
  • While - repeatedly calls a closure while a predicate is true - *
  • DoWhile - repeatedly calls a closure while a predicate is true *
  • Chained - chains two or more closures together *
  • If - calls one closure or another based on a predicate *
  • Switch - calls one closure based on one or more predicates @@ -46,7 +45,14 @@ import org.apache.commons.collections4.functors.WhileClosure; *
  • NOP - does nothing *
  • Exception - always throws an exception * - * All the supplied closures are Serializable. + *

    + * Since v4.1 only closures which are considered to be unsafe are + * Serializable. Closures considered to be unsafe for serialization are: + *

    * * @since 3.0 * @version $Id$ diff --git a/src/main/java/org/apache/commons/collections4/FactoryUtils.java b/src/main/java/org/apache/commons/collections4/FactoryUtils.java index bb5887f86..6d7763574 100644 --- a/src/main/java/org/apache/commons/collections4/FactoryUtils.java +++ b/src/main/java/org/apache/commons/collections4/FactoryUtils.java @@ -26,12 +26,18 @@ import org.apache.commons.collections4.functors.PrototypeFactory; * for the Factory functor interface. The supplied factories are: * - * All the supplied factories are Serializable. + *

    + * Since v4.1 only factories which are considered to be unsafe are + * Serializable. Factories considered to be unsafe for serialization are: + *

    * * @since 3.0 * @version $Id$ diff --git a/src/main/java/org/apache/commons/collections4/TransformerUtils.java b/src/main/java/org/apache/commons/collections4/TransformerUtils.java index 05a94f5ef..ad6265a36 100644 --- a/src/main/java/org/apache/commons/collections4/TransformerUtils.java +++ b/src/main/java/org/apache/commons/collections4/TransformerUtils.java @@ -56,7 +56,14 @@ import org.apache.commons.collections4.functors.SwitchTransformer; *
  • Exception - always throws an exception *
  • StringValue - returns a java.lang.String representation of the input object * - * All the supplied transformers are Serializable. + *

    + * Since v4.1 only transformers which are considered to be unsafe are + * Serializable. Transformers considered to be unsafe for serialization are: + *

    * * @since 3.0 * @version $Id$