iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
90.06k stars 26.61k forks source link

Sonarcloud vernability fix issue #2865 #3058

Open code-akanksha opened 1 month ago

code-akanksha commented 1 month ago

What problem does this PR solve?

solves some of the vernability fix from issue #2865 Use already-defined constant 'BINARY_DATA' instead of duplicating its value here. Define a constant instead of duplicating this literal " -------------------------- " 4 times. Fix this access on a collection that may trigger an 'ArrayIndexOutOfBoundsException'.