File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/main/java/com/iluwatar/decorator Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,9 @@ troll.attack(); // The troll tries to grab you!
105105troll.fleeBattle(); // The troll shrieks in horror and runs away!
106106
107107// change the behavior of the simple troll by adding a decorator
108- Troll clubbed = new ClubbedTroll(troll);
109- clubbed .attack(); // The troll tries to grab you! The troll swings at you with a club!
110- clubbed .fleeBattle(); // The troll shrieks in horror and runs away!
108+ troll = new ClubbedTroll(troll);
109+ troll .attack(); // The troll tries to grab you! The troll swings at you with a club!
110+ troll .fleeBattle(); // The troll shrieks in horror and runs away!
111111```
112112
113113## Applicability
Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ public static void main(String[] args) {
5757
5858 // change the behavior of the simple troll by adding a decorator
5959 LOGGER .info ("A troll with huge club surprises you." );
60- Troll clubbed = new ClubbedTroll (troll );
61- clubbed .attack ();
62- clubbed .fleeBattle ();
63- LOGGER .info ("Clubbed troll power {}.\n " , clubbed .getAttackPower ());
60+ troll = new ClubbedTroll (troll );
61+ troll .attack ();
62+ troll .fleeBattle ();
63+ LOGGER .info ("Clubbed troll power {}.\n " , troll .getAttackPower ());
6464 }
6565}
You can’t perform that action at this time.
0 commit comments