Cleaning up MetricDatabase.java
Removed unused resultSet in MetricInsert
Removed old parameter out in MetricInsert.
Fix for issue where Inserts were being injected with the wrong date.

Analysis emailed out

Problem:
Availability inserts for days missing data were failing to insert into the database properly.

Cause and Debug:
I used printouts of System.identityHashCode(theCalendarObject) to track the Java equivalent of the memory addresses. I found that Scanner.java's (GregorianCalendar timestamp) Line 86 was being passed by reference all the way to the dates passed to MetricDatabase.

This caused problems when the threaded injector tasks would run concurrently as the scan. When the date was updated in Scanner.java, it would effectively propagate down the tree of references including the tasks yet to be inserted for the previous days.

Solution:
I replaced MetricResult.java line 45:
     this.date = stationInfo.getTimestamp();
with:
     this.date = (Calendar)stationInfo.getTimestamp().clone();

Calendar has an overridden clone() which is supposed to correctly do a deep copy of the object. Cloning here should break the chain of references at a logical point. Each MetricResult now has its own instance of the date. This is passed by reference to MetricInjector and subsequently the task handler, but each result's date shouldn't change like it was doing.