I will explain the problem with the equals method but the same apply for the hashcode (actually, the hashcode is the one causing the problem in my case)
GerritTrigger class contains an abstractProject, after reloading the configuration from disk, the equals method of GerritTrigger is no longer returning true when comparing 2 triggers for the same abstractProject because the equals of the abstractProject is returning false, since it's the default equals implementation of object. This is causing to have 2 gerritTrigger or more instead of one and triggering 2 build jobs or more (depending how many time you reload the configuration). I could patch gerritTrigger equals to do the comparison of the project's fullname but it would make more sense to implement this the equals based on the fullname in the abstractItem since the getFullName method is implemented at that level. Maybe the gerrit-trigger plugin is not the only plugin that have issue because equals (or hashcode) of item is not returning true if compared to an instance created after reloading the configuration from disk. Thanks for your quick reply On Monday, September 16, 2013 3:13:04 PM UTC-4, Jesse Glick wrote: > > On Mon, Sep 16, 2013 at 2:30 PM, Hugo Arès > <[email protected]<javascript:>> > wrote: > > I found a bug in the gerrit trigger plugin > > Not sure which bug you are referring to but I suspect that adding > AbstractItem.equals is the wrong fix. > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
