Java 11 migration: patterns (remaining b-c) (#1081)
* Moves business-delegate pattern to java 11 * Moves bytecode pattern to java 11 * Moves caching pattern to java 11 * Moves callback pattern to java 11 * Moves chain pattern to java 11 * Moves circuit-breaker pattern to java 11 * Moves collection-pipeline pattern to java 11 * Moves command pattern to java 11 * Moves commander pattern to java 11 * Moves composite pattern to java 11 * Corrects test cases
This commit is contained in:
committed by
Ilkka Seppälä
parent
6ef840f3cf
commit
33ea7335b1
@ -49,8 +49,8 @@ public class App {
|
||||
* @param args command line args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
Wizard wizard = new Wizard();
|
||||
Goblin goblin = new Goblin();
|
||||
var wizard = new Wizard();
|
||||
var goblin = new Goblin();
|
||||
|
||||
goblin.printStatus();
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class ShrinkSpell extends Command {
|
||||
@Override
|
||||
public void undo() {
|
||||
if (oldSize != null && target != null) {
|
||||
Size temp = target.getSize();
|
||||
var temp = target.getSize();
|
||||
target.setSize(oldSize);
|
||||
oldSize = temp;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class Wizard {
|
||||
*/
|
||||
public void undoLastSpell() {
|
||||
if (!undoStack.isEmpty()) {
|
||||
Command previousSpell = undoStack.pollLast();
|
||||
var previousSpell = undoStack.pollLast();
|
||||
redoStack.offerLast(previousSpell);
|
||||
LOGGER.info("{} undoes {}", this, previousSpell);
|
||||
previousSpell.undo();
|
||||
@ -68,7 +68,7 @@ public class Wizard {
|
||||
*/
|
||||
public void redoLastSpell() {
|
||||
if (!redoStack.isEmpty()) {
|
||||
Command previousSpell = redoStack.pollLast();
|
||||
var previousSpell = redoStack.pollLast();
|
||||
undoStack.offerLast(previousSpell);
|
||||
LOGGER.info("{} redoes {}", this, previousSpell);
|
||||
previousSpell.redo();
|
||||
|
Reference in New Issue
Block a user