Lab 6: Core Methods
-
FindBugs and Checkstyle
If you are using Eclipse on your own machine, download and install the FindBugs and Checkstyle plugins as described here (see step 4): Installing the Eclipse IDE at Home. If you are using Eclipse on the department Linux servers, these plugins are already installed. But you should still refer to the above link for configuration and use instructions (see step 4).
There is nothing to turn in for this part of the lab, but the expectation is that you will complete the next part of the lab (and all future labs) with both FindBugs and Checkstyle enabled. The code you submit for lab solutions (apart from JUnit test fixtures) should not have any violations flagged by either of these tools.
Note: Installing FindBugs and Checkstyle isn't enough. You have to explicitly run/enable them on a given project. Right click on a project and select the FindBugs and/or Checkstyle menu item to explicitly run these checks on the project.
-
Core Methods
You have been gradually refining your implementation of unbounded natural numbers. In this lab, you will continue this process by implementing the core methods inherited from
java.lang.Object. In particular, yourSlowBigNaturalclass should be augmented with implementations of the following methods:-
equals() -
hashCode()
Augment your JUnit test fixture with test cases that exercise these new elements of functionality — that is, there should be a number of test cases to ensure that
equalsandhashCodework correctly in various interesting circumstances.Document your augmented
SlowBigNaturalclass with Javadoc and include the html documentation with your lab submission.Your submission for this part of the lab should include:
BigNatural.javaandBigNatural.html, the natural number interface and its documentation (unchanged from the last lab, except as necessary to remove any FindBugs or Checkstyle violations).SlowBigNatural.javaandSlowBigNatural.html, the implementation and its documentation.- The JUnit test fixture(s) for testing your implementation.
-