From 6ef841a560146544e23e455df568141309884ae4 Mon Sep 17 00:00:00 2001 From: Ivan Hetman Date: Sat, 6 Mar 2021 18:28:06 +0200 Subject: [PATCH] Fix generic collection toString (#559) --- .../org/teavm/classlib/java/util/TAbstractCollection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractCollection.java b/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractCollection.java index 6f5809d19..8fed83afd 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractCollection.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TAbstractCollection.java @@ -146,11 +146,11 @@ public abstract class TAbstractCollection extends TObject implements TCollect TIterator iter = iterator(); if (iter.hasNext()) { E e = iter.next(); - sb.append(e == this ? "(this Collection)" : iter.next()); + sb.append(e == this ? "(this Collection)" : e); } while (iter.hasNext()) { E e = iter.next(); - sb.append(", ").append(e == this ? "(this Collection)" : iter.next()); + sb.append(", ").append(e == this ? "(this Collection)" : e); } sb.append(']'); return sb.toString();