Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getLastTask() method to o.sf.util.StopWatch (and fix a couple of typos) [SPR-7134] #11793

Closed
spring-projects-issues opened this issue Apr 26, 2010 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Richard Fearn opened SPR-7134 and commented

It would be handy to have a getLastTask() method to allow the TaskInfo object to be passed around (e.g. for logging). Something like this:

/**
 * Return the last task.
 */
public TaskInfo getLastTask() throws IllegalStateException {
	if (this.lastTaskInfo == null) {
		throw new IllegalStateException("No tasks run: can't get last task");
	}
	return this.lastTaskInfo;
}

Also, there's a typo in getLastTaskName(), presumably because getLastTaskTimeMillis() was copied. The exception message should read "can't get last name" instead of "can't get last interval".

Finally, I imagine this has something to do with the original use of this code, but shouldn't the execption messages in both getLastTaskName() and getLastTaskTimeMillis() refer to "tasks" instead of "tests"?


Affects: 3.0.2

Referenced from: commits ceb668a

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

All good points. I've added a getLastTaskInfo() method and also fixed those error messages for 3.0.3.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants