Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6361033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:43:28+00:00 2026-05-24T23:43:28+00:00

I have a problem. Accessing to a Vector concurrently I get an ConcurrentModificationException. I

  • 0

I have a problem. Accessing to a Vector concurrently I get an ConcurrentModificationException. I added synchronized blocks to all the vector iterations but maybe forgot one or there is another leak.

The problem is that the in error stacktrace the error shown is a call to Vector.retainAll() which is a synchronized method. How can I guess whats the other point involved in the collision?

Thanks in advance

 08-24 13:37:25.968: ERROR/AndroidRuntime(6582): java.util.ConcurrentModificationException
 08-24 13:37:25.968: ERROR/AndroidRuntime(6582):     at java.util.AbstractList$SubAbstractList.listIterator(AbstractList.java:320)
 08-24 13:37:25.968: ERROR/AndroidRuntime(6582):     at java.util.AbstractList$SubAbstractList.iterator(AbstractList.java:307)
 08-24 13:37:25.968: ERROR/AndroidRuntime(6582):     at java.util.AbstractCollection.contains(AbstractCollection.java:128)
 08-24 13:37:25.968: ERROR/AndroidRuntime(6582):     at java.util.Collections$SynchronizedCollection.contains(Collections.java:432)
 08-24 13:37:25.968: ERROR/AndroidRuntime(6582):     at java.util.AbstractCollection.retainAll(AbstractCollection.java:319)
 08-24 13:37:25.968: ERROR/AndroidRuntime(6582):     at java.util.Vector.retainAll(Vector.java:856)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:43:28+00:00Added an answer on May 24, 2026 at 11:43 pm

    Check for a code where you structurally modify Vector (add or remove) while iterating it – this is most likely reason why you’re getting CME. Use iterator to do such a modification to avoid CME

    void unsafeMod(Vector data) {
        for (Object o : data) {
            if (o != null) {
                data.remove(o); // may cause CME
            }
        }
    }
    

    Also I second an advice to use ArrayList instead of Vector.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all I have a problem with accessing an HashMap into my jsl using
I want to implement custom JSP list tag, but have problem with accessing properties
I have a problem accessing JSON data. I'm new to JSON and jquery so
I am building my first ASP.Net MVC based app and have a problem accessing
i have problem with libhid . i found that there 2 way 4 accessing
I am having a problem accessing the ViewData object through javascript. I have set
I have a problem with: NHibernate.Cfg.Configuration.SetProperties() Not accepting the IDictionary: NHibernateConfigHandler I get the
I have problem with return statment >.< I want to store all magazine names
I'm quite new to JS and jQuery. I have a problem accessing the properties
I have have a problem loading and accessing data from a value object in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.