Collection was modified; enumeration operation may not execute

I can’t get to the bottom of this error, because when the debugger is attached, it does not seem to occur. Collection was modified; enumeration operation may not execute Below is the code. This is a WCF server in a Windows service. The method NotifySubscribers() is called by the service whenever there is a data … Read more

No enclosing instance of type is accessible.

The whole code is: public class ThreadLocalTest { ThreadLocal<Integer> globalint = new ThreadLocal<Integer>(){ @Override protected Integer initialValue() { return new Integer(0); } }; public class MyThread implements Runnable{ Integer myi; ThreadLocalTest mytest; public MyThread(Integer i, ThreadLocalTest test) { myi = i; mytest = test; } @Override public void run() { System.out.println(“I am thread:” + myi); … Read more