Master of time

February 12, 2010

I think this comment is unintentionally very amusing:

/**
 * {@code MyTimer} manages time.<br>
 * <b>Collaborations:</b><br>
 * <i>none</i>
 */
public class MyTimer extends JLabel implements ActionListener {
   // ...
}


Weird widget adapter

February 5, 2010

I’m still not really sure what misconception lead to this class:

public class StatusBar {
   private JTextField status;

   public void setStatus (String status) {
      this.status.setText(status);
   }
   public void clearStatus () {
      this.status.setText("");
   }
   public JTextField getStatus () {
      return this.status;
   }
}

I can’t comprehend why they didn’t just extend JTextField to add their methods instead of doing this weird wrapping. This violation of encapsulation principles really hurts somehow.


Not much time

February 5, 2010

I just found this within a sourcecode comment a student team handed in:

Sorry, but we had not much time this week, so our implementation is more or less garbage.

I’m not really sure, if I should look into the sourcecode at all or just take their own assessment…

Addition:

I should have taken their remark for real…they actually did nothing except extracting anonymous classes into explicit ones…


Follow

Get every new post delivered to your Inbox.