From daf53225d8977f2a8998e54e4d5001a3d15a8a03 Mon Sep 17 00:00:00 2001 From: Anurag Agarwal Date: Fri, 1 May 2020 08:04:45 +0000 Subject: [PATCH] Resolves CR comments --- marker/src/main/java/App.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/marker/src/main/java/App.java b/marker/src/main/java/App.java index c7b4530c6..8a08a8f70 100644 --- a/marker/src/main/java/App.java +++ b/marker/src/main/java/App.java @@ -21,6 +21,9 @@ * THE SOFTWARE. */ +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Created by Alexis on 28-Apr-17. With Marker interface idea is to make empty interface and extend * it. Basically it is just to identify the special objects from normal objects. Like in case of @@ -43,10 +46,23 @@ public class App { * @param args command line args */ public static void main(String[] args) { + final Logger logger = LoggerFactory.getLogger(App.class); var guard = new Guard(); var thief = new Thief(); - guard.enter(); - thief.doNothing(); + + //noinspection ConstantConditions + if (guard instanceof Permission) { + guard.enter(); + } else { + logger.info("You have no permission to enter, please leave this area"); + } + + //noinspection ConstantConditions + if (thief instanceof Permission) { + thief.doNothing(); + } else { + thief.doNothing(); + } } }