Bugzilla – Bug 5806
Change of GramJob.setDuration()
Last modified: 2008-02-04 10:47:46
You need to log in before you can comment on or make changes to this bug.
In GramJob duration and terminationTime are handled separately. Duration is handled currently in weird way. If someone sets the job duration via GramJob only the hour of the day and minutes are taken from the input type java.util.Date. So a duration > 24h is not possible. Also it does not seem to be very intuitive that the duration of a job will e.g. be 17 hours if the time of the Date of the input parameter 'duration' is 17:00:00 Here's code from an older version of trunk public void setDuration( Date duration) { if (duration == null) { this.terminationTime = null; } else { Calendar durationCalendar = Calendar.getInstance(); durationCalendar.setTime(duration); int hours = durationCalendar.get(Calendar.HOUR_OF_DAY); int minutes = durationCalendar.get(Calendar.MINUTE); this.terminationTime = Calendar.getInstance(); this.terminationTime.add(Calendar.HOUR_OF_DAY, hours); this.terminationTime.add(Calendar.MINUTE, minutes); } } We'll change the setDuration method to the following: void setDuration(int hours, int minutes) GramJob will then calculate the termination time by adding the hours and minutes to the current date. Implementation already completed.
setDuration now accepts hours and minutes as parameters note this is an interface change from 4.0.x series.