New issue report by marti.th:
Hello
Some of the static factory methods, for instance Predicates.isEqualTo(),
can return non-serializable predicates when called with a parameter that
doesn't implement Serializable.
Example:
---------------------------------------------------------
Object predicateObj = Predicates.isEqualTo(new Object());
ObjectOutput objectOut = new ObjectOutputStream(new
FileOutputStream("predicate.ser"));
objectOut.writeObject(predicateObj);
Exception in thread "main" java.io.NotSerializableException:
java.lang.Object
---------------------------------------------------------
In my opinion this should at least be mentioned in the javadocs...
Bye, Thomas
Issue attributes:
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Comment #1 by jared.l.levy:
Thanks for pointing this out.
I'll keep the current behavior of returning instances that aren't
serializable but
satisfy the Serializable interface. However, documenting that behavior is a
good
idea. That approach is consistent with JDK methods like
Collections.unmodifiableCollection().
Issue attribute updates:
Status: Accepted
Owner: jared.l.levy