PDA

View Full Version : Bindings class bug.....



eggp
29 Oct 2011, 12:37 PM
Hello My name is Egg :)))

i little speak english

i create a GXT application and create formpanel and bind with bindings.... sometimes i get ConcurrentModificationException[ http://download.oracle.com/javase/6/docs/api/java/util/ConcurrentModificationException.html ]

i looked after him and found the solution => Release 2.2.2 (Released February 9th, 2011) [Fixed ConcurrentModificationException in ChangeEventSupport notify.] :)bugfix:
public void bind(final ModelData model) {
Scheduler.get().scheduleDeferred(new ScheduledCommand()
{
@Override
public void execute()
{
BindingEvent e = new BindingEvent(Bindings.this, model);
if (fireEvent(Events.BeforeBind, e)) {
if (Bindings.this.model != null) {
unbind();
}
Bindings.this.model = model;
Map<String, FieldBinding> tmpMap = new FastMap<FieldBinding>();
tmpMap.putAll(bindings);
for (FieldBinding binding : tmpMap.values()) {
binding.bind(model);
}
fireEvent(Events.Bind, e);

}
}
});
}

and replace deferred => scheduler....

sorry i translate to google... :)

I'm here if you already, i would like to ask why it was Deprecated this class ? [i use gxt 2.2.5]

Thx....

sven
30 Oct 2011, 3:17 AM
We cannot replace deferred with scheduler as it is not backward compatible. We will take a look.

eggp
30 Oct 2011, 3:22 AM
We cannot replace deferred with scheduler as it is not backward compatible. We will take a look.

thx.... but exception is java bug.... or GWT or GXT ?

Colin Alworth
31 Oct 2011, 4:35 PM
To tell where the ConcurrentModificationException is coming from, can you share the full stack trace of the error? It should tell you what list is being modified, and by what code.

This exception is often thrown when code is iterating through a collection, and inside that loop, something modifies this collection. Seeing the full stack trace, and a simplified example of the code that can reproduce this bug, will make it easier to point at what is going wrong.

eggp
21 Nov 2011, 3:45 AM
To tell where the ConcurrentModificationException is coming from, can you share the full stack trace of the error? It should tell you what list is being modified, and by what code.

This exception is often thrown when code is iterating through a collection, and inside that loop, something modifies this collection. Seeing the full stack trace, and a simplified example of the code that can reproduce this bug, will make it easier to point at what is going wrong.

sorry my laptop hdd crash :( and lost all data :{{{{{ about 1-2 week and i add code you...