From d61f56db10f58b36fdbddbe1230b5bd62d9d2be9 Mon Sep 17 00:00:00 2001 From: KSaiSivani Date: Wed, 10 Jun 2026 11:30:55 +0530 Subject: [PATCH 1/2] Added_fix_for_issue_3088 --- .../Forms/Controls/ListBoxes/ListBox.IntegerCollection.cs | 2 +- .../Forms/Controls/ListBoxes/ListBox.SelectedIndexCollection.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.IntegerCollection.cs b/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.IntegerCollection.cs index 421247d5b70..932bc047604 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.IntegerCollection.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.IntegerCollection.cs @@ -43,7 +43,7 @@ bool ICollection.IsSynchronized { get { - return true; + return false; } } diff --git a/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.SelectedIndexCollection.cs b/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.SelectedIndexCollection.cs index 31b0100cfba..f8c5aeea6e3 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.SelectedIndexCollection.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/ListBox.SelectedIndexCollection.cs @@ -41,7 +41,7 @@ bool ICollection.IsSynchronized { get { - return true; + return false; } } From 59b854006e1bd5debfb8c1b15abbc8d7fedda1fb Mon Sep 17 00:00:00 2001 From: Sai Sivani Koppolu Date: Thu, 25 Jun 2026 19:49:13 +0530 Subject: [PATCH 2/2] Added_Test_for_issue_3088 --- .../System/Windows/Forms/ListBox.IntegerCollectionTests.cs | 4 ++-- .../Windows/Forms/ListBox.SelectedIndexCollectionTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.IntegerCollectionTests.cs b/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.IntegerCollectionTests.cs index 6912f58e31f..b9e110f0fca 100644 --- a/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.IntegerCollectionTests.cs +++ b/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.IntegerCollectionTests.cs @@ -30,7 +30,7 @@ public void ListBoxIntegerCollection_ICollection_Properties_GetReturnsExpected() using ListBox owner = new(); ICollection collection = new ListBox.IntegerCollection(owner); Assert.Empty(collection); - Assert.True(collection.IsSynchronized); + Assert.False(collection.IsSynchronized); Assert.Same(collection, collection.SyncRoot); } @@ -42,7 +42,7 @@ public void ListBoxIntegerCollection_IList_Properties_GetReturnsExpected() Assert.Empty(collection); Assert.False(collection.IsFixedSize); Assert.False(collection.IsReadOnly); - Assert.True(collection.IsSynchronized); + Assert.False(collection.IsSynchronized); Assert.Same(collection, collection.SyncRoot); } diff --git a/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.SelectedIndexCollectionTests.cs b/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.SelectedIndexCollectionTests.cs index e589d76f7f3..1cb76f08f53 100644 --- a/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.SelectedIndexCollectionTests.cs +++ b/src/test/unit/System.Windows.Forms/System/Windows/Forms/ListBox.SelectedIndexCollectionTests.cs @@ -29,7 +29,7 @@ public void ListBoxSelectedIndexCollection_ICollection_Properties_GetReturnsExpe using ListBox owner = new(); ICollection collection = new ListBox.SelectedIndexCollection(owner); Assert.Empty(collection); - Assert.True(collection.IsSynchronized); + Assert.False(collection.IsSynchronized); Assert.Same(collection, collection.SyncRoot); } @@ -41,7 +41,7 @@ public void ListBoxSelectedIndexCollection_IList_Properties_GetReturnsExpected() Assert.Empty(collection); Assert.True(collection.IsFixedSize); Assert.True(collection.IsReadOnly); - Assert.True(collection.IsSynchronized); + Assert.False(collection.IsSynchronized); Assert.Same(collection, collection.SyncRoot); }