On this topic there are repercussions with using static methods related to thread safety and unpredictable behavior when a static method modifies a data structure shared between threads and race conditions associated with this. In general do you all have guidelines as to when to use instance versus static methods? Doesn't it also depend on how the chunk of code is being called?
Sent from my iPhone On Aug 18, 2010, at 5:42 AM, Sean Owen <[email protected]> wrote: > This brings up an interesting side question. > > I think all methods that can be static (i.e. use no instance methods > or fields) should be static -- unless explicitly intended to be > overrideable. It simply reflects reality and adds flexibility. In > critical sections it can improve performance. > > If such methods were static, they can be. If they're private, they're > not to be overridden. So I think they should be. > > I also bring it up since I think I *made* a number of such methods > static, so we ought to agree. > > What's the argument for making them non-static, versus not accessing > them via instance references? > > > On Wed, Aug 18, 2010 at 10:29 AM, Hudson (JIRA) <[email protected]> wrote: >> >> [ >> https://issues.apache.org/jira/browse/MAHOUT-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899801#action_12899801 >> ] >> >> Hudson commented on MAHOUT-467: >> ------------------------------- >> >> Integrated in Mahout-Quality #200 (See >> [https://hudson.apache.org/hudson/job/Mahout-Quality/200/]) >> MAHOUT-467: removed static modifiers on driver private methods that were >> not invoked statically anyway >> >
