File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 2121 * THE SOFTWARE.
2222 */
2323
24+ import org .slf4j .Logger ;
25+ import org .slf4j .LoggerFactory ;
26+
2427/**
2528 * Created by Alexis on 28-Apr-17. With Marker interface idea is to make empty interface and extend
2629 * it. Basically it is just to identify the special objects from normal objects. Like in case of
@@ -43,10 +46,23 @@ public class App {
4346 * @param args command line args
4447 */
4548 public static void main (String [] args ) {
49+ final Logger logger = LoggerFactory .getLogger (App .class );
4650 var guard = new Guard ();
4751 var thief = new Thief ();
48- guard .enter ();
49- thief .doNothing ();
52+
53+ //noinspection ConstantConditions
54+ if (guard instanceof Permission ) {
55+ guard .enter ();
56+ } else {
57+ logger .info ("You have no permission to enter, please leave this area" );
58+ }
59+
60+ //noinspection ConstantConditions
61+ if (thief instanceof Permission ) {
62+ thief .doNothing ();
63+ } else {
64+ thief .doNothing ();
65+ }
5066 }
5167}
5268
You can’t perform that action at this time.
0 commit comments