Java 11 migrate c-d (remaining) (#1111)
* Moves converter pattern to Java 11 * Moves cqrs pattern to Java 11 * Moves dao pattern to Java 11 * Moves data-bus pattern to Java 11 * Moves data-locality pattern to Java 11 * Moves data-mapper pattern to Java 11 * Moves data-transfer-object pattern to Java 11 * Moves decorator pattern to Java 11 * Moves delegation pattern to Java 11 * Moves dependency-injection to Java 11 * Moves dirty-flag to Java 11 * Moves double-buffer to Java 11 * Moves double-checked-locking to Java 11 * Moves double-dispatch to Java 11 * Corrects with changes thats breaking test cases
This commit is contained in:
committed by
Ilkka Seppälä
parent
5681684157
commit
ea57934db6
@ -32,8 +32,7 @@ public class AppTest {
|
||||
|
||||
@Test
|
||||
public void testMain() {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
App.main(new String[]{});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
package com.iluwatar.doublebuffer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -35,10 +36,8 @@ public class FrameBufferTest {
|
||||
public void testClearAll() {
|
||||
try {
|
||||
var field = FrameBuffer.class.getDeclaredField("pixels");
|
||||
Pixel[] pixels = new Pixel[FrameBuffer.HEIGHT * FrameBuffer.WIDTH];
|
||||
for (int i = 0; i < pixels.length; ++i) {
|
||||
pixels[i] = Pixel.WHITE;
|
||||
}
|
||||
var pixels = new Pixel[FrameBuffer.HEIGHT * FrameBuffer.WIDTH];
|
||||
Arrays.fill(pixels, Pixel.WHITE);
|
||||
pixels[0] = Pixel.BLACK;
|
||||
var frameBuffer = new FrameBuffer();
|
||||
field.setAccessible(true);
|
||||
@ -54,10 +53,8 @@ public class FrameBufferTest {
|
||||
public void testClear() {
|
||||
try {
|
||||
var field = FrameBuffer.class.getDeclaredField("pixels");
|
||||
Pixel[] pixels = new Pixel[FrameBuffer.HEIGHT * FrameBuffer.WIDTH];
|
||||
for (int i = 0; i < pixels.length; ++i) {
|
||||
pixels[i] = Pixel.WHITE;
|
||||
}
|
||||
var pixels = new Pixel[FrameBuffer.HEIGHT * FrameBuffer.WIDTH];
|
||||
Arrays.fill(pixels, Pixel.WHITE);
|
||||
pixels[0] = Pixel.BLACK;
|
||||
var frameBuffer = new FrameBuffer();
|
||||
field.setAccessible(true);
|
||||
@ -80,10 +77,8 @@ public class FrameBufferTest {
|
||||
public void testGetPixels() {
|
||||
try {
|
||||
var field = FrameBuffer.class.getDeclaredField("pixels");
|
||||
Pixel[] pixels = new Pixel[FrameBuffer.HEIGHT * FrameBuffer.WIDTH];
|
||||
for (int i = 0; i < pixels.length; ++i) {
|
||||
pixels[i] = Pixel.WHITE;
|
||||
}
|
||||
var pixels = new Pixel[FrameBuffer.HEIGHT * FrameBuffer.WIDTH];
|
||||
Arrays.fill(pixels, Pixel.WHITE);
|
||||
pixels[0] = Pixel.BLACK;
|
||||
var frameBuffer = new FrameBuffer();
|
||||
field.setAccessible(true);
|
||||
|
@ -23,12 +23,10 @@
|
||||
|
||||
package com.iluwatar.doublebuffer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Scene unit tests.
|
||||
*/
|
||||
@ -41,8 +39,8 @@ public class SceneTest {
|
||||
var field1 = Scene.class.getDeclaredField("current");
|
||||
field1.setAccessible(true);
|
||||
field1.set(scene, 0);
|
||||
FrameBuffer[] frameBuffers = new FrameBuffer[2];
|
||||
FrameBuffer frameBuffer = new FrameBuffer();
|
||||
var frameBuffers = new FrameBuffer[2];
|
||||
var frameBuffer = new FrameBuffer();
|
||||
frameBuffer.draw(0, 0);
|
||||
frameBuffers[0] = frameBuffer;
|
||||
var field2 = Scene.class.getDeclaredField("frameBuffers");
|
||||
|
Reference in New Issue
Block a user