📍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>
This commit is contained in:
va1m
2021-03-13 13:19:21 +01:00
committed by GitHub
parent 0e26a6adb5
commit 5cf2fe009b
681 changed files with 2472 additions and 4966 deletions

View File

@ -23,8 +23,7 @@
package com.iluwatar.multiton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* Whereas Singleton design pattern introduces single globally accessible object the Multiton
@ -38,10 +37,9 @@ import org.slf4j.LoggerFactory;
* <p>In the enum implementation {@link NazgulEnum} is the multiton. It is static and mutable
* because of the way java supports enums.
*/
@Slf4j
public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
/**
* Program entry point.
*

View File

@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
public class AppTest {
@Test
public void test() {
void test() {
App.main(new String[]{});
}
}

View File

@ -23,7 +23,7 @@
package com.iluwatar.multiton;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertSame;
import org.junit.jupiter.api.Test;
@ -34,11 +34,11 @@ import org.junit.jupiter.api.Test;
class NazgulEnumTest {
/**
* Check that multiple calls to any one of the instances in the multiton returns
* Check that multiple calls to any one of the instances in the multiton returns
* only that one particular instance, and do that for all instances in multiton
*/
@Test
public void testTheSameObjectIsReturnedWithMultipleCalls() {
void testTheSameObjectIsReturnedWithMultipleCalls() {
for (var i = 0; i < NazgulEnum.values().length; i++) {
var instance1 = NazgulEnum.values()[i];
var instance2 = NazgulEnum.values()[i];

View File

@ -23,12 +23,12 @@
package com.iluwatar.multiton;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import org.junit.jupiter.api.Test;
/**
* Date: 12/22/15 - 22:28 AM
*
@ -40,7 +40,7 @@ public class NazgulTest {
* Verify if {@link Nazgul#getInstance(NazgulName)} returns the correct Nazgul multiton instance
*/
@Test
public void testGetInstance() {
void testGetInstance() {
for (final var name : NazgulName.values()) {
final var nazgul = Nazgul.getInstance(name);
assertNotNull(nazgul);