Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    37
    Vote Rating
    0
    meliniak is on a distinguished road

      0  

    Default [TreeGrid] removing a child results in IndexOutOfBoundsException

    [TreeGrid] removing a child results in IndexOutOfBoundsException


    I'm having an issue with removing an element from a TreeGrid and it seems like a bug. Here is a stack trace:

    Code:
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at com.extjs.gxt.ui.client.data.ChangeEventSupport.notify(ChangeEventSupport.java:37)
        at com.extjs.gxt.ui.client.data.BaseModel.notify(BaseModel.java:114)
        at com.extjs.gxt.ui.client.data.BaseTreeModel.notify(BaseTreeModel.java:131)
        at com.extjs.gxt.ui.client.data.BaseTreeModel.remove(BaseTreeModel.java:161)
    I guess it might be hard to extract a test case, I'll just try to explain it verbosely.

    The GUI setup is as follows. There is a TreeGrid containing BaseTreeModel as parent nodes, and ModelData as their children. Selecting one of those causes them to be bound to the form. There are different FormPanels for the parent nodes and for the children nodes.

    The exception is thrown when removing a child node by calling BaseTreeModel.remove(ModelData child). It seems to be happening just in a one particular case. In most cases it works fine, excluding the case when first selecting a parent node, selecting the child node next and trying to delete it afterwards.

    ChangeEventSupport.notify() looks like this:

    Code:
    public void notify(ChangeEvent event) {
      if (!silent && listeners != null) {
          for (int i = 0, len = listeners.size(); i< len; i++) {
            ChangeListener listener = listeners.get(i);
            listener.modelChanged(event);
          }
        }
      }
    List<ChangeListener> listeners initially contains two elements in the following order:

    Store$1
    FieldBinding$1

    Needless to say, both are ChangeListener anonymous classes. It seems that calling listener.modelChanged(event) (ie. Store$1.modelChanged(event)) in the first iteration removes the FieldBinding$1 instance from the listeners. The second iteration should not occur then, but since len value is assigned once, the iteration is done anyway. i == 1, listeners.size() == 1, so invoking listener.get(1) causes the exception to be thrown.

    Can you guys examine this problem? If this is a bug, can you figure out any workarounds? Hilfe bitte.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    The latest GXT code makes a copy of the list:

    Code:
     public void notify(ChangeEvent event) {
        if (!silent && listeners != null) {
          //make a copy of it because of ConcurrentModificationException
          List<ChangeListener> l = new ArrayList<ChangeListener>(listeners);
          for (int i = 0, len = l.size(); i< len; i++) {
            ChangeListener listener = l.get(i);
            listener.modelChanged(event);
          }
        }
      }

  3. #3
    Sencha User
    Join Date
    Oct 2010
    Posts
    37
    Vote Rating
    0
    meliniak is on a distinguished road

      0  

    Default


    Thx, helpful answer, as usual. By the latest gxt code you mean svn? It's not released yet? Or there is any jar to download?

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Its only in SVN so far. you will need to wait for the next relaese.

Similar Threads

  1. Replies: 1
    Last Post: 30 Sep 2010, 3:03 AM
  2. Replies: 1
    Last Post: 26 Aug 2009, 10:54 AM
  3. Replies: 2
    Last Post: 16 Jun 2008, 1:43 AM

Thread Participants: 1