Skip to content

Refactoring: remove duplication by adding Throwables#getStacktrace #1312

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

Conversation

alb-i986
Copy link
Contributor

No description provided.

@@ -39,4 +42,14 @@ public static Exception rethrowAsException(Throwable e) throws Exception {
private static <T extends Throwable> void rethrow(Throwable e) throws T {
throw (T) e;
}

/**
* @return a String with the stacktrace of the given throwable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style-nit: remove the @return and instead give the method a description. The first sentence of a method's description shows up in the method summary section of the class Javadoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, thanks!

@kcooney
Copy link
Member

kcooney commented May 31, 2016

Nice. Thanks!

/**
* @return a String with the stacktrace of the given throwable
*/
public static String getStacktrace(Throwable exception) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add "@SInCE 4.13" to the Javadoc

@marcphilipp marcphilipp merged commit 7f2569f into junit-team:master May 31, 2016
@marcphilipp
Copy link
Member

@alb-i986 Thanks!

@alb-i986 alb-i986 deleted the add-Throwables-getStacktrace-and-refactor branch May 31, 2016 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants