Skip to content

Conversation

dgruntz
Copy link
Contributor

@dgruntz dgruntz commented Oct 5, 2022

As described in Issue #1099 it is recommended to declare the template method as final.
This pull request changes the implementation in the sample code of the template method pattern.

This change is applied both in the sample code and in the documentation.

Moreover, the tests was adjusted. As Mockito has problems with final methods, the Mockito dependency had to be changed from mockito-core to mockito-inline.

The tests pass:

[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in com.iluwatar.templatemethod.SubtleMethodTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.938 s
[INFO] Finished at: 2022-10-05T11:21:34+02:00
[INFO] ------------------------------------------------------------------------

@iluwatar iluwatar self-assigned this Oct 10, 2022
@iluwatar iluwatar added this to the 1.26.0 milestone Oct 10, 2022
@iluwatar
Copy link
Owner

This looks perfect. Well done @dgruntz 👍😄

@all-contributors please add @dgruntz for code

@allcontributors
Copy link
Contributor

@iluwatar

@dgruntz already contributed before to code

@iluwatar iluwatar merged commit 67f01d4 into iluwatar:master Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants