4 Replies Latest reply on Jun 26, 2009 5:25 AM by nimo stephan

    rich:listShuttle with false hashCode?

    nimo stephan Master

      I have a few rich:listShuttles, holding objects and all works well.

      Except this one, and I do not know why.

      Component myForm:myListShuttle has invalid value expression com.MyObject@d759f2e5


      I guess my equals/hashCode for this Object is wrong. This Object has only one property within my equals/hashCode and in my database there exists a Object-Instance with a primary key idObject =0.

      @Override
       public boolean equals(Object o) {
       if (this == o) return true;
       if (o == null || getClass() != o.getClass()) return false;
      
       MyObject that = (MyObject ) o;
       if (idObject != null ? !idObject .equals(that.idObject ) : that.idObject != null) return false;
      
       return true;
       }
      
       @Override
       public int hashCode() {
       int result = idObject != null ? idObject .hashCode() : 0;
      
       return result;
       }




      06:38:12,954 INFO [STDOUT] AfterPhase: INVOKE_APPLICATION 5
      06:38:12,970 INFO [STDOUT] BeforePhase: RENDER_RESPONSE 6
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 1 :1
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 1 :1
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 1 :1
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 101 :101
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 101 :101
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 101 :101
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 102 :102
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 102 :102
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 102 :102
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 103 :103
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 103 :103
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 103 :103
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 104 :104
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 104 :104
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 104 :104
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 105 :105
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 105 :105
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 105 :105
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 50 :50
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 50 :50
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 50 :50
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 51 :51
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 51 :51
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 51 :51
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 2 :2
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 2 :2
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 2 :2
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 3 :3
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 3 :3
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 3 :3
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 4 :4
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 4 :4
      06:38:13,063 INFO [STDOUT] hashCode of Object with ID 4 :4
      06:38:13,965 INFO [STDOUT] AfterPhase: RENDER_RESPONSE 6
      06:38:22,268 INFO [STDOUT] BeforePhase: RESTORE_VIEW 1
      06:38:22,284 INFO [STDOUT] AfterPhase: RESTORE_VIEW 1
      06:38:22,284 INFO [STDOUT] BeforePhase: APPLY_REQUEST_VALUES 2
      06:38:22,393 INFO [STDOUT] AfterPhase: APPLY_REQUEST_VALUES 2


      I also do not know why the printstack prints each object three times.