Commit Graph

42 Commits

Author SHA1 Message Date
Mehdi Rahimi 49172dd5be fix: Minor misspelling (#3161) 2025-01-13 18:03:54 +02:00
Ilkka Seppälä 8389456532 refactor: sanitize javadoc 2024-05-23 18:40:52 +03:00
Ilkka Seppälä f3bde28d01 docs: update strategy 2024-05-21 17:38:03 +03:00
k1w1dev ef42e169b9 fix: Fix sonar issues (#2925)
* Remove unused member which was also causing a false positive sonar issue.
Fixes sonar issue https://sonarcloud.io/project/issues?open=AY3gHwu5DIZTZkppqVEG&id=iluwatar_java-design-patterns

* Fixes sonar issue https://sonarcloud.io/project/issues?open=AXK0OzDA-CiGJS70dLki&id=iluwatar_java-design-patterns
related to "Refactor the code of the lambda to not have multiple invocations throwing the same checked exception."

Also, updated the code to use Instant and Duration to deal with time instead of int. Added the awaitility
library to perform assertions in test which is more reliable than using Thread.sleep directly to wait for events to happen.

* checkstyle fix

* Add sneaky throws to fix sonar lint issue. This is fine as the newFile method is not being tested but instead the new SimpleFileWriter(...) is.

* The first booking needs to happen outside the assertions. Fixed other warnings

* Use records to pass around related objects instead of using a large number of
individual params, which sonar did not like.

* Checkstyle fixes

* checkstyle fixes

* Remove complexity to keep sonar happy.

* Split into different methods to reduce complexity. Could be broken down even further but currently Sonar is happy.

* Move files to correct package

* Add valid assertions to tests

* rename constants to avoid confusion

* Sonar warning related to cognitive complexity can be suppressed as the methods are quite generic and not functional enough to be separated out.

* Use constants to keep Sonar happy

* Use correct constant naming conventions

* Use correct constant naming conventions

* Use lombok to define noargsconstructor

* Use a single method to do the logging

* Remove unused constructor and redundant method

* Use a reusable method for logging
2024-05-04 08:20:01 +03:00
Rahul Raj fb7ec9b375 dependencies: #2449 bump maven-checkstyle-plugin from 3.1.0 to 3.2.0 + resolve chec… (#2464)
* #2449 bump maven-checkstyle-plugin from 3.1.0 to 3.2.0 + resolve checkstyle issues

* remove FileSelectorJFrame.java to resolve checkstyle issue

* remove FileSelectorJFrame.java to resolve checkstyle issue

* remove FileSelectorJFrame.java to resolve checkstyle issue

* add refactored file with correct filename to resolve checkstyle issue

* add the test data

* change filenames from JFrame to Jframe for checkstyle

* fix code smell from  sonar report

* add new testcases to improve the test coverage

* remove code smell
2023-02-04 19:20:54 +02:00
Robert Volkmann 4cd8149502 refactor: remove code smell java:S5786 (#2159)
https://sonarcloud.io/organizations/iluwatar/rules?open=java%3AS5786&rule_key=java%3AS5786
2022-10-30 18:21:21 +02:00
Ilkka Seppälä 932836f68b Update license plugin (#2020)
* update license plugin

* suppress linelength and emptylineseparator rules

* fix checkstyle error

Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
2022-09-14 23:22:24 +05:30
Harshal 22ddd57146 sonar fix: Update App.java (#1898) 2021-10-31 09:08:49 +02:00
Ilkka Seppälä 04bf566dc1 task: Explanations and grammar fixes for all the GoF patterns (#1791)
* Grammatical fixes to command pattern

* Update bridge pattern readme

* Fixes to builder pattern grammar

* Update chain of responsibility

* Improvements to the composite example

* Fixes to headings

* Minor updates to decorator pattern

* Update facade

* Update factory example

* Update factory method

* Update flyweight

* Interpreter explanation

* Update iterator readme

* Add explanation for mediator pattern

* Grammatical fixes to memento

* Grammar fixes for observer

* Update explanation for the prototype pattern

* Proxy pattern grammar fixes

* Update singleton

* Grammar fixes to state pattern

* Grammar fixes for strategy

* Grammar fixes, template method

* Grammar fixes for visitor

* Fix typo
2021-06-24 18:27:20 +05:30
va1m 5cf2fe009b 📍Use lombok, reformat, and optimize the code (#1560)
* Use lombok, reformat, and optimize the code

* Fix merge conflicts and some sonar issues

Co-authored-by: va1m <va1m@email.com>
2021-03-13 14:19:21 +02:00
Subhrodip Mohanta 7891c2b117 update inception year to 2021 (#1653) 2021-02-14 11:57:57 +02:00
Ilkka Seppälä 0010fb55c5 Merge data transfer object examples (#1635)
* #1617 merge dto pattern examples

* #1617 update license headers

Co-authored-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com>
2021-01-25 09:05:04 +05:30
ignite1771 18a1a725ee #1469 Add lambda expressions implementation for Strategy Pattern (#1631)
* #1469 Add Strategy Pattern lambda implementation

After Java 8.
Also take advantage of enum

* #1469 Update class diagrams

* #1469 Update README.md

Add lambda programmatic example

* #1469 Remove unused imports

Co-authored-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com>
2021-01-19 12:06:26 +05:30
Toxic Dreamz 31471acb69 Fixed most reported issues by SonarCloud. 2020-08-15 21:47:39 +04:00
Ilkka Seppälä 417f21ed3d Code cleanup (#1461)
* Code cleanup

* Fix flux tests

* Fix checkstyle errors

* Fix compile error
2020-07-30 20:28:47 +03:00
Anurag Agarwal cd2a2e7711 Java 11 migrate all remaining s (#1120)
* Moves saga to Java 11

* Moves semaphore to Java 11

* Moves servant to Java 11

* Moves serverless to Java 11

* Moves service-layer to Java 11

* Moves service-locator to Java 11

* Moves sharding to Java 11

* Moves singleton to Java 11

* Moves spatial-partition to Java 11

* Moves specification to Java 11

* Moves state to Java 11

* Moves step-builder to Java 11

* Moves strategy to Java 11

* Moves subclass-sandbox to Java 11

* Fixes checkstyle issues
2020-01-04 18:36:08 +02:00
Leonóra Dér 3b1a28149b decrease number of checkstyle errors in singleton, strategy and visitor patterns #1021 (#1054)
* fix checkstlye errors - visitor pattern

* fix checkstlye errors - strategy pattern

* fix checkstlye errors - singleton pattern
2019-10-31 19:54:13 +02:00
Leon Mak c8a481bb77 Add java 11 support for #987 (o-t) (#1051)
* Use java 11

* Use .of
- Replace Arrays.asList with List.of
- Replace HashSet<>(List.of()) with Set.of

* Formatting
2019-10-29 08:37:40 +02:00
GVSharma af8c5ed0dd local variable type inference changes (#1040)
local variable type inference changes for strategy design pattern
2019-10-26 18:45:54 +03:00
Alexander Ivanov 4904d7eea0 #1021: Fix checkstyle warnings by changing the license header template (#1027)
* Add custom license header style in order to comply with Google's Checkstyle format

* Update license headers to comply with Google's Checkstyle format
2019-10-22 08:15:35 +03:00
Ilkka Seppälä 9ebbc421dd Update license headers 2019-10-12 20:05:54 +03:00
hoangNam a6e6c22bf6 Remove redundant Exception from throws list in DragonSlayerTest 2018-10-15 10:44:14 +07:00
Artur Mogozov 6694d742a3 Migrate to JUnit5 2017-12-31 16:29:48 +09:00
Ilkka Seppälä faa29f8025 Update license headers 2016-11-27 14:34:20 +02:00
daniel-bryla e138163c4f #502 Adjusted tests for logger introduction 2016-11-04 11:47:06 +01:00
daniel-bryla 0438811489 #502 Replaced usages of System.out with logger. 2016-10-23 19:59:03 +02:00
Narendra Pathai b14aff17b6 Updated failing test cases 2016-03-26 15:54:10 +05:30
Saiful Islam e549af25dd Severe is not appropriate.
"Sever" is most Appropriate
2016-03-25 22:50:17 +06:00
Joseph McCarthy 3d95696078 #358 Added license to all files using plugin 2016-01-27 22:20:42 +00:00
Jeroen Meulemeester 997bfba3b2 Added tests for strategy pattern 2015-12-30 20:55:22 +01:00
Ilkka Seppala 5f033be54f Fix PMD violations #327 2015-12-27 21:21:57 +02:00
Ilkka Seppala 6e59d9554f Functional approach to Strategy pattern #310 2015-12-08 23:25:05 +02:00
Ankur Kaushal 306b1f3d31 Reformat rest of the design patterns - Issue #224 2015-11-01 21:29:13 -05:00
Ilkka Seppala 0a9879a277 Improve Strategy Javadoc 2015-10-04 00:22:27 +03:00
Ilkka Seppala 934f99e2a9 #107 JavaDoc for Strategy 2015-08-21 23:17:25 +03:00
Ilkka Seppala 8524c75ba6 Changed package naming across all examples. 2015-05-31 11:55:18 +03:00
Ilkka Seppala 991653062d Improved comments for strategy pattern sample. 2015-01-13 08:20:27 +02:00
Ilkka Seppala 6301e0bc11 Added unit tests for each of the patterns. 2014-12-06 20:34:41 +02:00
matthew 3da9ad5469 Formatted all files to the same standard 2014-10-08 13:42:12 +01:00
Matthew bde5b343d0 Just formatting App classes to be like the other class files on the project 2014-10-07 16:23:37 +01:00
Ilkka Seppala 94b289801b Comments for the strategy example. 2014-08-31 11:27:19 +03:00
Ilkka Seppala 6157f22ea4 added strategy pattern sample 2014-08-23 13:18:53 +03:00