Skip to content

Commit daf5322

Browse files
Resolves CR comments
1 parent d733122 commit daf5322

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

marker/src/main/java/App.java

+18-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
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

0 commit comments

Comments
 (0)