0 Replies Latest reply on Apr 15, 2010 2:28 PM by 843810

    JPDA/JDI retrieve the content of an ArrayList

      A few months ago I started using the JDI for developing a kind of "debugger".

      What I want to do is retrieve the content of ArrayList(s) as the content of this ArrayList is changed (add, remove)?

      I wrote a script that retrieves the content of an ArrayList:
      public void fieldWatchEvent(ModificationWatchpointEvent event)  {
              Field field = event.field();
              Value value = event.valueToBe();
                    ObjectReference t = (ObjectReference) value;
                    Value value2 = t.getValue(t.referenceType().fieldByName("elementData"));
                    ArrayReference r = (ArrayReference) value2;
                   System.out.println("This array contains this values :" + r.getValues());
      Is there an easier way for retrieving the content of an Array and is it possible to do this when the content of the ArrayList changes?

      Thanks in advance,