From 67e8cfede63cde014e967455133852f4ac5dcb9f Mon Sep 17 00:00:00 2001 From: akarnokd Date: Wed, 21 Jan 2015 13:13:46 +0100 Subject: [PATCH] SynchronousQueue.clone fix --- src/main/java/rx/internal/util/SynchronizedQueue.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/rx/internal/util/SynchronizedQueue.java b/src/main/java/rx/internal/util/SynchronizedQueue.java index cf04bc021f..9fe867d93a 100644 --- a/src/main/java/rx/internal/util/SynchronizedQueue.java +++ b/src/main/java/rx/internal/util/SynchronizedQueue.java @@ -138,7 +138,9 @@ public synchronized boolean offer(T e) { @Override public synchronized Object clone() { - return list.clone(); + SynchronizedQueue q = new SynchronizedQueue(size); + q.addAll(list); + return q; } @Override