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

Reduce Throwable to Exception in JavaSnippet #1208

Merged
merged 2 commits into from
Aug 29, 2017

Conversation

mpkorstanje
Copy link
Contributor

Summary

Tests are allowed to fail by throwing an(y) exception. As such #318
added throws Throwable to the JavaSnippet. Aside from being a bad
practice this results in unnecessary checkstyle warnings. As such the
generated snippet should not explicitly declare Throwable.

Reducing Throwable to Exception should be sufficient.

Fixes #1207

How Has This Been Tested?

Updated the Unit Tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Tests are allowed to fail by throwing an(y) exception. As such #318
added `throws Throwable` to the JavaSnippet. Aside from being a bad
practice this results in unnecessary checkstyle warnings. As such the
generated snippet should not explicitly declare `Throwable`.

Reducing `Throwable` to `Exception` should be sufficient.

Fixes #1207
@mpkorstanje mpkorstanje requested a review from mlvandijk August 28, 2017 21:01
@coveralls
Copy link

Coverage Status

Coverage remained the same at 56.198% when pulling 7873cb5 on throw-exception-not-throwable into 0ea7b43 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 56.198% when pulling 7873cb5 on throw-exception-not-throwable into 0ea7b43 on master.

@brasmusson brasmusson merged commit 7873cb5 into master Aug 29, 2017
@@ -2,6 +2,7 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO

## [2.0.0-SNAPSHOT](https://github.com/cucumber/cucumber-jvm/compare/v1.2.5...master) (In Git)

* [Java] Reduce Throwable to Exception in JavaSnippet ([#1207](https://github.com/cucumber/cucumber-jvm/issues/1207), [#1208](https://github.com/cucumber/cucumber-jvm/pull/1208) M.P. Korstanje)
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, we discourage updating the Changelog in PR:s, and instead put that task on the person merging the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Planned on doing that myself. Then realized @mlvandijk could do it as a practice.

Copy link
Member

Choose a reason for hiding this comment

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

But I was too slow ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, the same day I was up to release Cucumber-JVM 2.0.0 was the wrong day for such practice ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Such is life. :D

@brasmusson brasmusson deleted the throw-exception-not-throwable branch August 29, 2017 19:48
@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
@mpkorstanje mpkorstanje restored the throw-exception-not-throwable branch October 4, 2019 18:19
@mpkorstanje mpkorstanje deleted the throw-exception-not-throwable branch October 4, 2019 18:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkstyle warnings on throwing Throwables in Step Definitions
4 participants