Community
Participate
Working Groups
Created attachment 142152 [details] stack trace DeferredUpdateManager -> performValidation() this cycle has an error: for (int i = 0; i < invalidFigures.size(); i++) { fig = (IFigure) invalidFigures.get(i); invalidFigures.set(i, null); fig.validate(); } should be: for (int i = 0; i < invalidFigures.size(); i++) { fig = (IFigure) invalidFigures.get(i); fig.validate(); invalidFigures.set(i, null); } cause possible to get infinite loop. I get this loop. Look -> DeferredUpdateManager -> public synchronized void addInvalidFigure(IFigure f) { if (invalidFigures.contains(f)) return; queueWork(); invalidFigures.add(f); }
Do you have an example so we can reproduce the issue?
you can find code example here: https://svn.jboss.org/repos/jbosstools/trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts -> ShapeEditPart -> getLocation -> commented block. To reproduce - uncomment the block. The infinite loop is after the call -> figureSource.translateToAbsolute(rcSource); If you need more help to reproduce it - ask me. Anyway I see obvious error in the code and to fix it -> just necessary to change order of calls: //--- this is wrong order: invalidFigures.set(i, null); fig.validate(); //--- this is right order: fig.validate(); invalidFigures.set(i, null); //--- Take a look at the stack trace screenshot in attachment: fig.validate() finally calls function addInvalidFigure. invalidFigures.set(i, null); -> remove fig from invalidFigures, but firstly necessary to validate fig and only then remove it from invalidFigures.
This seems to be a duplicate of Bug 106151 which is closed as invalid. BTW Vitali I could not access to your example as it ask me a login and password (tried anonymous with empty password without success).
sorry, use anonsvn.jboss.org instead of svn.jboss.org: https://anonsvn.jboss.org/repos/jbosstools/trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/