Skip to content

Commit

Permalink
Add assertion for null class loggers
Browse files Browse the repository at this point in the history
Null class loggers are created using a incorrect method.
However, AB3 currently do not use null class loggers.

Let's replace the null class check with assertion instead
to follow YAGNI principle.
  • Loading branch information
Eclipse-Dominator committed May 18, 2023
1 parent a3f7c82 commit 2a3814c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/seedu/address/commons/core/LogsCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public static Logger getLogger(String name) {
* Creates a Logger for the given class name.
*/
public static <T> Logger getLogger(Class<T> clazz) {
if (clazz == null) {
return Logger.getLogger("");
}
assert clazz != null;
return getLogger(clazz.getSimpleName());
}

Expand Down

0 comments on commit 2a3814c

Please sign in to comment.