From issues-return-80388-apmail-commons-issues-archive=commons.apache.org@commons.apache.org Tue Nov 5 12:46:02 2019 Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 5AB0519200 for ; Tue, 5 Nov 2019 12:46:02 +0000 (UTC) Received: (qmail 5573 invoked by uid 500); 5 Nov 2019 12:46:01 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 5449 invoked by uid 500); 5 Nov 2019 12:46:01 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 5433 invoked by uid 99); 5 Nov 2019 12:46:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2019 12:46:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 911ACE0334 for ; Tue, 5 Nov 2019 12:46:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 0BCE5780538 for ; Tue, 5 Nov 2019 12:46:00 +0000 (UTC) Date: Tue, 5 Nov 2019 12:46:00 +0000 (UTC) From: "Chen (Jira)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (COLLECTIONS-732) Got an UnsupportedOperationException when using MultiValuedMap.MapIterator().setValue() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COLLECTIONS-732?page=3Dcom.atl= assian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chen updated COLLECTIONS-732: ----------------------------- Summary: Got an UnsupportedOperationException when using MultiValuedMap= .MapIterator().setValue() (was: Got an UnsupportedOperationException when = altering MultiValuedMap MapIterator setValue) > Got an UnsupportedOperationException when using MultiValuedMap.MapIterato= r().setValue() > -------------------------------------------------------------------------= -------------- > > Key: COLLECTIONS-732 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-73= 2 > Project: Commons Collections > Issue Type: Bug > Components: Map > Reporter: Chen > Priority: Major > > copy from=C2=A0https://issues.apache.org/jira/browse/COLLECTIONS-663 > {code:java} > public void testSetValueMapIterator(){ > final ListValuedMap listMap =3D makeObject(); > List listA =3D listMap.get((K) "A"); > listA.addAll(0, Arrays.asList((V) "W", (V) "X", (V) "F")); > List listB =3D listMap.get((K) "B"); > listB.addAll(0, Arrays.asList((V) "Q", (V) "Q", (V) "L")); > assertEquals("{A=3D[W, X, F], B=3D[Q, Q, L]}", listMap.toString()= ); for(MapIterator iterator =3D listMap.mapIterator(); iterato= r.hasNext(); ){ > iterator.next(); > V value =3D iterator.getValue(); > if(value =3D=3D "F"){ > iterator.setValue((V) "B"); > } > } > assertEquals("{A=3D[W, X, B], B=3D[Q, Q, L]}", listMap.toString()= ); > } > {code} > The test throws a=C2=A0UnsupportedOperationException when altering mapIte= rato setValue=E3=80=82 > The issue is that the code throws=C2=A0UnsupportedOperationException=C2= =A0 in setValue=E3=80=82So=EF=BC=8Cif setValue method is not supported=EF= =BC=8Cthe Javadoc should comment=E3=80=82 -- This message was sent by Atlassian Jira (v8.3.4#803005)