📍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:
@ -24,9 +24,8 @@
|
||||
package com.iluwatar.doublebuffer;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Double buffering is a term used to describe a device that has two buffers. The usage of multiple
|
||||
@ -35,10 +34,9 @@ import org.slf4j.LoggerFactory;
|
||||
* separate frame is being buffered to be shown next. This method makes animations and games look
|
||||
* more realistic than the same done in a single buffer mode.
|
||||
*/
|
||||
@Slf4j
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
* Program main entry point.
|
||||
*
|
||||
|
@ -28,12 +28,6 @@ package com.iluwatar.doublebuffer;
|
||||
*/
|
||||
public enum Pixel {
|
||||
|
||||
WHITE(0),
|
||||
BLACK(1);
|
||||
|
||||
private final int color;
|
||||
|
||||
Pixel(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
WHITE,
|
||||
BLACK;
|
||||
}
|
||||
|
@ -24,17 +24,15 @@
|
||||
package com.iluwatar.doublebuffer;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Scene class. Render the output frame.
|
||||
*/
|
||||
@Slf4j
|
||||
public class Scene {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Scene.class);
|
||||
|
||||
private final Buffer[] frameBuffers;
|
||||
|
||||
private int current;
|
||||
|
@ -34,7 +34,7 @@ class AppTest {
|
||||
|
||||
/**
|
||||
* Issue: Add at least one assertion to this test case.
|
||||
*
|
||||
* <p>
|
||||
* Solution: Inserted assertion to check whether the execution of the main method in {@link App#main(String[])}
|
||||
* throws an exception.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user